@ianicdev/datatables2 0.8.11 → 0.8.13

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.
Files changed (49) hide show
  1. package/dist/Columns-DeJNOLCM.cjs +1 -0
  2. package/dist/Columns-GBEpMZ5m.js +28 -0
  3. package/dist/Comparison-gMTr9mHU.cjs +1 -0
  4. package/dist/Comparison-v57GhUTZ.js +37 -0
  5. package/dist/Datepicker-Bv4of4w1.js +1246 -0
  6. package/dist/Datepicker-DGQbQ2jD.cjs +1 -0
  7. package/dist/Download-B4zf7Fob.js +164 -0
  8. package/dist/Download-DFSeQ_uL.cjs +1 -0
  9. package/dist/Options-C6gv21MY.js +82 -0
  10. package/dist/Options-XytiOb4O.cjs +1 -0
  11. package/dist/RefreshTable-BO7uzuWX.js +26 -0
  12. package/dist/RefreshTable-C-5AmxAL.cjs +1 -0
  13. package/dist/Search-ByPG22T-.js +72 -0
  14. package/dist/Search-DIUl3vxm.cjs +1 -0
  15. package/dist/Table-0QV9000m.js +64 -0
  16. package/dist/Table-xPzhAgpA.cjs +1 -0
  17. package/dist/TableServer-ByC-EgB4.js +3937 -0
  18. package/dist/TableServer-i6_C-Qd2.cjs +27 -0
  19. package/dist/cellRender-L5NaGvf8.js +2269 -0
  20. package/dist/cellRender-Ru_IZsKe.cjs +1 -0
  21. package/dist/dataTables-DP-djHBE.cjs +4 -0
  22. package/dist/{dataTables-vb6hbdQB.js → dataTables-qd_2hmGP.js} +1548 -1471
  23. package/dist/datatables.cjs +1 -1
  24. package/dist/datatables.js +1 -1
  25. package/dist/datatables2.css +1 -1
  26. package/dist/escapeKeyString-B_mzfoez.js +17 -0
  27. package/dist/escapeKeyString-CQVlwp30.cjs +1 -0
  28. package/dist/exporttocsv-CUWOZ1Z_.js +88 -0
  29. package/dist/exporttocsv-RZvZEhmM.cjs +6 -0
  30. package/dist/filesaver-Deatpm3H.cjs +1 -0
  31. package/dist/filesaver-K4_fCr7v.js +75 -0
  32. package/dist/index-BeWDgF_v.cjs +1 -0
  33. package/dist/index-CIkwH8Kr.cjs +1 -0
  34. package/dist/index-Drz0TALq.js +79 -0
  35. package/dist/index-Dt2Z193z.js +4316 -0
  36. package/dist/{index.es-DRbDgHS7.cjs → index.es-B0GUE7KM.cjs} +6 -6
  37. package/dist/{index.es-JO9irKMX.js → index.es-sKSodxcW.js} +4 -3
  38. package/dist/jspdf-BDkAtFGI.cjs +194 -0
  39. package/dist/jspdf-CzuJJB6C.js +10998 -0
  40. package/dist/printjs-BbgDICDe.cjs +1 -0
  41. package/dist/printjs-kC3Qmb-l.js +689 -0
  42. package/dist/sortablejs-BhPwT7wS.cjs +6 -0
  43. package/dist/sortablejs-DSHM8iDp.js +1260 -0
  44. package/dist/xlsx-BBXALOAs.cjs +128 -0
  45. package/dist/xlsx-vtl6oPEm.js +15887 -0
  46. package/package.json +4 -4
  47. package/dist/dataTables-DzQnNgjr.cjs +0 -4
  48. package/dist/index-CsWSROxT.js +0 -41217
  49. package/dist/index-nr135rbT.cjs +0 -357
