@nuralyui/table 0.0.3 → 0.0.7
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/bundle.js +2351 -0
- package/package.json +16 -2
- package/react.js +2 -2
- package/react.js.map +1 -1
- package/table.component.d.ts +112 -12
- package/table.component.js +285 -136
- package/table.component.js.map +1 -1
- package/table.style.js +676 -2
- package/table.style.js.map +1 -1
- package/table.types.d.ts +60 -4
- package/table.types.js +0 -23
- package/table.types.js.map +1 -1
- package/components/hy-table-actions.d.ts +0 -10
- package/components/hy-table-actions.d.ts.map +0 -1
- package/components/hy-table-actions.js +0 -39
- package/components/hy-table-actions.js.map +0 -1
- package/components/hy-table-content.d.ts +0 -25
- package/components/hy-table-content.d.ts.map +0 -1
- package/components/hy-table-content.js +0 -168
- package/components/hy-table-content.js.map +0 -1
- package/components/hy-table-filter.d.ts +0 -11
- package/components/hy-table-filter.d.ts.map +0 -1
- package/components/hy-table-filter.js +0 -59
- package/components/hy-table-filter.js.map +0 -1
- package/components/hy-table-pagination.d.ts +0 -21
- package/components/hy-table-pagination.d.ts.map +0 -1
- package/components/hy-table-pagination.js +0 -111
- package/components/hy-table-pagination.js.map +0 -1
- package/components/table-actions.style.d.ts +0 -2
- package/components/table-actions.style.d.ts.map +0 -1
- package/components/table-actions.style.js +0 -31
- package/components/table-actions.style.js.map +0 -1
- package/components/table-actions.variables.d.ts +0 -2
- package/components/table-actions.variables.d.ts.map +0 -1
- package/components/table-actions.variables.js +0 -13
- package/components/table-actions.variables.js.map +0 -1
- package/components/table-content.style.d.ts +0 -2
- package/components/table-content.style.d.ts.map +0 -1
- package/components/table-content.style.js +0 -77
- package/components/table-content.style.js.map +0 -1
- package/components/table-content.variables.d.ts +0 -2
- package/components/table-content.variables.d.ts.map +0 -1
- package/components/table-content.variables.js +0 -29
- package/components/table-content.variables.js.map +0 -1
- package/components/table-filter.style.d.ts +0 -2
- package/components/table-filter.style.d.ts.map +0 -1
- package/components/table-filter.style.js +0 -39
- package/components/table-filter.style.js.map +0 -1
- package/components/table-filter.variables.d.ts +0 -2
- package/components/table-filter.variables.d.ts.map +0 -1
- package/components/table-filter.variables.js +0 -17
- package/components/table-filter.variables.js.map +0 -1
- package/components/table-pagination.style.d.ts +0 -2
- package/components/table-pagination.style.d.ts.map +0 -1
- package/components/table-pagination.style.js +0 -102
- package/components/table-pagination.style.js.map +0 -1
- package/components/table-pagination.variables.d.ts +0 -2
- package/components/table-pagination.variables.d.ts.map +0 -1
- package/components/table-pagination.variables.js +0 -17
- package/components/table-pagination.variables.js.map +0 -1
- package/demo/table-demo.d.ts +0 -17
- package/demo/table-demo.d.ts.map +0 -1
- package/demo/table-demo.js +0 -166
- package/demo/table-demo.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/react.d.ts.map +0 -1
- package/table.component.d.ts.map +0 -1
- package/table.style.d.ts.map +0 -1
- package/table.types.d.ts.map +0 -1
- package/test/hy-table-actions_test.d.ts +0 -2
- package/test/hy-table-actions_test.d.ts.map +0 -1
- package/test/hy-table-actions_test.js +0 -32
- package/test/hy-table-actions_test.js.map +0 -1
- package/test/hy-table-content_test.d.ts +0 -2
- package/test/hy-table-content_test.d.ts.map +0 -1
- package/test/hy-table-content_test.js +0 -168
- package/test/hy-table-content_test.js.map +0 -1
- package/test/hy-table-filter_test.d.ts +0 -2
- package/test/hy-table-filter_test.d.ts.map +0 -1
- package/test/hy-table-filter_test.js +0 -80
- package/test/hy-table-filter_test.js.map +0 -1
- package/test/hy-table-pagination_test.d.ts +0 -2
- package/test/hy-table-pagination_test.d.ts.map +0 -1
- package/test/hy-table-pagination_test.js +0 -114
- package/test/hy-table-pagination_test.js.map +0 -1
- package/test/hy-table_test.d.ts +0 -2
- package/test/hy-table_test.d.ts.map +0 -1
- package/test/hy-table_test.js +0 -145
- package/test/hy-table_test.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuralyui/table",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -11,5 +11,19 @@
|
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
12
|
},
|
|
13
13
|
"author": "Labidi Aymen",
|
|
14
|
-
"license": "ISC"
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./index.js"
|
|
18
|
+
},
|
|
19
|
+
"./bundle": {
|
|
20
|
+
"import": "./bundle.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bundle.js",
|
|
25
|
+
"*.js",
|
|
26
|
+
"*.d.ts",
|
|
27
|
+
"*.js.map"
|
|
28
|
+
]
|
|
15
29
|
}
|
package/react.js
CHANGED
|
@@ -2,13 +2,13 @@ import { createComponent } from '@lit-labs/react';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { HyTable } from './table.component.js';
|
|
4
4
|
export const HyTableComponent = createComponent({
|
|
5
|
-
tagName: '
|
|
5
|
+
tagName: 'nr-table',
|
|
6
6
|
elementClass: HyTable,
|
|
7
7
|
react: React,
|
|
8
8
|
events: {
|
|
9
9
|
rowClick: 'row-click',
|
|
10
10
|
sortChange: 'sort-change',
|
|
11
|
-
selectionChange: '
|
|
11
|
+
selectionChange: 'nr-select',
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
//# sourceMappingURL=react.js.map
|
package/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/table/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;IAC9C,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,OAAO;IACrB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,QAAQ,EAAE,WAAW;QACrB,UAAU,EAAE,aAAa;QACzB,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/table/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;IAC9C,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,OAAO;IACrB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,QAAQ,EAAE,WAAW;QACrB,UAAU,EAAE,aAAa;QACzB,eAAe,EAAE,WAAW;KAC7B;CACF,CAAC,CAAC","sourcesContent":["import { createComponent } from '@lit-labs/react';\nimport * as React from 'react';\nimport { HyTable } from './table.component.js';\n\nexport const HyTableComponent = createComponent({\n tagName: 'nr-table',\n elementClass: HyTable,\n react: React,\n events: {\n rowClick: 'row-click',\n sortChange: 'sort-change',\n selectionChange: 'nr-select',\n },\n});\n"]}
|
package/table.component.d.ts
CHANGED
|
@@ -1,39 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
1
6
|
import { LitElement, PropertyValueMap } from 'lit';
|
|
2
|
-
import './components/hy-table-actions.js';
|
|
3
|
-
import './components/hy-table-filter.js';
|
|
4
|
-
import './components/hy-table-pagination.js';
|
|
5
|
-
import './components/hy-table-content.js';
|
|
6
7
|
import { IHeader, SelectionMode, Sizes, SortAttribute } from './table.types.js';
|
|
7
|
-
|
|
8
|
+
import '../select/select.component.js';
|
|
9
|
+
import '../icon/icon.component.js';
|
|
10
|
+
import '../radio/radio.component.js';
|
|
11
|
+
import { TableHost } from './interfaces/index.js';
|
|
12
|
+
declare const HyTable_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & typeof LitElement;
|
|
13
|
+
/**
|
|
14
|
+
* Advanced table component with sorting, filtering, pagination, selection, and fixed columns.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```html
|
|
18
|
+
* <!-- Basic table with fixed header -->
|
|
19
|
+
* <nr-table
|
|
20
|
+
* .headers=${headers}
|
|
21
|
+
* .rows=${data}
|
|
22
|
+
* size="normal"
|
|
23
|
+
* selectionMode="multiple"
|
|
24
|
+
* fixedHeader
|
|
25
|
+
* .scrollConfig=${{ y: 400 }}>
|
|
26
|
+
* </nr-table>
|
|
27
|
+
*
|
|
28
|
+
* <!-- Table with fixed columns -->
|
|
29
|
+
* <nr-table
|
|
30
|
+
* .headers=${[
|
|
31
|
+
* { name: 'ID', key: 'id', fixed: 'left', width: 80 },
|
|
32
|
+
* { name: 'Name', key: 'name', fixed: 'left', width: 150 },
|
|
33
|
+
* { name: 'Email', key: 'email' },
|
|
34
|
+
* { name: 'Status', key: 'status' }
|
|
35
|
+
* ]}
|
|
36
|
+
* .rows=${data}
|
|
37
|
+
* .scrollConfig=${{ x: 800 }}>
|
|
38
|
+
* </nr-table>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @fires onPaginate - Fired when pagination changes
|
|
42
|
+
* @fires nr-select - Fired when row selection changes
|
|
43
|
+
* @fires onSearch - Fired when search/filter is applied
|
|
44
|
+
* @fires onSort - Fired when sorting is applied
|
|
45
|
+
*/
|
|
46
|
+
export declare class HyTable extends HyTable_base implements TableHost {
|
|
8
47
|
static styles: import("lit").CSSResult;
|
|
9
48
|
headers: IHeader[];
|
|
10
|
-
rows: [];
|
|
49
|
+
rows: any[];
|
|
11
50
|
size: Sizes;
|
|
12
51
|
withFilter: boolean;
|
|
13
52
|
expandable: string | undefined;
|
|
53
|
+
expansionRenderer: ((row: any, index: number) => any) | undefined;
|
|
14
54
|
selectionMode: SelectionMode | undefined;
|
|
55
|
+
fixedHeader: boolean;
|
|
56
|
+
scrollConfig: {
|
|
57
|
+
x?: number | string;
|
|
58
|
+
y?: number | string;
|
|
59
|
+
} | undefined;
|
|
60
|
+
loading: boolean;
|
|
61
|
+
emptyText: string;
|
|
62
|
+
emptyIcon: string | undefined;
|
|
15
63
|
itemPerPage: number[];
|
|
16
64
|
selectedItemPerPage: number;
|
|
17
|
-
displayedRows:
|
|
65
|
+
displayedRows: any[];
|
|
18
66
|
selectedItems: boolean[];
|
|
19
67
|
currentPage: number;
|
|
20
|
-
rowsCopy: [];
|
|
68
|
+
rowsCopy: any[];
|
|
21
69
|
activeSearch: boolean;
|
|
22
70
|
sortAttribute: SortAttribute;
|
|
71
|
+
expand: boolean[];
|
|
72
|
+
showFilterInput: boolean;
|
|
73
|
+
filterValue: string;
|
|
74
|
+
columnFilters: Map<string, string | number>;
|
|
75
|
+
activeFilterColumn: string | null;
|
|
76
|
+
globalCheck?: HTMLElement;
|
|
77
|
+
requiredComponents: string[];
|
|
78
|
+
private selectionController;
|
|
79
|
+
private paginationController;
|
|
80
|
+
private sortController;
|
|
81
|
+
private filterController;
|
|
23
82
|
connectedCallback(): void;
|
|
83
|
+
updated(_changedProperties: PropertyValueMap<this> | Map<PropertyKey, unknown>): void;
|
|
24
84
|
willUpdate(_changedProperties: PropertyValueMap<this>): void;
|
|
25
|
-
|
|
26
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Initialize or reset pagination state
|
|
87
|
+
*/
|
|
88
|
+
private _initPagination;
|
|
89
|
+
/**
|
|
90
|
+
* Handle items per page change event
|
|
91
|
+
*/
|
|
27
92
|
_handleItemPerPage(itemPerPageEvent: CustomEvent): void;
|
|
93
|
+
/**
|
|
94
|
+
* Handle page navigation event
|
|
95
|
+
*/
|
|
28
96
|
_handleUpdatePage(updatePageEvent: CustomEvent): void;
|
|
97
|
+
/**
|
|
98
|
+
* Handle check all rows event
|
|
99
|
+
*/
|
|
29
100
|
_handleCheckAll(checkAllEvent: CustomEvent): void;
|
|
101
|
+
/**
|
|
102
|
+
* Handle check single row event
|
|
103
|
+
*/
|
|
30
104
|
_handleCheckOne(checkOneEvent: CustomEvent): void;
|
|
105
|
+
/**
|
|
106
|
+
* Handle select single row event (radio button mode)
|
|
107
|
+
*/
|
|
31
108
|
_handleSelectOne(selectOneEvent: CustomEvent): void;
|
|
109
|
+
/**
|
|
110
|
+
* Handle cancel selection action
|
|
111
|
+
*/
|
|
32
112
|
_handleCancelSelection(): void;
|
|
113
|
+
/**
|
|
114
|
+
* Handle search/filter input
|
|
115
|
+
*/
|
|
33
116
|
_handleSearch(searchEvent: CustomEvent): void;
|
|
117
|
+
/**
|
|
118
|
+
* Handle column sort order change
|
|
119
|
+
*/
|
|
34
120
|
_handleSortOrder(sortOrderEvent: CustomEvent): void;
|
|
35
|
-
|
|
36
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Toggle expanded content for a row
|
|
123
|
+
*/
|
|
124
|
+
private _showExpandedContent;
|
|
125
|
+
/**
|
|
126
|
+
* Toggle filter input visibility
|
|
127
|
+
*/
|
|
128
|
+
private _toggleFilterInput;
|
|
129
|
+
/**
|
|
130
|
+
* Handle filter input change
|
|
131
|
+
*/
|
|
132
|
+
private _handleFilterInputChange;
|
|
133
|
+
/**
|
|
134
|
+
* Render the table component with all templates
|
|
135
|
+
*/
|
|
37
136
|
render(): import("lit").TemplateResult<1>;
|
|
38
137
|
}
|
|
138
|
+
export {};
|
|
39
139
|
//# sourceMappingURL=table.component.d.ts.map
|