vuetable-next 1.0.11 → 1.0.12
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/README.md +54 -0
- package/dist/index.js +1 -0
- package/dist/public.d.ts +6 -0
- package/dist/types/components/Vuetable.vue.d.ts +37 -45
- package/dist/types/components/VuetableRenderBoundary.d.ts +14 -0
- package/dist/types/components/createVuetable.d.ts +6 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/vue2.cjs +6 -6
- package/dist/vue2.cjs.map +1 -1
- package/dist/vue2.js +915 -818
- package/dist/vue2.js.map +1 -1
- package/dist/vue3.cjs +2 -2
- package/dist/vue3.cjs.map +1 -1
- package/dist/vue3.js +1019 -907
- package/dist/vue3.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -233,6 +233,54 @@ The table API is intended to stay familiar on Vue 2 and Vue 3. Framework-level
|
|
|
233
233
|
differences still apply: use Vue 3 slot/render-function conventions in your own
|
|
234
234
|
components, and follow the setup instructions for your installed Vue version.
|
|
235
235
|
|
|
236
|
+
### Vue 3: automatic row-render optimization
|
|
237
|
+
|
|
238
|
+
The standard `Vuetable` avoids rebuilding unchanged rows when parent updates
|
|
239
|
+
only replace event listeners, including inline callbacks. No factory, special
|
|
240
|
+
registration or application-side listener caching is required. The outer
|
|
241
|
+
component can still update to keep listeners and root attributes current.
|
|
242
|
+
Reactive rows, fields and values read by formatters continue to update normally.
|
|
243
|
+
External slots are updated conservatively so their content cannot become stale;
|
|
244
|
+
this is not a promise to skip renders when table content actually changes.
|
|
245
|
+
|
|
246
|
+
`createVuetable()` remains optional for declaring a fixed component-event
|
|
247
|
+
contract. It is not required for the standard listener-only optimization.
|
|
248
|
+
|
|
249
|
+
```ts
|
|
250
|
+
import { createVuetable } from "vuetable-next";
|
|
251
|
+
|
|
252
|
+
const AuditTable = createVuetable({
|
|
253
|
+
eventPrefix: "audit:",
|
|
254
|
+
events: ["custom-action"]
|
|
255
|
+
});
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Define the component once at module scope, outside `render()` and `setup()`, then
|
|
259
|
+
register it locally or use it directly in `<script setup>`. Keep existing table
|
|
260
|
+
props, slots and refs; listen with `@audit:row-clicked` or `@audit:custom-action`.
|
|
261
|
+
`events` contains **additional unprefixed** names passed to `fireEvent()`; the
|
|
262
|
+
default prefix is `vuetable:`. Vue handles latest listeners, `.once`, errors and
|
|
263
|
+
native DOM listeners normally. With an empty prefix, declaring `click` makes
|
|
264
|
+
`@click` a component event only, not a root DOM click listener.
|
|
265
|
+
|
|
266
|
+
The prefix is fixed for each factory component: overriding its `eventPrefix`
|
|
267
|
+
prop is unsupported and warns in development. Undeclared factory events also
|
|
268
|
+
warn in development. Create another factory for a different prefix or event set.
|
|
269
|
+
Factory results are local components, not plugins (`app.use()` is unsupported).
|
|
270
|
+
For the generic component, single-word listeners such as `onCustom` are ambiguous:
|
|
271
|
+
they fall through to the root DOM element as well as receiving component events.
|
|
272
|
+
Use the factory with `events: ["custom"]` when a listener must be component-only.
|
|
273
|
+
Explicit Vue DOM listeners such as `on:custom-event` remain DOM listeners.
|
|
274
|
+
The generic `Vuetable` remains fully dynamic and warning-free for arbitrary
|
|
275
|
+
prefixes/custom events. Vue 2 users keep the generic component:
|
|
276
|
+
importing the factory is safe, but calling it throws a Vue-3-only error.
|
|
277
|
+
|
|
278
|
+
For sorting state, inspect the live table ref’s `order`. `clearSortOrder()`
|
|
279
|
+
detaches the table’s local order and leaves the owner’s `sortOrder` input
|
|
280
|
+
unchanged; do not rely on Vue 2 prop-mutation quirks or treat that input as the
|
|
281
|
+
live order after clearing. Replacing the owner’s `sortOrder` array resynchronizes
|
|
282
|
+
the table with the new input.
|
|
283
|
+
|
|
236
284
|
### Moving an existing table
|
|
237
285
|
|
|
238
286
|
1. Replace the `vuetable-2` dependency with the verified `vuetable-next` release or archive.
|
|
@@ -329,6 +377,12 @@ Try selecting and clearing rows, replacing data, opening details, and reloading.
|
|
|
329
377
|
The live state panel shows the runtime version, selected IDs, emitted custom
|
|
330
378
|
events and any captured runtime errors.
|
|
331
379
|
|
|
380
|
+
On the Vue 3 page, choose **Factory playground** (`/vue-3/factory/`) for the
|
|
381
|
+
interactive `createVuetable()` demo: sortable and paginated orders, checkboxes,
|
|
382
|
+
details, custom row actions, and measured generic-versus-factory listener updates
|
|
383
|
+
(both avoid rebuilding unchanged rows in the listener-only scenario).
|
|
384
|
+
It uses the same freshly packed archive; Vue 2 pages keep the generic component.
|
|
385
|
+
|
|
332
386
|
For source-level Vue 3 development, `npm run dev` starts the Vite demo. The legacy
|
|
333
387
|
`dev:2` source demo is not the cross-version compatibility gate; use the packed
|
|
334
388
|
demo and consumer matrix for Vue 2 verification.
|
package/dist/index.js
CHANGED
|
@@ -17,4 +17,5 @@ export const useVuetableField = selected.useVuetableField;
|
|
|
17
17
|
export const useVuetableFieldCheckbox = selected.useVuetableFieldCheckbox;
|
|
18
18
|
export const useVuetablePagination = selected.useVuetablePagination;
|
|
19
19
|
export const useVuetablePaginationInfo = selected.useVuetablePaginationInfo;
|
|
20
|
+
export const createVuetable = selected.createVuetable;
|
|
20
21
|
export default selected.default;
|
package/dist/public.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export interface VuetableProps {
|
|
|
41
41
|
apiUrl?: string;
|
|
42
42
|
httpMethod?: "get" | "post";
|
|
43
43
|
loadOnStart?: boolean;
|
|
44
|
+
eventPrefix?: string;
|
|
44
45
|
data?: any;
|
|
45
46
|
perPage?: number;
|
|
46
47
|
initialPage?: number;
|
|
@@ -103,6 +104,11 @@ export declare function install(app: {
|
|
|
103
104
|
}): void;
|
|
104
105
|
|
|
105
106
|
export declare const Vuetable: VuetableComponent<VuetableInstance> & { install: typeof install };
|
|
107
|
+
export interface CreateVuetableOptions {
|
|
108
|
+
eventPrefix?: string;
|
|
109
|
+
events?: string[];
|
|
110
|
+
}
|
|
111
|
+
export declare function createVuetable(options?: CreateVuetableOptions): VuetableComponent<VuetableInstance>;
|
|
106
112
|
export declare const VuetableColGutter: VuetableComponent;
|
|
107
113
|
export declare const VuetableFieldCheckbox: VuetableComponent;
|
|
108
114
|
export declare const VuetableFieldHandle: VuetableComponent;
|
|
@@ -58,6 +58,7 @@ interface Props {
|
|
|
58
58
|
transform?: ((response: AxiosResponse) => any) | null;
|
|
59
59
|
sortParams?: ((sortOrder: SortOrder[]) => string) | null;
|
|
60
60
|
fieldPrefix?: string;
|
|
61
|
+
eventPrefix?: string;
|
|
61
62
|
}
|
|
62
63
|
export interface Field {
|
|
63
64
|
name: any | DefineComponent;
|
|
@@ -172,7 +173,11 @@ declare const _default: DefineComponent<import('vue').ExtractPropTypes<{
|
|
|
172
173
|
sortOrder: {
|
|
173
174
|
type: PropType<Props["sortOrder"]>;
|
|
174
175
|
required: false;
|
|
175
|
-
default: () =>
|
|
176
|
+
default: () => {
|
|
177
|
+
field: string;
|
|
178
|
+
sortField: string;
|
|
179
|
+
direction: "asc" | "desc";
|
|
180
|
+
}[];
|
|
176
181
|
};
|
|
177
182
|
multiSort: {
|
|
178
183
|
type: BooleanConstructor;
|
|
@@ -264,7 +269,15 @@ declare const _default: DefineComponent<import('vue').ExtractPropTypes<{
|
|
|
264
269
|
required: false;
|
|
265
270
|
default: string;
|
|
266
271
|
};
|
|
272
|
+
eventPrefix: {
|
|
273
|
+
type: StringConstructor;
|
|
274
|
+
required: false;
|
|
275
|
+
default: string;
|
|
276
|
+
};
|
|
267
277
|
}>, {
|
|
278
|
+
bodyRevision: import('vue').Ref<number, number>;
|
|
279
|
+
getSlot: (name: string) => any;
|
|
280
|
+
getRootAttrs: () => Record<string, unknown>;
|
|
268
281
|
tableContext: {
|
|
269
282
|
vuetable: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}, {}, {}, string, import('vue').ComponentProvideOptions>, {}, {}, "", {}, any> | null | undefined;
|
|
270
283
|
$el: any;
|
|
@@ -416,26 +429,7 @@ declare const _default: DefineComponent<import('vue').ExtractPropTypes<{
|
|
|
416
429
|
minRows: number;
|
|
417
430
|
silent: boolean;
|
|
418
431
|
noDataTemplate: string;
|
|
419
|
-
|
|
420
|
-
"onVuetable:load-error": ((...args: any[]) => any) | undefined;
|
|
421
|
-
"onVuetable:load-success": ((...args: any[]) => any) | undefined;
|
|
422
|
-
"onVuetable:loaded": ((...args: any[]) => any) | undefined;
|
|
423
|
-
"onVuetable:loading": ((...args: any[]) => any) | undefined;
|
|
424
|
-
"onVuetable:scrollbar-visible": ((...args: any[]) => any) | undefined;
|
|
425
|
-
"onVuetable:pagination-data": ((...args: any[]) => any) | undefined;
|
|
426
|
-
"onVuetable:row-clicked": ((...args: any[]) => any) | undefined;
|
|
427
|
-
"onVuetable:row-dblclicked": ((...args: any[]) => any) | undefined;
|
|
428
|
-
"onVuetable:detail-row-clicked": ((...args: any[]) => any) | undefined;
|
|
429
|
-
"onVuetable:cell-clicked": ((...args: any[]) => any) | undefined;
|
|
430
|
-
"onVuetable:cell-dblclicked": ((...args: any[]) => any) | undefined;
|
|
431
|
-
"onVuetable:cell-rightclicked": ((...args: any[]) => any) | undefined;
|
|
432
|
-
"onVuetable:row-mouseover": ((...args: any[]) => any) | undefined;
|
|
433
|
-
"onVuetable:field-event": ((...args: any[]) => any) | undefined;
|
|
434
|
-
"onVuetable:checkbox-toggled": ((...args: any[]) => any) | undefined;
|
|
435
|
-
"onVuetable:checkbox-toggled-all": ((...args: any[]) => any) | undefined;
|
|
436
|
-
"onVuetable:checkbox-toggled-custom": ((...args: any[]) => any) | undefined;
|
|
437
|
-
"onVuetable:data-reset": ((...args: any[]) => any) | undefined;
|
|
438
|
-
"onVuetable:initialized": ((...args: any[]) => any) | undefined;
|
|
432
|
+
eventPrefix: string;
|
|
439
433
|
};
|
|
440
434
|
fireEvent: (name: string, ...args: any[]) => void;
|
|
441
435
|
bodyWrapper: import('vue').Ref<any, any>;
|
|
@@ -646,7 +640,7 @@ declare const _default: DefineComponent<import('vue').ExtractPropTypes<{
|
|
|
646
640
|
sortableIcon: string;
|
|
647
641
|
handleIcon: string;
|
|
648
642
|
};
|
|
649
|
-
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin,
|
|
643
|
+
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
650
644
|
fields: {
|
|
651
645
|
type: PropType<Props["fields"]>;
|
|
652
646
|
required: true;
|
|
@@ -738,7 +732,11 @@ declare const _default: DefineComponent<import('vue').ExtractPropTypes<{
|
|
|
738
732
|
sortOrder: {
|
|
739
733
|
type: PropType<Props["sortOrder"]>;
|
|
740
734
|
required: false;
|
|
741
|
-
default: () =>
|
|
735
|
+
default: () => {
|
|
736
|
+
field: string;
|
|
737
|
+
sortField: string;
|
|
738
|
+
direction: "asc" | "desc";
|
|
739
|
+
}[];
|
|
742
740
|
};
|
|
743
741
|
multiSort: {
|
|
744
742
|
type: BooleanConstructor;
|
|
@@ -830,28 +828,12 @@ declare const _default: DefineComponent<import('vue').ExtractPropTypes<{
|
|
|
830
828
|
required: false;
|
|
831
829
|
default: string;
|
|
832
830
|
};
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
"onVuetable:scrollbar-visible"?: ((...args: any[]) => any) | undefined;
|
|
840
|
-
"onVuetable:pagination-data"?: ((...args: any[]) => any) | undefined;
|
|
841
|
-
"onVuetable:row-clicked"?: ((...args: any[]) => any) | undefined;
|
|
842
|
-
"onVuetable:row-dblclicked"?: ((...args: any[]) => any) | undefined;
|
|
843
|
-
"onVuetable:detail-row-clicked"?: ((...args: any[]) => any) | undefined;
|
|
844
|
-
"onVuetable:cell-clicked"?: ((...args: any[]) => any) | undefined;
|
|
845
|
-
"onVuetable:cell-dblclicked"?: ((...args: any[]) => any) | undefined;
|
|
846
|
-
"onVuetable:cell-rightclicked"?: ((...args: any[]) => any) | undefined;
|
|
847
|
-
"onVuetable:row-mouseover"?: ((...args: any[]) => any) | undefined;
|
|
848
|
-
"onVuetable:field-event"?: ((...args: any[]) => any) | undefined;
|
|
849
|
-
"onVuetable:checkbox-toggled"?: ((...args: any[]) => any) | undefined;
|
|
850
|
-
"onVuetable:checkbox-toggled-all"?: ((...args: any[]) => any) | undefined;
|
|
851
|
-
"onVuetable:checkbox-toggled-custom"?: ((...args: any[]) => any) | undefined;
|
|
852
|
-
"onVuetable:data-reset"?: ((...args: any[]) => any) | undefined;
|
|
853
|
-
"onVuetable:initialized"?: ((...args: any[]) => any) | undefined;
|
|
854
|
-
}>, {
|
|
831
|
+
eventPrefix: {
|
|
832
|
+
type: StringConstructor;
|
|
833
|
+
required: false;
|
|
834
|
+
default: string;
|
|
835
|
+
};
|
|
836
|
+
}>> & Readonly<{}>, {
|
|
855
837
|
fieldPrefix: string;
|
|
856
838
|
sortOrder: SortOrder[] | undefined;
|
|
857
839
|
trackBy: string;
|
|
@@ -903,7 +885,17 @@ declare const _default: DefineComponent<import('vue').ExtractPropTypes<{
|
|
|
903
885
|
minRows: number;
|
|
904
886
|
silent: boolean;
|
|
905
887
|
noDataTemplate: string;
|
|
888
|
+
eventPrefix: string;
|
|
906
889
|
}, {}, {
|
|
890
|
+
RenderBoundary: import('vue').FunctionalComponent<{}, {}, any, {}> | {
|
|
891
|
+
functional: boolean;
|
|
892
|
+
render: (_createElement: any, context: any) => any;
|
|
893
|
+
};
|
|
894
|
+
SlotOutlet: import('vue').FunctionalComponent<import('./VuetableRenderBoundary').SlotOutletProps, {}, any, {}> | {
|
|
895
|
+
functional: boolean;
|
|
896
|
+
props: string[];
|
|
897
|
+
render: (_createElement: any, context: any) => any;
|
|
898
|
+
};
|
|
907
899
|
VuetableRowHeader: DefineComponent<import('vue').ExtractPropTypes<{
|
|
908
900
|
vuetable: {
|
|
909
901
|
type: ObjectConstructor;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Vue from "vue-demi";
|
|
2
|
+
export interface SlotOutletProps {
|
|
3
|
+
content?: (scope: Record<string, unknown>) => any;
|
|
4
|
+
scope: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export declare const RenderBoundary: Vue.FunctionalComponent<{}, {}, any, {}> | {
|
|
7
|
+
functional: boolean;
|
|
8
|
+
render: (_createElement: any, context: any) => any;
|
|
9
|
+
};
|
|
10
|
+
export declare const SlotOutlet: Vue.FunctionalComponent<SlotOutletProps, {}, any, {}> | {
|
|
11
|
+
functional: boolean;
|
|
12
|
+
props: string[];
|
|
13
|
+
render: (_createElement: any, context: any) => any;
|
|
14
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ declare const Vuetable: typeof VuetableComponent & {
|
|
|
22
22
|
};
|
|
23
23
|
export { Vuetable, VuetableFieldMixin, VuetableFieldCheckboxMixin, VuetablePaginationInfoMixin, VuetablePaginationMixin, useVuetableField, useVuetableFieldCheckbox, useVuetablePagination, useVuetablePaginationInfo, VuetableColGutter, VuetableFieldCheckbox, VuetableFieldHandle, VuetableFieldSequence, VuetablePagination, VuetablePaginationDropdown, VuetablePaginationInfo, VuetableRowHeader, install };
|
|
24
24
|
export default Vuetable;
|
|
25
|
+
export { createVuetable } from './components/createVuetable';
|
|
26
|
+
export type { CreateVuetableOptions } from './components/createVuetable';
|
|
25
27
|
export type { VuetableFieldContext, VuetableFieldDefinition, VuetableFieldProps, VuetableFieldResult, VuetableFieldRow } from './components/useVuetableField';
|
|
26
28
|
export type { VuetableFieldCheckboxContext, VuetableFieldCheckboxProps, VuetableFieldCheckboxResult } from './components/useVuetableFieldCheckbox';
|
|
27
29
|
export type { VuetablePaginationOptions, VuetablePaginationResult } from './components/useVuetablePagination';
|
package/dist/vue2.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";var on=Object.defineProperty,sn=Object.defineProperties;var un=Object.getOwnPropertyDescriptors;var yt=Object.getOwnPropertySymbols;var cn=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable;var _t=(e,a,t)=>a in e?on(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,E=(e,a)=>{for(var t in a||(a={}))cn.call(a,t)&&_t(e,t,a[t]);if(yt)for(var t of yt(a))dn.call(a,t)&&_t(e,t,a[t]);return e},Pt=(e,a)=>sn(e,un(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue-demi"),Ct=require("axios"),fn=require("mitt"),H=l.defineComponent({name:"vuetable-field-checkbox",props:{rowData:{type:Object,required:!1},rowIndex:{type:Number,required:!1},rowField:{type:Object,required:!1,default:null},isHeader:{type:Boolean,required:!1,default:!1},title:{type:String,required:!1}},setup(e){const a=l.inject("vuetable"),t=l.ref(null),r=l.computed(()=>(a.tableData||[]).filter(d=>a.isSelectedRow(d[a.trackBy])).length),i=l.computed(()=>{var d;return r.value>0&&r.value<(((d=a.tableData)==null?void 0:d.length)||0)});function s(d,m){var p;d&&a.onCheckboxToggled(m.target.checked,(p=e.rowField)==null?void 0:p.name,d)}function f(d){a.onCheckboxToggledAll(d.target.checked)}function c(d){return!!d&&a.isSelectedRow(d[a.trackBy])}function v(){return r.value>0}return{vuetable:a,checkbox:t,isIndeterminate:i,toggleCheckbox:s,toggleAllCheckbox:f,isSelected:c,isAllItemsInCurrentPageSelected:v}}});var vn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return e.isHeader?t("th",{staticClass:"vuetable-th-component-checkbox"},[t("input",{ref:"checkbox",attrs:{type:"checkbox"},domProps:{indeterminate:e.isIndeterminate,checked:e.isAllItemsInCurrentPageSelected()},on:{change:function(r){return e.toggleAllCheckbox(r)}}})]):t("td",{staticClass:"vuetable-td-component-checkbox"},[t("input",{ref:"checkbox",attrs:{type:"checkbox"},domProps:{checked:e.isSelected(e.rowData)},on:{change:function(r){return e.toggleCheckbox(e.rowData,r)}}})])},bn=[];H.render=vn;H.staticRenderFns=bn;const M=l.defineComponent({name:"vuetable-field-handle",props:{isHeader:{type:Boolean,required:!1,default:!1},title:{type:String,required:!1,default:""}},setup(){const e=l.inject("vuetable");function a(t,r=""){return typeof e.css.renderIcon=="undefined"?`<i class="${t.join(" ")}" ${r}></i>`:e.css.renderIcon(t,r)}return{vuetable:e,renderIconTag:a}}});var gn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return e.isHeader?t("th",{staticClass:"vuetable-th-component-handle",domProps:{innerHTML:e._s(e.title)}}):t("td",{staticClass:"vuetable-td-component-handle",domProps:{innerHTML:e._s(e.renderIconTag(["handle-icon",e.vuetable.css.handleIcon]))}})},pn=[];M.render=gn;M.staticRenderFns=pn;const A=l.defineComponent({name:"vuetable-field-sequence",props:{rowIndex:{type:Number,required:!1,default:0},isHeader:{type:Boolean,required:!1,default:!1},title:{type:String,required:!1,default:""}},setup(e){const a=l.inject("vuetable");function t(){return a.tablePagination?a.tablePagination.from+e.rowIndex:1+e.rowIndex}return{vuetable:a,renderSequence:t}}});var hn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return e.isHeader?t("th",{staticClass:"vuetable-th-component-sequence",domProps:{innerHTML:e._s(e.title)}}):t("td",{staticClass:"vuetable-td-component-sequence",domProps:{innerHTML:e._s(e.renderSequence())}})},mn=[];A.render=hn;A.staticRenderFns=mn;const D=l.defineComponent({name:"vuetable-th-gutter",setup(){return{vuetable:l.inject("vuetable")}}});var yn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("th",{staticClass:"vuetable-th-gutter",style:{width:e.vuetable.scrollBarWidth}})},_n=[];D.render=yn;D.staticRenderFns=_n;D._scopeId="data-v-05d64983";const L=l.defineComponent({name:"vuetable-row-header",components:{"vuetable-field-checkbox":H,"vuetable-field-handle":M,"vuetable-field-sequence":A,VuetableColGutter:D},props:{vuetable:{type:Object,default:null}},setup(){const e=l.inject("vuetable");function a(u){return u.replace(e.fieldPrefix,"")}function t(u,g){return[`${u}-${r(g.name)}`,g.titleClass||"",i(g),{sortable:e.isSortable(g)}]}function r(u){return typeof u=="string"&&u.replace(/([A-Z])/g,g=>"_"+g.toLowerCase()).replace(" ","_").replace(".","_")}function i(u){const g=v(u);return g!==!1?e.sortOrder[g].direction=="asc"?e.css.ascendingClass:e.css.descendingClass:""}function s(u){const g=v(u);return g===!1?e.css.sortableIcon:e.sortOrder[g].direction=="asc"?e.css.ascendingIcon:e.css.descendingIcon}function f(u){return v(u)!==!1}function c(u){return e.isSortable(u)&&e.css.sortableIcon!=""}function v(u){if(!e.isSortable(u))return!1;for(let g=0;g<e.sortOrder.length;g++)if(d(u,g))return g;return!1}function d(u,g){return e.sortOrder[g].field===u.name&&e.sortOrder[g].sortField===u.sortField}function m(u){const g=p(u);if(g.length>0&&f(u)||c(u)){const S=`opacity:${y(u)};position:relative;float:right`,$=e.showSortIcons?C(["sort-icon",s(u)],`style="${S}"`):"";return g+" "+$}return g}function p(u){return typeof u.title=="function"?u.title():typeof u.title=="undefined"?u.name.toString().replace("."," "):u.title}function y(u){let $=.3;const x=e.sortOrder.length,P=v(u);return 1-x*$<.3&&($=(1-.3)/(x-1)),1-(P===!1?0:P)*$}function C(u,g=""){return typeof e.css.renderIcon=="undefined"?`<i class="${u.join(" ")}" ${g}></i>`:e.css.renderIcon(u,g)}function w(u,g){e.orderBy(u,g)}return{headerTable:e,stripPrefix:a,headerClass:t,toSnakeCase:r,sortClass:i,sortIcon:s,isInCurrentSortGroup:f,hasSortableIcon:c,currentSortOrderPosition:v,fieldIsInSortOrderPosition:d,renderTitle:m,getTitle:p,sortIconOpacity:y,renderIconTag:C,onColumnHeaderClicked:w,VuetableColGutter:D}}});var Pn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("tr",[e._l(e.headerTable.tableFields,function(r,i){return[r.visible?[e.headerTable.isFieldComponent(r.name)?[t(r.name,{key:i,tag:"component",class:e.headerClass("vuetable-th-component",r),style:{width:r.width},attrs:{"is-header":"",vuetable:e.headerTable,"row-field":r,title:e.renderTitle(r)},on:{"vuetable:header-event":e.headerTable.onHeaderEvent,click:function(s){return e.onColumnHeaderClicked(r,s)}}})]:e.headerTable.isFieldSlot(r.name)?[t("th",{key:i,class:e.headerClass("vuetable-th-slot",r),style:{width:r.width},domProps:{innerHTML:e._s(e.renderTitle(r))},on:{click:function(s){return e.onColumnHeaderClicked(r,s)}}})]:[t("th",{key:i,class:e.headerClass("vuetable-th",r),style:{width:r.width},attrs:{id:"_"+r.name},domProps:{innerHTML:e._s(e.renderTitle(r))},on:{click:function(s){return e.onColumnHeaderClicked(r,s)}}})]]:e._e()]}),e._v(" "),e.headerTable.scrollVisible?t("VuetableColGutter"):e._e()],2)},Cn=[];L.render=Pn;L.staticRenderFns=Cn;const Q=l.defineComponent({name:"vuetable-col-group",props:{isHeader:{type:Boolean,required:!1,default:!1}},setup(){const e=l.inject("vuetable");function a(t,r){let i=typeof t.name=="object"&&t.name!==null?t.name.name||"component":t.name;return i=i.replace(e.fieldPrefix,""),[`vuetable-col-${i}`,t.titleClass,`${i}-${r}`]}return{vuetable:e,columnClass:a}}});var wn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("colgroup",[e._l(e.vuetable.tableFields,function(r,i){return[r.visible?[t("col",{key:i,class:e.columnClass(r,i),style:{width:r.width}})]:e._e()]}),e._v(" "),e.isHeader&&e.vuetable.scrollVisible?t("col",{staticClass:"vuetable-col-gutter",style:{width:e.vuetable.scrollBarWidth}}):e._e()],2)},kn=[];Q.render=wn;Q.staticRenderFns=kn;const $e=l.defineComponent({name:"VuetableDetailHost",props:{detailComponent:{type:[String,Object],default:""},rowData:{type:Object,required:!0},rowIndex:{type:Number,required:!0},options:{type:Object,default:()=>({})}},setup(e){const a=l.inject("vuetable"),t=l.computed(()=>a.vuetable),r=l.computed(()=>typeof e.detailComponent=="object"?l.markRaw(l.toRaw(e.detailComponent)):e.detailComponent);return{tableContext:a,vuetable:t,resolvedDetailComponent:r}}});var Sn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t(e.resolvedDetailComponent,{tag:"component",attrs:{"row-data":e.rowData,"row-index":e.rowIndex,vuetable:e.tableContext,options:e.options}})},Fn=[];$e.render=Sn;$e.staticRenderFns=Fn;const T={table:{tableWrapper:"",tableHeaderClass:"fixed",tableBodyClass:"fixed",tableClass:"ui blue selectable unstackable celled table",loadingClass:"loading",ascendingIcon:"blue chevron up icon",descendingIcon:"blue chevron down icon",ascendingClass:"sorted-asc",descendingClass:"sorted-desc",sortableIcon:"grey sort icon",handleIcon:"grey sidebar icon"},pagination:{wrapperClass:"ui right floated pagination menu",activeClass:"active large",disabledClass:"disabled",pageClass:"item",linkClass:"icon item",paginationClass:"ui bottom attached segment grid",paginationInfoClass:"left floated left aligned six wide column",dropdownClass:"ui search dropdown",icons:{first:"angle double left icon",prev:"left chevron icon",next:"right chevron icon",last:"angle double right icon"}},paginationInfo:{infoClass:"left floated left aligned six wide column"}};var $n=Object.defineProperty,xn=Object.defineProperties,On=Object.getOwnPropertyDescriptors,wt=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,Tn=Object.prototype.propertyIsEnumerable,kt=(e,a,t)=>a in e?$n(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,I=(e,a)=>{for(var t in a||(a={}))Rn.call(a,t)&&kt(e,t,a[t]);if(wt)for(var t of wt(a))Tn.call(a,t)&&kt(e,t,a[t]);return e},we=(e,a)=>xn(e,On(a)),qn=(e,a,t)=>new Promise((r,i)=>{var s=v=>{try{c(t.next(v))}catch(d){i(d)}},f=v=>{try{c(t.throw(v))}catch(d){i(d)}},c=v=>v.done?r(v.value):Promise.resolve(v.value).then(s,f);c((t=t.apply(e,a)).next())});const xe=l.defineComponent({name:"Vuetable",components:{VuetableRowHeader:L,VuetableColGroup:Q,VuetableDetailHost:$e,"vuetable-field-checkbox":H,"vuetable-field-handle":M,"vuetable-field-sequence":A},props:{fields:{type:Array,required:!0},loadOnStart:{type:Boolean,required:!1,default:!0},apiUrl:{type:String,required:!1,default:""},httpMethod:{type:String,required:!1,default:"get"},reactiveApiUrl:{type:Boolean,required:!1,default:!0},apiMode:{type:Boolean,required:!1,default:!0},data:{type:null,required:!1,default:null},dataManager:{type:Function,required:!1,default:null},dataPath:{type:String,required:!1,default:"data"},paginationPath:{type:String,required:!1,default:"links.pagination"},queryParams:{type:[Object,Function],required:!1,default:()=>({sort:"sort",page:"page",perPage:"per_page"})},appendParams:{type:Object,required:!1,default:()=>({})},httpOptions:{type:Object,required:!1,default:()=>({})},httpFetch:{type:Function,required:!1,default:null},perPage:{type:Number,required:!1,default:10},initialPage:{type:Number,required:!1,default:1},firstPage:{type:Number,required:!1,default:1},sortOrder:{type:Array,required:!1,default:()=>[]},multiSort:{type:Boolean,required:!1,default:!1},tableHeight:{type:String,required:!1,default:null},multiSortKey:{type:String,required:!1,default:"alt"},rowClass:{type:[String,Function],required:!1,default:""},detailRowComponent:{type:[String,Object],required:!1,default:""},detailRowTransition:{type:String,required:!1,default:""},detailRowClass:{type:[String,Function],required:!1,default:"vuetable-detail-row"},detailRowOptions:{type:Object,required:!1,default:()=>({})},trackBy:{type:String,required:!1,default:"id"},css:{type:Object,required:!1,default:()=>({})},minRows:{type:Number,required:!1,default:0},silent:{type:Boolean,required:!1,default:!1},noDataTemplate:{type:String,required:!1,default:"No Data Available"},showSortIcons:{type:Boolean,required:!1,default:!0},headerRows:{type:Array,required:!1,default:()=>["VuetableRowHeader"]},transform:{type:Function,required:!1,default:null},sortParams:{type:Function,required:!1,default:null},fieldPrefix:{type:String,required:!1,default:"vuetable-field-"}},emits:["vuetable:load-error","vuetable:load-success","vuetable:loaded","vuetable:loading","vuetable:scrollbar-visible","vuetable:pagination-data","vuetable:row-clicked","vuetable:row-dblclicked","vuetable:detail-row-clicked","vuetable:cell-clicked","vuetable:cell-dblclicked","vuetable:cell-rightclicked","vuetable:row-mouseover","vuetable:field-event","vuetable:header-event","vuetable:checkbox-toggled","vuetable:checkbox-toggled-all","vuetable:checkbox-toggled-custom","vuetable:data-reset","vuetable:initialized"],computed:{$_css(){return this.tableCss}},setup(e,{emit:a,slots:t}){const r=l.getCurrentInstance(),i=l.ref(),s=l.computed(()=>r==null?void 0:r.proxy),f=l.ref([]),c=l.ref(null),v=l.ref(null),d=l.ref(e.initialPage),m=l.ref([]),p=l.ref([]),y=l.ref(0),C=l.ref("17px"),w=l.ref(!1),u=l.ref(e.sortOrder.map(n=>I({},n))),g=l.ref(e.httpOptions),S=l.ref(),$=l.computed(()=>I(I({},T.table),e.css)),x=l.computed(()=>{var n,o;return(n=c.value)!=null&&n.length?((o=c.value)==null?void 0:o.length)>0:!1}),P=l.computed(()=>x.value&&e.detailRowComponent!==""),F=l.computed(()=>c.value&&typeof c.value[0][e.trackBy]!="undefined"),Te=l.computed(()=>f.value.filter(n=>n.visible).length),ee=l.computed(()=>{var n;return((n=c.value)==null?void 0:n.length)||0}),qe=l.computed(()=>ee.value===0&&e.noDataTemplate.length>0),te=l.computed(()=>{var n;return c.value===null||((n=c.value)==null?void 0:n.length)===0}),De=l.computed(()=>te.value?!0:c.value.length<e.minRows),je=l.computed(()=>te.value?e.minRows:c.value.length>=e.minRows?0:e.minRows-c.value.length),ne=l.computed(()=>e.apiMode),Ee=l.computed(()=>!e.apiMode),Ie=l.computed(()=>e.tableHeight!=null);re(),st(),l.nextTick(()=>{a("vuetable:initialized",f.value)}),l.onMounted(()=>{if(e.loadOnStart&&O(),Ie.value){C.value=Me()+"px";const n=i.value;n!=null&&n.addEventListener("scroll",ae)}}),l.onBeforeUnmount(()=>{const n=i.value;n!=null&&n.removeEventListener("scroll",ae)});const He=l.reactive(we(I({},l.toRefs(e)),{vuetable:s,$el:l.computed(()=>{var n;return(n=r==null?void 0:r.proxy)==null?void 0:n.$el}),isApiMode:ne,tableFields:f,tableData:c,tablePagination:v,selectedTo:m,countVisibleFields:Te,dataIsAvailable:x,countTableData:ee,displayEmptyDataRow:qe,useDetailRow:P,hasRowIdentifier:F,lessThanMinRows:De,blankRows:je,scrollVisible:w,scrollBarWidth:C,sortOrder:u,css:$,$_css:$,isFieldSlot:Ve,onHeaderEvent:vt,setData:q,getFieldTitle:Be,orderBy:Ye,camelCase:Ne,clearSortOrder:Ze,toggleDetailRow:at,showDetailRow:ye,hideDetailRow:_e,isVisibleDetailRow:V,reload:Pe,fireEvent:ht,singleColumnSort:be,removeSortColumn:fe,setSortColumnDirection:ve,clearSelectedValues:Xe,showField:rt,hideField:lt,toggleField:ot,onCheckboxToggled:bt,onCheckboxToggledAll:gt,checkIfRowIdentifierExists:W,changePage:pt,resetData:mt,refresh:Ce,isFieldComponent:oe,makeTitle:z,getAllQueryParams:se,isSortable:K,getDefaultSortParam:ue,getObjectValue:R,isSelectedRow:me}));l.provide("vuetable",He);function Me(){const n=document.createElement("div"),o=document.createElement("div");n.style.visibility="hidden",n.style.width="100px",o.style.width="100%",n.appendChild(o),document.body.appendChild(n);const b=n.offsetWidth;n.style.overflow="scroll";const h=o.offsetWidth;return document.body.removeChild(n),b-h}function ae(n){var o,b,h;const Y=(o=n.currentTarget)==null?void 0:o.scrollLeft;if(Y!=y.value){const j=(h=(b=i.value)==null?void 0:b.parentElement)==null?void 0:h.querySelector(".vuetable-head-wrapper");j!=null&&(j.scrollLeft=Y),y.value=Y}}function B(n){e.silent||console.error(n)}function Kt(n,o){return[n,o.dataClass]}function re(){if(typeof e.fields=="undefined"){B('You need to provide "fields" prop.');return}f.value=[],e.fields.forEach((n,o)=>{f.value.push(Ae(n,o))})}function Ae(n,o){const b={name:"",titleClass:"",dataClass:"",sortField:null,formatter:null,visible:!0,width:null,$_index:o};if(typeof n=="string")return we(I({},b),{name:le(n),title:z(n)});const h=Object.assign({},b,n);return h.name=le(h.name),h.title===void 0&&(h.title=z(h.name)),h.formatter!==null&&typeof h.formatter!="function"&&(console.error(h.name+" field formatter must be a function"),h.formatter=null),h}function le(n){return n instanceof Object?l.markRaw(l.toRaw(n)):n.replace("__",e.fieldPrefix)}function q(n){if(!(n===null||typeof n=="undefined")){if(a("vuetable:loading"),Array.isArray(n)){c.value=n,a("vuetable:loaded");return}c.value=R(n,e.dataPath,null),v.value=R(n,e.paginationPath,null),l.nextTick(()=>{W(),U(),a("vuetable:pagination-data",v.value),a("vuetable:loaded")})}}function W(){if(x.value)return F.value?!0:(B('Invalid your data! Use "track-by" prop to specify.'),!1)}function z(n){return oe(n)?"":ie(n.replace("."," "))}function Be(n){return typeof n.title=="function"?n.title():n.title}function Yt(n,o){return ge(n)?Je(n,o):R(o,n.name,"")}function oe(n){return n instanceof Object?!0:n.slice(0,e.fieldPrefix.length)===e.fieldPrefix||n.slice(0,2)==="__"}function Ve(n){return typeof t[n]!="undefined"}function ie(n){return n.replace(/\w+/g,o=>o.charAt(0).toUpperCase()+o.substring(1).toLowerCase())}function Ne(n,o="_"){return n.split(o).map(b=>ie(b)).join("")}function O(n=We,o=ze){if(Ee.value){ut();return}return a("vuetable:loading"),g.value.params=Ge(se()),S.value=Le(e.apiUrl,g.value),S.value.then(n,o).catch(()=>o())}function Le(n,o){return qn(this,null,function*(){if(e.httpFetch)return e.httpFetch(n,o);if(e.httpMethod==="get")return Ct.get(n,o);{const b=yield g.value.params;return delete o.params,delete g.value.params,Ct.post(n,b,g.value)}})}function We(n){a("vuetable:load-success",n);const o=e.transform?e.transform(n.data):n.data;c.value=R(o,e.dataPath,null),v.value=R(o,e.paginationPath,null),v.value===null&&B(`vuetable: pagination-path ${e.paginationPath} not found.
|
|
1
|
+
"use strict";var yn=Object.defineProperty,_n=Object.defineProperties;var Pn=Object.getOwnPropertyDescriptors;var Rt=Object.getOwnPropertySymbols;var Cn=Object.prototype.hasOwnProperty,wn=Object.prototype.propertyIsEnumerable;var jt=(e,a,t)=>a in e?yn(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,j=(e,a)=>{for(var t in a||(a={}))Cn.call(a,t)&&jt(e,t,a[t]);if(Rt)for(var t of Rt(a))wn.call(a,t)&&jt(e,t,a[t]);return e},W=(e,a)=>_n(e,Pn(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue-demi"),Tt=require("axios"),Sn=require("mitt");function kn(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const Ee=kn(o),B=o.defineComponent({name:"vuetable-field-checkbox",props:{rowData:{type:Object,required:!1},rowIndex:{type:Number,required:!1},rowField:{type:Object,required:!1,default:null},isHeader:{type:Boolean,required:!1,default:!1},title:{type:String,required:!1}},setup(e){const a=o.inject("vuetable"),t=o.ref(null),r=o.computed(()=>(a.tableData||[]).filter(b=>a.isSelectedRow(b[a.trackBy])).length),i=o.computed(()=>{var b;return r.value>0&&r.value<(((b=a.tableData)==null?void 0:b.length)||0)});function s(b,m){var c;b&&a.onCheckboxToggled(m.target.checked,(c=e.rowField)==null?void 0:c.name,b)}function v(b){a.onCheckboxToggledAll(b.target.checked)}function g(b){return!!b&&a.isSelectedRow(b[a.trackBy])}function h(){return r.value>0}return{vuetable:a,checkbox:t,isIndeterminate:i,toggleCheckbox:s,toggleAllCheckbox:v,isSelected:g,isAllItemsInCurrentPageSelected:h}}});var $n=function(){var e=this,a=e.$createElement,t=e._self._c||a;return e.isHeader?t("th",{staticClass:"vuetable-th-component-checkbox"},[t("input",{ref:"checkbox",attrs:{type:"checkbox"},domProps:{indeterminate:e.isIndeterminate,checked:e.isAllItemsInCurrentPageSelected()},on:{change:function(r){return e.toggleAllCheckbox(r)}}})]):t("td",{staticClass:"vuetable-td-component-checkbox"},[t("input",{ref:"checkbox",attrs:{type:"checkbox"},domProps:{checked:e.isSelected(e.rowData)},on:{change:function(r){return e.toggleCheckbox(e.rowData,r)}}})])},Fn=[];B.render=$n;B.staticRenderFns=Fn;const N=o.defineComponent({name:"vuetable-field-handle",props:{isHeader:{type:Boolean,required:!1,default:!1},title:{type:String,required:!1,default:""}},setup(){const e=o.inject("vuetable");function a(t,r=""){return typeof e.css.renderIcon=="undefined"?`<i class="${t.join(" ")}" ${r}></i>`:e.css.renderIcon(t,r)}return{vuetable:e,renderIconTag:a}}});var On=function(){var e=this,a=e.$createElement,t=e._self._c||a;return e.isHeader?t("th",{staticClass:"vuetable-th-component-handle",domProps:{innerHTML:e._s(e.title)}}):t("td",{staticClass:"vuetable-td-component-handle",domProps:{innerHTML:e._s(e.renderIconTag(["handle-icon",e.vuetable.css.handleIcon]))}})},xn=[];N.render=On;N.staticRenderFns=xn;const L=o.defineComponent({name:"vuetable-field-sequence",props:{rowIndex:{type:Number,required:!1,default:0},isHeader:{type:Boolean,required:!1,default:!1},title:{type:String,required:!1,default:""}},setup(e){const a=o.inject("vuetable");function t(){return a.tablePagination?a.tablePagination.from+e.rowIndex:1+e.rowIndex}return{vuetable:a,renderSequence:t}}});var Rn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return e.isHeader?t("th",{staticClass:"vuetable-th-component-sequence",domProps:{innerHTML:e._s(e.title)}}):t("td",{staticClass:"vuetable-td-component-sequence",domProps:{innerHTML:e._s(e.renderSequence())}})},jn=[];L.render=Rn;L.staticRenderFns=jn;const H=o.defineComponent({name:"vuetable-th-gutter",setup(){return{vuetable:o.inject("vuetable")}}});var Tn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("th",{staticClass:"vuetable-th-gutter",style:{width:e.vuetable.scrollBarWidth}})},qn=[];H.render=Tn;H.staticRenderFns=qn;H._scopeId="data-v-05d64983";const K=o.defineComponent({name:"vuetable-row-header",components:{"vuetable-field-checkbox":B,"vuetable-field-handle":N,"vuetable-field-sequence":L,VuetableColGutter:H},props:{vuetable:{type:Object,default:null}},setup(){const e=o.inject("vuetable");function a(d){return d.replace(e.fieldPrefix,"")}function t(d,y){return[`${d}-${r(y.name)}`,y.titleClass||"",i(y),{sortable:e.isSortable(y)}]}function r(d){return typeof d=="string"&&d.replace(/([A-Z])/g,y=>"_"+y.toLowerCase()).replace(" ","_").replace(".","_")}function i(d){const y=h(d);return y!==!1?e.sortOrder[y].direction=="asc"?e.css.ascendingClass:e.css.descendingClass:""}function s(d){const y=h(d);return y===!1?e.css.sortableIcon:e.sortOrder[y].direction=="asc"?e.css.ascendingIcon:e.css.descendingIcon}function v(d){return h(d)!==!1}function g(d){return e.isSortable(d)&&e.css.sortableIcon!=""}function h(d){if(!e.isSortable(d))return!1;for(let y=0;y<e.sortOrder.length;y++)if(b(d,y))return y;return!1}function b(d,y){return e.sortOrder[y].field===d.name&&e.sortOrder[y].sortField===d.sortField}function m(d){const y=c(d);if(y.length>0&&v(d)||g(d)){const F=`opacity:${_(d)};position:relative;float:right`,O=e.showSortIcons?P(["sort-icon",s(d)],`style="${F}"`):"";return y+" "+O}return y}function c(d){return typeof d.title=="function"?d.title():typeof d.title=="undefined"?d.name.toString().replace("."," "):d.title}function _(d){let O=.3;const E=e.sortOrder.length,f=h(d);return 1-E*O<.3&&(O=(1-.3)/(E-1)),1-(f===!1?0:f)*O}function P(d,y=""){return typeof e.css.renderIcon=="undefined"?`<i class="${d.join(" ")}" ${y}></i>`:e.css.renderIcon(d,y)}function S(d,y){e.orderBy(d,y)}return{headerTable:e,stripPrefix:a,headerClass:t,toSnakeCase:r,sortClass:i,sortIcon:s,isInCurrentSortGroup:v,hasSortableIcon:g,currentSortOrderPosition:h,fieldIsInSortOrderPosition:b,renderTitle:m,getTitle:c,sortIconOpacity:_,renderIconTag:P,onColumnHeaderClicked:S,VuetableColGutter:H}}});var Dn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("tr",[e._l(e.headerTable.tableFields,function(r,i){return[r.visible?[e.headerTable.isFieldComponent(r.name)?[t(r.name,{key:i,tag:"component",class:e.headerClass("vuetable-th-component",r),style:{width:r.width},attrs:{"is-header":"",vuetable:e.headerTable,"row-field":r,title:e.renderTitle(r)},on:{"vuetable:header-event":e.headerTable.onHeaderEvent,click:function(s){return e.onColumnHeaderClicked(r,s)}}})]:e.headerTable.isFieldSlot(r.name)?[t("th",{key:i,class:e.headerClass("vuetable-th-slot",r),style:{width:r.width},domProps:{innerHTML:e._s(e.renderTitle(r))},on:{click:function(s){return e.onColumnHeaderClicked(r,s)}}})]:[t("th",{key:i,class:e.headerClass("vuetable-th",r),style:{width:r.width},attrs:{id:"_"+r.name},domProps:{innerHTML:e._s(e.renderTitle(r))},on:{click:function(s){return e.onColumnHeaderClicked(r,s)}}})]]:e._e()]}),e._v(" "),e.headerTable.scrollVisible?t("VuetableColGutter"):e._e()],2)},En=[];K.render=Dn;K.staticRenderFns=En;const te=o.defineComponent({name:"vuetable-col-group",props:{isHeader:{type:Boolean,required:!1,default:!1}},setup(){const e=o.inject("vuetable");function a(t,r){let i=typeof t.name=="object"&&t.name!==null?t.name.name||"component":t.name;return i=i.replace(e.fieldPrefix,""),[`vuetable-col-${i}`,t.titleClass,`${i}-${r}`]}return{vuetable:e,columnClass:a}}});var In=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("colgroup",[e._l(e.vuetable.tableFields,function(r,i){return[r.visible?[t("col",{key:i,class:e.columnClass(r,i),style:{width:r.width}})]:e._e()]}),e._v(" "),e.isHeader&&e.vuetable.scrollVisible?t("col",{staticClass:"vuetable-col-gutter",style:{width:e.vuetable.scrollBarWidth}}):e._e()],2)},Hn=[];te.render=In;te.staticRenderFns=Hn;const Ie=o.defineComponent({name:"VuetableDetailHost",props:{detailComponent:{type:[String,Object],default:""},rowData:{type:Object,required:!0},rowIndex:{type:Number,required:!0},options:{type:Object,default:()=>({})}},setup(e){const a=o.inject("vuetable"),t=o.computed(()=>a.vuetable),r=o.computed(()=>typeof e.detailComponent=="object"?o.markRaw(o.toRaw(e.detailComponent)):e.detailComponent);return{tableContext:a,vuetable:t,resolvedDetailComponent:r}}});var Vn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t(e.resolvedDetailComponent,{tag:"component",attrs:{"row-data":e.rowData,"row-index":e.rowIndex,vuetable:e.tableContext,options:e.options}})},An=[];Ie.render=Vn;Ie.staticRenderFns=An;const He=(e,{slots:a})=>{var t;return(t=a.default)==null?void 0:t.call(a)[0]};He.props=["revision"];He.inheritAttrs=!1;const Ve=(e,{slots:a})=>Ee.renderSlot({default:e.content},"default",e.scope,a.default);Ve.props=["content","scope"];Ve.inheritAttrs=!1;const Mn=Ee.isVue2?{functional:!0,render:(e,a)=>{var t,r,i;return(i=(r=(t=a.scopedSlots).default)==null?void 0:r.call(t)[0])!=null?i:a.children[0]}}:He,Bn=Ee.isVue2?{functional:!0,props:["content","scope"],render:(e,a)=>{var t,r,i,s,v;return(v=(r=(t=a.props).content)==null?void 0:r.call(t,a.props.scope))!=null?v:(s=(i=a.scopedSlots).default)==null?void 0:s.call(i)}}:Ve,D={table:{tableWrapper:"",tableHeaderClass:"fixed",tableBodyClass:"fixed",tableClass:"ui blue selectable unstackable celled table",loadingClass:"loading",ascendingIcon:"blue chevron up icon",descendingIcon:"blue chevron down icon",ascendingClass:"sorted-asc",descendingClass:"sorted-desc",sortableIcon:"grey sort icon",handleIcon:"grey sidebar icon"},pagination:{wrapperClass:"ui right floated pagination menu",activeClass:"active large",disabledClass:"disabled",pageClass:"item",linkClass:"icon item",paginationClass:"ui bottom attached segment grid",paginationInfoClass:"left floated left aligned six wide column",dropdownClass:"ui search dropdown",icons:{first:"angle double left icon",prev:"left chevron icon",next:"right chevron icon",last:"angle double right icon"}},paginationInfo:{infoClass:"left floated left aligned six wide column"}};var Nn=Object.defineProperty,Ln=Object.defineProperties,zn=Object.getOwnPropertyDescriptors,qt=Object.getOwnPropertySymbols,Un=Object.prototype.hasOwnProperty,Wn=Object.prototype.propertyIsEnumerable,Dt=(e,a,t)=>a in e?Nn(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,T=(e,a)=>{for(var t in a||(a={}))Un.call(a,t)&&Dt(e,t,a[t]);if(qt)for(var t of qt(a))Wn.call(a,t)&&Dt(e,t,a[t]);return e},Et=(e,a)=>Ln(e,zn(a)),Gn=(e,a,t)=>new Promise((r,i)=>{var s=h=>{try{g(t.next(h))}catch(b){i(b)}},v=h=>{try{g(t.throw(h))}catch(b){i(b)}},g=h=>h.done?r(h.value):Promise.resolve(h.value).then(s,v);g((t=t.apply(e,a)).next())});const M=o.defineComponent({name:"Vuetable",inheritAttrs:o.isVue2,components:{RenderBoundary:Mn,SlotOutlet:Bn,VuetableRowHeader:K,VuetableColGroup:te,VuetableDetailHost:Ie,"vuetable-field-checkbox":B,"vuetable-field-handle":N,"vuetable-field-sequence":L},props:{fields:{type:Array,required:!0},loadOnStart:{type:Boolean,required:!1,default:!0},apiUrl:{type:String,required:!1,default:""},httpMethod:{type:String,required:!1,default:"get"},reactiveApiUrl:{type:Boolean,required:!1,default:!0},apiMode:{type:Boolean,required:!1,default:!0},data:{type:null,required:!1,default:null},dataManager:{type:Function,required:!1,default:null},dataPath:{type:String,required:!1,default:"data"},paginationPath:{type:String,required:!1,default:"links.pagination"},queryParams:{type:[Object,Function],required:!1,default:()=>({sort:"sort",page:"page",perPage:"per_page"})},appendParams:{type:Object,required:!1,default:()=>({})},httpOptions:{type:Object,required:!1,default:()=>({})},httpFetch:{type:Function,required:!1,default:null},perPage:{type:Number,required:!1,default:10},initialPage:{type:Number,required:!1,default:1},firstPage:{type:Number,required:!1,default:1},sortOrder:{type:Array,required:!1,default:()=>o.ref([]).value},multiSort:{type:Boolean,required:!1,default:!1},tableHeight:{type:String,required:!1,default:null},multiSortKey:{type:String,required:!1,default:"alt"},rowClass:{type:[String,Function],required:!1,default:""},detailRowComponent:{type:[String,Object],required:!1,default:""},detailRowTransition:{type:String,required:!1,default:""},detailRowClass:{type:[String,Function],required:!1,default:"vuetable-detail-row"},detailRowOptions:{type:Object,required:!1,default:()=>({})},trackBy:{type:String,required:!1,default:"id"},css:{type:Object,required:!1,default:()=>({})},minRows:{type:Number,required:!1,default:0},silent:{type:Boolean,required:!1,default:!1},noDataTemplate:{type:String,required:!1,default:"No Data Available"},showSortIcons:{type:Boolean,required:!1,default:!0},headerRows:{type:Array,required:!1,default:()=>["VuetableRowHeader"]},transform:{type:Function,required:!1,default:null},sortParams:{type:Function,required:!1,default:null},fieldPrefix:{type:String,required:!1,default:"vuetable-field-"},eventPrefix:{type:String,required:!1,default:"vuetable:"}},computed:{$_css(){return this.tableCss}},setup(e,{emit:a,slots:t,attrs:r}){const i=o.getCurrentInstance(),s=o.ref(),v=o.ref(0);let g=T(T({},e),r),h=Object.keys(t).length>0;o.onBeforeUpdate(()=>{if(o.isVue2)return;const n=T(T({},e),r),l=Object.keys(n),u=l.length===Object.keys(g).length&&l.every(R=>n[R]===g[R]),p=Object.keys(t).length>0;(u||h||p)&&v.value++,h=p,g=n});const b=o.computed(()=>i==null?void 0:i.proxy),m=o.ref([]),c=o.ref(null),_=o.ref(null),P=o.ref(e.initialPage),S=o.ref([]),d=o.ref([]),y=o.ref(0),F=o.ref("17px"),O=o.ref(!1),E=_t(e.sortOrder),f=o.isVue2?o.ref(E):o.shallowRef(E),k=o.ref(e.httpOptions),oe=o.ref(),le=o.computed(()=>T(T({},D.table),e.css)),Y=o.computed(()=>{var n,l;return(n=c.value)!=null&&n.length?((l=c.value)==null?void 0:l.length)>0:!1}),Be=o.computed(()=>Y.value&&e.detailRowComponent!==""),ie=o.computed(()=>c.value&&typeof c.value[0][e.trackBy]!="undefined"),Ne=o.computed(()=>m.value.filter(n=>n.visible).length),se=o.computed(()=>{var n;return((n=c.value)==null?void 0:n.length)||0}),Le=o.computed(()=>se.value===0&&e.noDataTemplate.length>0),ue=o.computed(()=>{var n;return c.value===null||((n=c.value)==null?void 0:n.length)===0}),ze=o.computed(()=>ue.value?!0:c.value.length<e.minRows),Ue=o.computed(()=>ue.value?e.minRows:c.value.length>=e.minRows?0:e.minRows-c.value.length),ce=o.computed(()=>e.apiMode),We=o.computed(()=>!e.apiMode),Ge=o.computed(()=>e.tableHeight!=null);fe(),xe(),o.nextTick(()=>{C("initialized",m.value)}),o.onMounted(()=>{if(e.loadOnStart&&x(),Ge.value){F.value=Ye()+"px";const n=s.value;n!=null&&n.addEventListener("scroll",de)}}),o.onBeforeUnmount(()=>{const n=s.value;n!=null&&n.removeEventListener("scroll",de)});const Ke=o.reactive(Et(T({},o.toRefs(e)),{vuetable:b,$el:o.computed(()=>{var n;return(n=i==null?void 0:i.proxy)==null?void 0:n.$el}),isApiMode:ce,tableFields:m,tableData:c,tablePagination:_,selectedTo:S,countVisibleFields:Ne,dataIsAvailable:Y,countTableData:se,displayEmptyDataRow:Le,useDetailRow:Be,hasRowIdentifier:ie,lessThanMinRows:ze,blankRows:Ue,scrollVisible:O,scrollBarWidth:F,sortOrder:f,css:le,$_css:le,isFieldSlot:Je,onHeaderEvent:kt,setData:I,getFieldTitle:Qe,orderBy:it,camelCase:et,clearSortOrder:ut,toggleDetailRow:pt,showDetailRow:Fe,hideDetailRow:Oe,isVisibleDetailRow:U,reload:Re,fireEvent:C,singleColumnSort:Ce,removeSortColumn:_e,setSortColumnDirection:Pe,clearSelectedValues:dt,showField:gt,hideField:ht,toggleField:mt,onCheckboxToggled:$t,onCheckboxToggledAll:Ft,checkIfRowIdentifierExists:Z,changePage:Ot,resetData:xt,refresh:je,isFieldComponent:be,makeTitle:Q,getAllQueryParams:ge,isSortable:ee,getDefaultSortParam:he,getObjectValue:q,isSelectedRow:$e}));o.provide("vuetable",Ke);function Ye(){const n=document.createElement("div"),l=document.createElement("div");n.style.visibility="hidden",n.style.width="100px",l.style.width="100%",n.appendChild(l),document.body.appendChild(n);const u=n.offsetWidth;n.style.overflow="scroll";const p=l.offsetWidth;return document.body.removeChild(n),u-p}function de(n){var l,u,p;const R=(l=n.currentTarget)==null?void 0:l.scrollLeft;if(R!=y.value){const A=(p=(u=s.value)==null?void 0:u.parentElement)==null?void 0:p.querySelector(".vuetable-head-wrapper");A!=null&&(A.scrollLeft=R),y.value=R}}function z(n){e.silent||console.error(n)}function on(n,l){return[n,l.dataClass]}function fe(){if(typeof e.fields=="undefined"){z('You need to provide "fields" prop.');return}m.value=[],e.fields.forEach((n,l)=>{m.value.push(Ze(n,l))})}function Ze(n,l){const u={name:"",titleClass:"",dataClass:"",sortField:null,formatter:null,visible:!0,width:null,$_index:l};if(typeof n=="string")return Et(T({},u),{name:ve(n),title:Q(n)});const p=Object.assign({},u,n);return p.name=ve(p.name),p.title===void 0&&(p.title=Q(p.name)),p.formatter!==null&&typeof p.formatter!="function"&&(console.error(p.name+" field formatter must be a function"),p.formatter=null),p}function ve(n){return n instanceof Object?o.markRaw(o.toRaw(n)):n.replace("__",e.fieldPrefix)}function I(n){if(!(n===null||typeof n=="undefined")){if(C("loading"),Array.isArray(n)){c.value=n,C("loaded");return}c.value=q(n,e.dataPath,null),_.value=q(n,e.paginationPath,null),o.nextTick(()=>{Z(),J(),C("pagination-data",_.value),C("loaded")})}}function Z(){if(Y.value)return ie.value?!0:(z('Invalid your data! Use "track-by" prop to specify.'),!1)}function Q(n){return be(n)?"":pe(n.replace("."," "))}function Qe(n){return typeof n.title=="function"?n.title():n.title}function ln(n,l){return we(n)?ct(n,l):q(l,n.name,"")}function be(n){return n instanceof Object?!0:n.slice(0,e.fieldPrefix.length)===e.fieldPrefix||n.slice(0,2)==="__"}function Je(n){return typeof Xe(n)!="undefined"}function Xe(n){var l,u;return o.isVue2?(u=(l=i==null?void 0:i.proxy)==null?void 0:l.$scopedSlots)==null?void 0:u[n]:t[n]}function pe(n){return n.replace(/\w+/g,l=>l.charAt(0).toUpperCase()+l.substring(1).toLowerCase())}function et(n,l="_"){return n.split(l).map(u=>pe(u)).join("")}function x(n=nt,l=at){if(We.value){Pt();return}return C("loading"),k.value.params=ot(ge()),oe.value=tt(e.apiUrl,k.value),oe.value.then(n,l).catch(()=>l())}function tt(n,l){return Gn(this,null,function*(){if(e.httpFetch)return e.httpFetch(n,l);if(e.httpMethod==="get")return Tt.get(n,l);{const u=yield k.value.params;return delete l.params,delete k.value.params,Tt.post(n,u,k.value)}})}function nt(n){C("load-success",n);const l=e.transform?e.transform(n.data):n.data;c.value=q(l,e.dataPath,null),_.value=q(l,e.paginationPath,null),_.value===null&&z(`vuetable: pagination-path ${e.paginationPath} not found.
|
|
2
2
|
It looks like the data returned from the server does not have pagination information
|
|
3
3
|
or you may have set it incorrectly.
|
|
4
4
|
|
|
5
|
-
You can explicitly suppress this warning by setting pagination-path="".`),l.nextTick(()=>{W(),U(),a("vuetable:pagination-data",v.value),a("vuetable:loaded")})}function U(){setTimeout(G,80)}function G(){l.nextTick(()=>{const n=i.value;n!=null&&(w.value=n.scrollHeight>n.clientHeight,a("vuetable:scrollbar-visible",w.value))})}function ze(n){console.error("load-error",n),a("vuetable:load-error",n),a("vuetable:loaded")}function se(){let n={};return typeof e.queryParams=="function"?(n=e.queryParams(u.value,d.value,e.perPage),typeof n=="object"?n:{}):(n[e.queryParams.sort]=Ue(),n[e.queryParams.page]=d.value,n[e.queryParams.perPage]=e.perPage,n)}function Ue(){var n;return!u.value||((n=u.value[0])==null?void 0:n.field)==""?"":typeof e.sortParams=="function"?e.sortParams(u.value):ue()}function ue(){return u.value.map(n=>`${n.sortField}|${n.direction}`).join(",")}function Ge(n){for(let o in e.appendParams)n[o]=e.appendParams[o];return n}function K(n){return n.sortField!==null}function Ke(n){if(!K(n))return!1;for(let o=0;o<u.value.length;o++)if(ce(n,o))return o;return!1}function ce(n,o){return u.value[o].field===n.name&&u.value[o].sortField===n.sortField}function Ye(n,o){if(!K(n))return;const b=e.multiSortKey.toLowerCase()+"Key";e.multiSort&&o[b]?Qe(n):be(n),d.value=e.firstPage,(ne.value||e.dataManager)&&O()}function de(n,o){u.value.push({field:n.name,sortField:n.sortField,direction:o||"asc"})}function fe(n){u.value.splice(n,1)}function ve(n,o){u.value[n].direction=o}function Qe(n){let o=Ke(n);o===!1?de(n,"asc"):u.value[o].direction==="asc"?ve(o,"desc"):fe(o)}function be(n){if(u.value.length===0){de(n,"asc");return}u.value.splice(1),ce(n,0)?u.value[0].direction=u.value[0].direction==="asc"?"desc":"asc":u.value[0].direction="asc",u.value[0].field=n.name,u.value[0].sortField=n.sortField}function Ze(){u.value=[]}function ge(n){return typeof n.formatter=="function"}function Je(n,o){if(ge(n)&&typeof n.formatter=="function")return n.formatter(R(o,n.name),r==null?void 0:r.proxy)}function R(n,o,b){b=typeof b=="undefined"?null:b;let h=n;return o.trim()!=""&&o.split(".").forEach(j=>{if(h!==null&&typeof h[j]!="undefined"&&h[j]!==null)h=h[j];else{h=b;return}}),h}function pe(n){me(n)||m.value.push(n)}function he(n){m.value=m.value.filter(o=>o!==n)}function me(n){return m.value.indexOf(n)>=0}function Xe(){m.value=[]}function et(){d.value>e.firstPage&&(d.value-=1,O())}function tt(){d.value<v.value.last_page&&(d.value+=1,O())}function nt(n){n!=d.value&&n>=e.firstPage&&n<=v.value.last_page&&(d.value=n,O())}function V(n){return p.value.indexOf(n)>=0}function ye(n){V(n)||p.value.push(n),G()}function _e(n){V(n)&&(p.value.splice(p.value.indexOf(n),1),U())}function at(n){V(n)?_e(n):ye(n)}function rt(n){n<0||n>f.value.length||(f.value[n].visible=!0)}function lt(n){n<0||n>f.value.length||(f.value[n].visible=!1)}function ot(n){n<0||n>f.value.length||(f.value[n].visible=!f.value[n].visible)}function it(n=null,o=null,b=null){return n=n===null?0:n,o=o===null?e.perPage:o,b=b===null?d.value:b,{total:n,per_page:e.perPage,current_page:d.value,last_page:Math.ceil(n/e.perPage)||0,next_page_url:"",prev_page_url:"",from:(b-1)*o+1,to:Math.min(b*o,n)}}function st(){u.value.forEach(n=>{n.sortField=n.sortField||n.field})}function ut(){if(e.data!==null&&Array.isArray(e.data)){q(e.data);return}e.dataManager?ct():q(e.data)}function ct(){const n=e.dataManager(u.value,it());ft(n)?n.then(o=>q(o)):q(n)}function dt(n){return typeof n=="object"&&n!==null}function ft(n){return dt(n)&&typeof n.then=="function"}function Qt(n,o){return typeof e.rowClass=="function"?e.rowClass(n,o):e.rowClass}function Zt(n,o){return typeof e.detailRowClass=="function"?e.detailRowClass(n,o):e.detailRowClass}function Jt(n,o,b){return a("vuetable:row-clicked",{data:n,index:o,event:b}),!0}function Xt(n,o,b){a("vuetable:row-dblclicked",{data:n,index:o,event:b})}function en(n,o,b){a("vuetable:detail-row-clicked",{data:n,index:o,event:b})}function tn(n,o,b,h){a("vuetable:cell-clicked",{data:n,index:o,field:b,event:h})}function nn(n,o,b,h){a("vuetable:cell-dblclicked",{data:n,index:o,field:b,event:h})}function an(n,o,b,h){a("vuetable:cell-rightclicked",{data:n,index:o,field:b,event:h})}function rn(n,o,b){a("vuetable:row-mouseover",{data:n,index:o,event:b})}function ln(n,o){a("vuetable:field-event",n,o,r==null?void 0:r.proxy)}function vt(n,o){a("vuetable:header-event",n,o,r==null?void 0:r.proxy)}function bt(n,o,b){if(b[e.trackBy]===void 0){B(`checkbox field: The "${e.trackBy}" field does not exist! Make sure the field you specify in "track-by" prop does exist.`);return}const h=b[e.trackBy];n?pe(h):he(h),a("vuetable:checkbox-toggled",n,o)}function gt(n){var o,b;n?(o=c.value)==null||o.forEach(h=>{pe(h[e.trackBy])}):(b=c.value)==null||b.forEach(h=>{he(h[e.trackBy])}),a("vuetable:checkbox-toggled-all",n)}function pt(n){n==="prev"?et():n==="next"?tt():nt(n)}function Pe(){return O()}function ht(n,...o){return a(`vuetable:${n}`,...o)}function Ce(){return d.value=e.firstPage,O()}function mt(){c.value=null,v.value=null,a("vuetable:data-reset")}return l.watch(()=>e.multiSort,n=>{!n&&u.value.length>1&&(u.value.splice(1),O())}),l.watch(()=>e.apiUrl,(n,o)=>e.reactiveApiUrl&&n!==o&&Ce()),l.watch(()=>e.data,q,{immediate:!0}),l.watch(()=>e.tableHeight,G),l.watch(()=>e.fields,re,{immediate:!0}),l.watch(()=>e.perPage,Pe),l.watch(()=>e.sortOrder,n=>{u.value=n.map(o=>we(I({},o),{sortField:o.sortField||o.field}))},{immediate:!0}),l.watch(()=>e.httpOptions,n=>{g.value=n},{immediate:!0}),{tableContext:He,fireEvent:ht,bodyWrapper:i,vuetable:s,tableFields:f,tableData:c,tablePagination:v,currentPage:d,selectedTo:m,visibleDetailRows:p,lastScrollPosition:y,scrollBarWidth:C,scrollVisible:w,order:u,optionsHttp:g,instanceFetch:S,tableCss:$,dataIsAvailable:x,useDetailRow:P,hasRowIdentifier:F,countVisibleFields:Te,countTableData:ee,displayEmptyDataRow:qe,emptyDataTable:te,lessThanMinRows:De,blankRows:je,isApiMode:ne,isDataMode:Ee,isFixedHeader:Ie,getScrollBarWidth:Me,handleScroll:ae,warn:B,bodyClass:Kt,normalizeFields:re,newField:Ae,normalizeFieldName:le,setData:q,checkIfRowIdentifierExists:W,makeTitle:z,getFieldTitle:Be,renderNormalField:Yt,isFieldComponent:oe,isFieldSlot:Ve,titleCase:ie,camelCase:Ne,loadData:O,fetch:Le,loadSuccess:We,updateHeader:U,checkScrollbarVisibility:G,loadFailed:ze,getAllQueryParams:se,getSortParam:Ue,getDefaultSortParam:ue,getAppendParams:Ge,isSortable:K,currentSortOrderPosition:Ke,fieldIsInSortOrderPosition:ce,orderBy:Ye,addSortColumn:de,removeSortColumn:fe,setSortColumnDirection:ve,multiColumnSort:Qe,singleColumnSort:be,clearSortOrder:Ze,hasFormatter:ge,callFormatter:Je,getObjectValue:R,selectId:pe,unselectId:he,isSelectedRow:me,clearSelectedValues:Xe,gotoPreviousPage:et,gotoNextPage:tt,gotoPage:nt,isVisibleDetailRow:V,showDetailRow:ye,hideDetailRow:_e,toggleDetailRow:at,showField:rt,hideField:lt,toggleField:ot,makePagination:it,normalizeSortOrder:st,handleDataMode:ut,callDataManager:ct,isObject:dt,isPromiseObject:ft,onRowClass:Qt,onDetailRowClass:Zt,onRowClicked:Jt,onRowDoubleClicked:Xt,onDetailRowClick:en,onCellClicked:tn,onCellDoubleClicked:nn,onCellRightClicked:an,onMouseOver:rn,onFieldEvent:ln,onHeaderEvent:vt,onCheckboxToggled:bt,onCheckboxToggledAll:gt,changePage:pt,reload:Pe,refresh:Ce,resetData:mt,VuetableColGroup:Q}}});var Dn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{class:e.tableCss.tableWrapper},[e.isFixedHeader?t("div",{staticClass:"vuetable-head-wrapper"},[t("table",{class:["vuetable",e.tableCss.tableClass,e.tableCss.tableHeaderClass]},[t("vuetable-col-group",{attrs:{"is-header":""}}),e._v(" "),t("thead",[e._t("tableHeader",function(){return e._l(e.headerRows,function(r,i){return t(r,{key:i,tag:"component",attrs:{index:i,vuetable:e.tableContext},on:{"vuetable:header-event":e.onHeaderEvent}})})},{fields:e.tableFields})],2)],1)]):e._e(),e._v(" "),t("div",{ref:"bodyWrapper",staticClass:"vuetable-body-wrapper",class:{"fixed-header":e.isFixedHeader},style:{height:e.tableHeight}},[t("table",{class:["vuetable",e.isFixedHeader?"fixed-header":"",e.tableCss.tableClass,e.tableCss.tableBodyClass]},[t("vuetable-col-group"),e._v(" "),e.isFixedHeader?e._e():t("thead",[e._t("tableHeader",function(){return e._l(e.headerRows,function(r,i){return t(r,{key:i,tag:"component",attrs:{index:i,vuetable:e.tableContext},on:{"vuetable:header-event":e.onHeaderEvent}})})},{fields:e.tableFields})],2),e._v(" "),t("tfoot",[e._t("tableFooter",null,{fields:e.tableFields})],2),e._v(" "),t("tbody",{staticClass:"vuetable-body"},[e._l(e.tableData,function(r,i){return[t("tr",{key:i+":0",class:e.onRowClass(r,i),attrs:{"item-index":i},on:{click:function(s){return e.onRowClicked(r,i,s)},dblclick:function(s){return e.onRowDoubleClicked(r,i,s)},mouseover:function(s){return e.onMouseOver(r,i,s)}}},[e._l(e.tableFields,function(s,f){return[s.visible?[e.isFieldComponent(s.name)?[t(s.name,{key:f,tag:"component",class:e.bodyClass("vuetable-component",s),style:{width:s.width||void 0},attrs:{"row-data":r,"row-index":i,"row-field":s,vuetable:e.tableContext},on:{"vuetable:field-event":e.onFieldEvent}})]:e.isFieldSlot(s.name)?[t("td",{key:f,class:e.bodyClass("vuetable-slot",s),style:{width:s.width||void 0}},[e._t(s.name,null,{rowData:r,rowIndex:i,rowField:s})],2)]:[t("td",{key:f,class:e.bodyClass("vuetable-td-"+s.name,s),style:{width:s.width||void 0},domProps:{innerHTML:e._s(e.renderNormalField(s,r))},on:{click:function(c){return e.onCellClicked(r,i,s,c)},dblclick:function(c){return e.onCellDoubleClicked(r,i,s,c)},contextmenu:function(c){return e.onCellRightClicked(r,i,s,c)}}})]]:e._e()]})],2),e._v(" "),e.useDetailRow?[t("transition",{key:i+":1.0:"+i,attrs:{name:e.detailRowTransition}},[e.isVisibleDetailRow(r[e.trackBy])?t("tr",{class:e.onDetailRowClass(r,i),on:{click:function(s){return e.onDetailRowClick(r,i,s)}}},[t("td",{attrs:{colspan:e.countVisibleFields}},[t("vuetable-detail-host",{attrs:{"detail-component":e.detailRowComponent,"row-data":r,"row-index":i,options:e.detailRowOptions}})],1)]):e._e()])]:e._e()]}),e._v(" "),e.displayEmptyDataRow?[t("tr",[t("td",{staticClass:"vuetable-empty-result",attrs:{colspan:e.countVisibleFields},domProps:{innerHTML:e._s(e.noDataTemplate)}})])]:e._e(),e._v(" "),e.lessThanMinRows?e._l(e.blankRows,function(r){return t("tr",{key:r,staticClass:"blank-row"},[e._l(e.tableFields,function(i,s){return[i.visible?t("td",{key:s},[e._v(`
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
You can explicitly suppress this warning by setting pagination-path="".`),o.nextTick(()=>{Z(),J(),C("pagination-data",_.value),C("loaded")})}function J(){setTimeout(X,80)}function X(){o.nextTick(()=>{const n=s.value;n!=null&&(O.value=n.scrollHeight>n.clientHeight,C("scrollbar-visible",O.value))})}function at(n){console.error("load-error",n),C("load-error",n),C("loaded")}function ge(){let n={};return typeof e.queryParams=="function"?(n=e.queryParams(f.value,P.value,e.perPage),typeof n=="object"?n:{}):(n[e.queryParams.sort]=rt(),n[e.queryParams.page]=P.value,n[e.queryParams.perPage]=e.perPage,n)}function rt(){var n;return!f.value||((n=f.value[0])==null?void 0:n.field)==""?"":typeof e.sortParams=="function"?e.sortParams(f.value):he()}function he(){return f.value.map(n=>`${n.sortField}|${n.direction}`).join(",")}function ot(n){for(let l in e.appendParams)n[l]=e.appendParams[l];return n}function ee(n){return n.sortField!==null}function lt(n){if(!ee(n))return!1;for(let l=0;l<f.value.length;l++)if(me(n,l))return l;return!1}function me(n,l){return f.value[l].field===n.name&&f.value[l].sortField===n.sortField}function it(n,l){if(!ee(n))return;const u=e.multiSortKey.toLowerCase()+"Key";e.multiSort&&l[u]?st(n):Ce(n),P.value=e.firstPage,(ce.value||e.dataManager)&&x()}function V(){o.isVue2||o.triggerRef(f)}function ye(n,l){f.value.push({field:n.name,sortField:n.sortField,direction:l||"asc"}),V()}function _e(n){f.value.splice(n,1),V()}function Pe(n,l){f.value[n].direction=l,V()}function st(n){let l=lt(n);l===!1?ye(n,"asc"):f.value[l].direction==="asc"?Pe(l,"desc"):_e(l)}function Ce(n){if(f.value.length===0){ye(n,"asc");return}f.value.splice(1),me(n,0)?f.value[0].direction=f.value[0].direction==="asc"?"desc":"asc":f.value[0].direction="asc",f.value[0].field=n.name,f.value[0].sortField=n.sortField,V()}function ut(){f.value=o.ref([]).value}function we(n){return typeof n.formatter=="function"}function ct(n,l){if(we(n)&&typeof n.formatter=="function")return n.formatter(q(l,n.name),i==null?void 0:i.proxy)}function q(n,l,u){u=typeof u=="undefined"?null:u;let p=n;return l.trim()!=""&&l.split(".").forEach(A=>{if(p!==null&&typeof p[A]!="undefined"&&p[A]!==null)p=p[A];else{p=u;return}}),p}function Se(n){$e(n)||S.value.push(n)}function ke(n){S.value=S.value.filter(l=>l!==n)}function $e(n){return S.value.indexOf(n)>=0}function dt(){S.value=[]}function ft(){P.value>e.firstPage&&(P.value-=1,x())}function vt(){P.value<_.value.last_page&&(P.value+=1,x())}function bt(n){n!=P.value&&n>=e.firstPage&&n<=_.value.last_page&&(P.value=n,x())}function U(n){return d.value.indexOf(n)>=0}function Fe(n){U(n)||d.value.push(n),X()}function Oe(n){U(n)&&(d.value.splice(d.value.indexOf(n),1),J())}function pt(n){U(n)?Oe(n):Fe(n)}function gt(n){n<0||n>m.value.length||(m.value[n].visible=!0)}function ht(n){n<0||n>m.value.length||(m.value[n].visible=!1)}function mt(n){n<0||n>m.value.length||(m.value[n].visible=!m.value[n].visible)}function yt(n=null,l=null,u=null){return n=n===null?0:n,l=l===null?e.perPage:l,u=u===null?P.value:u,{total:n,per_page:l,current_page:u,last_page:Math.ceil(n/l)||0,next_page_url:"",prev_page_url:"",from:(u-1)*l+1,to:Math.min(u*l,n)}}function _t(n){const l=u=>o.isReadonly(u)||Object.isFrozen(o.toRaw(u));return l(n)||n.some(l)?o.ref(n.map(u=>T({},u))).value:n}function xe(){let n=!1;f.value.forEach(l=>{const u=l.sortField||l.field;l.sortField!==u&&(o.set(l,"sortField",u),n=!0)}),n&&V()}function Pt(){if(e.data!==null&&Array.isArray(e.data)){I(e.data);return}e.dataManager?Ct():I(e.data)}function Ct(){const n=e.dataManager(f.value,yt());St(n)?n.then(l=>I(l)):I(n)}function wt(n){return typeof n=="object"&&n!==null}function St(n){return wt(n)&&typeof n.then=="function"}function sn(n,l){return typeof e.rowClass=="function"?e.rowClass(n,l):e.rowClass}function un(n,l){return typeof e.detailRowClass=="function"?e.detailRowClass(n,l):e.detailRowClass}function cn(n,l,u){return C("row-clicked",{data:n,index:l,event:u}),!0}function dn(n,l,u){C("row-dblclicked",{data:n,index:l,event:u})}function fn(n,l,u){C("detail-row-clicked",{data:n,index:l,event:u})}function vn(n,l,u,p){C("cell-clicked",{data:n,index:l,field:u,event:p})}function bn(n,l,u,p){C("cell-dblclicked",{data:n,index:l,field:u,event:p})}function pn(n,l,u,p){C("cell-rightclicked",{data:n,index:l,field:u,event:p})}function gn(n,l,u){C("row-mouseover",{data:n,index:l,event:u})}function hn(n,l){C("field-event",n,l,i==null?void 0:i.proxy)}function kt(n,l){C("header-event",n,l,i==null?void 0:i.proxy)}function $t(n,l,u){if(u[e.trackBy]===void 0){z(`checkbox field: The "${e.trackBy}" field does not exist! Make sure the field you specify in "track-by" prop does exist.`);return}const p=u[e.trackBy];n?Se(p):ke(p),C("checkbox-toggled",n,l)}function Ft(n){var l,u;n?(l=c.value)==null||l.forEach(p=>{Se(p[e.trackBy])}):(u=c.value)==null||u.forEach(p=>{ke(p[e.trackBy])}),C("checkbox-toggled-all",n)}function Ot(n){n==="prev"?ft():n==="next"?vt():bt(n)}function Re(){return x()}function C(n,...l){return a(`${e.eventPrefix}${n}`,...l)}function mn(){if(o.isVue2)return{};const n=[e.eventPrefix,`${e.eventPrefix}x`.replace(/-(\w)/g,(u,p)=>p.toUpperCase()).slice(0,-1)].map(u=>`on${u.charAt(0).toUpperCase()}${u.slice(1)}`),l={};for(const u in r)if(Object.prototype.hasOwnProperty.call(r,u)){if(/^on[^a-z]/.test(u)){const p=u.replace(/(?:Once|Passive|Capture)+$/,"");if(!u.startsWith("on:")&&!/^on[A-Z][a-z0-9]*$/.test(p)&&(e.eventPrefix===""||n.some(R=>p.startsWith(R))))continue}l[u]=r[u]}return l}function je(){return P.value=e.firstPage,x()}function xt(){c.value=null,_.value=null,C("data-reset")}return o.watch(()=>e.multiSort,n=>{!n&&f.value.length>1&&(f.value.splice(1),V(),x())}),o.watch(()=>e.apiUrl,(n,l)=>e.reactiveApiUrl&&n!==l&&je()),o.watch(()=>e.data,I,{immediate:!0}),o.watch(()=>e.tableHeight,X),o.watch(()=>e.fields,fe,{immediate:!0}),o.watch(()=>e.perPage,Re),o.watch(()=>e.sortOrder,(n,l)=>{(n!==l||f.value===n)&&(f.value=_t(n)),xe()},{flush:"sync"}),o.watch(()=>e.httpOptions,n=>{k.value=n},{immediate:!0}),{bodyRevision:v,getSlot:Xe,getRootAttrs:mn,tableContext:Ke,fireEvent:C,bodyWrapper:s,vuetable:b,tableFields:m,tableData:c,tablePagination:_,currentPage:P,selectedTo:S,visibleDetailRows:d,lastScrollPosition:y,scrollBarWidth:F,scrollVisible:O,order:f,optionsHttp:k,instanceFetch:oe,tableCss:le,dataIsAvailable:Y,useDetailRow:Be,hasRowIdentifier:ie,countVisibleFields:Ne,countTableData:se,displayEmptyDataRow:Le,emptyDataTable:ue,lessThanMinRows:ze,blankRows:Ue,isApiMode:ce,isDataMode:We,isFixedHeader:Ge,getScrollBarWidth:Ye,handleScroll:de,warn:z,bodyClass:on,normalizeFields:fe,newField:Ze,normalizeFieldName:ve,setData:I,checkIfRowIdentifierExists:Z,makeTitle:Q,getFieldTitle:Qe,renderNormalField:ln,isFieldComponent:be,isFieldSlot:Je,titleCase:pe,camelCase:et,loadData:x,fetch:tt,loadSuccess:nt,updateHeader:J,checkScrollbarVisibility:X,loadFailed:at,getAllQueryParams:ge,getSortParam:rt,getDefaultSortParam:he,getAppendParams:ot,isSortable:ee,currentSortOrderPosition:lt,fieldIsInSortOrderPosition:me,orderBy:it,addSortColumn:ye,removeSortColumn:_e,setSortColumnDirection:Pe,multiColumnSort:st,singleColumnSort:Ce,clearSortOrder:ut,hasFormatter:we,callFormatter:ct,getObjectValue:q,selectId:Se,unselectId:ke,isSelectedRow:$e,clearSelectedValues:dt,gotoPreviousPage:ft,gotoNextPage:vt,gotoPage:bt,isVisibleDetailRow:U,showDetailRow:Fe,hideDetailRow:Oe,toggleDetailRow:pt,showField:gt,hideField:ht,toggleField:mt,makePagination:yt,normalizeSortOrder:xe,handleDataMode:Pt,callDataManager:Ct,isObject:wt,isPromiseObject:St,onRowClass:sn,onDetailRowClass:un,onRowClicked:cn,onRowDoubleClicked:dn,onDetailRowClick:fn,onCellClicked:vn,onCellDoubleClicked:bn,onCellRightClicked:pn,onMouseOver:gn,onFieldEvent:hn,onHeaderEvent:kt,onCheckboxToggled:$t,onCheckboxToggledAll:Ft,changePage:Ot,reload:Re,refresh:je,resetData:xt,VuetableColGroup:te}}});var Kn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",e._b({class:e.tableCss.tableWrapper},"div",e.getRootAttrs(),!1),[e.isFixedHeader?t("div",{staticClass:"vuetable-head-wrapper"},[t("table",{class:["vuetable",e.tableCss.tableClass,e.tableCss.tableHeaderClass]},[t("vuetable-col-group",{attrs:{"is-header":""}}),e._v(" "),t("thead",[e._t("tableHeader",function(){return e._l(e.headerRows,function(r,i){return t(r,{key:i,tag:"component",attrs:{index:i,vuetable:e.tableContext},on:{"vuetable:header-event":e.onHeaderEvent}})})},{fields:e.tableFields})],2)],1)]):e._e(),e._v(" "),t("render-boundary",{attrs:{revision:e.bodyRevision}},[t("div",{ref:"bodyWrapper",staticClass:"vuetable-body-wrapper",class:{"fixed-header":e.isFixedHeader},style:{height:e.tableHeight}},[t("table",{class:["vuetable",e.isFixedHeader?"fixed-header":"",e.tableCss.tableClass,e.tableCss.tableBodyClass]},[t("vuetable-col-group"),e._v(" "),e.isFixedHeader?e._e():t("thead",[t("slot-outlet",{attrs:{content:e.getSlot("tableHeader"),scope:{fields:e.tableFields}}},e._l(e.headerRows,function(r,i){return t(r,{key:i,tag:"component",attrs:{index:i,vuetable:e.tableContext},on:{"vuetable:header-event":e.onHeaderEvent}})}),1)],1),e._v(" "),t("tfoot",[t("slot-outlet",{attrs:{content:e.getSlot("tableFooter"),scope:{fields:e.tableFields}}})],1),e._v(" "),t("tbody",{staticClass:"vuetable-body"},[e._l(e.tableData,function(r,i){return[t("tr",{key:i+":0",class:e.onRowClass(r,i),attrs:{"item-index":i},on:{click:function(s){return e.onRowClicked(r,i,s)},dblclick:function(s){return e.onRowDoubleClicked(r,i,s)},mouseover:function(s){return e.onMouseOver(r,i,s)}}},[e._l(e.tableFields,function(s,v){return[s.visible?[e.isFieldComponent(s.name)?[t(s.name,{key:v,tag:"component",class:e.bodyClass("vuetable-component",s),style:{width:s.width||void 0},attrs:{"row-data":r,"row-index":i,"row-field":s,vuetable:e.tableContext},on:{"vuetable:field-event":e.onFieldEvent}})]:e.isFieldSlot(s.name)?[t("td",{key:v,class:e.bodyClass("vuetable-slot",s),style:{width:s.width||void 0}},[t("slot-outlet",{attrs:{content:e.getSlot(s.name),scope:{rowData:r,rowIndex:i,rowField:s}}})],1)]:[t("td",{key:v,class:e.bodyClass("vuetable-td-"+s.name,s),style:{width:s.width||void 0},domProps:{innerHTML:e._s(e.renderNormalField(s,r))},on:{click:function(g){return e.onCellClicked(r,i,s,g)},dblclick:function(g){return e.onCellDoubleClicked(r,i,s,g)},contextmenu:function(g){return e.onCellRightClicked(r,i,s,g)}}})]]:e._e()]})],2),e._v(" "),e.useDetailRow?[t("transition",{key:i+":1.0:"+i,attrs:{name:e.detailRowTransition}},[e.isVisibleDetailRow(r[e.trackBy])?t("tr",{class:e.onDetailRowClass(r,i),on:{click:function(s){return e.onDetailRowClick(r,i,s)}}},[t("td",{attrs:{colspan:e.countVisibleFields}},[t("vuetable-detail-host",{attrs:{"detail-component":e.detailRowComponent,"row-data":r,"row-index":i,options:e.detailRowOptions}})],1)]):e._e()])]:e._e()]}),e._v(" "),e.displayEmptyDataRow?[t("tr",[t("td",{staticClass:"vuetable-empty-result",attrs:{colspan:e.countVisibleFields},domProps:{innerHTML:e._s(e.noDataTemplate)}})])]:e._e(),e._v(" "),e.lessThanMinRows?e._l(e.blankRows,function(r){return t("tr",{key:r,staticClass:"blank-row"},[e._l(e.tableFields,function(i,s){return[i.visible?t("td",{key:s},[e._v(`
|
|
6
|
+
|
|
7
|
+
`)]):e._e()]})],2)}):e._e()],2)],1)])])],1)},Yn=[];M.render=Kn;M.staticRenderFns=Yn;function $(e){return typeof e=="function"?e():o.unref(e)}function Ae(e,a){const t=e===void 0||o.isRef(e)||typeof e=="function"||typeof e=="number"?{onEachSide:e,firstPage:a}:e,r=()=>$(t.onEachSide===void 0?2:t.onEachSide),i=()=>$(t.firstPage===void 0?1:t.firstPage),s=o.ref(null),v=o.ref({}),g=o.ref("vuetable-pagination:"),h=o.computed(()=>{var f,k;return(k=(f=s.value)==null?void 0:f.last_page)!=null?k:0}),b=o.computed(()=>{var f;return((f=s.value)==null?void 0:f.current_page)===$(i)}),m=o.computed(()=>{var f;return((f=s.value)==null?void 0:f.current_page)===h.value}),c=o.computed(()=>$(r)*2+1),_=o.computed(()=>s.value?s.value.last_page-$(i)+1:0),P=o.computed(()=>_.value<$(r)*2+4),S=o.computed(()=>!s.value||s.value.current_page<=$(r)?1:s.value.current_page>=_.value-$(r)?_.value-$(r)*2:s.value.current_page-$(r));function d(){v.value=j(j({},D.pagination),$(t.css===void 0?{}:t.css))}function y(f){var k;(k=t.emit)==null||k.call(t,"vuetable-pagination:change-page",f)}function F(f){s.value=f}function O(){s.value=null}function E(f){var k;return f===((k=s.value)==null?void 0:k.current_page)}return d(),{tablePagination:s,customCss:v,eventPrefix:g,lastPage:h,isOnFirstPage:b,isOnLastPage:m,notEnoughPages:P,windowSize:c,windowStart:S,totalPage:_,setPaginationData:F,resetData:O,isCurrentPage:E,mergeCss:d,loadPage:y}}var Zn=Object.defineProperty,It=Object.getOwnPropertySymbols,Qn=Object.prototype.hasOwnProperty,Jn=Object.prototype.propertyIsEnumerable,Ht=(e,a,t)=>a in e?Zn(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,Vt=(e,a)=>{for(var t in a||(a={}))Qn.call(a,t)&&Ht(e,t,a[t]);if(It)for(var t of It(a))Jn.call(a,t)&&Ht(e,t,a[t]);return e};const ne=o.defineComponent({props:{css:{type:Object,required:!1,default:()=>({})},onEachSide:{type:Number,required:!1,default:2},firstPage:{type:Number,required:!1,default:1}},emits:["vuetable-pagination:change-page"],setup(e,{emit:a}){const t=o.reactive(Vt(Vt({},D.pagination),e.css)),{tablePagination:r,totalPage:i,lastPage:s,isOnFirstPage:v,isOnLastPage:g,notEnoughPages:h,windowSize:b,windowStart:m,isCurrentPage:c,setPaginationData:_,resetData:P}=Ae(()=>e.onEachSide,()=>e.firstPage);function S(d){a("vuetable-pagination:change-page",d)}return{tableCss:t,tablePagination:r,totalPage:i,lastPage:s,isOnFirstPage:v,isOnLastPage:g,notEnoughPages:h,windowSize:b,windowStart:m,isCurrentPage:c,setPaginationData:_,resetData:P,loadPage:S}}});var Xn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.tablePagination&&e.lastPage>e.firstPage,expression:"tablePagination && lastPage > firstPage"}],class:e.tableCss.wrapperClass},[t("a",{class:["btn-nav",e.tableCss.linkClass,e.isOnFirstPage?e.tableCss.disabledClass:""],on:{click:function(r){return e.loadPage(e.firstPage)}}},[e.tableCss.icons.first!=""?t("i",{class:[e.tableCss.icons.first]}):t("span",[e._v(`
|
|
8
8
|
«
|
|
9
9
|
`)])]),e._v(" "),t("a",{class:["btn-nav",e.tableCss.linkClass,e.isOnFirstPage?e.tableCss.disabledClass:""],on:{click:function(r){return e.loadPage("prev")}}},[e.tableCss.icons.next!=""?t("i",{class:[e.tableCss.icons.prev]}):t("span",[e._v(`
|
|
10
10
|
‹
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
›
|
|
13
13
|
`)])]),e._v(" "),t("a",{class:["btn-nav",e.tableCss.linkClass,e.isOnLastPage?e.tableCss.disabledClass:""],on:{click:function(r){return e.loadPage(e.lastPage)}}},[e.tableCss.icons.last!=""?t("i",{class:[e.tableCss.icons.last]}):t("span",[e._v(`
|
|
14
14
|
»
|
|
15
|
-
`)])])],2)},
|
|
15
|
+
`)])])],2)},ea=[];ne.render=Xn;ne.staticRenderFns=ea;var ta=Object.defineProperty,At=Object.getOwnPropertySymbols,na=Object.prototype.hasOwnProperty,aa=Object.prototype.propertyIsEnumerable,Mt=(e,a,t)=>a in e?ta(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,Bt=(e,a)=>{for(var t in a||(a={}))na.call(a,t)&&Mt(e,t,a[t]);if(At)for(var t of At(a))aa.call(a,t)&&Mt(e,t,a[t]);return e};const ae=o.defineComponent({props:{css:{type:Object,required:!1,default:()=>({})},pageText:{type:String,required:!1,default:"Page"},onEachSide:{type:Number,required:!1,default:2},firstPage:{type:Number,required:!1,default:1}},emits:["vuetable-pagination:change-page"],setup(e,{emit:a}){const t=Sn(),r=o.reactive(Bt(Bt({},D.pagination),e.css)),{tablePagination:i,totalPage:s,lastPage:v,isOnFirstPage:g,isOnLastPage:h,notEnoughPages:b,windowSize:m,windowStart:c,isCurrentPage:_,setPaginationData:P,resetData:S}=Ae(()=>e.onEachSide,()=>e.firstPage);function d(F){a("vuetable-pagination:change-page",F)}function y(F){d(F.target.selectedIndex+e.firstPage)}return t.on("vuetable:pagination-data",F=>{P(F)}),{emitter:t,tableCss:r,tablePagination:i,totalPage:s,lastPage:v,isOnFirstPage:g,isOnLastPage:h,notEnoughPages:b,windowSize:m,windowStart:c,isCurrentPage:_,setPaginationData:P,resetData:S,loadPage:d,onPageSelected:y}}});var ra=function(){var e,a,t=this,r=t.$createElement,i=t._self._c||r;return i("div",{class:[t.tableCss.wrapperClass]},[i("a",{class:[t.tableCss.linkClass,(e={},e[t.tableCss.disabledClass]=t.isOnFirstPage,e)],on:{click:function(s){return t.loadPage("prev")}}},[i("i",{class:t.tableCss.icons.prev})]),t._v(" "),i("select",{class:["vuetable-pagination-dropdown",t.tableCss.dropdownClass],on:{change:function(s){return t.onPageSelected(s)}}},t._l(t.totalPage,function(s,v){return i("option",{key:s,class:[t.tableCss.pageClass],domProps:{value:v+t.firstPage,selected:t.isCurrentPage(v+t.firstPage)}},[t._v(`
|
|
16
16
|
`+t._s(t.pageText)+" "+t._s(s)+`
|
|
17
|
-
`)])}),0),t._v(" "),i("a",{class:[t.tableCss.linkClass,(a={},a[t.tableCss.disabledClass]=t.isOnLastPage,a)],on:{click:function(s){return t.loadPage("next")}}},[i("i",{class:t.tableCss.icons.next})])])},Wn=[];J.render=Ln;J.staticRenderFns=Wn;function Bt(e,a){const t=e===void 0||l.isRef(e)||typeof e=="function"||typeof e=="string"?{noDataTemplate:e,infoTemplate:a}:e,r=()=>k(t.noDataTemplate===void 0?"No relevant data":t.noDataTemplate),i=()=>k(t.infoTemplate===void 0?"Displaying {from} to {to} of {total} items":t.infoTemplate),s=l.ref(null),f=l.ref({}),c=l.computed(()=>s.value==null||s.value.total==0),v=l.computed(()=>c.value?k(r):k(i).replace("{from}",`${s.value.from||0}`).replace("{to}",`${s.value.to||0}`).replace("{total}",`${s.value.total||0}`));function d(){f.value=E(E({},T.paginationInfo),k(t.css===void 0?{}:t.css))}function m(C){s.value=C}function p(){s.value=null}function y(C){var w;return C===((w=s.value)==null?void 0:w.current_page)}return d(),{tablePagination:s,customCss:f,paginationInfo:v,setPaginationData:m,resetData:p,isCurrentPage:y,mergeCss:d}}var zn=Object.defineProperty,Tt=Object.getOwnPropertySymbols,Un=Object.prototype.hasOwnProperty,Gn=Object.prototype.propertyIsEnumerable,qt=(e,a,t)=>a in e?zn(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,Dt=(e,a)=>{for(var t in a||(a={}))Un.call(a,t)&&qt(e,t,a[t]);if(Tt)for(var t of Tt(a))Gn.call(a,t)&&qt(e,t,a[t]);return e};const X=l.defineComponent({props:{css:{type:null,required:!1,default:()=>({})},infoTemplate:{type:String,required:!1,default:"Displaying {from} to {to} of {total} items"},noDataTemplate:{type:String,required:!1,default:"No relevant data"}},setup(e){const{tablePagination:a,paginationInfo:t,setPaginationData:r,resetData:i}=Bt(()=>e.noDataTemplate,()=>e.infoTemplate),s=l.ref(Dt(Dt({},T.paginationInfo),e.css));return{tablePagination:a,paginationInfo:t,setPaginationData:r,resetData:i,tableCss:s}}});var Kn=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{class:["vuetable-pagination-info",e.tableCss.infoClass],domProps:{innerHTML:e._s(e.paginationInfo)}})},Yn=[];X.render=Kn;X.staticRenderFns=Yn;const Vt=l.defineComponent({props:{rowData:{type:Object,default:null},rowIndex:{type:Number},rowField:{type:Object},isHeader:{type:Boolean,default:!1},title:{type:String,default:""},vuetable:{type:Object,default:null}}}),Qn=l.defineComponent({mixins:[Vt],methods:{toggleCheckbox(e,a){this.vuetable.onCheckboxToggled(a.target.checked,this.rowField.name,e)},toggleAllCheckbox(e){this.vuetable.onCheckboxToggledAll(e.target.checked)},isSelected(e){return this.vuetable.isSelectedRow(e[this.vuetable.trackBy])},isAllItemsInCurrentPageSelected(){var e;if(!this.vuetable.tableData)return;let a=this.vuetable.trackBy,t=(e=this.$el)==null?void 0:e.querySelector("input[type=checkbox]"),r=this.vuetable.tableData.filter(i=>this.vuetable.isSelectedRow(i[a]));return r.length<=0?(t&&(t.indeterminate=!1),!1):r.length<this.vuetable.tableData.length?(t&&(t.indeterminate=!0),!0):(t&&(t.indeterminate=!1),!0)}}});var Zn=Object.defineProperty,jt=Object.getOwnPropertySymbols,Jn=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable,Et=(e,a,t)=>a in e?Zn(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,It=(e,a)=>{for(var t in a||(a={}))Jn.call(a,t)&&Et(e,t,a[t]);if(jt)for(var t of jt(a))Xn.call(a,t)&&Et(e,t,a[t]);return e};const ea=l.defineComponent({props:{css:{type:Object,default:()=>({})},infoTemplate:{type:String,default:"Displaying {from} to {to} of {total} items"},noDataTemplate:{type:String,default:"No relevant data"}},data(){return{tablePagination:null,customCss:{}}},computed:{paginationInfo(){return this.tablePagination==null||this.tablePagination.total===0?this.noDataTemplate:this.infoTemplate.replace("{from}",`${this.tablePagination.from||0}`).replace("{to}",`${this.tablePagination.to||0}`).replace("{total}",`${this.tablePagination.total||0}`)}},created(){this.mergeCss()},methods:{mergeCss(){this.customCss=It(It({},T.paginationInfo),this.css)},setPaginationData(e){this.tablePagination=e},resetData(){this.tablePagination=null}}});var ta=Object.defineProperty,Ht=Object.getOwnPropertySymbols,na=Object.prototype.hasOwnProperty,aa=Object.prototype.propertyIsEnumerable,Mt=(e,a,t)=>a in e?ta(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,At=(e,a)=>{for(var t in a||(a={}))na.call(a,t)&&Mt(e,t,a[t]);if(Ht)for(var t of Ht(a))aa.call(a,t)&&Mt(e,t,a[t]);return e};const ra=l.defineComponent({emits:["vuetable-pagination:change-page"],props:{css:{type:Object,default(){return{}}},onEachSide:{type:Number,default(){return 2}},firstPage:{type:Number,default:1}},data(){return{eventPrefix:"vuetable-pagination:",tablePagination:null,customCss:{}}},created(){this.mergeCss()},computed:{totalPage(){return this.tablePagination===null?0:this.tablePagination.last_page-this.firstPage+1},lastPage(){return this.tablePagination===null?0:this.tablePagination.last_page},isOnFirstPage(){return this.tablePagination===null?!1:this.tablePagination.current_page===this.firstPage},isOnLastPage(){return this.tablePagination===null?!1:this.tablePagination.current_page===this.lastPage},notEnoughPages(){return this.totalPage<this.onEachSide*2+4},windowSize(){return this.onEachSide*2+1},windowStart(){return!this.tablePagination||this.tablePagination.current_page<=this.onEachSide?1:this.tablePagination.current_page>=this.totalPage-this.onEachSide?this.totalPage-this.onEachSide*2:this.tablePagination.current_page-this.onEachSide}},methods:{mergeCss(){this.customCss=At(At({},T.pagination),this.css)},loadPage(e){this.$emit("vuetable-pagination:change-page",e)},isCurrentPage(e){return e===this.tablePagination.current_page},setPaginationData(e){this.tablePagination=e},resetData(){this.tablePagination=null}}});function Nt(e){const a=l.inject("vuetable",null);return{rowData:l.computed(()=>{var t;return(t=e.rowData)!=null?t:null}),rowIndex:l.computed(()=>e.rowIndex),rowField:l.computed(()=>e.rowField),isHeader:l.computed(()=>{var t;return(t=e.isHeader)!=null?t:!1}),title:l.computed(()=>{var t;return(t=e.title)!=null?t:""}),vuetable:l.computed(()=>{var t;return(t=e.vuetable)!=null?t:a})}}function la(e){const a=Nt(e);function t(){const p=a.vuetable.value;if(!p)throw new TypeError('useVuetableFieldCheckbox requires a vuetable prop or a "vuetable" provider.');return p}t();const r=l.ref(null),i=l.computed(()=>{const p=t();return(p.tableData||[]).filter(y=>p.isSelectedRow(y[p.trackBy])).length}),s=l.computed(()=>{var p;return i.value>0&&i.value<(((p=t().tableData)==null?void 0:p.length)||0)});function f(p,y){var w;if(!p)return;t().onCheckboxToggled(y.target.checked,(w=a.rowField.value)==null?void 0:w.name,p)}function c(p){t().onCheckboxToggledAll(p.target.checked)}function v(p){if(!p)return!1;const y=t();return y.isSelectedRow(p[y.trackBy])}function d(){if(t().tableData)return i.value>0}function m(){r.value&&(r.value.indeterminate=a.isHeader.value&&s.value)}return l.onMounted(m),l.onUpdated(m),l.watch([r,a.isHeader,s],m,{flush:"post"}),Pt(E({},a),{checkbox:r,selectedCount:i,isIndeterminate:s,toggleCheckbox:f,toggleAllCheckbox:c,isSelected:v,isAllItemsInCurrentPageSelected:d})}function oa(e){var a=this.constructor;return this.then(function(t){return a.resolve(e()).then(function(){return t})},function(t){return a.resolve(e()).then(function(){return a.reject(t)})})}function ia(e){var a=this;return new a(function(t,r){if(!(e&&typeof e.length!="undefined"))return r(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(e);if(i.length===0)return t([]);var s=i.length;function f(v,d){if(d&&(typeof d=="object"||typeof d=="function")){var m=d.then;if(typeof m=="function"){m.call(d,function(p){f(v,p)},function(p){i[v]={status:"rejected",reason:p},--s===0&&t(i)});return}}i[v]={status:"fulfilled",value:d},--s===0&&t(i)}for(var c=0;c<i.length;c++)f(c,i[c])})}function Lt(e,a){this.name="AggregateError",this.errors=e,this.message=a||""}Lt.prototype=Error.prototype;function sa(e){var a=this;return new a(function(t,r){if(!(e&&typeof e.length!="undefined"))return r(new TypeError("Promise.any accepts an array"));var i=Array.prototype.slice.call(e);if(i.length===0)return r();for(var s=[],f=0;f<i.length;f++)try{a.resolve(i[f]).then(t).catch(function(c){s.push(c),s.length===i.length&&r(new Lt(s,"All promises were rejected"))})}catch(c){r(c)}})}var ua=setTimeout;function Wt(e){return!!(e&&typeof e.length!="undefined")}function ca(){}function da(e,a){return function(){e.apply(a,arguments)}}function _(e){if(!(this instanceof _))throw new TypeError("Promises must be constructed via new");if(typeof e!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Ut(e,this)}function zt(e,a){for(;e._state===3;)e=e._value;if(e._state===0){e._deferreds.push(a);return}e._handled=!0,_._immediateFn(function(){var t=e._state===1?a.onFulfilled:a.onRejected;if(t===null){(e._state===1?Se:N)(a.promise,e._value);return}var r;try{r=t(e._value)}catch(i){N(a.promise,i);return}Se(a.promise,r)})}function Se(e,a){try{if(a===e)throw new TypeError("A promise cannot be resolved with itself.");if(a&&(typeof a=="object"||typeof a=="function")){var t=a.then;if(a instanceof _){e._state=3,e._value=a,Fe(e);return}else if(typeof t=="function"){Ut(da(t,a),e);return}}e._state=1,e._value=a,Fe(e)}catch(r){N(e,r)}}function N(e,a){e._state=2,e._value=a,Fe(e)}function Fe(e){e._state===2&&e._deferreds.length===0&&_._immediateFn(function(){e._handled||_._unhandledRejectionFn(e._value)});for(var a=0,t=e._deferreds.length;a<t;a++)zt(e,e._deferreds[a]);e._deferreds=null}function fa(e,a,t){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof a=="function"?a:null,this.promise=t}function Ut(e,a){var t=!1;try{e(function(r){t||(t=!0,Se(a,r))},function(r){t||(t=!0,N(a,r))})}catch(r){if(t)return;t=!0,N(a,r)}}_.prototype.catch=function(e){return this.then(null,e)};_.prototype.then=function(e,a){var t=new this.constructor(ca);return zt(this,new fa(e,a,t)),t};_.prototype.finally=oa;_.all=function(e){return new _(function(a,t){if(!Wt(e))return t(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(r.length===0)return a([]);var i=r.length;function s(c,v){try{if(v&&(typeof v=="object"||typeof v=="function")){var d=v.then;if(typeof d=="function"){d.call(v,function(m){s(c,m)},t);return}}r[c]=v,--i===0&&a(r)}catch(m){t(m)}}for(var f=0;f<r.length;f++)s(f,r[f])})};_.any=sa;_.allSettled=ia;_.resolve=function(e){return e&&typeof e=="object"&&e.constructor===_?e:new _(function(a){a(e)})};_.reject=function(e){return new _(function(a,t){t(e)})};_.race=function(e){return new _(function(a,t){if(!Wt(e))return t(new TypeError("Promise.race accepts an array"));for(var r=0,i=e.length;r<i;r++)_.resolve(e[r]).then(a,t)})};_._immediateFn=typeof setImmediate=="function"&&function(e){setImmediate(e)}||function(e){ua(e,0)};_._unhandledRejectionFn=function(a){typeof console!="undefined"&&console&&console.warn("Possible Unhandled Promise Rejection:",a)};const ke=typeof globalThis=="object"?globalThis:typeof self=="object"?self:void 0;ke&&!ke.Promise&&(ke.Promise=_);function Gt(e){e.component("vuetable",Re),e.component("vuetable-col-gutter",D),e.component("vuetable-field-checkbox",H),e.component("vuetable-field-handle",M),e.component("vuetable-field-sequence",A),e.component("vuetable-pagination",Z),e.component("vuetable-pagination-dropdown",J),e.component("vuetable-pagination-info",X),e.component("vuetable-row-header",L)}const Re=Object.assign(xe,{install:Gt});exports.Vuetable=Re;exports.VuetableColGutter=D;exports.VuetableFieldCheckbox=H;exports.VuetableFieldCheckboxMixin=Qn;exports.VuetableFieldHandle=M;exports.VuetableFieldMixin=Vt;exports.VuetableFieldSequence=A;exports.VuetablePagination=Z;exports.VuetablePaginationDropdown=J;exports.VuetablePaginationInfo=X;exports.VuetablePaginationInfoMixin=ea;exports.VuetablePaginationMixin=ra;exports.VuetableRowHeader=L;exports.default=Re;exports.install=Gt;exports.useVuetableField=Nt;exports.useVuetableFieldCheckbox=la;exports.useVuetablePagination=Oe;exports.useVuetablePaginationInfo=Bt;
|
|
17
|
+
`)])}),0),t._v(" "),i("a",{class:[t.tableCss.linkClass,(a={},a[t.tableCss.disabledClass]=t.isOnLastPage,a)],on:{click:function(s){return t.loadPage("next")}}},[i("i",{class:t.tableCss.icons.next})])])},oa=[];ae.render=ra;ae.staticRenderFns=oa;function Qt(e,a){const t=e===void 0||o.isRef(e)||typeof e=="function"||typeof e=="string"?{noDataTemplate:e,infoTemplate:a}:e,r=()=>$(t.noDataTemplate===void 0?"No relevant data":t.noDataTemplate),i=()=>$(t.infoTemplate===void 0?"Displaying {from} to {to} of {total} items":t.infoTemplate),s=o.ref(null),v=o.ref({}),g=o.computed(()=>s.value==null||s.value.total==0),h=o.computed(()=>g.value?$(r):$(i).replace("{from}",`${s.value.from||0}`).replace("{to}",`${s.value.to||0}`).replace("{total}",`${s.value.total||0}`));function b(){v.value=j(j({},D.paginationInfo),$(t.css===void 0?{}:t.css))}function m(P){s.value=P}function c(){s.value=null}function _(P){var S;return P===((S=s.value)==null?void 0:S.current_page)}return b(),{tablePagination:s,customCss:v,paginationInfo:h,setPaginationData:m,resetData:c,isCurrentPage:_,mergeCss:b}}var la=Object.defineProperty,Nt=Object.getOwnPropertySymbols,ia=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,Lt=(e,a,t)=>a in e?la(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,zt=(e,a)=>{for(var t in a||(a={}))ia.call(a,t)&&Lt(e,t,a[t]);if(Nt)for(var t of Nt(a))sa.call(a,t)&&Lt(e,t,a[t]);return e};const re=o.defineComponent({props:{css:{type:null,required:!1,default:()=>({})},infoTemplate:{type:String,required:!1,default:"Displaying {from} to {to} of {total} items"},noDataTemplate:{type:String,required:!1,default:"No relevant data"}},setup(e){const{tablePagination:a,paginationInfo:t,setPaginationData:r,resetData:i}=Qt(()=>e.noDataTemplate,()=>e.infoTemplate),s=o.ref(zt(zt({},D.paginationInfo),e.css));return{tablePagination:a,paginationInfo:t,setPaginationData:r,resetData:i,tableCss:s}}});var ua=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{class:["vuetable-pagination-info",e.tableCss.infoClass],domProps:{innerHTML:e._s(e.paginationInfo)}})},ca=[];re.render=ua;re.staticRenderFns=ca;const Jt=o.defineComponent({props:{rowData:{type:Object,default:null},rowIndex:{type:Number},rowField:{type:Object},isHeader:{type:Boolean,default:!1},title:{type:String,default:""},vuetable:{type:Object,default:null}}}),da=o.defineComponent({mixins:[Jt],methods:{toggleCheckbox(e,a){this.vuetable.onCheckboxToggled(a.target.checked,this.rowField.name,e)},toggleAllCheckbox(e){this.vuetable.onCheckboxToggledAll(e.target.checked)},isSelected(e){return this.vuetable.isSelectedRow(e[this.vuetable.trackBy])},isAllItemsInCurrentPageSelected(){var e;if(!this.vuetable.tableData)return;let a=this.vuetable.trackBy,t=(e=this.$el)==null?void 0:e.querySelector("input[type=checkbox]"),r=this.vuetable.tableData.filter(i=>this.vuetable.isSelectedRow(i[a]));return r.length<=0?(t&&(t.indeterminate=!1),!1):r.length<this.vuetable.tableData.length?(t&&(t.indeterminate=!0),!0):(t&&(t.indeterminate=!1),!0)}}});var fa=Object.defineProperty,Ut=Object.getOwnPropertySymbols,va=Object.prototype.hasOwnProperty,ba=Object.prototype.propertyIsEnumerable,Wt=(e,a,t)=>a in e?fa(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,Gt=(e,a)=>{for(var t in a||(a={}))va.call(a,t)&&Wt(e,t,a[t]);if(Ut)for(var t of Ut(a))ba.call(a,t)&&Wt(e,t,a[t]);return e};const pa=o.defineComponent({props:{css:{type:Object,default:()=>({})},infoTemplate:{type:String,default:"Displaying {from} to {to} of {total} items"},noDataTemplate:{type:String,default:"No relevant data"}},data(){return{tablePagination:null,customCss:{}}},computed:{paginationInfo(){return this.tablePagination==null||this.tablePagination.total===0?this.noDataTemplate:this.infoTemplate.replace("{from}",`${this.tablePagination.from||0}`).replace("{to}",`${this.tablePagination.to||0}`).replace("{total}",`${this.tablePagination.total||0}`)}},created(){this.mergeCss()},methods:{mergeCss(){this.customCss=Gt(Gt({},D.paginationInfo),this.css)},setPaginationData(e){this.tablePagination=e},resetData(){this.tablePagination=null}}});var ga=Object.defineProperty,Kt=Object.getOwnPropertySymbols,ha=Object.prototype.hasOwnProperty,ma=Object.prototype.propertyIsEnumerable,Yt=(e,a,t)=>a in e?ga(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,Zt=(e,a)=>{for(var t in a||(a={}))ha.call(a,t)&&Yt(e,t,a[t]);if(Kt)for(var t of Kt(a))ma.call(a,t)&&Yt(e,t,a[t]);return e};const ya=o.defineComponent({emits:["vuetable-pagination:change-page"],props:{css:{type:Object,default(){return{}}},onEachSide:{type:Number,default(){return 2}},firstPage:{type:Number,default:1}},data(){return{eventPrefix:"vuetable-pagination:",tablePagination:null,customCss:{}}},created(){this.mergeCss()},computed:{totalPage(){return this.tablePagination===null?0:this.tablePagination.last_page-this.firstPage+1},lastPage(){return this.tablePagination===null?0:this.tablePagination.last_page},isOnFirstPage(){return this.tablePagination===null?!1:this.tablePagination.current_page===this.firstPage},isOnLastPage(){return this.tablePagination===null?!1:this.tablePagination.current_page===this.lastPage},notEnoughPages(){return this.totalPage<this.onEachSide*2+4},windowSize(){return this.onEachSide*2+1},windowStart(){return!this.tablePagination||this.tablePagination.current_page<=this.onEachSide?1:this.tablePagination.current_page>=this.totalPage-this.onEachSide?this.totalPage-this.onEachSide*2:this.tablePagination.current_page-this.onEachSide}},methods:{mergeCss(){this.customCss=Zt(Zt({},D.pagination),this.css)},loadPage(e){this.$emit("vuetable-pagination:change-page",e)},isCurrentPage(e){return e===this.tablePagination.current_page},setPaginationData(e){this.tablePagination=e},resetData(){this.tablePagination=null}}});function Xt(e){const a=o.inject("vuetable",null);return{rowData:o.computed(()=>{var t;return(t=e.rowData)!=null?t:null}),rowIndex:o.computed(()=>e.rowIndex),rowField:o.computed(()=>e.rowField),isHeader:o.computed(()=>{var t;return(t=e.isHeader)!=null?t:!1}),title:o.computed(()=>{var t;return(t=e.title)!=null?t:""}),vuetable:o.computed(()=>{var t;return(t=e.vuetable)!=null?t:a})}}function _a(e){const a=Xt(e);function t(){const c=a.vuetable.value;if(!c)throw new TypeError('useVuetableFieldCheckbox requires a vuetable prop or a "vuetable" provider.');return c}t();const r=o.ref(null),i=o.computed(()=>{const c=t();return(c.tableData||[]).filter(_=>c.isSelectedRow(_[c.trackBy])).length}),s=o.computed(()=>{var c;return i.value>0&&i.value<(((c=t().tableData)==null?void 0:c.length)||0)});function v(c,_){var S;if(!c)return;t().onCheckboxToggled(_.target.checked,(S=a.rowField.value)==null?void 0:S.name,c)}function g(c){t().onCheckboxToggledAll(c.target.checked)}function h(c){if(!c)return!1;const _=t();return _.isSelectedRow(c[_.trackBy])}function b(){if(t().tableData)return i.value>0}function m(){r.value&&(r.value.indeterminate=a.isHeader.value&&s.value)}return o.onMounted(m),o.onUpdated(m),o.watch([r,a.isHeader,s],m,{flush:"post"}),W(j({},a),{checkbox:r,selectedCount:i,isIndeterminate:s,toggleCheckbox:v,toggleAllCheckbox:g,isSelected:h,isAllItemsInCurrentPageSelected:b})}function Pa(e){var a=this.constructor;return this.then(function(t){return a.resolve(e()).then(function(){return t})},function(t){return a.resolve(e()).then(function(){return a.reject(t)})})}function Ca(e){var a=this;return new a(function(t,r){if(!(e&&typeof e.length!="undefined"))return r(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(e);if(i.length===0)return t([]);var s=i.length;function v(h,b){if(b&&(typeof b=="object"||typeof b=="function")){var m=b.then;if(typeof m=="function"){m.call(b,function(c){v(h,c)},function(c){i[h]={status:"rejected",reason:c},--s===0&&t(i)});return}}i[h]={status:"fulfilled",value:b},--s===0&&t(i)}for(var g=0;g<i.length;g++)v(g,i[g])})}function en(e,a){this.name="AggregateError",this.errors=e,this.message=a||""}en.prototype=Error.prototype;function wa(e){var a=this;return new a(function(t,r){if(!(e&&typeof e.length!="undefined"))return r(new TypeError("Promise.any accepts an array"));var i=Array.prototype.slice.call(e);if(i.length===0)return r();for(var s=[],v=0;v<i.length;v++)try{a.resolve(i[v]).then(t).catch(function(g){s.push(g),s.length===i.length&&r(new en(s,"All promises were rejected"))})}catch(g){r(g)}})}var Sa=setTimeout;function tn(e){return!!(e&&typeof e.length!="undefined")}function ka(){}function $a(e,a){return function(){e.apply(a,arguments)}}function w(e){if(!(this instanceof w))throw new TypeError("Promises must be constructed via new");if(typeof e!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],an(e,this)}function nn(e,a){for(;e._state===3;)e=e._value;if(e._state===0){e._deferreds.push(a);return}e._handled=!0,w._immediateFn(function(){var t=e._state===1?a.onFulfilled:a.onRejected;if(t===null){(e._state===1?qe:G)(a.promise,e._value);return}var r;try{r=t(e._value)}catch(i){G(a.promise,i);return}qe(a.promise,r)})}function qe(e,a){try{if(a===e)throw new TypeError("A promise cannot be resolved with itself.");if(a&&(typeof a=="object"||typeof a=="function")){var t=a.then;if(a instanceof w){e._state=3,e._value=a,De(e);return}else if(typeof t=="function"){an($a(t,a),e);return}}e._state=1,e._value=a,De(e)}catch(r){G(e,r)}}function G(e,a){e._state=2,e._value=a,De(e)}function De(e){e._state===2&&e._deferreds.length===0&&w._immediateFn(function(){e._handled||w._unhandledRejectionFn(e._value)});for(var a=0,t=e._deferreds.length;a<t;a++)nn(e,e._deferreds[a]);e._deferreds=null}function Fa(e,a,t){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof a=="function"?a:null,this.promise=t}function an(e,a){var t=!1;try{e(function(r){t||(t=!0,qe(a,r))},function(r){t||(t=!0,G(a,r))})}catch(r){if(t)return;t=!0,G(a,r)}}w.prototype.catch=function(e){return this.then(null,e)};w.prototype.then=function(e,a){var t=new this.constructor(ka);return nn(this,new Fa(e,a,t)),t};w.prototype.finally=Pa;w.all=function(e){return new w(function(a,t){if(!tn(e))return t(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(r.length===0)return a([]);var i=r.length;function s(g,h){try{if(h&&(typeof h=="object"||typeof h=="function")){var b=h.then;if(typeof b=="function"){b.call(h,function(m){s(g,m)},t);return}}r[g]=h,--i===0&&a(r)}catch(m){t(m)}}for(var v=0;v<r.length;v++)s(v,r[v])})};w.any=wa;w.allSettled=Ca;w.resolve=function(e){return e&&typeof e=="object"&&e.constructor===w?e:new w(function(a){a(e)})};w.reject=function(e){return new w(function(a,t){t(e)})};w.race=function(e){return new w(function(a,t){if(!tn(e))return t(new TypeError("Promise.race accepts an array"));for(var r=0,i=e.length;r<i;r++)w.resolve(e[r]).then(a,t)})};w._immediateFn=typeof setImmediate=="function"&&function(e){setImmediate(e)}||function(e){Sa(e,0)};w._unhandledRejectionFn=function(a){typeof console!="undefined"&&console&&console.warn("Possible Unhandled Promise Rejection:",a)};const Oa=["initialized","loading","loaded","pagination-data","load-success","scrollbar-visible","load-error","row-clicked","row-dblclicked","detail-row-clicked","cell-clicked","cell-dblclicked","cell-rightclicked","row-mouseover","field-event","header-event","checkbox-toggled","checkbox-toggled-all","data-reset","checkbox-toggled-custom"];function xa(e={}){var r,i;if(o.isVue2)throw new Error("createVuetable requires Vue 3. Use the generic Vuetable component on Vue 2.");const a=(r=e.eventPrefix)!=null?r:"vuetable:",t=W(j({},M),{props:W(j({},M.props),{eventPrefix:W(j({},M.props.eventPrefix),{default:a,validator:s=>s===a})}),emits:[...new Set([...Oa,...(i=e.events)!=null?i:[]].reduce((s,v)=>{const g=`${a}${v}`,h=g.replace(/-(\w)/g,(b,m)=>m.toUpperCase());return s.push(g,h.charAt(0).toLowerCase()+h.slice(1)),s},[]))]});return delete t.install,t}const Te=typeof globalThis=="object"?globalThis:typeof self=="object"?self:void 0;Te&&!Te.Promise&&(Te.Promise=w);function rn(e){e.component("vuetable",Me),e.component("vuetable-col-gutter",H),e.component("vuetable-field-checkbox",B),e.component("vuetable-field-handle",N),e.component("vuetable-field-sequence",L),e.component("vuetable-pagination",ne),e.component("vuetable-pagination-dropdown",ae),e.component("vuetable-pagination-info",re),e.component("vuetable-row-header",K)}const Me=Object.assign(M,{install:rn});exports.Vuetable=Me;exports.VuetableColGutter=H;exports.VuetableFieldCheckbox=B;exports.VuetableFieldCheckboxMixin=da;exports.VuetableFieldHandle=N;exports.VuetableFieldMixin=Jt;exports.VuetableFieldSequence=L;exports.VuetablePagination=ne;exports.VuetablePaginationDropdown=ae;exports.VuetablePaginationInfo=re;exports.VuetablePaginationInfoMixin=pa;exports.VuetablePaginationMixin=ya;exports.VuetableRowHeader=K;exports.createVuetable=xa;exports.default=Me;exports.install=rn;exports.useVuetableField=Xt;exports.useVuetableFieldCheckbox=_a;exports.useVuetablePagination=Ae;exports.useVuetablePaginationInfo=Qt;
|
|
18
18
|
//# sourceMappingURL=vue2.cjs.map
|