@@ -0,0 +1,82 @@
1
+ import { inject as n, computed as v, ref as y, createBlock as b, openBlock as p, unref as c, isRef as _, withCtx as u, createVNode as g, createElementBlock as V, Fragment as w, renderList as B, mergeProps as k } from "vue";
2
+ import { useI18n as E } from "vue-i18n";
3
+ import { g as P, r as I } from "./printjs-kC3Qmb-l.js";
4
+ import { e as d, g as h } from "./escapeKeyString-B_mzfoez.js";
5
+ import { aD as j, ab as C, ac as F, a9 as L } from "./dataTables-qd_2hmGP.js";
6
+ var M = I();
7
+ const O = /* @__PURE__ */ P(M);
8
+ function R() {
9
+ const m = n("table_props"), r = n("tableRef"), l = n("downloadModal"), s = v(() => m.headers.filter((e) => e?.printable !== !1));
10
+ return { printTable: async () => {
11
+ l.value = !0;
12
+ const e = await r.value.getItemsForPrint(), i = [];
13
+ e.forEach((o) => {
14
+ let a = {};
15
+ s.value.forEach((t) => {
16
+ t.value ? a[d(t.key)] = t.value(o) : a[d(t.key)] = h(o, t.key) ?? "";
17
+ }), i.push(a);
18
+ }), O({
19
+ printable: i,
20
+ type: "json",
21
+ properties: s.value.map((o) => ({
22
+ field: d(o.key),
23
+ displayName: o.title
24
+ }))
25
+ }), l.value = !1;
26
+ } };
27
+ }
28
+ const q = {
29
+ __name: "Options",
30
+ setup(m) {
31
+ const r = n("table_props"), l = n("pluginOptions"), { t: s } = E(), { printTable: f } = R(), e = y(!1), i = v(() => [
32
+ {
33
+ title: s("$datatables.print"),
34
+ onClick: f,
35
+ prependIcon: "mdi-printer",
36
+ ...r.options.header?.export?.buttons
37
+ },
38
+ ...r.options?.globalButtons ?? []
39
+ ]);
40
+ return (o, a) => (p(), b(j, {
41
+ modelValue: c(e),
42
+ "onUpdate:modelValue": a[0] || (a[0] = (t) => _(e) ? e.value = t : null),
43
+ "close-on-content-click": !1,
44
+ location: "bottom end"
45
+ }, {
46
+ activator: u(({ props: t }) => [
47
+ g(L, k({
48
+ "prepend-icon": c(l).header.icons.options,
49
+ text: o.$t("$datatables.more"),
50
+ variant: "text",
51
+ density: "comfortable",
52
+ color: "dark",
53
+ stacked: "",
54
+ class: "text-capitalize"
55
+ }, t), null, 16, ["prepend-icon", "text"])
56
+ ]),
57
+ default: u(() => [
58
+ g(C, {
59
+ "bg-color": "surface-light",
60
+ class: "options-list d-flex flex-column ga-1 pa-1",
61
+ density: "compact",
62
+ rounded: "lg",
63
+ variant: "text",
64
+ slim: ""
65
+ }, {
66
+ default: u(() => [
67
+ (p(!0), V(w, null, B(c(i), (t, x) => (p(), b(F, k({ ref_for: !0 }, t, {
68
+ key: x,
69
+ rounded: "lg",
70
+ link: ""
71
+ }), null, 16))), 128))
72
+ ]),
73
+ _: 1
74
+ })
75
+ ]),
76
+ _: 1
77
+ }, 8, ["modelValue"]));
78
+ }
79
+ };
80
+ export {
81
+ q as default
82
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("vue-i18n"),f=require("./printjs-BbgDICDe.cjs"),c=require("./escapeKeyString-CQVlwp30.cjs"),p=require("./dataTables-DP-djHBE.cjs");var g=f.requirePrint();const y=f.getDefaultExportFromCjs(g);function k(){const u=e.inject("table_props"),l=e.inject("tableRef"),a=e.inject("downloadModal"),s=e.computed(()=>u.headers.filter(n=>n?.printable!==!1));return{printTable:async()=>{a.value=!0;const n=await l.value.getItemsForPrint(),i=[];n.forEach(o=>{let r={};s.value.forEach(t=>{t.value?r[c.escapeKeyString(t.key)]=t.value(o):r[c.escapeKeyString(t.key)]=c.getValueByStringPath(o,t.key)??""}),i.push(r)}),y({printable:i,type:"json",properties:s.value.map(o=>({field:c.escapeKeyString(o.key),displayName:o.title}))}),a.value=!1}}}const v={__name:"Options",setup(u){const l=e.inject("table_props"),a=e.inject("pluginOptions"),{t:s}=b.useI18n(),{printTable:d}=k(),n=e.ref(!1),i=e.computed(()=>[{title:s("$datatables.print"),onClick:d,prependIcon:"mdi-printer",...l.options.header?.export?.buttons},...l.options?.globalButtons??[]]);return(o,r)=>(e.openBlock(),e.createBlock(p.VMenu,{modelValue:e.unref(n),"onUpdate:modelValue":r[0]||(r[0]=t=>e.isRef(n)?n.value=t:null),"close-on-content-click":!1,location:"bottom end"},{activator:e.withCtx(({props:t})=>[e.createVNode(p.VBtn,e.mergeProps({"prepend-icon":e.unref(a).header.icons.options,text:o.$t("$datatables.more"),variant:"text",density:"comfortable",color:"dark",stacked:"",class:"text-capitalize"},t),null,16,["prepend-icon","text"])]),default:e.withCtx(()=>[e.createVNode(p.VList,{"bg-color":"surface-light",class:"options-list d-flex flex-column ga-1 pa-1",density:"compact",rounded:"lg",variant:"text",slim:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),(t,m)=>(e.openBlock(),e.createBlock(p.VListItem,e.mergeProps({ref_for:!0},t,{key:m,rounded:"lg",link:""}),null,16))),128))]),_:1})]),_:1},8,["modelValue"]))}};exports.default=v;
@@ -0,0 +1,26 @@
1
+ import { inject as t, ref as l, createBlock as p, openBlock as d, unref as e } from "vue";
2
+ import { i as f } from "./index-Dt2Z193z.js";
3
+ import { useI18n as m } from "vue-i18n";
4
+ import { a9 as u } from "./dataTables-qd_2hmGP.js";
5
+ const D = {
6
+ __name: "RefreshTable",
7
+ setup(_) {
8
+ const s = t("busEmits"), a = t("table_props"), o = t("pluginOptions"), { deleteDataStorage: r } = f(a), { t: n } = m(), c = l(!1), i = () => {
9
+ r(), s("refetchData");
10
+ };
11
+ return (b, h) => (d(), p(u, {
12
+ disabled: e(c),
13
+ "prepend-icon": e(o).header.icons.refresh,
14
+ text: e(n)("$datatables.refresh"),
15
+ variant: "text",
16
+ density: "comfortable",
17
+ color: "dark",
18
+ stacked: "",
19
+ class: "text-capitalize",
20
+ onClick: i
21
+ }, null, 8, ["disabled", "prepend-icon", "text"]));
22
+ }
23
+ };
24
+ export {
25
+ D as default
26
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-CIkwH8Kr.cjs"),l=require("vue-i18n"),u=require("./dataTables-DP-djHBE.cjs"),d={__name:"RefreshTable",setup(p){const t=e.inject("busEmits"),n=e.inject("table_props"),s=e.inject("pluginOptions"),{deleteDataStorage:r}=i.useDatastate(n),{t:a}=l.useI18n(),c=e.ref(!1),o=()=>{r(),t("refetchData")};return(f,b)=>(e.openBlock(),e.createBlock(u.VBtn,{disabled:e.unref(c),"prepend-icon":e.unref(s).header.icons.refresh,text:e.unref(a)("$datatables.refresh"),variant:"text",density:"comfortable",color:"dark",stacked:"",class:"text-capitalize",onClick:o},null,8,["disabled","prepend-icon","text"]))}};exports.default=d;
@@ -0,0 +1,72 @@
1
+ import { inject as u, ref as d, useTemplateRef as v, computed as _, watch as x, onMounted as k, createBlock as y, openBlock as g, unref as n, isRef as m, withCtx as r, createVNode as s, mergeProps as S } from "vue";
2
+ import { e as T, u as w, f as D, g as F, h as $ } from "./index-Dt2Z193z.js";
3
+ import { watchDebounced as B } from "@vueuse/core";
4
+ import { aD as C, a9 as M } from "./dataTables-qd_2hmGP.js";
5
+ const z = {
6
+ __name: "Search",
7
+ setup(O) {
8
+ const p = u("table_props"), f = u("pluginOptions"), b = T(), { searchState: c } = w(), { setData: h } = b, a = d(null), l = d(!1), i = v("searchField"), V = _(() => c.value);
9
+ return B(
10
+ a,
11
+ (e) => {
12
+ h({
13
+ table_id: p.id,
14
+ name: "search",
15
+ value: { query: e }
16
+ });
17
+ },
18
+ { debounce: 1e3, maxWait: 5e3 }
19
+ ), x(l, (e) => {
20
+ e && setTimeout(() => {
21
+ i.value?.focus();
22
+ }, 250);
23
+ }), k(() => {
24
+ a.value = c.value;
25
+ }), (e, o) => (g(), y(C, {
26
+ modelValue: n(l),
27
+ "onUpdate:modelValue": o[1] || (o[1] = (t) => m(l) ? l.value = t : null),
28
+ "close-on-content-click": !1,
29
+ location: "bottom center"
30
+ }, {
31
+ activator: r(({ props: t }) => [
32
+ s(M, S({
33
+ "prepend-icon": n(f).header.icons.search,
34
+ text: e.$t("$datatables.search"),
35
+ variant: "text",
36
+ density: "comfortable",
37
+ color: n(V) ? "primary" : "dark",
38
+ stacked: "",
39
+ class: "text-capitalize"
40
+ }, t), null, 16, ["prepend-icon", "text", "color"])
41
+ ]),
42
+ default: r(() => [
43
+ s(D, { "min-width": "300" }, {
44
+ default: r(() => [
45
+ s(F, null, {
46
+ default: r(() => [
47
+ s($, {
48
+ ref_key: "searchField",
49
+ ref: i,
50
+ modelValue: n(a),
51
+ "onUpdate:modelValue": o[0] || (o[0] = (t) => m(a) ? a.value = t : null),
52
+ density: "comfortable",
53
+ label: e.$t("$datatables.search"),
54
+ variant: "outlined",
55
+ clearable: "",
56
+ "hide-details": "",
57
+ "prepend-inner-icon": "mdi-magnify"
58
+ }, null, 8, ["modelValue", "label"])
59
+ ]),
60
+ _: 1
61
+ })
62
+ ]),
63
+ _: 1
64
+ })
65
+ ]),
66
+ _: 1
67
+ }, 8, ["modelValue"]));
68
+ }
69
+ };
70
+ export {
71
+ z as default
72
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CIkwH8Kr.cjs"),b=require("@vueuse/core"),u=require("./dataTables-DP-djHBE.cjs"),h={__name:"Search",setup(V){const i=e.inject("table_props"),d=e.inject("pluginOptions"),p=n.useDatatablesStore(),{searchState:c}=n.useTableState(),{setData:f}=p,a=e.ref(null),o=e.ref(!1),s=e.useTemplateRef("searchField"),m=e.computed(()=>c.value);return b.watchDebounced(a,t=>{f({table_id:i.id,name:"search",value:{query:t}})},{debounce:1e3,maxWait:5e3}),e.watch(o,t=>{t&&setTimeout(()=>{s.value?.focus()},250)}),e.onMounted(()=>{a.value=c.value}),(t,r)=>(e.openBlock(),e.createBlock(u.VMenu,{modelValue:e.unref(o),"onUpdate:modelValue":r[1]||(r[1]=l=>e.isRef(o)?o.value=l:null),"close-on-content-click":!1,location:"bottom center"},{activator:e.withCtx(({props:l})=>[e.createVNode(u.VBtn,e.mergeProps({"prepend-icon":e.unref(d).header.icons.search,text:t.$t("$datatables.search"),variant:"text",density:"comfortable",color:e.unref(m)?"primary":"dark",stacked:"",class:"text-capitalize"},l),null,16,["prepend-icon","text","color"])]),default:e.withCtx(()=>[e.createVNode(n.VCard,{"min-width":"300"},{default:e.withCtx(()=>[e.createVNode(n.VCardText,null,{default:e.withCtx(()=>[e.createVNode(n.VTextField,{ref_key:"searchField",ref:s,modelValue:e.unref(a),"onUpdate:modelValue":r[0]||(r[0]=l=>e.isRef(a)?a.value=l:null),density:"comfortable",label:t.$t("$datatables.search"),variant:"outlined",clearable:"","hide-details":"","prepend-inner-icon":"mdi-magnify"},null,8,["modelValue","label"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}};exports.default=h;
@@ -0,0 +1,64 @@
1
+ import { inject as w, useModel as C, ref as D, createBlock as n, openBlock as r, mergeProps as R, unref as e, createSlots as T, withCtx as d, createElementVNode as p, createCommentVNode as B, resolveDynamicComponent as N, createVNode as P, renderList as U, normalizeClass as v, createElementBlock as E, toDisplayString as F } from "vue";
2
+ import { u as I } from "./index-Dt2Z193z.js";
3
+ import { u as L, V as M, a as j, C as z } from "./cellRender-L5NaGvf8.js";
4
+ const O = { key: 1 }, $ = { class: "expandable-row" }, q = ["colspan"], K = {
5
+ __name: "Table",
6
+ props: {
7
+ modelValue: {},
8
+ modelModifiers: {}
9
+ },
10
+ emits: ["update:modelValue"],
11
+ setup(f, { expose: V }) {
12
+ const { tableState: h, searchState: k, headersState: i, saveTableOptions: y } = I(), { filteredData: c } = L(), s = w("table_props"), m = C(f, "modelValue"), S = D(null), x = (l) => l?.lock ? null : `item.${l.key}`;
13
+ return V({ getItemsForPrint: async () => c.value }), (l, u) => (r(), n(M, R({
14
+ ref_key: "datatable",
15
+ ref: S,
16
+ modelValue: m.value,
17
+ "onUpdate:modelValue": u[0] || (u[0] = (t) => m.value = t),
18
+ color: "primary",
19
+ "show-select": "",
20
+ items: e(c),
21
+ headers: e(i),
22
+ loading: e(s).loading
23
+ }, { ...e(s).options, ...e(h).options.state }, {
24
+ search: e(k),
25
+ "onUpdate:options": e(y)
26
+ }), T({
27
+ loading: d(() => [
28
+ P(j, { type: "table-row@10" })
29
+ ]),
30
+ "expanded-row": d(({ columns: t, item: _ }) => [
31
+ p("tr", $, [
32
+ p("td", {
33
+ class: "expandable-row--column",
34
+ colspan: t.length
35
+ }, [
36
+ e(s).options.expandedRowRenderer ? (r(), n(N(e(s).options.expandedRowRenderer), {
37
+ key: 0,
38
+ params: { columns: t, item: _ }
39
+ }, null, 8, ["params"])) : B("", !0)
40
+ ], 8, q)
41
+ ])
42
+ ]),
43
+ _: 2
44
+ }, [
45
+ U(e(i), (t, _) => ({
46
+ name: x(t),
47
+ fn: d(({ item: b, internalItem: g, value: a, column: o }) => [
48
+ p("div", {
49
+ class: v(o.cellClass)
50
+ }, [
51
+ o?.cell ? (r(), n(e(z), {
52
+ key: 0,
53
+ render: o.cell({ item: b, internalItem: g, value: a, column: o }),
54
+ params: { item: b, internalItem: g, value: a, column: o }
55
+ }, null, 8, ["render", "params"])) : (r(), E("span", O, F(String(a).length || String(a) === "0" ? a : "-"), 1))
56
+ ], 2)
57
+ ])
58
+ }))
59
+ ]), 1040, ["modelValue", "items", "headers", "loading", "search", "onUpdate:options"]));
60
+ }
61
+ };
62
+ export {
63
+ K as default
64
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),y=require("./index-CIkwH8Kr.cjs"),n=require("./cellRender-Ru_IZsKe.cjs"),S={key:1},x={class:"expandable-row"},w=["colspan"],B={__name:"Table",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(f,{expose:b}){const{tableState:g,searchState:k,headersState:s,saveTableOptions:_}=y.useTableState(),{filteredData:d}=n.useTableData(),a=e.inject("table_props"),c=e.useModel(f,"modelValue"),h=e.ref(null),V=l=>l?.lock?null:`item.${l.key}`;return b({getItemsForPrint:async()=>d.value}),(l,i)=>(e.openBlock(),e.createBlock(n.VDataTable,e.mergeProps({ref_key:"datatable",ref:h,modelValue:c.value,"onUpdate:modelValue":i[0]||(i[0]=t=>c.value=t),color:"primary","show-select":"",items:e.unref(d),headers:e.unref(s),loading:e.unref(a).loading},{...e.unref(a).options,...e.unref(g).options.state},{search:e.unref(k),"onUpdate:options":e.unref(_)}),e.createSlots({loading:e.withCtx(()=>[e.createVNode(n.VSkeletonLoader,{type:"table-row@10"})]),"expanded-row":e.withCtx(({columns:t,item:p})=>[e.createElementVNode("tr",x,[e.createElementVNode("td",{class:"expandable-row--column",colspan:t.length},[e.unref(a).options.expandedRowRenderer?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a).options.expandedRowRenderer),{key:0,params:{columns:t,item:p}},null,8,["params"])):e.createCommentVNode("",!0)],8,w)])]),_:2},[e.renderList(e.unref(s),(t,p)=>({name:V(t),fn:e.withCtx(({item:u,internalItem:m,value:o,column:r})=>[e.createElementVNode("div",{class:e.normalizeClass(r.cellClass)},[r?.cell?(e.openBlock(),e.createBlock(e.unref(n.CellRender),{key:0,render:r.cell({item:u,internalItem:m,value:o,column:r}),params:{item:u,internalItem:m,value:o,column:r}},null,8,["render","params"])):(e.openBlock(),e.createElementBlock("span",S,e.toDisplayString(String(o).length||String(o)==="0"?o:"-"),1))],2)])}))]),1040,["modelValue","items","headers","loading","search","onUpdate:options"]))}};exports.default=B;