@honed/table 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -63,7 +63,7 @@ export declare interface HonedTable<T extends Record<string, any> = Record<strin
63
63
  isEmpty: boolean;
64
64
  isPageable: boolean;
65
65
  isToggleable: boolean;
66
- getRecordKey: (record: TableEntry<T>) => Identifier;
66
+ getRecordKey: (record: TableEntry<T> | TableRecord<T>) => Identifier;
67
67
  getEntry: (record: TableEntry<T>, column: Column<T> | string) => {
68
68
  v: any;
69
69
  e: any;
@@ -103,6 +103,9 @@ export declare interface HonedTable<T extends Record<string, any> = Record<strin
103
103
 
104
104
  export declare type Identifier = string | number;
105
105
 
106
+ /**
107
+ * Check if a column is of a given type.
108
+ */
106
109
  export declare function is(column: Column | string | null | undefined, type: ColumnType): boolean;
107
110
 
108
111
  export declare interface LengthAwarePaginate extends SimplePaginate {
package/dist/index.es.js CHANGED
@@ -1,606 +1,630 @@
1
- import { ref as ee, computed as v, reactive as Z, toValue as Y } from "vue";
2
- import { router as S } from "@inertiajs/vue3";
3
- function te(l, d, s, o = {}) {
4
- return l.route ? (S.visit(l.route.url, {
5
- ...o,
6
- method: l.route.method
7
- }), !0) : l.action && d ? (S.post(
8
- d,
9
- { ...s, name: l.name, type: l.type },
10
- o
11
- ), !0) : !1;
1
+ import { ref as ne, computed as f, reactive as ee, toValue as Z } from "vue";
2
+ import { router as b } from "@inertiajs/vue3";
3
+ import le from "axios";
4
+ function ae(r, v, s, o = {}) {
5
+ if (r.route) {
6
+ const { url: l, method: u } = r.route;
7
+ return r.inertia ? window.location.href = l : b.visit(l, { ...o, method: u }), !0;
8
+ }
9
+ if (!r.action || !v)
10
+ return !1;
11
+ const p = {
12
+ ...s,
13
+ name: r.name,
14
+ type: r.type
15
+ };
16
+ return r.inertia ? b.post(v, p, o) : le.post(v, p).catch((l) => {
17
+ var u;
18
+ return (u = o.onError) == null ? void 0 : u.call(o, l);
19
+ }), !0;
12
20
  }
13
- function _(l, d, s, o = {}, m = {}) {
14
- return te(
15
- l,
16
- d,
21
+ function te(r, v, s, o = {}, p = {}) {
22
+ return ae(
23
+ r,
24
+ v,
17
25
  { ...o, id: s ?? void 0 },
18
- m
26
+ p
19
27
  );
20
28
  }
21
- function ne(l, d, s, o = {}) {
22
- return l.map((m) => ({
23
- ...m,
24
- execute: (u = {}, i = {}) => _(m, d, s, u, { ...o, ...i })
29
+ function re(r, v, s, o = {}, p = {}) {
30
+ return r.map((l) => ({
31
+ ...l,
32
+ execute: (u = {}, a = {}) => te(
33
+ l,
34
+ v,
35
+ s,
36
+ { ...p, ...u },
37
+ { ...o, ...a }
38
+ )
25
39
  }));
26
40
  }
27
- function le() {
28
- const l = ee({
41
+ function oe() {
42
+ const r = ne({
29
43
  all: !1,
30
44
  only: /* @__PURE__ */ new Set(),
31
45
  except: /* @__PURE__ */ new Set()
32
46
  });
33
- function d() {
34
- l.value.all = !0, l.value.only.clear(), l.value.except.clear();
47
+ function v() {
48
+ r.value.all = !0, r.value.only.clear(), r.value.except.clear();
35
49
  }
36
50
  function s() {
37
- l.value.all = !1, l.value.only.clear(), l.value.except.clear();
51
+ r.value.all = !1, r.value.only.clear(), r.value.except.clear();
38
52
  }
39
- function o(...f) {
40
- f.forEach((y) => l.value.except.delete(y)), f.forEach((y) => l.value.only.add(y));
53
+ function o(...d) {
54
+ d.forEach((y) => r.value.except.delete(y)), d.forEach((y) => r.value.only.add(y));
41
55
  }
42
- function m(...f) {
43
- f.forEach((y) => l.value.except.add(y)), f.forEach((y) => l.value.only.delete(y));
56
+ function p(...d) {
57
+ d.forEach((y) => r.value.except.add(y)), d.forEach((y) => r.value.only.delete(y));
44
58
  }
45
- function u(f, y) {
46
- if (i(f) || y === !1) return m(f);
47
- if (!i(f) || y === !0) return o(f);
59
+ function l(d, y) {
60
+ if (u(d) || y === !1) return p(d);
61
+ if (!u(d) || y === !0) return o(d);
48
62
  }
49
- function i(f) {
50
- return l.value.all ? !l.value.except.has(f) : l.value.only.has(f);
63
+ function u(d) {
64
+ return r.value.all ? !r.value.except.has(d) : r.value.only.has(d);
51
65
  }
52
- const h = v(() => l.value.all && l.value.except.size === 0), x = v(() => l.value.only.size > 0 || h.value);
53
- function w(f) {
66
+ const a = f(() => r.value.all && r.value.except.size === 0), x = f(() => r.value.only.size > 0 || a.value);
67
+ function w(d) {
54
68
  return {
55
69
  "onUpdate:modelValue": (y) => {
56
- y ? o(f) : m(f);
70
+ y ? o(d) : p(d);
57
71
  },
58
- modelValue: i(f),
59
- value: f
72
+ modelValue: u(d),
73
+ value: d
60
74
  };
61
75
  }
62
76
  function k() {
63
77
  return {
64
- "onUpdate:modelValue": (f) => {
65
- f ? d() : s();
78
+ "onUpdate:modelValue": (d) => {
79
+ d ? v() : s();
66
80
  },
67
- modelValue: h.value
81
+ modelValue: a.value
68
82
  };
69
83
  }
70
84
  return {
71
- allSelected: h,
72
- selection: l,
85
+ allSelected: a,
86
+ selection: r,
73
87
  hasSelected: x,
74
- selectAll: d,
88
+ selectAll: v,
75
89
  deselectAll: s,
76
90
  select: o,
77
- deselect: m,
78
- toggle: u,
79
- selected: i,
91
+ deselect: p,
92
+ toggle: l,
93
+ selected: u,
80
94
  bind: w,
81
95
  bindAll: k
82
96
  };
83
97
  }
84
98
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
85
- const Q = () => {
99
+ const _ = () => {
86
100
  };
87
- function ae(l, d) {
101
+ function ie(r, v) {
88
102
  function s(...o) {
89
- return new Promise((m, u) => {
90
- Promise.resolve(l(() => d.apply(this, o), { fn: d, thisArg: this, args: o })).then(m).catch(u);
103
+ return new Promise((p, l) => {
104
+ Promise.resolve(r(() => v.apply(this, o), { fn: v, thisArg: this, args: o })).then(p).catch(l);
91
105
  });
92
106
  }
93
107
  return s;
94
108
  }
95
- function re(l, d = {}) {
96
- let s, o, m = Q;
97
- const u = (h) => {
98
- clearTimeout(h), m(), m = Q;
109
+ function ue(r, v = {}) {
110
+ let s, o, p = _;
111
+ const l = (a) => {
112
+ clearTimeout(a), p(), p = _;
99
113
  };
100
- let i;
101
- return (h) => {
102
- const x = Y(l), w = Y(d.maxWait);
103
- return s && u(s), x <= 0 || w !== void 0 && w <= 0 ? (o && (u(o), o = null), Promise.resolve(h())) : new Promise((k, f) => {
104
- m = d.rejectOnCancel ? f : k, i = h, w && !o && (o = setTimeout(() => {
105
- s && u(s), o = null, k(i());
114
+ let u;
115
+ return (a) => {
116
+ const x = Z(r), w = Z(v.maxWait);
117
+ return s && l(s), x <= 0 || w !== void 0 && w <= 0 ? (o && (l(o), o = null), Promise.resolve(a())) : new Promise((k, d) => {
118
+ p = v.rejectOnCancel ? d : k, u = a, w && !o && (o = setTimeout(() => {
119
+ s && l(s), o = null, k(u());
106
120
  }, w)), s = setTimeout(() => {
107
- o && u(o), o = null, k(h());
121
+ o && l(o), o = null, k(a());
108
122
  }, x);
109
123
  });
110
124
  };
111
125
  }
112
- function H(l, d = 200, s = {}) {
113
- return ae(
114
- re(d, s),
115
- l
126
+ function N(r, v = 200, s = {}) {
127
+ return ie(
128
+ ue(v, s),
129
+ r
116
130
  );
117
131
  }
118
- function oe(l, d, s = {}) {
119
- if (!(l != null && l[d]))
132
+ function ce(r, v, s = {}) {
133
+ if (!(r != null && r[v]))
120
134
  throw new Error("The refine must be provided with valid props and key.");
121
- const o = v(() => l[d]), m = v(() => !!o.value.sort), u = v(() => !!o.value.search), i = v(() => !!o.value.match), h = v(
135
+ const o = f(() => r[v]), p = f(() => !!o.value.sort), l = f(() => !!o.value.search), u = f(() => !!o.value.match), a = f(
122
136
  () => {
123
- var e;
124
- return (e = o.value.filters) == null ? void 0 : e.map((n) => ({
137
+ var t;
138
+ return (t = o.value.filters) == null ? void 0 : t.map((n) => ({
125
139
  ...n,
126
- apply: (a, p = {}) => P(n, a, p),
127
- clear: (a = {}) => C(n, a),
128
- bind: () => G(n.name)
140
+ apply: (i, m = {}) => E(n, i, m),
141
+ clear: (i = {}) => j(n, i),
142
+ bind: () => $(n.name)
129
143
  }));
130
144
  }
131
- ), x = v(
145
+ ), x = f(
132
146
  () => {
133
- var e;
134
- return (e = o.value.sorts) == null ? void 0 : e.map((n) => ({
147
+ var t;
148
+ return (t = o.value.sorts) == null ? void 0 : t.map((n) => ({
135
149
  ...n,
136
- apply: (a = {}) => F(n, n.direction, a),
137
- clear: (a = {}) => O(a),
138
- bind: () => K(n)
150
+ apply: (i = {}) => T(n, n.direction, i),
151
+ clear: (i = {}) => B(i),
152
+ bind: () => F(n)
139
153
  }));
140
154
  }
141
- ), w = v(
155
+ ), w = f(
142
156
  () => {
143
- var e;
144
- return (e = o.value.searches) == null ? void 0 : e.map((n) => ({
157
+ var t;
158
+ return (t = o.value.searches) == null ? void 0 : t.map((n) => ({
145
159
  ...n,
146
- apply: (a = {}) => A(n, a),
147
- clear: (a = {}) => A(n, a),
148
- bind: () => q(n)
160
+ apply: (i = {}) => A(n, i),
161
+ clear: (i = {}) => A(n, i),
162
+ bind: () => H(n)
149
163
  }));
150
164
  }
151
- ), k = v(
152
- () => h.value.filter(({ active: e }) => e)
153
- ), f = v(
154
- () => x.value.find(({ active: e }) => e)
155
- ), y = v(
156
- () => w.value.filter(({ active: e }) => e)
165
+ ), k = f(
166
+ () => a.value.filter(({ active: t }) => t)
167
+ ), d = f(
168
+ () => x.value.find(({ active: t }) => t)
169
+ ), y = f(
170
+ () => w.value.filter(({ active: t }) => t)
157
171
  );
158
- function j(e) {
159
- return Array.isArray(e) ? e.join(o.value.delimiter) : e;
172
+ function U(t) {
173
+ return Array.isArray(t) ? t.join(o.value.delimiter) : t;
160
174
  }
161
- function T(e) {
162
- return typeof e != "string" ? e : e.trim().replace(/\s+/g, "+");
175
+ function R(t) {
176
+ return typeof t != "string" ? t : t.trim().replace(/\s+/g, "+");
163
177
  }
164
- function V(e) {
165
- if (!["", null, void 0, []].includes(e))
166
- return e;
178
+ function P(t) {
179
+ if (!["", null, void 0, []].includes(t))
180
+ return t;
167
181
  }
168
- function $(e) {
169
- return [j, T, V].reduce(
170
- (n, a) => a(n),
171
- e
182
+ function C(t) {
183
+ return [U, R, P].reduce(
184
+ (n, i) => i(n),
185
+ t
172
186
  );
173
187
  }
174
- function B(e, n) {
175
- return n = Array.isArray(n) ? n : [n], n.includes(e) ? n.filter((a) => a !== e) : [...n, e];
188
+ function I(t, n) {
189
+ return n = Array.isArray(n) ? n : [n], n.includes(t) ? n.filter((i) => i !== t) : [...n, t];
176
190
  }
177
- function M(e) {
178
- return typeof e != "string" ? e : h.value.find(({ name: n }) => n === e);
191
+ function O(t) {
192
+ return typeof t != "string" ? t : a.value.find(({ name: n }) => n === t);
179
193
  }
180
- function R(e, n = null) {
181
- return typeof e != "string" ? e : x.value.find(
182
- ({ name: a, direction: p }) => a === e && p === n
194
+ function W(t, n = null) {
195
+ return typeof t != "string" ? t : x.value.find(
196
+ ({ name: i, direction: m }) => i === t && m === n
183
197
  );
184
198
  }
185
- function U(e) {
186
- return typeof e != "string" ? e : w.value.find(({ name: n }) => n === e);
199
+ function z(t) {
200
+ return typeof t != "string" ? t : w.value.find(({ name: n }) => n === t);
187
201
  }
188
- function J(e) {
189
- return e ? typeof e == "string" ? k.value.some((n) => n.name === e) : e.active : !!k.value.length;
202
+ function X(t) {
203
+ return t ? typeof t == "string" ? k.value.some((n) => n.name === t) : t.active : !!k.value.length;
190
204
  }
191
- function N(e) {
205
+ function Y(t) {
192
206
  var n;
193
- return e ? typeof e == "string" ? ((n = f.value) == null ? void 0 : n.name) === e : e.active : !!f.value;
207
+ return t ? typeof t == "string" ? ((n = d.value) == null ? void 0 : n.name) === t : t.active : !!d.value;
194
208
  }
195
- function I(e) {
209
+ function K(t) {
196
210
  var n;
197
- return e ? typeof e == "string" ? (n = y.value) == null ? void 0 : n.some((a) => a.name === e) : e.active : !!o.value.term;
211
+ return t ? typeof t == "string" ? (n = y.value) == null ? void 0 : n.some((i) => i.name === t) : t.active : !!o.value.term;
198
212
  }
199
- function b(e, n = {}) {
200
- const a = Object.fromEntries(
201
- Object.entries(e).map(([p, t]) => [p, $(t)])
213
+ function S(t, n = {}) {
214
+ const i = Object.fromEntries(
215
+ Object.entries(t).map(([m, V]) => [m, C(V)])
202
216
  );
203
- S.reload({
217
+ b.reload({
204
218
  ...s,
205
219
  ...n,
206
- data: a
220
+ data: i
207
221
  });
208
222
  }
209
- function P(e, n, a = {}) {
210
- const p = M(e);
211
- if (!p) return console.warn(`Filter [${e}] does not exist.`);
212
- S.reload({
223
+ function E(t, n, i = {}) {
224
+ const m = O(t);
225
+ if (!m) return console.warn(`Filter [${t}] does not exist.`);
226
+ b.reload({
213
227
  ...s,
214
- ...a,
228
+ ...i,
215
229
  data: {
216
- [p.name]: $(n)
230
+ [m.name]: C(n)
217
231
  }
218
232
  });
219
233
  }
220
- function F(e, n = null, a = {}) {
221
- if (!m.value)
234
+ function T(t, n = null, i = {}) {
235
+ if (!p.value)
222
236
  return console.warn("Refine cannot perform sorting.");
223
- const p = R(e, n);
224
- if (!p) return console.warn(`Sort [${e}] does not exist.`);
225
- S.reload({
237
+ const m = W(t, n);
238
+ if (!m) return console.warn(`Sort [${t}] does not exist.`);
239
+ b.reload({
226
240
  ...s,
227
- ...a,
241
+ ...i,
228
242
  data: {
229
- [o.value.sort]: V(p.next)
243
+ [o.value.sort]: P(m.next)
230
244
  }
231
245
  });
232
246
  }
233
- function g(e, n = {}) {
234
- if (!u.value)
247
+ function h(t, n = {}) {
248
+ if (!l.value)
235
249
  return console.warn("Refine cannot perform searching.");
236
- e = [T, V].reduce(
237
- (a, p) => p(a),
238
- e
239
- ), S.reload({
250
+ t = [R, P].reduce(
251
+ (i, m) => m(i),
252
+ t
253
+ ), b.reload({
240
254
  ...s,
241
255
  ...n,
242
256
  data: {
243
- [o.value.search]: e
257
+ [o.value.search]: t
244
258
  }
245
259
  });
246
260
  }
247
- function A(e, n = {}) {
248
- if (!i.value || !u.value)
261
+ function A(t, n = {}) {
262
+ if (!u.value || !l.value)
249
263
  return console.warn("Refine cannot perform matching.");
250
- const a = U(e);
251
- if (!a) return console.warn(`Match [${e}] does not exist.`);
252
- const p = B(
253
- a.name,
254
- y.value.map(({ name: t }) => t)
264
+ const i = z(t);
265
+ if (!i) return console.warn(`Match [${t}] does not exist.`);
266
+ const m = I(
267
+ i.name,
268
+ y.value.map(({ name: V }) => V)
255
269
  );
256
- S.reload({
270
+ b.reload({
257
271
  ...s,
258
272
  ...n,
259
273
  data: {
260
- [o.value.match]: j(p)
274
+ [o.value.match]: U(m)
261
275
  }
262
276
  });
263
277
  }
264
- function C(e, n = {}) {
265
- if (e) return P(e, null, n);
266
- S.reload({
278
+ function j(t, n = {}) {
279
+ if (t) return E(t, null, n);
280
+ b.reload({
267
281
  ...s,
268
282
  ...n,
269
283
  data: Object.fromEntries(
270
- k.value.map(({ name: a }) => [a, null])
284
+ k.value.map(({ name: i }) => [i, null])
271
285
  )
272
286
  });
273
287
  }
274
- function O(e = {}) {
275
- if (!m.value)
288
+ function B(t = {}) {
289
+ if (!p.value)
276
290
  return console.warn("Refine cannot perform sorting.");
277
- S.reload({
291
+ b.reload({
278
292
  ...s,
279
- ...e,
293
+ ...t,
280
294
  data: {
281
295
  [o.value.sort]: null
282
296
  }
283
297
  });
284
298
  }
285
- function W(e = {}) {
286
- g(null, e);
299
+ function Q(t = {}) {
300
+ h(null, t);
287
301
  }
288
- function z(e = {}) {
289
- if (!i.value)
302
+ function q(t = {}) {
303
+ if (!u.value)
290
304
  return console.warn("Refine cannot perform matching.");
291
- S.reload({
305
+ b.reload({
292
306
  ...s,
293
- ...e,
307
+ ...t,
294
308
  data: {
295
309
  [o.value.match]: null
296
310
  }
297
311
  });
298
312
  }
299
- function E(e = {}) {
313
+ function G(t = {}) {
300
314
  var n;
301
- S.reload({
315
+ b.reload({
302
316
  ...s,
303
- ...e,
317
+ ...t,
304
318
  data: {
305
319
  [o.value.search ?? ""]: void 0,
306
320
  [o.value.sort ?? ""]: void 0,
307
321
  [o.value.match ?? ""]: void 0,
308
322
  ...Object.fromEntries(
309
- ((n = o.value.filters) == null ? void 0 : n.map((a) => [
310
- a.name,
323
+ ((n = o.value.filters) == null ? void 0 : n.map((i) => [
324
+ i.name,
311
325
  void 0
312
326
  ])) ?? []
313
327
  )
314
328
  }
315
329
  });
316
330
  }
317
- function G(e, n = {}) {
318
- const a = M(e);
319
- if (!a) return console.warn(`Filter [${e}] does not exist.`);
331
+ function $(t, n = {}) {
332
+ const i = O(t);
333
+ if (!i) return console.warn(`Filter [${t}] does not exist.`);
320
334
  const {
321
- debounce: p = 250,
322
- transform: t = (c) => c,
323
- ...r
335
+ debounce: m = 150,
336
+ transform: V = (e) => e,
337
+ ...M
324
338
  } = n;
325
339
  return {
326
- "onUpdate:modelValue": H((c) => {
327
- P(a, t(c), r);
328
- }, p),
329
- modelValue: a.value
340
+ "onUpdate:modelValue": N((e) => {
341
+ E(i, V(e), M);
342
+ }, m),
343
+ modelValue: i.value
330
344
  };
331
345
  }
332
- function K(e, n = {}) {
333
- const a = R(e);
334
- if (!a) return console.warn(`Sort [${e}] does not exist.`);
335
- const { debounce: p = 0, transform: t, ...r } = n;
346
+ function F(t, n = {}) {
347
+ if (!p.value)
348
+ return console.warn("Refine cannot perform sorting.");
349
+ const i = W(t);
350
+ if (!i) return console.warn(`Sort [${t}] does not exist.`);
351
+ const { debounce: m = 0, transform: V, ...M } = n;
336
352
  return {
337
- onClick: H(() => {
338
- var c;
339
- F(a, (c = f.value) == null ? void 0 : c.direction, r);
340
- }, p)
353
+ onClick: N(() => {
354
+ var e;
355
+ T(i, (e = d.value) == null ? void 0 : e.direction, M);
356
+ }, m)
341
357
  };
342
358
  }
343
- function X(e = {}) {
344
- const { debounce: n = 700, transform: a, ...p } = e;
359
+ function D(t = {}) {
360
+ if (!l.value)
361
+ return console.warn("Refine cannot perform searching.");
362
+ const { debounce: n = 700, transform: i, ...m } = t;
345
363
  return {
346
- "onUpdate:modelValue": H(
347
- (t) => {
348
- g(t, p);
364
+ "onUpdate:modelValue": N(
365
+ (V) => {
366
+ h(V, m);
349
367
  },
350
368
  n
351
369
  ),
352
370
  modelValue: o.value.term ?? ""
353
371
  };
354
372
  }
355
- function q(e, n = {}) {
356
- const a = U(e);
357
- if (!a) return console.warn(`Match [${e}] does not exist.`);
358
- const { debounce: p = 0, transform: t, ...r } = n;
373
+ function H(t, n = {}) {
374
+ if (!u.value)
375
+ return console.warn("Refine cannot perform matching.");
376
+ const i = z(t);
377
+ if (!i) return console.warn(`Match [${t}] does not exist.`);
378
+ const { debounce: m = 0, transform: V, ...M } = n;
359
379
  return {
360
- "onUpdate:modelValue": H((c) => {
361
- A(c, r);
362
- }, p),
363
- modelValue: I(a),
364
- value: a.name
380
+ "onUpdate:modelValue": N((e) => {
381
+ A(e, M);
382
+ }, m),
383
+ modelValue: K(i),
384
+ value: i.name
365
385
  };
366
386
  }
367
- return Z({
368
- filters: h,
387
+ return ee({
388
+ filters: a,
369
389
  sorts: x,
370
390
  searches: w,
371
391
  currentFilters: k,
372
- currentSort: f,
392
+ currentSort: d,
373
393
  currentSearches: y,
374
- isSortable: m,
375
- isSearchable: u,
376
- isMatchable: i,
377
- isFiltering: J,
378
- isSorting: N,
379
- isSearching: I,
380
- getFilter: M,
381
- getSort: R,
382
- getSearch: U,
383
- apply: b,
384
- applyFilter: P,
385
- applySort: F,
386
- applySearch: g,
394
+ isSortable: p,
395
+ isSearchable: l,
396
+ isMatchable: u,
397
+ isFiltering: X,
398
+ isSorting: Y,
399
+ isSearching: K,
400
+ getFilter: O,
401
+ getSort: W,
402
+ getSearch: z,
403
+ apply: S,
404
+ applyFilter: E,
405
+ applySort: T,
406
+ applySearch: h,
387
407
  applyMatch: A,
388
- clearFilter: C,
389
- clearSort: O,
390
- clearSearch: W,
391
- clearMatch: z,
392
- reset: E,
393
- bindFilter: G,
394
- bindSort: K,
395
- bindSearch: X,
396
- bindMatch: q,
397
- stringValue: T,
398
- omitValue: V,
399
- toggleValue: B,
400
- delimitArray: j
408
+ clearFilter: j,
409
+ clearSort: B,
410
+ clearSearch: Q,
411
+ clearMatch: q,
412
+ reset: G,
413
+ bindFilter: $,
414
+ bindSort: F,
415
+ bindSearch: D,
416
+ bindMatch: H,
417
+ stringValue: R,
418
+ omitValue: P,
419
+ toggleValue: I,
420
+ delimitArray: U
401
421
  });
402
422
  }
403
- function ce(l, d, s = {}) {
404
- if (!(l != null && l[d]))
423
+ function de(r, v, s = {}) {
424
+ if (!(r != null && r[v]))
405
425
  throw new Error("The table must be provided with valid props and key.");
406
- const { recordOperations: o = {}, ...m } = {
407
- only: [...s.only ?? [], d.toString()],
426
+ const { recordOperations: o = {}, ...p } = {
427
+ only: [...s.only ?? [], v.toString()],
408
428
  ...s
409
- }, u = v(() => l[d]), i = le(), h = oe(l, d, m), x = v(() => u.value.id ?? null), w = v(() => u.value.meta), k = v(() => u.value.views ?? []), f = v(() => u.value.emptyState ?? null), y = v(() => u.value.placeholder ?? null), j = v(() => !!u.value.emptyState), T = v(() => !!u.value.page && !!u.value.record), V = v(() => !!u.value.column), $ = v(
410
- () => u.value.columns.filter(({ active: t, hidden: r }) => t && !r).map((t) => {
411
- var r;
429
+ }, l = f(() => r[v]), u = oe(), a = ce(r, v, p), x = f(() => l.value.id ?? null), w = f(() => l.value.meta), k = f(() => l.value.views ?? []), d = f(() => l.value.emptyState ?? null), y = f(() => l.value.placeholder ?? null), U = f(() => !!l.value.emptyState), R = f(() => !!l.value.page && !!l.value.record), P = f(() => !!l.value.column), C = f(
430
+ () => l.value.columns.filter(({ active: e, hidden: c }) => e && !c).map((e) => {
431
+ var c;
412
432
  return {
413
- ...t,
414
- isSorting: !!((r = t.sort) != null && r.active),
415
- toggleSort: (c = {}) => h.applySort(t.sort, null, c)
433
+ ...e,
434
+ isSorting: !!((c = e.sort) != null && c.active),
435
+ toggleSort: (g = {}) => a.applySort(e.sort, null, g)
416
436
  };
417
437
  })
418
- ), B = v(
419
- () => u.value.columns.filter(({ hidden: t }) => !t).map((t) => ({
420
- ...t,
421
- toggle: (r = {}) => e(t.name, r)
438
+ ), I = f(
439
+ () => l.value.columns.filter(({ hidden: e }) => !e).map((e) => ({
440
+ ...e,
441
+ toggle: (c = {}) => i(e.name, c)
422
442
  }))
423
- ), M = v(
424
- () => u.value.records.map((t) => ({
443
+ ), O = f(
444
+ () => l.value.records.map((e) => ({
425
445
  /** The operations available for the record */
426
- operations: z(t.operations),
446
+ operations: $(e.operations, Q(e)),
427
447
  /** The classes to apply to the record */
428
- class: t.class ?? null,
448
+ class: e.class ?? null,
429
449
  /** Perform this operation when the record is clicked */
430
- default: (r = {}) => {
431
- const c = t.operations.find(
450
+ default: (c = {}) => {
451
+ const g = e.operations.find(
432
452
  ({ default: L }) => L
433
453
  );
434
- c && G(c, t, r);
454
+ g && D(g, e, c);
435
455
  },
436
456
  /** Selects this record */
437
- select: () => i.select(g(t)),
457
+ select: () => u.select(h(e)),
438
458
  /** Deselects this record */
439
- deselect: () => i.deselect(g(t)),
459
+ deselect: () => u.deselect(h(e)),
440
460
  /** Toggles the selection of this record */
441
- toggle: () => i.toggle(g(t)),
461
+ toggle: () => u.toggle(h(e)),
442
462
  /** Determine if the record is selected */
443
- selected: i.selected(g(t)),
463
+ selected: u.selected(h(e)),
444
464
  /** Bind the record to a checkbox */
445
- bind: () => i.bind(g(t)),
465
+ bind: () => u.bind(h(e)),
446
466
  /** Get the entry of the record for the column */
447
- entry: (r) => A(t, r),
467
+ entry: (c) => A(e, c),
448
468
  /** Get the value of the record for the column */
449
- value: (r) => C(t, r),
469
+ value: (c) => j(e, c),
450
470
  /** Get the extra data of the record for the column */
451
- extra: (r) => O(t, r)
471
+ extra: (c) => B(e, c)
452
472
  }))
453
- ), R = v(() => !!u.value.operations.inline), U = v(() => z(u.value.operations.bulk)), J = v(() => z(u.value.operations.page)), N = v(
454
- () => u.value.pages.find(({ active: t }) => t)
455
- ), I = v(() => u.value.pages), b = v(() => ({
456
- ...u.value.paginate,
457
- next: (t = {}) => {
458
- "nextLink" in b.value && b.value.nextLink && E(b.value.nextLink, t);
473
+ ), W = f(() => !!l.value.operations.inline), z = f(
474
+ () => $(l.value.operations.bulk, q())
475
+ ), X = f(() => $(l.value.operations.page)), Y = f(
476
+ () => l.value.pages.find(({ active: e }) => e)
477
+ ), K = f(() => l.value.pages), S = f(() => ({
478
+ ...l.value.paginate,
479
+ next: (e = {}) => {
480
+ "nextLink" in S.value && S.value.nextLink && F(S.value.nextLink, e);
459
481
  },
460
- previous: (t = {}) => {
461
- "prevLink" in b.value && b.value.prevLink && E(b.value.prevLink, t);
482
+ previous: (e = {}) => {
483
+ "prevLink" in S.value && S.value.prevLink && F(S.value.prevLink, e);
462
484
  },
463
- first: (t = {}) => {
464
- "firstLink" in b.value && b.value.firstLink && E(b.value.firstLink, t);
485
+ first: (e = {}) => {
486
+ "firstLink" in S.value && S.value.firstLink && F(S.value.firstLink, e);
465
487
  },
466
- last: (t = {}) => {
467
- "lastLink" in b.value && b.value.lastLink && E(b.value.lastLink, t);
488
+ last: (e = {}) => {
489
+ "lastLink" in S.value && S.value.lastLink && F(S.value.lastLink, e);
468
490
  },
469
- ..."links" in u.value.paginate && u.value.paginate.links ? {
470
- links: u.value.paginate.links.map((t) => ({
471
- ...t,
472
- navigate: (r = {}) => t.url && E(t.url, r)
491
+ ..."links" in l.value.paginate && l.value.paginate.links ? {
492
+ links: l.value.paginate.links.map((e) => ({
493
+ ...e,
494
+ navigate: (c = {}) => e.url && F(e.url, c)
473
495
  }))
474
496
  } : {}
475
- })), P = v(
476
- () => u.value.records.length > 0 && u.value.records.every(
477
- (t) => i.selected(g(t))
497
+ })), E = f(
498
+ () => l.value.records.length > 0 && l.value.records.every(
499
+ (e) => u.selected(h(e))
478
500
  )
479
501
  );
480
- function F(t) {
481
- return typeof t == "string" ? t : t.name;
502
+ function T(e) {
503
+ return typeof e == "string" ? e : e.name;
482
504
  }
483
- function g(t) {
484
- var r;
485
- return (r = A(t, u.value.key)) == null ? void 0 : r.v;
505
+ function h(e) {
506
+ return "value" in e && typeof e.value == "function" ? e.value(l.value.key) : j(e, l.value.key);
486
507
  }
487
- function A(t, r) {
488
- const c = F(r);
489
- return c in t && c !== "classes" ? t[c] : null;
508
+ function A(e, c) {
509
+ const g = T(c);
510
+ return g in e && g !== "classes" ? e[g] : null;
490
511
  }
491
- function C(t, r) {
492
- var c;
493
- return ((c = A(t, r)) == null ? void 0 : c.v) ?? null;
512
+ function j(e, c) {
513
+ var g;
514
+ return ((g = A(e, c)) == null ? void 0 : g.v) ?? null;
494
515
  }
495
- function O(t, r) {
496
- var c;
497
- return (c = A(t, r)) == null ? void 0 : c.e;
516
+ function B(e, c) {
517
+ var g;
518
+ return (g = A(e, c)) == null ? void 0 : g.e;
519
+ }
520
+ function Q(e) {
521
+ return { record: h(e) };
522
+ }
523
+ function q() {
524
+ return {
525
+ all: u.selection.value.all,
526
+ only: Array.from(u.selection.value.only),
527
+ except: Array.from(u.selection.value.except)
528
+ };
498
529
  }
499
- function W(t, r = {}, c = {}) {
500
- return _(t, u.value.endpoint, x.value, r, {
501
- ...m,
502
- ...c
530
+ function G(e, c = {}, g = {}) {
531
+ return te(e, l.value.endpoint, x.value, c, {
532
+ ...p,
533
+ ...g
503
534
  });
504
535
  }
505
- function z(t) {
506
- return ne(
507
- t,
508
- u.value.endpoint,
536
+ function $(e, c = {}) {
537
+ return re(
538
+ e,
539
+ l.value.endpoint,
509
540
  x.value,
510
- m
541
+ p,
542
+ c
511
543
  );
512
544
  }
513
- function E(t, r = {}) {
514
- S.visit(t, {
545
+ function F(e, c = {}) {
546
+ b.visit(e, {
515
547
  preserveScroll: !0,
516
548
  preserveState: !0,
517
- ...m,
518
- ...r,
549
+ ...p,
550
+ ...c,
519
551
  method: "get"
520
552
  });
521
553
  }
522
- function G(t, r, c = {}) {
523
- var D;
524
- W(
525
- t,
554
+ function D(e, c, g = {}) {
555
+ var J;
556
+ G(
557
+ e,
526
558
  {
527
- record: g(r)
559
+ record: h(c)
528
560
  },
529
- c
530
- ) || (D = o == null ? void 0 : o[t.name]) == null || D.call(o, r);
531
- }
532
- function K(t, r = {}) {
533
- W(
534
- t,
535
- {
536
- all: i.selection.value.all,
537
- only: Array.from(i.selection.value.only),
538
- except: Array.from(i.selection.value.except)
539
- },
540
- {
541
- ...r,
542
- onSuccess: (c) => {
543
- var L;
544
- (L = r.onSuccess) == null || L.call(r, c), t.keepSelected || i.deselectAll();
545
- }
561
+ g
562
+ ) || (J = o == null ? void 0 : o[e.name]) == null || J.call(o, c);
563
+ }
564
+ function H(e, c = {}) {
565
+ G(e, q(), {
566
+ ...c,
567
+ onSuccess: (g) => {
568
+ var L;
569
+ (L = c.onSuccess) == null || L.call(c, g), e.keepSelected || u.deselectAll();
546
570
  }
547
- );
571
+ });
548
572
  }
549
- function X(t, r = {}, c = {}) {
550
- return W(t, r, c);
573
+ function t(e, c = {}, g = {}) {
574
+ return G(e, c, g);
551
575
  }
552
- function q(t, r = {}) {
553
- if (!T.value)
576
+ function n(e, c = {}) {
577
+ if (!R.value)
554
578
  return console.warn("The table does not support pagination changes.");
555
- S.reload({
556
- ...m,
557
- ...r,
579
+ b.reload({
580
+ ...p,
581
+ ...c,
558
582
  data: {
559
- [u.value.record]: t.value,
560
- [u.value.page]: void 0
583
+ [l.value.record]: e.value,
584
+ [l.value.page]: void 0
561
585
  }
562
586
  });
563
587
  }
564
- function e(t, r = {}) {
565
- if (!V.value)
588
+ function i(e, c = {}) {
589
+ if (!P.value)
566
590
  return console.warn("The table does not support column toggling.");
567
- const c = F(t);
568
- if (!c) return console.log(`Column [${t}] does not exist.`);
569
- const L = h.toggleValue(
570
- c,
571
- $.value.map(({ name: D }) => D)
591
+ const g = T(e);
592
+ if (!g) return console.log(`Column [${e}] does not exist.`);
593
+ const L = a.toggleValue(
594
+ g,
595
+ C.value.map(({ name: J }) => J)
572
596
  );
573
- S.reload({
574
- ...m,
575
- ...r,
597
+ b.reload({
598
+ ...p,
599
+ ...c,
576
600
  data: {
577
- [u.value.column]: h.delimitArray(L)
601
+ [l.value.column]: a.delimitArray(L)
578
602
  }
579
603
  });
580
604
  }
581
- function n() {
582
- i.select(
583
- ...u.value.records.map(
584
- (t) => g(t)
605
+ function m() {
606
+ u.select(
607
+ ...l.value.records.map(
608
+ (e) => h(e)
585
609
  )
586
610
  );
587
611
  }
588
- function a() {
589
- i.deselect(
590
- ...u.value.records.map(
591
- (t) => g(t)
612
+ function V() {
613
+ u.deselect(
614
+ ...l.value.records.map(
615
+ (e) => h(e)
592
616
  )
593
617
  );
594
618
  }
595
- function p() {
619
+ function M() {
596
620
  return {
597
- "onUpdate:modelValue": (t) => {
598
- t ? n() : a();
621
+ "onUpdate:modelValue": (e) => {
622
+ e ? m() : V();
599
623
  },
600
- modelValue: P.value
624
+ modelValue: E.value
601
625
  };
602
626
  }
603
- return Z({
627
+ return ee({
604
628
  /** The identifier of the table */
605
629
  id: x,
606
630
  /** Table-specific metadata */
@@ -608,85 +632,116 @@ function ce(l, d, s = {}) {
608
632
  /** The views for the table */
609
633
  views: k,
610
634
  /** The empty state for the table */
611
- emptyState: f,
635
+ emptyState: d,
612
636
  /** The placeholder for the search term.*/
613
637
  placeholder: y,
614
638
  /** Whether the table is empty */
615
- isEmpty: j,
639
+ isEmpty: U,
616
640
  /** Whether the table supports changing the number of records to display per page */
617
- isPageable: T,
641
+ isPageable: R,
618
642
  /** Whether the table supports toggling columns */
619
- isToggleable: V,
643
+ isToggleable: P,
620
644
  /** Get the entry of the record for the column */
621
645
  getEntry: A,
622
646
  /** Get the value of the record for the column */
623
- getValue: C,
647
+ getValue: j,
624
648
  /** Get the extra data of the record for the column */
625
- getExtra: O,
649
+ getExtra: B,
626
650
  /** Retrieve a record's identifier */
627
- getRecordKey: g,
651
+ getRecordKey: h,
628
652
  /** The heading columns for the table */
629
- headings: $,
653
+ headings: C,
630
654
  /** All of the table's columns */
631
- columns: B,
655
+ columns: I,
632
656
  /** The records of the table */
633
- records: M,
657
+ records: O,
634
658
  /** Whether the table has record operations */
635
- inline: R,
659
+ inline: W,
636
660
  /** The available bulk operations */
637
- bulk: U,
661
+ bulk: z,
638
662
  /** The available page operations */
639
- page: J,
663
+ page: X,
640
664
  /** The available number of records to display per page */
641
- pages: I,
665
+ pages: K,
642
666
  /** The current record per page item */
643
- currentPage: N,
667
+ currentPage: Y,
644
668
  /** The pagination metadata */
645
- paginator: b,
669
+ paginator: S,
646
670
  /** Execute an inline operation */
647
- executeInline: G,
671
+ executeInline: D,
648
672
  /** Execute a bulk operation */
649
- executeBulk: K,
673
+ executeBulk: H,
650
674
  /** Execute a page operation */
651
- executePage: X,
675
+ executePage: t,
652
676
  /** Apply a new page by changing the number of records to display */
653
- applyPage: q,
677
+ applyPage: n,
654
678
  /** The current selection of records */
655
- selection: i.selection,
679
+ selection: u.selection,
656
680
  /** Select the given records */
657
- select: (t) => i.select(g(t)),
681
+ select: (e) => u.select(h(e)),
658
682
  /** Deselect the given records */
659
- deselect: (t) => i.deselect(g(t)),
683
+ deselect: (e) => u.deselect(h(e)),
660
684
  /** Select records on the current page */
661
- selectPage: n,
685
+ selectPage: m,
662
686
  /** Deselect records on the current page */
663
- deselectPage: a,
687
+ deselectPage: V,
664
688
  /** Toggle the selection of the given records */
665
- toggle: (t) => i.toggle(g(t)),
689
+ toggle: (e) => u.toggle(h(e)),
666
690
  /** Determine if the given record is selected */
667
- selected: (t) => i.selected(g(t)),
691
+ selected: (e) => u.selected(h(e)),
668
692
  /** Select all records */
669
- selectAll: i.selectAll,
693
+ selectAll: u.selectAll,
670
694
  /** Deselect all records */
671
- deselectAll: i.deselectAll,
695
+ deselectAll: u.deselectAll,
672
696
  /** Whether all records on the current page are selected */
673
- isPageSelected: P,
697
+ isPageSelected: E,
674
698
  /** Determine if any records are selected */
675
- hasSelected: i.hasSelected,
699
+ hasSelected: u.hasSelected,
676
700
  /** Bind the given record to a checkbox */
677
- bindCheckbox: (t) => i.bind(g(t)),
701
+ bindCheckbox: (e) => u.bind(h(e)),
678
702
  /** Bind the select all checkbox to the current page */
679
- bindPage: p,
703
+ bindPage: M,
680
704
  /** Bind select all records to the checkbox */
681
- bindAll: i.bindAll,
682
- /** Include the sorts, filters, and search query */
683
- ...h
705
+ bindAll: u.bindAll,
706
+ filters: a.filters,
707
+ sorts: a.sorts,
708
+ searches: a.searches,
709
+ currentFilters: a.currentFilters,
710
+ currentSort: a.currentSort,
711
+ currentSearches: a.currentSearches,
712
+ isSortable: a.isSortable,
713
+ isSearchable: a.isSearchable,
714
+ isMatchable: a.isMatchable,
715
+ isFiltering: a.isFiltering,
716
+ isSorting: a.isSorting,
717
+ isSearching: a.isSearching,
718
+ getFilter: a.getFilter,
719
+ getSort: a.getSort,
720
+ getSearch: a.getSearch,
721
+ apply: a.apply,
722
+ applyFilter: a.applyFilter,
723
+ applySort: a.applySort,
724
+ applySearch: a.applySearch,
725
+ applyMatch: a.applyMatch,
726
+ clearFilter: a.clearFilter,
727
+ clearSort: a.clearSort,
728
+ clearSearch: a.clearSearch,
729
+ clearMatch: a.clearMatch,
730
+ reset: a.reset,
731
+ bindFilter: a.bindFilter,
732
+ bindSort: a.bindSort,
733
+ bindSearch: a.bindSearch,
734
+ bindMatch: a.bindMatch,
735
+ stringValue: a.stringValue,
736
+ omitValue: a.omitValue,
737
+ toggleValue: a.toggleValue,
738
+ delimitArray: a.delimitArray
684
739
  });
685
740
  }
686
- function se(l, d) {
687
- return l ? typeof l == "object" ? l.type === d : l === d : !1;
741
+ function pe(r, v) {
742
+ return r ? typeof r == "object" ? r.type === v : r === v : !1;
688
743
  }
689
744
  export {
690
- se as is,
691
- ce as useTable
745
+ pe as is,
746
+ de as useTable
692
747
  };
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(A,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("@inertiajs/vue3")):typeof define=="function"&&define.amd?define(["exports","vue","@inertiajs/vue3"],i):(A=typeof globalThis<"u"?globalThis:A||self,i(A["@honed/table"]={},A.Vue,A.Inertia))})(this,function(A,i,S){"use strict";function _(l,p,d,o={}){return l.route?(S.router.visit(l.route.url,{...o,method:l.route.method}),!0):l.action&&p?(S.router.post(p,{...d,name:l.name,type:l.type},o),!0):!1}function Q(l,p,d,o={},m={}){return _(l,p,{...o,id:d??void 0},m)}function ee(l,p,d,o={}){return l.map(m=>({...m,execute:(u={},c={})=>Q(m,p,d,u,{...o,...c})}))}function te(){const l=i.ref({all:!1,only:new Set,except:new Set});function p(){l.value.all=!0,l.value.only.clear(),l.value.except.clear()}function d(){l.value.all=!1,l.value.only.clear(),l.value.except.clear()}function o(...f){f.forEach(y=>l.value.except.delete(y)),f.forEach(y=>l.value.only.add(y))}function m(...f){f.forEach(y=>l.value.except.add(y)),f.forEach(y=>l.value.only.delete(y))}function u(f,y){if(c(f)||y===!1)return m(f);if(!c(f)||y===!0)return o(f)}function c(f){return l.value.all?!l.value.except.has(f):l.value.only.has(f)}const h=i.computed(()=>l.value.all&&l.value.except.size===0),x=i.computed(()=>l.value.only.size>0||h.value);function w(f){return{"onUpdate:modelValue":y=>{y?o(f):m(f)},modelValue:c(f),value:f}}function k(){return{"onUpdate:modelValue":f=>{f?p():d()},modelValue:h.value}}return{allSelected:h,selection:l,hasSelected:x,selectAll:p,deselectAll:d,select:o,deselect:m,toggle:u,selected:c,bind:w,bindAll:k}}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Z=()=>{};function ne(l,p){function d(...o){return new Promise((m,u)=>{Promise.resolve(l(()=>p.apply(this,o),{fn:p,thisArg:this,args:o})).then(m).catch(u)})}return d}function le(l,p={}){let d,o,m=Z;const u=h=>{clearTimeout(h),m(),m=Z};let c;return h=>{const x=i.toValue(l),w=i.toValue(p.maxWait);return d&&u(d),x<=0||w!==void 0&&w<=0?(o&&(u(o),o=null),Promise.resolve(h())):new Promise((k,f)=>{m=p.rejectOnCancel?f:k,c=h,w&&!o&&(o=setTimeout(()=>{d&&u(d),o=null,k(c())},w)),d=setTimeout(()=>{o&&u(o),o=null,k(h())},x)})}}function I(l,p=200,d={}){return ne(le(p,d),l)}function ae(l,p,d={}){if(!(l!=null&&l[p]))throw new Error("The refine must be provided with valid props and key.");const o=i.computed(()=>l[p]),m=i.computed(()=>!!o.value.sort),u=i.computed(()=>!!o.value.search),c=i.computed(()=>!!o.value.match),h=i.computed(()=>{var e;return(e=o.value.filters)==null?void 0:e.map(n=>({...n,apply:(a,v={})=>T(n,a,v),clear:(a={})=>O(n,a),bind:()=>G(n.name)}))}),x=i.computed(()=>{var e;return(e=o.value.sorts)==null?void 0:e.map(n=>({...n,apply:(a={})=>F(n,n.direction,a),clear:(a={})=>W(a),bind:()=>D(n)}))}),w=i.computed(()=>{var e;return(e=o.value.searches)==null?void 0:e.map(n=>({...n,apply:(a={})=>V(n,a),clear:(a={})=>V(n,a),bind:()=>H(n)}))}),k=i.computed(()=>h.value.filter(({active:e})=>e)),f=i.computed(()=>x.value.find(({active:e})=>e)),y=i.computed(()=>w.value.filter(({active:e})=>e));function M(e){return Array.isArray(e)?e.join(o.value.delimiter):e}function j(e){return typeof e!="string"?e:e.trim().replace(/\s+/g,"+")}function P(e){if(!["",null,void 0,[]].includes(e))return e}function $(e){return[M,j,P].reduce((n,a)=>a(n),e)}function B(e,n){return n=Array.isArray(n)?n:[n],n.includes(e)?n.filter(a=>a!==e):[...n,e]}function R(e){return typeof e!="string"?e:h.value.find(({name:n})=>n===e)}function U(e,n=null){return typeof e!="string"?e:x.value.find(({name:a,direction:v})=>a===e&&v===n)}function C(e){return typeof e!="string"?e:w.value.find(({name:n})=>n===e)}function N(e){return e?typeof e=="string"?k.value.some(n=>n.name===e):e.active:!!k.value.length}function X(e){var n;return e?typeof e=="string"?((n=f.value)==null?void 0:n.name)===e:e.active:!!f.value}function K(e){var n;return e?typeof e=="string"?(n=y.value)==null?void 0:n.some(a=>a.name===e):e.active:!!o.value.term}function b(e,n={}){const a=Object.fromEntries(Object.entries(e).map(([v,t])=>[v,$(t)]));S.router.reload({...d,...n,data:a})}function T(e,n,a={}){const v=R(e);if(!v)return console.warn(`Filter [${e}] does not exist.`);S.router.reload({...d,...a,data:{[v.name]:$(n)}})}function F(e,n=null,a={}){if(!m.value)return console.warn("Refine cannot perform sorting.");const v=U(e,n);if(!v)return console.warn(`Sort [${e}] does not exist.`);S.router.reload({...d,...a,data:{[o.value.sort]:P(v.next)}})}function g(e,n={}){if(!u.value)return console.warn("Refine cannot perform searching.");e=[j,P].reduce((a,v)=>v(a),e),S.router.reload({...d,...n,data:{[o.value.search]:e}})}function V(e,n={}){if(!c.value||!u.value)return console.warn("Refine cannot perform matching.");const a=C(e);if(!a)return console.warn(`Match [${e}] does not exist.`);const v=B(a.name,y.value.map(({name:t})=>t));S.router.reload({...d,...n,data:{[o.value.match]:M(v)}})}function O(e,n={}){if(e)return T(e,null,n);S.router.reload({...d,...n,data:Object.fromEntries(k.value.map(({name:a})=>[a,null]))})}function W(e={}){if(!m.value)return console.warn("Refine cannot perform sorting.");S.router.reload({...d,...e,data:{[o.value.sort]:null}})}function q(e={}){g(null,e)}function z(e={}){if(!c.value)return console.warn("Refine cannot perform matching.");S.router.reload({...d,...e,data:{[o.value.match]:null}})}function E(e={}){var n;S.router.reload({...d,...e,data:{[o.value.search??""]:void 0,[o.value.sort??""]:void 0,[o.value.match??""]:void 0,...Object.fromEntries(((n=o.value.filters)==null?void 0:n.map(a=>[a.name,void 0]))??[])}})}function G(e,n={}){const a=R(e);if(!a)return console.warn(`Filter [${e}] does not exist.`);const{debounce:v=250,transform:t=s=>s,...r}=n;return{"onUpdate:modelValue":I(s=>{T(a,t(s),r)},v),modelValue:a.value}}function D(e,n={}){const a=U(e);if(!a)return console.warn(`Sort [${e}] does not exist.`);const{debounce:v=0,transform:t,...r}=n;return{onClick:I(()=>{var s;F(a,(s=f.value)==null?void 0:s.direction,r)},v)}}function Y(e={}){const{debounce:n=700,transform:a,...v}=e;return{"onUpdate:modelValue":I(t=>{g(t,v)},n),modelValue:o.value.term??""}}function H(e,n={}){const a=C(e);if(!a)return console.warn(`Match [${e}] does not exist.`);const{debounce:v=0,transform:t,...r}=n;return{"onUpdate:modelValue":I(s=>{V(s,r)},v),modelValue:K(a),value:a.name}}return i.reactive({filters:h,sorts:x,searches:w,currentFilters:k,currentSort:f,currentSearches:y,isSortable:m,isSearchable:u,isMatchable:c,isFiltering:N,isSorting:X,isSearching:K,getFilter:R,getSort:U,getSearch:C,apply:b,applyFilter:T,applySort:F,applySearch:g,applyMatch:V,clearFilter:O,clearSort:W,clearSearch:q,clearMatch:z,reset:E,bindFilter:G,bindSort:D,bindSearch:Y,bindMatch:H,stringValue:j,omitValue:P,toggleValue:B,delimitArray:M})}function re(l,p,d={}){if(!(l!=null&&l[p]))throw new Error("The table must be provided with valid props and key.");const{recordOperations:o={},...m}={only:[...d.only??[],p.toString()],...d},u=i.computed(()=>l[p]),c=te(),h=ae(l,p,m),x=i.computed(()=>u.value.id??null),w=i.computed(()=>u.value.meta),k=i.computed(()=>u.value.views??[]),f=i.computed(()=>u.value.emptyState??null),y=i.computed(()=>u.value.placeholder??null),M=i.computed(()=>!!u.value.emptyState),j=i.computed(()=>!!u.value.page&&!!u.value.record),P=i.computed(()=>!!u.value.column),$=i.computed(()=>u.value.columns.filter(({active:t,hidden:r})=>t&&!r).map(t=>{var r;return{...t,isSorting:!!((r=t.sort)!=null&&r.active),toggleSort:(s={})=>h.applySort(t.sort,null,s)}})),B=i.computed(()=>u.value.columns.filter(({hidden:t})=>!t).map(t=>({...t,toggle:(r={})=>e(t.name,r)}))),R=i.computed(()=>u.value.records.map(t=>({operations:z(t.operations),class:t.class??null,default:(r={})=>{const s=t.operations.find(({default:L})=>L);s&&G(s,t,r)},select:()=>c.select(g(t)),deselect:()=>c.deselect(g(t)),toggle:()=>c.toggle(g(t)),selected:c.selected(g(t)),bind:()=>c.bind(g(t)),entry:r=>V(t,r),value:r=>O(t,r),extra:r=>W(t,r)}))),U=i.computed(()=>!!u.value.operations.inline),C=i.computed(()=>z(u.value.operations.bulk)),N=i.computed(()=>z(u.value.operations.page)),X=i.computed(()=>u.value.pages.find(({active:t})=>t)),K=i.computed(()=>u.value.pages),b=i.computed(()=>({...u.value.paginate,next:(t={})=>{"nextLink"in b.value&&b.value.nextLink&&E(b.value.nextLink,t)},previous:(t={})=>{"prevLink"in b.value&&b.value.prevLink&&E(b.value.prevLink,t)},first:(t={})=>{"firstLink"in b.value&&b.value.firstLink&&E(b.value.firstLink,t)},last:(t={})=>{"lastLink"in b.value&&b.value.lastLink&&E(b.value.lastLink,t)},..."links"in u.value.paginate&&u.value.paginate.links?{links:u.value.paginate.links.map(t=>({...t,navigate:(r={})=>t.url&&E(t.url,r)}))}:{}})),T=i.computed(()=>u.value.records.length>0&&u.value.records.every(t=>c.selected(g(t))));function F(t){return typeof t=="string"?t:t.name}function g(t){var r;return(r=V(t,u.value.key))==null?void 0:r.v}function V(t,r){const s=F(r);return s in t&&s!=="classes"?t[s]:null}function O(t,r){var s;return((s=V(t,r))==null?void 0:s.v)??null}function W(t,r){var s;return(s=V(t,r))==null?void 0:s.e}function q(t,r={},s={}){return Q(t,u.value.endpoint,x.value,r,{...m,...s})}function z(t){return ee(t,u.value.endpoint,x.value,m)}function E(t,r={}){S.router.visit(t,{preserveScroll:!0,preserveState:!0,...m,...r,method:"get"})}function G(t,r,s={}){var J;q(t,{record:g(r)},s)||(J=o==null?void 0:o[t.name])==null||J.call(o,r)}function D(t,r={}){q(t,{all:c.selection.value.all,only:Array.from(c.selection.value.only),except:Array.from(c.selection.value.except)},{...r,onSuccess:s=>{var L;(L=r.onSuccess)==null||L.call(r,s),t.keepSelected||c.deselectAll()}})}function Y(t,r={},s={}){return q(t,r,s)}function H(t,r={}){if(!j.value)return console.warn("The table does not support pagination changes.");S.router.reload({...m,...r,data:{[u.value.record]:t.value,[u.value.page]:void 0}})}function e(t,r={}){if(!P.value)return console.warn("The table does not support column toggling.");const s=F(t);if(!s)return console.log(`Column [${t}] does not exist.`);const L=h.toggleValue(s,$.value.map(({name:J})=>J));S.router.reload({...m,...r,data:{[u.value.column]:h.delimitArray(L)}})}function n(){c.select(...u.value.records.map(t=>g(t)))}function a(){c.deselect(...u.value.records.map(t=>g(t)))}function v(){return{"onUpdate:modelValue":t=>{t?n():a()},modelValue:T.value}}return i.reactive({id:x,meta:w,views:k,emptyState:f,placeholder:y,isEmpty:M,isPageable:j,isToggleable:P,getEntry:V,getValue:O,getExtra:W,getRecordKey:g,headings:$,columns:B,records:R,inline:U,bulk:C,page:N,pages:K,currentPage:X,paginator:b,executeInline:G,executeBulk:D,executePage:Y,applyPage:H,selection:c.selection,select:t=>c.select(g(t)),deselect:t=>c.deselect(g(t)),selectPage:n,deselectPage:a,toggle:t=>c.toggle(g(t)),selected:t=>c.selected(g(t)),selectAll:c.selectAll,deselectAll:c.deselectAll,isPageSelected:T,hasSelected:c.hasSelected,bindCheckbox:t=>c.bind(g(t)),bindPage:v,bindAll:c.bindAll,...h})}function oe(l,p){return l?typeof l=="object"?l.type===p:l===p:!1}A.is=oe,A.useTable=re,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
1
+ (function(A,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("@inertiajs/vue3"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","@inertiajs/vue3","axios"],s):(A=typeof globalThis<"u"?globalThis:A||self,s(A["@honed/table"]={},A.Vue,A.Inertia,A.axios))})(this,function(A,s,b,te){"use strict";function ne(l,f,d,o={}){if(l.route){const{url:r,method:u}=l.route;return l.inertia?window.location.href=r:b.router.visit(r,{...o,method:u}),!0}if(!l.action||!f)return!1;const m={...d,name:l.name,type:l.type};return l.inertia?b.router.post(f,m,o):te.post(f,m).catch(r=>{var u;return(u=o.onError)==null?void 0:u.call(o,r)}),!0}function _(l,f,d,o={},m={}){return ne(l,f,{...o,id:d??void 0},m)}function re(l,f,d,o={},m={}){return l.map(r=>({...r,execute:(u={},a={})=>_(r,f,d,{...m,...u},{...o,...a})}))}function ae(){const l=s.ref({all:!1,only:new Set,except:new Set});function f(){l.value.all=!0,l.value.only.clear(),l.value.except.clear()}function d(){l.value.all=!1,l.value.only.clear(),l.value.except.clear()}function o(...p){p.forEach(y=>l.value.except.delete(y)),p.forEach(y=>l.value.only.add(y))}function m(...p){p.forEach(y=>l.value.except.add(y)),p.forEach(y=>l.value.only.delete(y))}function r(p,y){if(u(p)||y===!1)return m(p);if(!u(p)||y===!0)return o(p)}function u(p){return l.value.all?!l.value.except.has(p):l.value.only.has(p)}const a=s.computed(()=>l.value.all&&l.value.except.size===0),x=s.computed(()=>l.value.only.size>0||a.value);function w(p){return{"onUpdate:modelValue":y=>{y?o(p):m(p)},modelValue:u(p),value:p}}function V(){return{"onUpdate:modelValue":p=>{p?f():d()},modelValue:a.value}}return{allSelected:a,selection:l,hasSelected:x,selectAll:f,deselectAll:d,select:o,deselect:m,toggle:r,selected:u,bind:w,bindAll:V}}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ee=()=>{};function le(l,f){function d(...o){return new Promise((m,r)=>{Promise.resolve(l(()=>f.apply(this,o),{fn:f,thisArg:this,args:o})).then(m).catch(r)})}return d}function oe(l,f={}){let d,o,m=ee;const r=a=>{clearTimeout(a),m(),m=ee};let u;return a=>{const x=s.toValue(l),w=s.toValue(f.maxWait);return d&&r(d),x<=0||w!==void 0&&w<=0?(o&&(r(o),o=null),Promise.resolve(a())):new Promise((V,p)=>{m=f.rejectOnCancel?p:V,u=a,w&&!o&&(o=setTimeout(()=>{d&&r(d),o=null,V(u())},w)),d=setTimeout(()=>{o&&r(o),o=null,V(a())},x)})}}function I(l,f=200,d={}){return le(oe(f,d),l)}function ie(l,f,d={}){if(!(l!=null&&l[f]))throw new Error("The refine must be provided with valid props and key.");const o=s.computed(()=>l[f]),m=s.computed(()=>!!o.value.sort),r=s.computed(()=>!!o.value.search),u=s.computed(()=>!!o.value.match),a=s.computed(()=>{var t;return(t=o.value.filters)==null?void 0:t.map(n=>({...n,apply:(i,v={})=>E(n,i,v),clear:(i={})=>$(n,i),bind:()=>U(n.name)}))}),x=s.computed(()=>{var t;return(t=o.value.sorts)==null?void 0:t.map(n=>({...n,apply:(i={})=>R(n,n.direction,i),clear:(i={})=>B(i),bind:()=>P(n)}))}),w=s.computed(()=>{var t;return(t=o.value.searches)==null?void 0:t.map(n=>({...n,apply:(i={})=>F(n,i),clear:(i={})=>F(n,i),bind:()=>N(n)}))}),V=s.computed(()=>a.value.filter(({active:t})=>t)),p=s.computed(()=>x.value.find(({active:t})=>t)),y=s.computed(()=>w.value.filter(({active:t})=>t));function C(t){return Array.isArray(t)?t.join(o.value.delimiter):t}function j(t){return typeof t!="string"?t:t.trim().replace(/\s+/g,"+")}function M(t){if(!["",null,void 0,[]].includes(t))return t}function O(t){return[C,j,M].reduce((n,i)=>i(n),t)}function K(t,n){return n=Array.isArray(n)?n:[n],n.includes(t)?n.filter(i=>i!==t):[...n,t]}function q(t){return typeof t!="string"?t:a.value.find(({name:n})=>n===t)}function W(t,n=null){return typeof t!="string"?t:x.value.find(({name:i,direction:v})=>i===t&&v===n)}function z(t){return typeof t!="string"?t:w.value.find(({name:n})=>n===t)}function Y(t){return t?typeof t=="string"?V.value.some(n=>n.name===t):t.active:!!V.value.length}function Q(t){var n;return t?typeof t=="string"?((n=p.value)==null?void 0:n.name)===t:t.active:!!p.value}function D(t){var n;return t?typeof t=="string"?(n=y.value)==null?void 0:n.some(i=>i.name===t):t.active:!!o.value.term}function S(t,n={}){const i=Object.fromEntries(Object.entries(t).map(([v,k])=>[v,O(k)]));b.router.reload({...d,...n,data:i})}function E(t,n,i={}){const v=q(t);if(!v)return console.warn(`Filter [${t}] does not exist.`);b.router.reload({...d,...i,data:{[v.name]:O(n)}})}function R(t,n=null,i={}){if(!m.value)return console.warn("Refine cannot perform sorting.");const v=W(t,n);if(!v)return console.warn(`Sort [${t}] does not exist.`);b.router.reload({...d,...i,data:{[o.value.sort]:M(v.next)}})}function h(t,n={}){if(!r.value)return console.warn("Refine cannot perform searching.");t=[j,M].reduce((i,v)=>v(i),t),b.router.reload({...d,...n,data:{[o.value.search]:t}})}function F(t,n={}){if(!u.value||!r.value)return console.warn("Refine cannot perform matching.");const i=z(t);if(!i)return console.warn(`Match [${t}] does not exist.`);const v=K(i.name,y.value.map(({name:k})=>k));b.router.reload({...d,...n,data:{[o.value.match]:C(v)}})}function $(t,n={}){if(t)return E(t,null,n);b.router.reload({...d,...n,data:Object.fromEntries(V.value.map(({name:i})=>[i,null]))})}function B(t={}){if(!m.value)return console.warn("Refine cannot perform sorting.");b.router.reload({...d,...t,data:{[o.value.sort]:null}})}function Z(t={}){h(null,t)}function H(t={}){if(!u.value)return console.warn("Refine cannot perform matching.");b.router.reload({...d,...t,data:{[o.value.match]:null}})}function G(t={}){var n;b.router.reload({...d,...t,data:{[o.value.search??""]:void 0,[o.value.sort??""]:void 0,[o.value.match??""]:void 0,...Object.fromEntries(((n=o.value.filters)==null?void 0:n.map(i=>[i.name,void 0]))??[])}})}function U(t,n={}){const i=q(t);if(!i)return console.warn(`Filter [${t}] does not exist.`);const{debounce:v=150,transform:k=e=>e,...T}=n;return{"onUpdate:modelValue":I(e=>{E(i,k(e),T)},v),modelValue:i.value}}function P(t,n={}){if(!m.value)return console.warn("Refine cannot perform sorting.");const i=W(t);if(!i)return console.warn(`Sort [${t}] does not exist.`);const{debounce:v=0,transform:k,...T}=n;return{onClick:I(()=>{var e;R(i,(e=p.value)==null?void 0:e.direction,T)},v)}}function J(t={}){if(!r.value)return console.warn("Refine cannot perform searching.");const{debounce:n=700,transform:i,...v}=t;return{"onUpdate:modelValue":I(k=>{h(k,v)},n),modelValue:o.value.term??""}}function N(t,n={}){if(!u.value)return console.warn("Refine cannot perform matching.");const i=z(t);if(!i)return console.warn(`Match [${t}] does not exist.`);const{debounce:v=0,transform:k,...T}=n;return{"onUpdate:modelValue":I(e=>{F(e,T)},v),modelValue:D(i),value:i.name}}return s.reactive({filters:a,sorts:x,searches:w,currentFilters:V,currentSort:p,currentSearches:y,isSortable:m,isSearchable:r,isMatchable:u,isFiltering:Y,isSorting:Q,isSearching:D,getFilter:q,getSort:W,getSearch:z,apply:S,applyFilter:E,applySort:R,applySearch:h,applyMatch:F,clearFilter:$,clearSort:B,clearSearch:Z,clearMatch:H,reset:G,bindFilter:U,bindSort:P,bindSearch:J,bindMatch:N,stringValue:j,omitValue:M,toggleValue:K,delimitArray:C})}function ue(l,f,d={}){if(!(l!=null&&l[f]))throw new Error("The table must be provided with valid props and key.");const{recordOperations:o={},...m}={only:[...d.only??[],f.toString()],...d},r=s.computed(()=>l[f]),u=ae(),a=ie(l,f,m),x=s.computed(()=>r.value.id??null),w=s.computed(()=>r.value.meta),V=s.computed(()=>r.value.views??[]),p=s.computed(()=>r.value.emptyState??null),y=s.computed(()=>r.value.placeholder??null),C=s.computed(()=>!!r.value.emptyState),j=s.computed(()=>!!r.value.page&&!!r.value.record),M=s.computed(()=>!!r.value.column),O=s.computed(()=>r.value.columns.filter(({active:e,hidden:c})=>e&&!c).map(e=>{var c;return{...e,isSorting:!!((c=e.sort)!=null&&c.active),toggleSort:(g={})=>a.applySort(e.sort,null,g)}})),K=s.computed(()=>r.value.columns.filter(({hidden:e})=>!e).map(e=>({...e,toggle:(c={})=>i(e.name,c)}))),q=s.computed(()=>r.value.records.map(e=>({operations:U(e.operations,Z(e)),class:e.class??null,default:(c={})=>{const g=e.operations.find(({default:L})=>L);g&&J(g,e,c)},select:()=>u.select(h(e)),deselect:()=>u.deselect(h(e)),toggle:()=>u.toggle(h(e)),selected:u.selected(h(e)),bind:()=>u.bind(h(e)),entry:c=>F(e,c),value:c=>$(e,c),extra:c=>B(e,c)}))),W=s.computed(()=>!!r.value.operations.inline),z=s.computed(()=>U(r.value.operations.bulk,H())),Y=s.computed(()=>U(r.value.operations.page)),Q=s.computed(()=>r.value.pages.find(({active:e})=>e)),D=s.computed(()=>r.value.pages),S=s.computed(()=>({...r.value.paginate,next:(e={})=>{"nextLink"in S.value&&S.value.nextLink&&P(S.value.nextLink,e)},previous:(e={})=>{"prevLink"in S.value&&S.value.prevLink&&P(S.value.prevLink,e)},first:(e={})=>{"firstLink"in S.value&&S.value.firstLink&&P(S.value.firstLink,e)},last:(e={})=>{"lastLink"in S.value&&S.value.lastLink&&P(S.value.lastLink,e)},..."links"in r.value.paginate&&r.value.paginate.links?{links:r.value.paginate.links.map(e=>({...e,navigate:(c={})=>e.url&&P(e.url,c)}))}:{}})),E=s.computed(()=>r.value.records.length>0&&r.value.records.every(e=>u.selected(h(e))));function R(e){return typeof e=="string"?e:e.name}function h(e){return"value"in e&&typeof e.value=="function"?e.value(r.value.key):$(e,r.value.key)}function F(e,c){const g=R(c);return g in e&&g!=="classes"?e[g]:null}function $(e,c){var g;return((g=F(e,c))==null?void 0:g.v)??null}function B(e,c){var g;return(g=F(e,c))==null?void 0:g.e}function Z(e){return{record:h(e)}}function H(){return{all:u.selection.value.all,only:Array.from(u.selection.value.only),except:Array.from(u.selection.value.except)}}function G(e,c={},g={}){return _(e,r.value.endpoint,x.value,c,{...m,...g})}function U(e,c={}){return re(e,r.value.endpoint,x.value,m,c)}function P(e,c={}){b.router.visit(e,{preserveScroll:!0,preserveState:!0,...m,...c,method:"get"})}function J(e,c,g={}){var X;G(e,{record:h(c)},g)||(X=o==null?void 0:o[e.name])==null||X.call(o,c)}function N(e,c={}){G(e,H(),{...c,onSuccess:g=>{var L;(L=c.onSuccess)==null||L.call(c,g),e.keepSelected||u.deselectAll()}})}function t(e,c={},g={}){return G(e,c,g)}function n(e,c={}){if(!j.value)return console.warn("The table does not support pagination changes.");b.router.reload({...m,...c,data:{[r.value.record]:e.value,[r.value.page]:void 0}})}function i(e,c={}){if(!M.value)return console.warn("The table does not support column toggling.");const g=R(e);if(!g)return console.log(`Column [${e}] does not exist.`);const L=a.toggleValue(g,O.value.map(({name:X})=>X));b.router.reload({...m,...c,data:{[r.value.column]:a.delimitArray(L)}})}function v(){u.select(...r.value.records.map(e=>h(e)))}function k(){u.deselect(...r.value.records.map(e=>h(e)))}function T(){return{"onUpdate:modelValue":e=>{e?v():k()},modelValue:E.value}}return s.reactive({id:x,meta:w,views:V,emptyState:p,placeholder:y,isEmpty:C,isPageable:j,isToggleable:M,getEntry:F,getValue:$,getExtra:B,getRecordKey:h,headings:O,columns:K,records:q,inline:W,bulk:z,page:Y,pages:D,currentPage:Q,paginator:S,executeInline:J,executeBulk:N,executePage:t,applyPage:n,selection:u.selection,select:e=>u.select(h(e)),deselect:e=>u.deselect(h(e)),selectPage:v,deselectPage:k,toggle:e=>u.toggle(h(e)),selected:e=>u.selected(h(e)),selectAll:u.selectAll,deselectAll:u.deselectAll,isPageSelected:E,hasSelected:u.hasSelected,bindCheckbox:e=>u.bind(h(e)),bindPage:T,bindAll:u.bindAll,filters:a.filters,sorts:a.sorts,searches:a.searches,currentFilters:a.currentFilters,currentSort:a.currentSort,currentSearches:a.currentSearches,isSortable:a.isSortable,isSearchable:a.isSearchable,isMatchable:a.isMatchable,isFiltering:a.isFiltering,isSorting:a.isSorting,isSearching:a.isSearching,getFilter:a.getFilter,getSort:a.getSort,getSearch:a.getSearch,apply:a.apply,applyFilter:a.applyFilter,applySort:a.applySort,applySearch:a.applySearch,applyMatch:a.applyMatch,clearFilter:a.clearFilter,clearSort:a.clearSort,clearSearch:a.clearSearch,clearMatch:a.clearMatch,reset:a.reset,bindFilter:a.bindFilter,bindSort:a.bindSort,bindSearch:a.bindSearch,bindMatch:a.bindMatch,stringValue:a.stringValue,omitValue:a.omitValue,toggleValue:a.toggleValue,delimitArray:a.delimitArray})}function ce(l,f){return l?typeof l=="object"?l.type===f:l===f:!1}A.is=ce,A.useTable=ue,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@honed/table",
3
3
  "private": false,
4
- "version": "0.11.1",
4
+ "version": "0.12.0",
5
5
  "license": "MIT",
6
6
  "description": "-",
7
7
  "keywords": [
@@ -57,8 +57,8 @@
57
57
  }
58
58
  },
59
59
  "peerDependencies": {
60
- "@honed/action": "^0.10.0",
61
- "@honed/refine": "^0.7.1",
60
+ "@honed/action": "^0.12.0",
61
+ "@honed/refine": "^0.8.0",
62
62
  "@inertiajs/vue3": "^1.2.0||^2.0.0",
63
63
  "@vueuse/core": "^11.0.0||^12.0.0",
64
64
  "axios": "^1.2.0",