lkt-table 1.1.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,31 @@
1
+ :root {
2
+ --lkt-table-page-gap: 15px;
3
+
4
+ --lkt-table-width: 100%;
5
+ --lkt-table-font-family: system-ui, Helvetica;
6
+ --lkt-table-font-family-header: system-ui, Helvetica;
7
+
8
+ --lkt-table-border-radius: 5px;
9
+ --lkt-table-text-align: left;
10
+
11
+ --lkt-table-padding-row: 15px;
12
+ --lkt-table-padding-header: 15px;
13
+
14
+ --lkt-table-font-size-row: 16px;
15
+ --lkt-table-color-row: #444444;
16
+ --lkt-table-bg-header: #ffffff;
17
+ --lkt-table-bg-row: #ffffff;
18
+ --lkt-table-bg-row-odd: #f1f1f1;
19
+
20
+ --lkt-table-font-family-sort-icon: Verdana, Arial, Helvetica, sans-serif;
21
+ --lkt-table-font-size-sort-icon: 11px;
22
+
23
+ --lkt-table-sort-icon-content-asc: '';
24
+ --lkt-table-sort-icon-content-desc: '';
25
+
26
+ --lkt-table-width-drag: 20px;
27
+ --lkt-table-border-sortable-chosen: 3px dashed #cccccc;
28
+ --lkt-table-bg-sortable-chosen-ghost: #aaaaaa;
29
+
30
+ --lkt-table-gap-buttons: 15px;
31
+ }
@@ -1,104 +0,0 @@
1
- import { LktTableColumn } from "../instances/LktTableColumn";
2
- import { PropType } from "vue";
3
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
4
- isDraggable: {
5
- type: BooleanConstructor;
6
- default: boolean;
7
- };
8
- sortable: {
9
- type: BooleanConstructor;
10
- default: boolean;
11
- };
12
- i: {
13
- type: NumberConstructor[];
14
- default: number;
15
- };
16
- hiddenColumnsColSpan: {
17
- type: NumberConstructor;
18
- default: number;
19
- };
20
- visibleColumns: {
21
- type: PropType<LktTableColumn[]>;
22
- default: () => LktTableColumn[];
23
- };
24
- hiddenColumns: {
25
- type: PropType<LktTableColumn[]>;
26
- default: () => LktTableColumn[];
27
- };
28
- emptyColumns: {
29
- type: PropType<string[]>;
30
- default: () => string[];
31
- };
32
- hiddenIsVisible: {
33
- type: BooleanConstructor;
34
- default: boolean;
35
- };
36
- modelValue: {
37
- type: PropType<any>;
38
- default: () => {};
39
- };
40
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
41
- click: (...args: any[]) => void;
42
- "update:modelValue": (...args: any[]) => void;
43
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
44
- isDraggable: {
45
- type: BooleanConstructor;
46
- default: boolean;
47
- };
48
- sortable: {
49
- type: BooleanConstructor;
50
- default: boolean;
51
- };
52
- i: {
53
- type: NumberConstructor[];
54
- default: number;
55
- };
56
- hiddenColumnsColSpan: {
57
- type: NumberConstructor;
58
- default: number;
59
- };
60
- visibleColumns: {
61
- type: PropType<LktTableColumn[]>;
62
- default: () => LktTableColumn[];
63
- };
64
- hiddenColumns: {
65
- type: PropType<LktTableColumn[]>;
66
- default: () => LktTableColumn[];
67
- };
68
- emptyColumns: {
69
- type: PropType<string[]>;
70
- default: () => string[];
71
- };
72
- hiddenIsVisible: {
73
- type: BooleanConstructor;
74
- default: boolean;
75
- };
76
- modelValue: {
77
- type: PropType<any>;
78
- default: () => {};
79
- };
80
- }>> & {
81
- onClick?: ((...args: any[]) => any) | undefined;
82
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
83
- }, {
84
- i: number;
85
- sortable: boolean;
86
- modelValue: any;
87
- isDraggable: boolean;
88
- hiddenColumnsColSpan: number;
89
- visibleColumns: LktTableColumn[];
90
- hiddenColumns: LktTableColumn[];
91
- emptyColumns: string[];
92
- hiddenIsVisible: boolean;
93
- }, {}>, Partial<Record<string, (_: {
94
- value: any;
95
- item: any;
96
- column: LktTableColumn;
97
- i: number;
98
- }) => any>>>;
99
- export default _default;
100
- type __VLS_WithTemplateSlots<T, S> = T & {
101
- new (): {
102
- $slots: S;
103
- };
104
- };
@@ -1,39 +0,0 @@
1
- import { LktTableColumn } from "../instances/LktTableColumn";
2
- import { PropType } from "vue";
3
- import { LktObject } from "lkt-ts-interfaces";
4
- declare const _default: import("vue").DefineComponent<{
5
- modelValue: {
6
- type: PropType<LktObject>;
7
- default: () => {};
8
- };
9
- column: {
10
- type: PropType<LktTableColumn>;
11
- default: () => {};
12
- };
13
- i: {
14
- type: NumberConstructor[];
15
- default: number;
16
- };
17
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
- edited: (...args: any[]) => void;
19
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
- modelValue: {
21
- type: PropType<LktObject>;
22
- default: () => {};
23
- };
24
- column: {
25
- type: PropType<LktTableColumn>;
26
- default: () => {};
27
- };
28
- i: {
29
- type: NumberConstructor[];
30
- default: number;
31
- };
32
- }>> & {
33
- onEdited?: ((...args: any[]) => any) | undefined;
34
- }, {
35
- i: number;
36
- column: LktTableColumn;
37
- modelValue: LktObject;
38
- }, {}>;
39
- export default _default;
@@ -1,97 +0,0 @@
1
- import { LktTableColumn } from "../instances/LktTableColumn";
2
- import { PropType } from "vue";
3
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
4
- isDraggable: {
5
- type: BooleanConstructor;
6
- default: boolean;
7
- };
8
- sortable: {
9
- type: BooleanConstructor;
10
- default: boolean;
11
- };
12
- i: {
13
- type: NumberConstructor[];
14
- default: number;
15
- };
16
- displayHiddenColumnsIndicator: {
17
- type: BooleanConstructor;
18
- default: boolean;
19
- };
20
- visibleColumns: {
21
- type: PropType<LktTableColumn[]>;
22
- default: () => LktTableColumn[];
23
- };
24
- emptyColumns: {
25
- type: PropType<string[]>;
26
- default: () => string[];
27
- };
28
- hiddenIsVisible: {
29
- type: BooleanConstructor;
30
- default: boolean;
31
- };
32
- item: {
33
- type: PropType<any>;
34
- default: () => {};
35
- };
36
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
- show: (...args: any[]) => void;
38
- click: (...args: any[]) => void;
39
- edited: (...args: any[]) => void;
40
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
41
- isDraggable: {
42
- type: BooleanConstructor;
43
- default: boolean;
44
- };
45
- sortable: {
46
- type: BooleanConstructor;
47
- default: boolean;
48
- };
49
- i: {
50
- type: NumberConstructor[];
51
- default: number;
52
- };
53
- displayHiddenColumnsIndicator: {
54
- type: BooleanConstructor;
55
- default: boolean;
56
- };
57
- visibleColumns: {
58
- type: PropType<LktTableColumn[]>;
59
- default: () => LktTableColumn[];
60
- };
61
- emptyColumns: {
62
- type: PropType<string[]>;
63
- default: () => string[];
64
- };
65
- hiddenIsVisible: {
66
- type: BooleanConstructor;
67
- default: boolean;
68
- };
69
- item: {
70
- type: PropType<any>;
71
- default: () => {};
72
- };
73
- }>> & {
74
- onClick?: ((...args: any[]) => any) | undefined;
75
- onEdited?: ((...args: any[]) => any) | undefined;
76
- onShow?: ((...args: any[]) => any) | undefined;
77
- }, {
78
- item: any;
79
- i: number;
80
- sortable: boolean;
81
- isDraggable: boolean;
82
- visibleColumns: LktTableColumn[];
83
- emptyColumns: string[];
84
- hiddenIsVisible: boolean;
85
- displayHiddenColumnsIndicator: boolean;
86
- }, {}>, Partial<Record<string, (_: {
87
- value: any;
88
- item: any;
89
- column: LktTableColumn;
90
- i: number;
91
- }) => any>>>;
92
- export default _default;
93
- type __VLS_WithTemplateSlots<T, S> = T & {
94
- new (): {
95
- $slots: S;
96
- };
97
- };
@@ -1,61 +0,0 @@
1
- import { LktTableColumn } from "../instances/LktTableColumn";
2
- import { LktObject } from "lkt-ts-interfaces";
3
- import { Option } from "lkt-field-select";
4
- /**
5
- *
6
- * @param key
7
- * @param label
8
- * @param sortable
9
- * @returns {LktTableColumn}
10
- */
11
- export declare const createColumn: (key: string, label: string, sortable?: boolean) => LktTableColumn;
12
- export declare const createLinkColumn: (key: string, label: string, href: string | Function, sortable?: boolean) => LktTableColumn;
13
- export declare const createActionColumn: (key: string, label: string, action: Function, sortable?: boolean) => LktTableColumn;
14
- export declare const createTextColumn: (key: string, label: string, sortable?: boolean) => LktTableColumn;
15
- export declare const createEmailColumn: (key: string, label: string, sortable?: boolean) => LktTableColumn;
16
- export declare const createTelColumn: (key: string, label: string, sortable?: boolean) => LktTableColumn;
17
- export declare const createCheckColumn: (key: string, label: string, sortable?: boolean) => LktTableColumn;
18
- export declare const createSwitchColumn: (key: string, label: string, sortable?: boolean) => LktTableColumn;
19
- export declare const createSelectColumn: (key: string, label: string, options: Option[], sortable?: boolean) => LktTableColumn;
20
- export declare const createHiddenColumn: (key: string, label: string, sortable?: boolean) => LktTableColumn;
21
- /**
22
- *
23
- * @param a
24
- * @param b
25
- * @param c
26
- * @param sortDirection
27
- * @returns {number}
28
- */
29
- export declare const defaultTableSorter: (a: any, b: any, c: LktTableColumn, sortDirection: string) => number;
30
- /**
31
- *
32
- * @param column
33
- * @param item
34
- * @param i
35
- * @returns {*}
36
- */
37
- export declare const getColumnDisplayContent: (column: LktTableColumn, item: any, i: number) => any;
38
- /**
39
- *
40
- * @param column
41
- * @param amountOfColumns
42
- * @param items
43
- */
44
- export declare const getVerticalColSpan: (column: LktTableColumn, amountOfColumns: number, items: Array<LktObject>) => number;
45
- /**
46
- *
47
- * @param column
48
- * @param item
49
- * @returns {boolean|*}
50
- */
51
- export declare const getHorizontalColSpan: (column: LktTableColumn, item: LktObject) => any;
52
- /**
53
- *
54
- * @param column
55
- * @param emptyColumns
56
- * @param item
57
- * @returns {boolean}
58
- */
59
- export declare const canRenderColumn: (column: LktTableColumn, emptyColumns: string[], item: LktObject) => boolean;
60
- export declare const getDefaultSortColumn: (columns?: LktTableColumn[]) => string;
61
- export declare const getColumnByKey: (columns: LktTableColumn[], key: string) => LktTableColumn | null;
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { App } from "vue";
2
- export { createColumn, createHiddenColumn, createLinkColumn, createActionColumn, createTextColumn, createCheckColumn, createSwitchColumn, createSelectColumn, createEmailColumn, createTelColumn } from "./functions/table-functions";
3
- export { LktTableColumn } from "./instances/LktTableColumn";
4
- import "./../lkt-table.css";
5
- declare const LktTable: {
6
- install: (app: App) => void;
7
- };
8
- export default LktTable;
@@ -1,68 +0,0 @@
1
- import { Option } from "lkt-field-select";
2
- import { LktObject } from "lkt-ts-interfaces";
3
- export declare class LktTableColumn {
4
- key: string;
5
- label: string;
6
- sortable: boolean;
7
- hidden: boolean;
8
- editable: boolean;
9
- formatter?: Function;
10
- checkEmpty?: Function;
11
- colspan?: Function | boolean | number;
12
- type: '' | 'link' | 'text' | 'int' | 'float' | 'check' | 'switch' | 'select' | 'action' | 'email' | 'tel';
13
- link: string | Function;
14
- action: Function;
15
- options: Option[];
16
- resource: string;
17
- resourceSlot: string;
18
- resourceData: LktObject;
19
- slotData: LktObject;
20
- isMultiple: boolean;
21
- isLoading: boolean;
22
- autoLoadSelectOptions: boolean;
23
- autoLoadSelectOptionsKey: string;
24
- resourceLoaded: boolean;
25
- valueSlot: string;
26
- editSlot: string;
27
- multipleDisplay: string;
28
- multipleDisplayEdition: string;
29
- constructor(key?: string, label?: string);
30
- setIsSortable(status?: boolean): this;
31
- setIsEditable(status?: boolean): this;
32
- setIsHidden(status?: boolean): this;
33
- setIsLoading(status?: boolean): this;
34
- setFormatter(formatter?: any): this;
35
- setEmptyChecker(checker?: any): this;
36
- setColSpan(checker?: any): this;
37
- getHref(item: LktObject): any;
38
- doAction(item: LktObject): any;
39
- defineAsLink(href: string | Function): this;
40
- defineAsText(): this;
41
- defineAsEmail(): this;
42
- defineAsTel(): this;
43
- defineAsInt(): this;
44
- defineAsFloat(): this;
45
- defineAsCheck(): this;
46
- defineAsSwitch(): this;
47
- defineAsAction(action: Function): this;
48
- defineAsSelect(options: Option[]): this;
49
- showLoading(): boolean;
50
- hasToLoadResource(): boolean;
51
- setIsMultiple(status?: boolean): this;
52
- setResource(resource: string): this;
53
- setResourceSlot(resource: string): this;
54
- setResourceData(data: LktObject): this;
55
- loadResource(): Promise<this>;
56
- setEditSlot(str: string): this;
57
- setValueSlot(str: string): this;
58
- setMultipleDisplay(str: string): this;
59
- setMultipleDisplayToList(): this;
60
- setMultipleDisplayToInline(): this;
61
- setMultipleDisplayToCount(): this;
62
- setMultipleDisplayEdition(str: string): this;
63
- setMultipleDisplayEditionToList(): this;
64
- setMultipleDisplayEditionToInline(): this;
65
- setSlotData(data: LktObject): this;
66
- setAutoLoadSelectOptions(enabled?: boolean, searchKey?: string): this;
67
- setOptions(opts?: Option[]): this;
68
- }
@@ -1,109 +0,0 @@
1
- import { PropType } from "vue";
2
- import { LktTableColumn } from "../instances/LktTableColumn";
3
- import { LktObject } from "lkt-ts-interfaces";
4
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
5
- modelValue: {
6
- type: PropType<LktObject[]>;
7
- default: () => any[];
8
- };
9
- columns: {
10
- type: PropType<LktTableColumn[]>;
11
- default: () => LktTableColumn[];
12
- };
13
- sorter: {
14
- type: FunctionConstructor;
15
- default: (a: any, b: any, c: LktTableColumn, sortDirection: string) => number;
16
- };
17
- sortable: {
18
- type: BooleanConstructor;
19
- default: boolean;
20
- };
21
- hideEmptyColumns: {
22
- type: BooleanConstructor;
23
- default: boolean;
24
- };
25
- draggableChecker: {
26
- type: FunctionConstructor;
27
- default: (item: any) => true;
28
- };
29
- checkValidDrag: {
30
- type: FunctionConstructor;
31
- default: (evt: any) => true;
32
- };
33
- draggableItemKey: {
34
- type: StringConstructor;
35
- default: string;
36
- };
37
- }, {
38
- getItemByEvent: (e: any) => LktObject | undefined;
39
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
40
- sort: (...args: any[]) => void;
41
- click: (...args: any[]) => void;
42
- "update:modelValue": (...args: any[]) => void;
43
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
44
- modelValue: {
45
- type: PropType<LktObject[]>;
46
- default: () => any[];
47
- };
48
- columns: {
49
- type: PropType<LktTableColumn[]>;
50
- default: () => LktTableColumn[];
51
- };
52
- sorter: {
53
- type: FunctionConstructor;
54
- default: (a: any, b: any, c: LktTableColumn, sortDirection: string) => number;
55
- };
56
- sortable: {
57
- type: BooleanConstructor;
58
- default: boolean;
59
- };
60
- hideEmptyColumns: {
61
- type: BooleanConstructor;
62
- default: boolean;
63
- };
64
- draggableChecker: {
65
- type: FunctionConstructor;
66
- default: (item: any) => true;
67
- };
68
- checkValidDrag: {
69
- type: FunctionConstructor;
70
- default: (evt: any) => true;
71
- };
72
- draggableItemKey: {
73
- type: StringConstructor;
74
- default: string;
75
- };
76
- }>> & {
77
- onClick?: ((...args: any[]) => any) | undefined;
78
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
79
- onSort?: ((...args: any[]) => any) | undefined;
80
- }, {
81
- columns: LktTableColumn[];
82
- sortable: boolean;
83
- modelValue: LktObject[];
84
- sorter: Function;
85
- hideEmptyColumns: boolean;
86
- draggableChecker: Function;
87
- checkValidDrag: Function;
88
- draggableItemKey: string;
89
- }, {}>, Partial<Record<any, (_: {
90
- item: any;
91
- value: any;
92
- column: LktTableColumn;
93
- }) => any>> & Partial<Record<any, (_: {
94
- item: any;
95
- value: any;
96
- column: LktTableColumn;
97
- }) => any>> & Partial<Record<any, (_: {
98
- item: any;
99
- value: any;
100
- column: LktTableColumn;
101
- }) => any>> & {
102
- "no-items"?(_: {}): any;
103
- }>;
104
- export default _default;
105
- type __VLS_WithTemplateSlots<T, S> = T & {
106
- new (): {
107
- $slots: S;
108
- };
109
- };