@kubex/zinc 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +135 -24
- package/dist/vscode.html-custom-data.json +2 -2
- package/dist/web-types.json +8 -8
- package/dist/zn.d.ts +11 -4
- package/dist/zn.min.js +204 -172
- package/docs/pages/components/note.md +11 -1
- package/package.json +1 -1
- package/src/components/content-block/content-block.scss +35 -23
- package/src/components/data-table/data-table.component.ts +160 -45
- package/src/components/data-table/data-table.scss +56 -10
- package/src/components/editor/editor.component.ts +1 -1
- package/src/components/filter-container/filter-container.component.ts +1 -1
- package/src/components/filter-wrapper/filter-wrapper.component.ts +1 -1
- package/src/components/form-group/form-group.component.ts +0 -1
- package/src/components/form-group/form-group.scss +0 -1
- package/src/components/note/note.component.ts +20 -34
- package/src/components/note/note.scss +8 -0
- package/src/components/tile/tile.component.ts +3 -1
|
@@ -5256,6 +5256,15 @@
|
|
|
5256
5256
|
"default": "\"asc\"",
|
|
5257
5257
|
"attribute": "sort-direction"
|
|
5258
5258
|
},
|
|
5259
|
+
{
|
|
5260
|
+
"kind": "field",
|
|
5261
|
+
"name": "localSort",
|
|
5262
|
+
"type": {
|
|
5263
|
+
"text": "boolean"
|
|
5264
|
+
},
|
|
5265
|
+
"default": "false",
|
|
5266
|
+
"attribute": "local-sort"
|
|
5267
|
+
},
|
|
5259
5268
|
{
|
|
5260
5269
|
"kind": "field",
|
|
5261
5270
|
"name": "filter",
|
|
@@ -5526,7 +5535,7 @@
|
|
|
5526
5535
|
"kind": "field",
|
|
5527
5536
|
"name": "_dataTask",
|
|
5528
5537
|
"privacy": "private",
|
|
5529
|
-
"default": "new Task(this, { task: async ([dataUri, requestParams], {signal}) => { if (dataUri === undefined || this.noInitialLoad && this._initialLoad) { return {rows: [], page: 1, perPage: this.itemsPerPage, total: 0}; } if (this.groupBy) { // we want to load all the data possible so we can group and show multiple tables this.itemsPerPage = 1000; } const requestData: DataRequest = { page: this.page, perPage: this.itemsPerPage, sortColumn: this.sortColumn, sortDirection: this.sortDirection, filter: this.filter, }; // get all inputs that are in the inputs slot and add them to the const inputs = this.hasSlotController.getSlots(ActionSlots.inputs.valueOf()); const params: Record<string, any> = {}; if (inputs) { inputs.forEach((input) => { const allowedInputs = ['zn-input', 'zn-select', 'zn-query-builder', 'zn-multiselect', 'zn-params-select', 'input', 'select', 'textarea']; if (allowedInputs.includes(input.tagName.toLowerCase())) { const value = (input as AllowedInputElement).value as string || input.getAttribute('value'); const name = (input as AllowedInputElement).name || input.getAttribute('name'); if (name) { params[name] = value; } } }); Object.assign(requestData, params); } // Add any extra request params if (requestParams && typeof requestParams === 'object') { Object.assign(requestData, requestParams); } // This is also used for Rubix, so it may not work for your application. const response = await fetch(dataUri, { method: this.method, headers: { 'x-kx-fetch-style': 'zn-data-table', }, signal, credentials: 'same-origin', body: this.method === 'POST' ? JSON.stringify(requestData) : undefined }); if (!response.ok) throw new Error(response.statusText); return response.json(); }, args: () => [this.dataUri, this.requestParams] })"
|
|
5538
|
+
"default": "new Task(this, { task: async ([dataUri, requestParams], {signal}) => { if (dataUri === undefined || this.noInitialLoad && this._initialLoad) { return {rows: [], page: 1, perPage: this.itemsPerPage, total: 0}; } if (this.groupBy) { // we want to load all the data possible so we can group and show multiple tables this.itemsPerPage = 1000; } const requestData: DataRequest = { page: this.page, perPage: this.itemsPerPage, sortColumn: this.sortColumn, sortDirection: this.sortDirection, filter: this.filter, }; // get all inputs that are in the inputs slot and add them to the const inputs = this.hasSlotController.getSlots(ActionSlots.inputs.valueOf()); const params: Record<string, any> = {}; if (inputs) { inputs.forEach((input) => { const allowedInputs = ['zn-input', 'zn-select', 'zn-query-builder', 'zn-multiselect', 'zn-params-select', 'zn-datepicker', 'input', 'select', 'textarea']; if (allowedInputs.includes(input.tagName.toLowerCase())) { const value = (input as AllowedInputElement).value as string || input.getAttribute('value'); const name = (input as AllowedInputElement).name || input.getAttribute('name'); if (name) { params[name] = value; } } }); Object.assign(requestData, params); } // Add any extra request params if (requestParams && typeof requestParams === 'object') { Object.assign(requestData, requestParams); } // This is also used for Rubix, so it may not work for your application. const response = await fetch(dataUri, { method: this.method, headers: { 'x-kx-fetch-style': 'zn-data-table', }, signal, credentials: 'same-origin', body: this.method === 'POST' ? JSON.stringify(requestData) : undefined }); if (!response.ok) throw new Error(response.statusText); return response.json(); }, args: () => [this.dataUri, this.requestParams] })"
|
|
5530
5539
|
},
|
|
5531
5540
|
{
|
|
5532
5541
|
"kind": "field",
|
|
@@ -5537,6 +5546,32 @@
|
|
|
5537
5546
|
"privacy": "private",
|
|
5538
5547
|
"default": "false"
|
|
5539
5548
|
},
|
|
5549
|
+
{
|
|
5550
|
+
"kind": "field",
|
|
5551
|
+
"name": "_expandedRows",
|
|
5552
|
+
"type": {
|
|
5553
|
+
"text": "Set<string>"
|
|
5554
|
+
},
|
|
5555
|
+
"privacy": "private",
|
|
5556
|
+
"default": "new Set()"
|
|
5557
|
+
},
|
|
5558
|
+
{
|
|
5559
|
+
"kind": "field",
|
|
5560
|
+
"name": "_hiddenCells",
|
|
5561
|
+
"type": {
|
|
5562
|
+
"text": "Map<string, Cell[]>"
|
|
5563
|
+
},
|
|
5564
|
+
"privacy": "private",
|
|
5565
|
+
"default": "new Map()"
|
|
5566
|
+
},
|
|
5567
|
+
{
|
|
5568
|
+
"kind": "field",
|
|
5569
|
+
"name": "_secondaryHeaders",
|
|
5570
|
+
"type": {
|
|
5571
|
+
"text": "HeaderConfig[]"
|
|
5572
|
+
},
|
|
5573
|
+
"privacy": "private"
|
|
5574
|
+
},
|
|
5540
5575
|
{
|
|
5541
5576
|
"kind": "field",
|
|
5542
5577
|
"name": "requestParams",
|
|
@@ -5773,6 +5808,67 @@
|
|
|
5773
5808
|
}
|
|
5774
5809
|
]
|
|
5775
5810
|
},
|
|
5811
|
+
{
|
|
5812
|
+
"kind": "method",
|
|
5813
|
+
"name": "hasHiddenColumns",
|
|
5814
|
+
"privacy": "private",
|
|
5815
|
+
"return": {
|
|
5816
|
+
"type": {
|
|
5817
|
+
"text": "boolean"
|
|
5818
|
+
}
|
|
5819
|
+
}
|
|
5820
|
+
},
|
|
5821
|
+
{
|
|
5822
|
+
"kind": "method",
|
|
5823
|
+
"name": "renderExpanderCell",
|
|
5824
|
+
"privacy": "private",
|
|
5825
|
+
"parameters": [
|
|
5826
|
+
{
|
|
5827
|
+
"name": "row",
|
|
5828
|
+
"type": {
|
|
5829
|
+
"text": "Row"
|
|
5830
|
+
}
|
|
5831
|
+
}
|
|
5832
|
+
]
|
|
5833
|
+
},
|
|
5834
|
+
{
|
|
5835
|
+
"kind": "method",
|
|
5836
|
+
"name": "renderDetailsRow",
|
|
5837
|
+
"privacy": "private",
|
|
5838
|
+
"parameters": [
|
|
5839
|
+
{
|
|
5840
|
+
"name": "row",
|
|
5841
|
+
"type": {
|
|
5842
|
+
"text": "Row"
|
|
5843
|
+
}
|
|
5844
|
+
},
|
|
5845
|
+
{
|
|
5846
|
+
"name": "colSpan",
|
|
5847
|
+
"type": {
|
|
5848
|
+
"text": "number"
|
|
5849
|
+
}
|
|
5850
|
+
}
|
|
5851
|
+
]
|
|
5852
|
+
},
|
|
5853
|
+
{
|
|
5854
|
+
"kind": "method",
|
|
5855
|
+
"name": "toggleRowExpansion",
|
|
5856
|
+
"privacy": "private",
|
|
5857
|
+
"parameters": [
|
|
5858
|
+
{
|
|
5859
|
+
"name": "e",
|
|
5860
|
+
"type": {
|
|
5861
|
+
"text": "Event"
|
|
5862
|
+
}
|
|
5863
|
+
},
|
|
5864
|
+
{
|
|
5865
|
+
"name": "row",
|
|
5866
|
+
"type": {
|
|
5867
|
+
"text": "Row"
|
|
5868
|
+
}
|
|
5869
|
+
}
|
|
5870
|
+
]
|
|
5871
|
+
},
|
|
5776
5872
|
{
|
|
5777
5873
|
"kind": "method",
|
|
5778
5874
|
"name": "isRowSelected",
|
|
@@ -5876,6 +5972,24 @@
|
|
|
5876
5972
|
}
|
|
5877
5973
|
]
|
|
5878
5974
|
},
|
|
5975
|
+
{
|
|
5976
|
+
"kind": "method",
|
|
5977
|
+
"name": "sortLocalData",
|
|
5978
|
+
"privacy": "private",
|
|
5979
|
+
"return": {
|
|
5980
|
+
"type": {
|
|
5981
|
+
"text": "Row[]"
|
|
5982
|
+
}
|
|
5983
|
+
},
|
|
5984
|
+
"parameters": [
|
|
5985
|
+
{
|
|
5986
|
+
"name": "rows",
|
|
5987
|
+
"type": {
|
|
5988
|
+
"text": "Row[]"
|
|
5989
|
+
}
|
|
5990
|
+
}
|
|
5991
|
+
]
|
|
5992
|
+
},
|
|
5879
5993
|
{
|
|
5880
5994
|
"kind": "method",
|
|
5881
5995
|
"name": "loadingTable",
|
|
@@ -5931,6 +6045,14 @@
|
|
|
5931
6045
|
"default": "\"asc\"",
|
|
5932
6046
|
"fieldName": "sortDirection"
|
|
5933
6047
|
},
|
|
6048
|
+
{
|
|
6049
|
+
"name": "local-sort",
|
|
6050
|
+
"type": {
|
|
6051
|
+
"text": "boolean"
|
|
6052
|
+
},
|
|
6053
|
+
"default": "false",
|
|
6054
|
+
"fieldName": "localSort"
|
|
6055
|
+
},
|
|
5934
6056
|
{
|
|
5935
6057
|
"name": "filter",
|
|
5936
6058
|
"type": {
|
|
@@ -14127,13 +14249,10 @@
|
|
|
14127
14249
|
},
|
|
14128
14250
|
{
|
|
14129
14251
|
"kind": "field",
|
|
14130
|
-
"name": "
|
|
14131
|
-
"
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
"default": "3",
|
|
14135
|
-
"attribute": "collapse-at-lines",
|
|
14136
|
-
"reflects": true
|
|
14252
|
+
"name": "hasSlotController",
|
|
14253
|
+
"privacy": "private",
|
|
14254
|
+
"readonly": true,
|
|
14255
|
+
"default": "new HasSlotController(this, 'caption', 'date', '[default]', 'snippet', 'footer')"
|
|
14137
14256
|
},
|
|
14138
14257
|
{
|
|
14139
14258
|
"kind": "field",
|
|
@@ -14144,15 +14263,15 @@
|
|
|
14144
14263
|
"privacy": "private",
|
|
14145
14264
|
"default": "false"
|
|
14146
14265
|
},
|
|
14147
|
-
{
|
|
14148
|
-
"kind": "field",
|
|
14149
|
-
"name": "_toggleExpand",
|
|
14150
|
-
"privacy": "private"
|
|
14151
|
-
},
|
|
14152
14266
|
{
|
|
14153
14267
|
"kind": "method",
|
|
14154
|
-
"name": "
|
|
14155
|
-
"privacy": "private"
|
|
14268
|
+
"name": "_toggleExpand",
|
|
14269
|
+
"privacy": "private",
|
|
14270
|
+
"return": {
|
|
14271
|
+
"type": {
|
|
14272
|
+
"text": "void"
|
|
14273
|
+
}
|
|
14274
|
+
}
|
|
14156
14275
|
}
|
|
14157
14276
|
],
|
|
14158
14277
|
"events": [
|
|
@@ -14192,14 +14311,6 @@
|
|
|
14192
14311
|
},
|
|
14193
14312
|
"default": "''",
|
|
14194
14313
|
"fieldName": "body"
|
|
14195
|
-
},
|
|
14196
|
-
{
|
|
14197
|
-
"name": "collapse-at-lines",
|
|
14198
|
-
"type": {
|
|
14199
|
-
"text": "number"
|
|
14200
|
-
},
|
|
14201
|
-
"default": "3",
|
|
14202
|
-
"fieldName": "collapseAtLines"
|
|
14203
14314
|
}
|
|
14204
14315
|
],
|
|
14205
14316
|
"superclass": {
|
|
@@ -26298,7 +26409,7 @@
|
|
|
26298
26409
|
"package": {
|
|
26299
26410
|
"name": "@kubex/zinc",
|
|
26300
26411
|
"description": "A collection of web components for building web applications based off of @shoelace-style/Shoelace",
|
|
26301
|
-
"version": "1.0.
|
|
26412
|
+
"version": "1.0.15",
|
|
26302
26413
|
"author": "",
|
|
26303
26414
|
"license": "MIT"
|
|
26304
26415
|
}
|
|
@@ -698,6 +698,7 @@
|
|
|
698
698
|
{ "name": "data", "values": [] },
|
|
699
699
|
{ "name": "sort-column", "values": [] },
|
|
700
700
|
{ "name": "sort-direction", "values": [] },
|
|
701
|
+
{ "name": "local-sort", "values": [] },
|
|
701
702
|
{ "name": "filter", "values": [] },
|
|
702
703
|
{ "name": "wide-column", "values": [] },
|
|
703
704
|
{ "name": "key", "values": [] },
|
|
@@ -1704,8 +1705,7 @@
|
|
|
1704
1705
|
{ "name": "color", "values": [{ "name": "typeof colors[number]" }] },
|
|
1705
1706
|
{ "name": "caption", "values": [] },
|
|
1706
1707
|
{ "name": "date", "values": [] },
|
|
1707
|
-
{ "name": "body", "values": [] }
|
|
1708
|
-
{ "name": "collapse-at-lines", "values": [] }
|
|
1708
|
+
{ "name": "body", "values": [] }
|
|
1709
1709
|
],
|
|
1710
1710
|
"references": [
|
|
1711
1711
|
{ "name": "Documentation", "url": "https://zinc.style/components/note" }
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@kubex/zinc",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.15",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -1509,6 +1509,10 @@
|
|
|
1509
1509
|
"name": "sort-direction",
|
|
1510
1510
|
"value": { "type": "string", "default": "\"asc\"" }
|
|
1511
1511
|
},
|
|
1512
|
+
{
|
|
1513
|
+
"name": "local-sort",
|
|
1514
|
+
"value": { "type": "boolean", "default": "false" }
|
|
1515
|
+
},
|
|
1512
1516
|
{
|
|
1513
1517
|
"name": "filter",
|
|
1514
1518
|
"value": { "type": "string", "default": "''" }
|
|
@@ -1578,6 +1582,7 @@
|
|
|
1578
1582
|
{ "name": "data", "type": "any" },
|
|
1579
1583
|
{ "name": "sortColumn", "type": "string" },
|
|
1580
1584
|
{ "name": "sortDirection", "type": "string" },
|
|
1585
|
+
{ "name": "localSort", "type": "boolean" },
|
|
1581
1586
|
{ "name": "filter", "type": "string" },
|
|
1582
1587
|
{ "name": "wideColumn", "type": "string" },
|
|
1583
1588
|
{ "name": "key", "type": "string" },
|
|
@@ -3840,11 +3845,7 @@
|
|
|
3840
3845
|
"value": { "type": "string", "default": "''" }
|
|
3841
3846
|
},
|
|
3842
3847
|
{ "name": "date", "value": { "type": "string", "default": "''" } },
|
|
3843
|
-
{ "name": "body", "value": { "type": "string", "default": "''" } }
|
|
3844
|
-
{
|
|
3845
|
-
"name": "collapse-at-lines",
|
|
3846
|
-
"value": { "type": "number", "default": "3" }
|
|
3847
|
-
}
|
|
3848
|
+
{ "name": "body", "value": { "type": "string", "default": "''" } }
|
|
3848
3849
|
],
|
|
3849
3850
|
"slots": [
|
|
3850
3851
|
{ "name": "caption", "description": "The note's caption." },
|
|
@@ -3859,8 +3860,7 @@
|
|
|
3859
3860
|
{ "name": "color", "type": "typeof colors[number]" },
|
|
3860
3861
|
{ "name": "caption", "type": "string" },
|
|
3861
3862
|
{ "name": "date", "type": "string" },
|
|
3862
|
-
{ "name": "body", "type": "string" }
|
|
3863
|
-
{ "name": "collapseAtLines", "type": "number" }
|
|
3863
|
+
{ "name": "body", "type": "string" }
|
|
3864
3864
|
],
|
|
3865
3865
|
"events": [
|
|
3866
3866
|
{
|
package/dist/zn.d.ts
CHANGED
|
@@ -2600,6 +2600,7 @@ declare module "components/data-table/data-table.component" {
|
|
|
2600
2600
|
filterable?: boolean;
|
|
2601
2601
|
hideHeader?: boolean;
|
|
2602
2602
|
hideColumn?: boolean;
|
|
2603
|
+
secondary?: boolean;
|
|
2603
2604
|
}
|
|
2604
2605
|
/**
|
|
2605
2606
|
* @summary Short summary of the component's intended use.
|
|
@@ -2646,6 +2647,7 @@ declare module "components/data-table/data-table.component" {
|
|
|
2646
2647
|
data: any;
|
|
2647
2648
|
sortColumn: string;
|
|
2648
2649
|
sortDirection: string;
|
|
2650
|
+
localSort: boolean;
|
|
2649
2651
|
filter: string;
|
|
2650
2652
|
wideColumn: string;
|
|
2651
2653
|
key: string;
|
|
@@ -2679,6 +2681,9 @@ declare module "components/data-table/data-table.component" {
|
|
|
2679
2681
|
private hasSlotController;
|
|
2680
2682
|
private _dataTask;
|
|
2681
2683
|
private rowHasActions;
|
|
2684
|
+
private _expandedRows;
|
|
2685
|
+
private _hiddenCells;
|
|
2686
|
+
private _secondaryHeaders;
|
|
2682
2687
|
requestParams: Record<string, any>;
|
|
2683
2688
|
refresh(): void;
|
|
2684
2689
|
render(): TemplateResult<1>;
|
|
@@ -2709,6 +2714,10 @@ declare module "components/data-table/data-table.component" {
|
|
|
2709
2714
|
private getTableSortIcon;
|
|
2710
2715
|
private renderCellHeader;
|
|
2711
2716
|
private renderCellBody;
|
|
2717
|
+
private hasHiddenColumns;
|
|
2718
|
+
private renderExpanderCell;
|
|
2719
|
+
private renderDetailsRow;
|
|
2720
|
+
private toggleRowExpansion;
|
|
2712
2721
|
private isRowSelected;
|
|
2713
2722
|
private getRows;
|
|
2714
2723
|
private getSelectedKeys;
|
|
@@ -2718,6 +2727,7 @@ declare module "components/data-table/data-table.component" {
|
|
|
2718
2727
|
private updateDeleteKeys;
|
|
2719
2728
|
private extractComparable;
|
|
2720
2729
|
private sortData;
|
|
2730
|
+
private sortLocalData;
|
|
2721
2731
|
private loadingTable;
|
|
2722
2732
|
private renderActions;
|
|
2723
2733
|
}
|
|
@@ -2867,12 +2877,9 @@ declare module "components/note/note.component" {
|
|
|
2867
2877
|
caption: string;
|
|
2868
2878
|
date: string;
|
|
2869
2879
|
body: string;
|
|
2870
|
-
|
|
2880
|
+
private readonly hasSlotController;
|
|
2871
2881
|
private expanded;
|
|
2872
2882
|
private _toggleExpand;
|
|
2873
|
-
private _measureOverflow;
|
|
2874
|
-
protected firstUpdated(): void;
|
|
2875
|
-
protected updated(): void;
|
|
2876
2883
|
protected render(): unknown;
|
|
2877
2884
|
}
|
|
2878
2885
|
}
|