globuswebcomponents 2.8.12 → 2.9.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.
- package/dist/cjs/gb-action-panel_75.cjs.entry.js +141 -83
- package/dist/cjs/globuscomponents.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/reusableModels-_LRAKnsh.js.map +1 -1
- package/dist/collection/assets/pencil-edit-01.svg +3 -0
- package/dist/collection/components/gb-button/readme.md +13 -0
- package/dist/collection/components/gb-date-picker/gb-date-picker.css +4 -0
- package/dist/collection/components/gb-date-picker/gb-date-picker.js +5 -7
- package/dist/collection/components/gb-date-picker/gb-date-picker.js.map +1 -1
- package/dist/collection/components/gb-input-dropdown/gb-input-dropdown.js +6 -6
- package/dist/collection/components/gb-input-dropdown/gb-input-dropdown.js.map +1 -1
- package/dist/collection/components/gb-pagination/gb-pagination.css +1 -0
- package/dist/collection/components/gb-portal/gb-portal.css +1 -2
- package/dist/collection/components/gb-portal/gb-portal.js +16 -10
- package/dist/collection/components/gb-portal/gb-portal.js.map +1 -1
- package/dist/collection/components/gb-table/gb-table.css +70 -23
- package/dist/collection/components/gb-table/gb-table.js +167 -130
- package/dist/collection/components/gb-table/gb-table.js.map +1 -1
- package/dist/collection/components/gb-table-header/gb-table-header.css +10 -9
- package/dist/collection/components/gb-table-header/gb-table-header.js +7 -5
- package/dist/collection/components/gb-table-header/gb-table-header.js.map +1 -1
- package/dist/collection/components/gb-textarea-input-field/gb-textarea-input-field.js +3 -4
- package/dist/collection/components/gb-textarea-input-field/gb-textarea-input-field.js.map +1 -1
- package/dist/collection/models/reusableModels.js.map +1 -1
- package/dist/components/gb-approval-modal.js +1 -1
- package/dist/components/gb-date-picker.js +1 -1
- package/dist/components/gb-empty-state.js +1 -145
- package/dist/components/gb-empty-state.js.map +1 -1
- package/dist/components/gb-input-dropdown.js +1 -1
- package/dist/components/gb-pagination.js +1 -1
- package/dist/components/gb-portal.js +1 -1
- package/dist/components/gb-table-header.js +1 -1
- package/dist/components/gb-table.js +195 -106
- package/dist/components/gb-table.js.map +1 -1
- package/dist/components/gb-textarea-input-field.js +1 -1
- package/dist/components/p-ByjJN3cS.js +150 -0
- package/dist/components/p-ByjJN3cS.js.map +1 -0
- package/dist/components/{p-B9vWIoWs.js → p-C--0Sicf.js} +8 -8
- package/dist/components/p-C--0Sicf.js.map +1 -0
- package/dist/components/{p-CSka0gDO.js → p-CJelLNTb.js} +5 -6
- package/dist/components/p-CJelLNTb.js.map +1 -0
- package/dist/components/p-cHn6O-Kf.js.map +1 -1
- package/dist/components/{p-BTHdpYQl.js → p-dgGYVBLp.js} +19 -13
- package/dist/components/p-dgGYVBLp.js.map +1 -0
- package/dist/components/{p-CIk9ZD0b.js → p-jEUDScnD.js} +4 -4
- package/dist/components/p-jEUDScnD.js.map +1 -0
- package/dist/components/{p-BHOJKe6j.js → p-q16C1y-8.js} +11 -9
- package/dist/components/p-q16C1y-8.js.map +1 -0
- package/dist/components/{p-BWx-o392.js → p-rzRgniQd.js} +7 -9
- package/dist/components/p-rzRgniQd.js.map +1 -0
- package/dist/docs.json +115 -120
- package/dist/esm/gb-action-panel_75.entry.js +141 -83
- package/dist/esm/globuscomponents.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/reusableModels-cHn6O-Kf.js.map +1 -1
- package/dist/globuscomponents/assets/pencil-edit-01.svg +3 -0
- package/dist/globuscomponents/globuscomponents.esm.js +1 -1
- package/dist/globuscomponents/{p-7024cc46.entry.js → p-087fe238.entry.js} +2 -2
- package/dist/globuscomponents/p-087fe238.entry.js.map +1 -0
- package/dist/globuscomponents/p-cHn6O-Kf.js.map +1 -1
- package/dist/globuscomponents/readme.md +13 -0
- package/dist/types/components/gb-table/gb-table.d.ts +28 -11
- package/dist/types/components.d.ts +44 -40
- package/dist/types/models/reusableModels.d.ts +8 -0
- package/package.json +1 -1
- package/dist/components/p-B9vWIoWs.js.map +0 -1
- package/dist/components/p-BHOJKe6j.js.map +0 -1
- package/dist/components/p-BTHdpYQl.js.map +0 -1
- package/dist/components/p-BWx-o392.js.map +0 -1
- package/dist/components/p-CIk9ZD0b.js.map +0 -1
- package/dist/components/p-CSka0gDO.js.map +0 -1
- package/dist/globuscomponents/p-7024cc46.entry.js.map +0 -1
|
@@ -11,14 +11,7 @@ export class GbTable {
|
|
|
11
11
|
{
|
|
12
12
|
key: 'status',
|
|
13
13
|
label: 'Status',
|
|
14
|
-
|
|
15
|
-
cellProps: row => ({
|
|
16
|
-
color: row.status === 'Completed' ? 'success' : 'error',
|
|
17
|
-
type: 'badge_modern',
|
|
18
|
-
size: 'sm',
|
|
19
|
-
icon: 'dot',
|
|
20
|
-
}),
|
|
21
|
-
cellSlots: row => h("p", null, row.status),
|
|
14
|
+
render: row => (h("gb-badge", { color: row.status === 'Completed' ? 'success' : 'error', type: "badge_modern", size: "sm", icon: "dot" }, h("p", null, row.status))),
|
|
22
15
|
mobile: { position: 'bottom_right' },
|
|
23
16
|
},
|
|
24
17
|
// {
|
|
@@ -36,7 +29,16 @@ export class GbTable {
|
|
|
36
29
|
// },
|
|
37
30
|
];
|
|
38
31
|
this.data = [
|
|
39
|
-
{
|
|
32
|
+
{
|
|
33
|
+
id: '#3001',
|
|
34
|
+
date: 'Jan 1, 2022',
|
|
35
|
+
name: 'Emma Johnson',
|
|
36
|
+
role: 'Frontend Developer',
|
|
37
|
+
level: 'Today',
|
|
38
|
+
customer: 'John Doe',
|
|
39
|
+
amount: '$120.00',
|
|
40
|
+
status: 'Completed',
|
|
41
|
+
},
|
|
40
42
|
{ id: '#3002', date: 'Jan 2, 2022', name: 'Liam Smith', role: 'Backend Developer', level: 'Today', customer: 'Sarah Wilson', amount: '$85.50', status: 'Pending' },
|
|
41
43
|
{ id: '#3003', date: 'Jan 3, 2022', name: 'Olivia Brown', role: 'UI Designer', level: 'Today', customer: 'Michael Lee', amount: '$230.75', status: 'Cancelled' },
|
|
42
44
|
{ id: '#3004', date: 'Jan 4, 2022', name: 'Noah Davis', role: 'DevOps Engineer', level: 'Today', customer: 'Emily Clark', amount: '$59.99', status: 'Completed' },
|
|
@@ -76,33 +78,79 @@ export class GbTable {
|
|
|
76
78
|
showSearch: true,
|
|
77
79
|
showExport: true,
|
|
78
80
|
showRefreshButton: true,
|
|
81
|
+
datePickerMode: 'single',
|
|
79
82
|
};
|
|
80
83
|
this.paginationConfig = {
|
|
84
|
+
paginationMode: 'internal',
|
|
81
85
|
entriesDropdownMenuPosition: 'top',
|
|
86
|
+
currentPage: 1,
|
|
87
|
+
pageSize: 10,
|
|
88
|
+
totalItems: null,
|
|
89
|
+
};
|
|
90
|
+
this.emptyStateConfig = {
|
|
91
|
+
mainText: 'No data available',
|
|
92
|
+
supportingText: 'Try adjusting your filters or check back later.',
|
|
93
|
+
color: 'gray',
|
|
94
|
+
illustrationIcon: 'assets/alert-circle.svg',
|
|
95
|
+
theme: 'light',
|
|
82
96
|
};
|
|
83
97
|
this.showActionsColumn = true;
|
|
84
|
-
this.rowActions = [
|
|
98
|
+
this.rowActions = [
|
|
99
|
+
{ label: '', action: '', icon: 'assets/more-horizontal.svg', type: 'dropdown' },
|
|
100
|
+
// { label: 'View Details', action: 'view_details', icon: 'assets/view.svg', type: 'button' },
|
|
101
|
+
// { label: 'Edit', action: 'edit', icon: 'assets/pencil-edit-01.svg', type: 'button' },
|
|
102
|
+
];
|
|
103
|
+
this.dropdownOptions = [
|
|
104
|
+
{ label: 'View', action: 'view', icon: 'assets/view.svg', disabled: false },
|
|
105
|
+
{ label: 'Edit', action: 'edit', icon: 'assets/pencil-edit-01.svg', disabled: false },
|
|
106
|
+
{ label: 'Delete', action: 'delete', icon: 'assets/delete-02.svg', disabled: true },
|
|
107
|
+
];
|
|
85
108
|
this.stickyFirstColumn = true;
|
|
86
109
|
this.stickyLastColumn = true;
|
|
87
110
|
this.actionsType = 'none';
|
|
88
|
-
this.showCheckbox =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
111
|
+
this.showCheckbox = false;
|
|
112
|
+
// @Prop({ mutable: true }) currentPage?: number = 1;
|
|
113
|
+
// @Prop() pageSize: number = 10;
|
|
114
|
+
// @Prop() totalItems?: number;
|
|
92
115
|
this.internalCurrentPage = 1;
|
|
116
|
+
this.internalPageSize = 10;
|
|
93
117
|
this.openRowIndex = null;
|
|
94
118
|
this.sortDirection = 'asc';
|
|
95
119
|
this.selectedRowIds = new Set();
|
|
96
120
|
this.breakpoint = 'desktop';
|
|
97
121
|
this.isMobile = false;
|
|
122
|
+
this.isScrollable = false;
|
|
98
123
|
this.actionButtonRefs = [];
|
|
124
|
+
this.handlePageChange = ({ detail }) => {
|
|
125
|
+
const { pageNumber, pageSize } = detail;
|
|
126
|
+
if (this.paginationConfig.paginationMode === 'internal') {
|
|
127
|
+
this.internalCurrentPage = pageNumber;
|
|
128
|
+
this.internalPageSize = pageSize;
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
this.pageItemSelected.emit(detail);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
99
134
|
}
|
|
100
|
-
|
|
135
|
+
componentWillRender() {
|
|
101
136
|
this.checkViewport();
|
|
102
|
-
window.addEventListener('resize', this.checkViewport);
|
|
137
|
+
window.addEventListener('resize', this.checkViewport.bind(this));
|
|
138
|
+
}
|
|
139
|
+
componentDidRender() {
|
|
140
|
+
requestAnimationFrame(() => this.checkScrollability());
|
|
103
141
|
}
|
|
104
142
|
checkViewport() {
|
|
105
143
|
this.isMobile = window.innerWidth <= 768;
|
|
144
|
+
this.checkScrollability();
|
|
145
|
+
}
|
|
146
|
+
checkScrollability() {
|
|
147
|
+
if (!this.scrollContainer)
|
|
148
|
+
return;
|
|
149
|
+
const { scrollWidth, clientWidth } = this.scrollContainer;
|
|
150
|
+
const newScrollable = scrollWidth > clientWidth;
|
|
151
|
+
if (newScrollable !== this.isScrollable) {
|
|
152
|
+
this.isScrollable = newScrollable; // only update if different
|
|
153
|
+
}
|
|
106
154
|
}
|
|
107
155
|
handleAction(action, row) {
|
|
108
156
|
this.rowActionClick.emit({ action, row });
|
|
@@ -212,21 +260,22 @@ export class GbTable {
|
|
|
212
260
|
this.selectionChanged.emit(selected);
|
|
213
261
|
}
|
|
214
262
|
get displayedData() {
|
|
215
|
-
if (this.
|
|
263
|
+
if (!this.paginationConfig) {
|
|
216
264
|
return this.sortedData;
|
|
217
265
|
}
|
|
218
|
-
|
|
219
|
-
|
|
266
|
+
if (this.paginationConfig.paginationMode === 'external') {
|
|
267
|
+
return this.sortedData; // parent already paginated it
|
|
268
|
+
}
|
|
269
|
+
const start = (this.internalCurrentPage - 1) * this.internalPageSize;
|
|
270
|
+
const end = start + this.internalPageSize;
|
|
220
271
|
return this.sortedData.slice(start, end);
|
|
221
272
|
}
|
|
222
|
-
|
|
223
|
-
if (this.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
this.pageItemSelected.emit(detail);
|
|
229
|
-
}
|
|
273
|
+
get totalPages() {
|
|
274
|
+
if (!this.paginationConfig)
|
|
275
|
+
return 1;
|
|
276
|
+
const pageSize = this.paginationConfig.paginationMode === 'internal' ? this.internalPageSize : this.paginationConfig.pageSize;
|
|
277
|
+
const totalItems = this.paginationConfig.paginationMode === 'external' ? this.paginationConfig.totalItems : this.sortedData.length;
|
|
278
|
+
return Math.ceil(totalItems / pageSize);
|
|
230
279
|
}
|
|
231
280
|
onDataChange(newValue, _oldValue) {
|
|
232
281
|
if (!newValue)
|
|
@@ -236,7 +285,7 @@ export class GbTable {
|
|
|
236
285
|
onTotalItemsChange(newValue, _oldValue) {
|
|
237
286
|
if (!newValue || newValue < 1)
|
|
238
287
|
return;
|
|
239
|
-
this.totalItems = Number(newValue);
|
|
288
|
+
this.paginationConfig.totalItems = Number(newValue);
|
|
240
289
|
}
|
|
241
290
|
renderHeaderIcons(col) {
|
|
242
291
|
return (h(Fragment, null, col.sortable && (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", style: {
|
|
@@ -258,8 +307,8 @@ export class GbTable {
|
|
|
258
307
|
totalWidth += defaultColWidth;
|
|
259
308
|
}
|
|
260
309
|
});
|
|
261
|
-
const tableStyle = this.columns.length > 5 ? { minWidth: `${totalWidth}px` } : {};
|
|
262
|
-
return (h("div", { class: `table_scroll
|
|
310
|
+
// const tableStyle = this.columns.length > 5 ? { minWidth: `${totalWidth}px` } : {};
|
|
311
|
+
return (h("div", { class: `table_scroll`, ref: el => (this.scrollContainer = el) }, h("table", null, h("thead", null, h("tr", { class: "table_head_row" }, this.showCheckbox && (h("th", { style: { width: '15px' }, class: {
|
|
263
312
|
sticky_left: this.stickyFirstColumn,
|
|
264
313
|
} }, h("gb-checkbox", { type: "checkbox", checked: this.allSelected, indeterminate: this.isIndeterminate, size: "sm", onClick: () => this.toggleAll() }))), this.columns.map((col, index) => {
|
|
265
314
|
var _a;
|
|
@@ -268,13 +317,25 @@ export class GbTable {
|
|
|
268
317
|
table_header: true,
|
|
269
318
|
sticky_left: this.stickyFirstColumn && index === 0,
|
|
270
319
|
sortable: col.sortable,
|
|
320
|
+
has_border: this.isScrollable,
|
|
271
321
|
} }, h("div", { class: `table_head_content align-${align}` }, align === 'right' && h("div", { class: "table_head_icons" }, this.renderHeaderIcons(col)), h("p", { class: `head_text text-xs-medium` }, col.label), align === 'left' && h("div", { class: "table_head_icons" }, this.renderHeaderIcons(col)))));
|
|
272
322
|
}), this.showActionsColumn && (h("th", { class: {
|
|
323
|
+
actions_cell: true,
|
|
273
324
|
sticky_right: this.stickyLastColumn,
|
|
274
|
-
|
|
325
|
+
has_border: this.isScrollable,
|
|
326
|
+
} }, h("div", { class: "empty_div" }))))), h("tbody", null, this.displayedData.map((row, rowIndex) => (h("tr", { class: "table_body" }, this.showCheckbox && (h("td", { class: "table_detail", style: { width: '50px' } }, h("gb-checkbox", { type: "checkbox", checked: this.selectedRowIds.has(row.id), indeterminate: false, size: "sm", onClick: () => this.toggleRow(row) }))), this.columns.map((col, index) => (h(Fragment, null, col.render ? (h("td", { style: { textAlign: col.align || 'left' }, class: `table_detail ${this.stickyFirstColumn && index === 0 ? 'sticky_left' : ''} ${this.isScrollable ? 'has_border' : ''}` }, col.render(row))) : (h("td", { style: { textAlign: col.align || 'left' }, class: `table_detail ${this.stickyFirstColumn && index === 0 ? 'sticky_left' : ''} ${this.isScrollable ? 'has_border' : ''}` }, this.renderCell(col, row)))))), this.showActionsColumn && (h("td", { class: { table_detail: true, actions_cell: true, sticky_right: this.stickyLastColumn, has_border: this.isScrollable }, style: { width: '50px' } }, h(Fragment, null, h("div", { class: "action_buttons" }, this.rowActions.map(action => (h(Fragment, null, action.type === 'dropdown' ? (h("gb-button", { id: `gb-table-trigger-${rowIndex}`, ref: el => (this.actionButtonRefs[rowIndex] = el), class: "dropdown_button", hierarchy: "tertiary_gray", size: "sm", icon: "only", iconLeading: true, iconLeadingSwap: "assets/more-horizontal.svg", onClick: () => this.toggleDropdown(rowIndex) })) : (h("gb-button", { hierarchy: "tertiary_gray", size: "sm", icon: "only", iconLeading: true, iconLeadingSwap: action.icon, onClick: () => this.handleAction(action.action, row) })))))), h(Fragment, null, this.openRowIndex === rowIndex && (h("gb-portal", { "anchor-id": `gb-table-trigger-${rowIndex}`, placement: "bottom-end", anchorEl: this.currentAnchorEl, open: true }, h("div", { class: "dropdown_wrapper" }, this.dropdownOptions.map(action => (
|
|
327
|
+
// <gb-input-dropdown-menu-item
|
|
328
|
+
// type="default"
|
|
329
|
+
// state={action.disabled ? StateEnum.Disabled : StateEnum.Default}
|
|
330
|
+
// icon-leading={action.icon ? true : false}
|
|
331
|
+
// icon-leading-swap={action.icon}
|
|
332
|
+
// >
|
|
333
|
+
// <p slot="name">{action.label}</p>
|
|
334
|
+
// </gb-input-dropdown-menu-item>
|
|
335
|
+
h("gb-dropdown-items-with-shortcut", { icon: action.icon ? true : false, state: action.disabled ? StateEnum.Disabled : StateEnum.Default, label: action.label, "icon-src": action.icon, onClick: () => {
|
|
275
336
|
this.handleAction(action.action, row);
|
|
276
337
|
this.openRowIndex = null;
|
|
277
|
-
} }
|
|
338
|
+
} })))))))))))))))));
|
|
278
339
|
}
|
|
279
340
|
validateMobilePositions() {
|
|
280
341
|
const positions = this.columns.map(c => { var _a; return (_a = c.mobile) === null || _a === void 0 ? void 0 : _a.position; }).filter(Boolean);
|
|
@@ -289,18 +350,20 @@ export class GbTable {
|
|
|
289
350
|
const topRight = this.columns.find(c => { var _a; return ((_a = c.mobile) === null || _a === void 0 ? void 0 : _a.position) === 'top_right'; });
|
|
290
351
|
const bottomLeft = this.columns.find(c => { var _a; return ((_a = c.mobile) === null || _a === void 0 ? void 0 : _a.position) === 'bottom_left'; });
|
|
291
352
|
const bottomRight = this.columns.find(c => { var _a; return ((_a = c.mobile) === null || _a === void 0 ? void 0 : _a.position) === 'bottom_right'; });
|
|
292
|
-
return (h("div", { class: "mobile-card" }, h("div", { class: "mobile-row mobile-top" }, h("div", { class: "mobile-cell" }, topLeft &&
|
|
353
|
+
return (h("div", { class: "mobile_card_wrapper", style: { paddingLeft: this.showCheckbox ? 'var(--spacing-4)' : '' } }, this.showCheckbox && (h("gb-checkbox", { style: { paddingTop: 'var(--spacing-6)' }, type: "checkbox", checked: this.selectedRowIds.has(row.id), indeterminate: false, size: "sm", onClick: () => this.toggleRow(row) })), h("div", { class: "mobile-card" }, h("div", { class: "mobile-row mobile-top" }, h("div", { class: "mobile-cell" }, h("p", { class: "top_left_text text-md-regular" }, topLeft && row[topLeft.key])), h("div", { class: "mobile-cell right" }, h("p", { class: "top_right_text text-md-semi-bold" }, topRight && row[topRight.key]))), h("div", { class: "mobile-row mobile-bottom" }, h("div", { class: "mobile-cell" }, h("p", { class: "bottom_left_text text-sm-regular" }, bottomLeft && row[bottomLeft.key])), h("div", { class: "mobile-cell right" }, bottomRight && this.renderCell(bottomRight, row))))));
|
|
293
354
|
})));
|
|
294
355
|
}
|
|
295
|
-
emitSearchValue(
|
|
296
|
-
this.inputValueChanged.emit(detail);
|
|
356
|
+
emitSearchValue(detail) {
|
|
357
|
+
this.inputValueChanged.emit(detail.detail);
|
|
358
|
+
}
|
|
359
|
+
emitDateChange(detail) {
|
|
360
|
+
this.dateChange.emit(detail.detail);
|
|
297
361
|
}
|
|
298
362
|
disconnectedCallback() {
|
|
299
363
|
window.removeEventListener('resize', this.checkViewport);
|
|
300
364
|
}
|
|
301
365
|
render() {
|
|
302
|
-
|
|
303
|
-
return (h("div", { key: '499bac31da3885b57d9469666f921c78978ec8ff', class: `table_wrapper` }, h("gb-table-header", { key: 'e629b21f83e27889f453f77cf0e2402eb5f552df', "table-heading": this.tableHeaderConfig.tableHeading, "table-heading-label": this.tableHeaderConfig.tableHeadingLabel, "show-search": this.tableHeaderConfig.showSearch, "show-date-filter": this.tableHeaderConfig.showDateFilter, "show-filter": this.tableHeaderConfig.showFilter, "show-export": this.tableHeaderConfig.showExport, "show-column-options": this.tableHeaderConfig.showColumnOptions, "show-refresh-button": this.tableHeaderConfig.showRefreshButton, onInputValueChanged: this.emitSearchValue.bind(this) }), h(Fragment, null, this.isMobile ? this.renderMobileView() : this.renderDesktopView()), h("gb-pagination", { key: 'e808a7c942fefd7b1c70707315a50926b841aee5', "entries-dropdown-menu-position": this.paginationConfig.entriesDropdownMenuPosition, "page-size": this.pageSize, "current-page": this.paginationMode === 'internal' ? this.internalCurrentPage : this.currentPage, "total-pages": totalPages, onPageItemSelected: this.handlePageChange.bind(this) })));
|
|
366
|
+
return (h("div", { key: 'd393c1812e06818c2a0dd266cfb8f1c849971b2c', class: `table_wrapper` }, h("gb-table-header", { key: '2398b782d79e6afccdd3047eb8b37cf23efbcbff', mode: this.tableHeaderConfig.datePickerMode, "table-heading": this.tableHeaderConfig.tableHeading, "table-heading-label": this.tableHeaderConfig.tableHeadingLabel, "show-search": this.tableHeaderConfig.showSearch, "show-date-filter": this.tableHeaderConfig.showDateFilter, "show-filter": this.tableHeaderConfig.showFilter, "show-export": this.tableHeaderConfig.showExport, "show-column-options": this.tableHeaderConfig.showColumnOptions, "show-refresh-button": this.tableHeaderConfig.showRefreshButton, onInputValueChanged: this.emitSearchValue.bind(this), onDateChange: this.emitDateChange.bind(this) }), this.data.length === 0 ? (h("div", { class: "empty_state_wrapper" }, h("gb-empty-state", { size: "sm", "main-text": this.emptyStateConfig.mainText, "supporting-text": this.emptyStateConfig.supportingText, color: this.emptyStateConfig.color, theme: this.emptyStateConfig.theme, "primary-button-icon-leading-swap": "assets/plus.svg", "illustration-icon": this.emptyStateConfig.illustrationIcon, background: true, "background-type": "grid", icon: "illustration", "illustration-style": "cloud" }))) : (h(Fragment, null, this.isMobile ? this.renderMobileView() : this.renderDesktopView())), this.paginationConfig && this.data.length > 0 && (h("gb-pagination", { key: '67b71bebffe1f1563520dd5eaac8cf0ffac6368a', "entries-dropdown-menu-position": this.paginationConfig.entriesDropdownMenuPosition, "page-size": this.paginationConfig.pageSize, "current-page": this.paginationConfig.paginationMode === 'internal' ? this.internalCurrentPage : this.paginationConfig.currentPage, "total-pages": this.totalPages, onPageItemSelected: this.handlePageChange.bind(this) }))));
|
|
304
367
|
}
|
|
305
368
|
static get is() { return "gb-table"; }
|
|
306
369
|
static get encapsulation() { return "shadow"; }
|
|
@@ -338,7 +401,7 @@ export class GbTable {
|
|
|
338
401
|
},
|
|
339
402
|
"getter": false,
|
|
340
403
|
"setter": false,
|
|
341
|
-
"defaultValue": "[\r\n { key: 'id', label: '#', width: '70px', sortable: true, sortType: 'string', mobile: { position: 'top_left' } },\r\n { key: 'date', label: 'Date', mobile: { position: 'bottom_left' } },\r\n { key: 'name', label: 'Name', sortable: true, sortType: 'string', helpIcon: true, mobile: { position: 'top_right' } },\r\n { key: 'role', label: 'Role' },\r\n { key: 'amount', label: 'Amount', align: 'right', sortable: true, sortType: 'number' },\r\n {\r\n key: 'status',\r\n label: 'Status',\r\n
|
|
404
|
+
"defaultValue": "[\r\n { key: 'id', label: '#', width: '70px', sortable: true, sortType: 'string', mobile: { position: 'top_left' } },\r\n { key: 'date', label: 'Date', mobile: { position: 'bottom_left' } },\r\n { key: 'name', label: 'Name', sortable: true, sortType: 'string', helpIcon: true, mobile: { position: 'top_right' } },\r\n { key: 'role', label: 'Role' },\r\n { key: 'amount', label: 'Amount', align: 'right', sortable: true, sortType: 'number' },\r\n {\r\n key: 'status',\r\n label: 'Status',\r\n render: row => (\r\n <gb-badge color={row.status === 'Completed' ? 'success' : 'error'} type=\"badge_modern\" size=\"sm\" icon=\"dot\">\r\n <p>{row.status}</p>\r\n </gb-badge>\r\n ),\r\n mobile: { position: 'bottom_right' },\r\n },\r\n // {\r\n // key: '',\r\n // label: '',\r\n // cellComponent: 'gb-button',\r\n // width: '50px',\r\n // cellProps: () => ({\r\n // hierarchy: 'tertiary_gray',\r\n // size: 'sm',\r\n // icon: 'only',\r\n // iconLeading: true,\r\n // iconLeadingSwap: 'assets/more-horizontal.svg',\r\n // }),\r\n // },\r\n ]"
|
|
342
405
|
},
|
|
343
406
|
"data": {
|
|
344
407
|
"type": "unknown",
|
|
@@ -356,14 +419,14 @@ export class GbTable {
|
|
|
356
419
|
},
|
|
357
420
|
"getter": false,
|
|
358
421
|
"setter": false,
|
|
359
|
-
"defaultValue": "[\r\n {
|
|
422
|
+
"defaultValue": "[\r\n {\r\n id: '#3001',\r\n date: 'Jan 1, 2022',\r\n name: 'Emma Johnson',\r\n role: 'Frontend Developer',\r\n level: 'Today',\r\n customer: 'John Doe',\r\n amount: '$120.00',\r\n status: 'Completed',\r\n },\r\n { id: '#3002', date: 'Jan 2, 2022', name: 'Liam Smith', role: 'Backend Developer', level: 'Today', customer: 'Sarah Wilson', amount: '$85.50', status: 'Pending' },\r\n { id: '#3003', date: 'Jan 3, 2022', name: 'Olivia Brown', role: 'UI Designer', level: 'Today', customer: 'Michael Lee', amount: '$230.75', status: 'Cancelled' },\r\n { id: '#3004', date: 'Jan 4, 2022', name: 'Noah Davis', role: 'DevOps Engineer', level: 'Today', customer: 'Emily Clark', amount: '$59.99', status: 'Completed' },\r\n { id: '#3005', date: 'Jan 5, 2022', name: 'Ava Martinez', role: 'Product Manager', level: 'Today', customer: 'Daniel Harris', amount: '$410.00', status: 'Pending' },\r\n { id: '#3006', date: 'Jan 6, 2022', name: 'William Garcia', role: 'QA Engineer', level: 'Today', customer: 'Sophia Lewis', amount: '$150.20', status: 'Completed' },\r\n { id: '#3007', date: 'Jan 7, 2022', name: 'Isabella Rodriguez', role: 'Business Analyst', level: 'Today', customer: 'James Walker', amount: '$78.40', status: 'Pending' },\r\n { id: '#3008', date: 'Jan 8, 2022', name: 'James Wilson', role: 'Fullstack Developer', level: 'Today', customer: 'Mia Hall', amount: '$300.00', status: 'Completed' },\r\n { id: '#3009', date: 'Jan 9, 2022', name: 'Sophia Anderson', role: 'UX Researcher', level: 'Today', customer: 'Benjamin Allen', amount: '$95.60', status: 'Cancelled' },\r\n { id: '#3010', date: 'Jan 10, 2022', name: 'Benjamin Thomas', role: 'Mobile Developer', level: 'Today', customer: 'Charlotte Young', amount: '$210.10', status: 'Completed' },\r\n { id: '#3011', date: 'Jan 11, 2022', name: 'Mia Taylor', role: 'Data Analyst', level: 'Today', customer: 'Lucas King', amount: '$180.00', status: 'Pending' },\r\n { id: '#3012', date: 'Jan 12, 2022', name: 'Lucas Moore', role: 'Cloud Engineer', level: 'Today', customer: 'Amelia Scott', amount: '$420.75', status: 'Completed' },\r\n { id: '#3013', date: 'Jan 13, 2022', name: 'Charlotte Jackson', role: 'Security Engineer', level: 'Today', customer: 'Elijah Green', amount: '$65.90', status: 'Cancelled' },\r\n { id: '#3014', date: 'Jan 14, 2022', name: 'Elijah Martin', role: 'Technical Lead', level: 'Today', customer: 'Harper Adams', amount: '$510.30', status: 'Completed' },\r\n { id: '#3015', date: 'Jan 15, 2022', name: 'Amelia Lee', role: 'Scrum Master', level: 'Today', customer: 'Alexander Baker', amount: '$99.99', status: 'Pending' },\r\n { id: '#3016', date: 'Jan 16, 2022', name: 'Harper Perez', role: 'Frontend Developer', level: 'Today', customer: 'Ella Nelson', amount: '$275.45', status: 'Completed' },\r\n { id: '#3017', date: 'Jan 17, 2022', name: 'Alexander White', role: 'Backend Developer', level: 'Today', customer: 'Matthew Carter', amount: '$340.00', status: 'Pending' },\r\n { id: '#3018', date: 'Jan 18, 2022', name: 'Ella Harris', role: 'UI Designer', level: 'Today', customer: 'Avery Mitchell', amount: '$88.80', status: 'Completed' },\r\n { id: '#3019', date: 'Jan 19, 2022', name: 'Matthew Clark', role: 'DevOps Engineer', level: 'Today', customer: 'Evelyn Perez', amount: '$190.25', status: 'Cancelled' },\r\n { id: '#3020', date: 'Jan 20, 2022', name: 'Avery Lewis', role: 'Product Manager', level: 'Today', customer: 'Henry Roberts', amount: '$600.00', status: 'Completed' },\r\n { id: '#3021', date: 'Jan 21, 2022', name: 'Evelyn Walker', role: 'QA Engineer', level: 'Today', customer: 'Luna Turner', amount: '$72.30', status: 'Pending' },\r\n { id: '#3022', date: 'Jan 22, 2022', name: 'Henry Hall', role: 'Business Analyst', level: 'Today', customer: 'Jack Phillips', amount: '$310.40', status: 'Completed' },\r\n { id: '#3023', date: 'Jan 23, 2022', name: 'Luna Allen', role: 'Fullstack Developer', level: 'Today', customer: 'Sofia Campbell', amount: '$145.00', status: 'Cancelled' },\r\n { id: '#3024', date: 'Jan 24, 2022', name: 'Jack Young', role: 'UX Researcher', level: 'Today', customer: 'David Parker', amount: '$260.70', status: 'Completed' },\r\n { id: '#3025', date: 'Jan 25, 2022', name: 'Sofia Hernandez', role: 'Mobile Developer', level: 'Today', customer: 'Grace Evans', amount: '$89.10', status: 'Pending' },\r\n { id: '#3026', date: 'Jan 26, 2022', name: 'David King', role: 'Data Analyst', level: 'Today', customer: 'Samuel Edwards', amount: '$410.90', status: 'Completed' },\r\n { id: '#3027', date: 'Jan 27, 2022', name: 'Grace Wright', role: 'Cloud Engineer', level: 'Today', customer: 'Chloe Collins', amount: '$130.55', status: 'Cancelled' },\r\n { id: '#3028', date: 'Jan 28, 2022', name: 'Samuel Scott', role: 'Security Engineer', level: 'Today', customer: 'Victoria Stewart', amount: '$555.00', status: 'Completed' },\r\n { id: '#3029', date: 'Jan 29, 2022', name: 'Chloe Green', role: 'Technical Lead', level: 'Today', customer: 'Nathan Morris', amount: '$205.25', status: 'Pending' },\r\n { id: '#3030', date: 'Jan 30, 2022', name: 'Nathan Adams', role: 'Scrum Master', level: 'Today', customer: 'Zoe Rogers', amount: '$320.80', status: 'Completed' },\r\n ]"
|
|
360
423
|
},
|
|
361
424
|
"tableHeaderConfig": {
|
|
362
425
|
"type": "unknown",
|
|
363
426
|
"mutable": false,
|
|
364
427
|
"complexType": {
|
|
365
|
-
"original": "{\r\n tableHeading: boolean;\r\n tableHeadingLabel: string;\r\n showDateFilter: boolean;\r\n showFilter: boolean;\r\n showColumnOptions: boolean;\r\n showSearch: boolean;\r\n showExport: boolean;\r\n showRefreshButton: boolean;\r\n }",
|
|
366
|
-
"resolved": "{ tableHeading: boolean; tableHeadingLabel: string; showDateFilter: boolean; showFilter: boolean; showColumnOptions: boolean; showSearch: boolean; showExport: boolean; showRefreshButton: boolean; }",
|
|
428
|
+
"original": "{\r\n tableHeading: boolean;\r\n tableHeadingLabel: string;\r\n showDateFilter: boolean;\r\n showFilter: boolean;\r\n showColumnOptions: boolean;\r\n showSearch: boolean;\r\n showExport: boolean;\r\n showRefreshButton: boolean;\r\n datePickerMode: 'single' | 'range';\r\n }",
|
|
429
|
+
"resolved": "{ tableHeading: boolean; tableHeadingLabel: string; showDateFilter: boolean; showFilter: boolean; showColumnOptions: boolean; showSearch: boolean; showExport: boolean; showRefreshButton: boolean; datePickerMode: \"single\" | \"range\"; }",
|
|
367
430
|
"references": {}
|
|
368
431
|
},
|
|
369
432
|
"required": false,
|
|
@@ -374,14 +437,14 @@ export class GbTable {
|
|
|
374
437
|
},
|
|
375
438
|
"getter": false,
|
|
376
439
|
"setter": false,
|
|
377
|
-
"defaultValue": "{\r\n tableHeading: false,\r\n tableHeadingLabel: 'Suspicious outflows',\r\n showDateFilter: true,\r\n showFilter: true,\r\n showColumnOptions: true,\r\n showSearch: true,\r\n showExport: true,\r\n showRefreshButton: true,\r\n }"
|
|
440
|
+
"defaultValue": "{\r\n tableHeading: false,\r\n tableHeadingLabel: 'Suspicious outflows',\r\n showDateFilter: true,\r\n showFilter: true,\r\n showColumnOptions: true,\r\n showSearch: true,\r\n showExport: true,\r\n showRefreshButton: true,\r\n datePickerMode: 'single',\r\n }"
|
|
378
441
|
},
|
|
379
442
|
"paginationConfig": {
|
|
380
|
-
"type": "
|
|
443
|
+
"type": "unknown",
|
|
381
444
|
"mutable": false,
|
|
382
445
|
"complexType": {
|
|
383
|
-
"original": "
|
|
384
|
-
"resolved": "
|
|
446
|
+
"original": "{\r\n paginationMode: 'internal' | 'external';\r\n entriesDropdownMenuPosition: 'top' | 'bottom';\r\n currentPage?: number;\r\n pageSize?: number;\r\n totalItems?: number;\r\n }",
|
|
447
|
+
"resolved": "{ paginationMode: \"external\" | \"internal\"; entriesDropdownMenuPosition: \"top\" | \"bottom\"; currentPage?: number; pageSize?: number; totalItems?: number; }",
|
|
385
448
|
"references": {}
|
|
386
449
|
},
|
|
387
450
|
"required": false,
|
|
@@ -392,9 +455,36 @@ export class GbTable {
|
|
|
392
455
|
},
|
|
393
456
|
"getter": false,
|
|
394
457
|
"setter": false,
|
|
395
|
-
"
|
|
396
|
-
|
|
397
|
-
|
|
458
|
+
"defaultValue": "{\r\n paginationMode: 'internal',\r\n entriesDropdownMenuPosition: 'top',\r\n currentPage: 1,\r\n pageSize: 10,\r\n totalItems: null,\r\n }"
|
|
459
|
+
},
|
|
460
|
+
"emptyStateConfig": {
|
|
461
|
+
"type": "unknown",
|
|
462
|
+
"mutable": false,
|
|
463
|
+
"complexType": {
|
|
464
|
+
"original": "{ mainText: string; supportingText?: string; color?: GeneralColors; illustrationIcon?: string; theme?: ThemeTypes; primaryButtonIcon?: string }",
|
|
465
|
+
"resolved": "{ mainText: string; supportingText?: string; color?: GeneralColors; illustrationIcon?: string; theme?: ThemeTypes; primaryButtonIcon?: string; }",
|
|
466
|
+
"references": {
|
|
467
|
+
"GeneralColors": {
|
|
468
|
+
"location": "import",
|
|
469
|
+
"path": "../../models/reusableModels",
|
|
470
|
+
"id": "src/models/reusableModels.ts::GeneralColors"
|
|
471
|
+
},
|
|
472
|
+
"ThemeTypes": {
|
|
473
|
+
"location": "import",
|
|
474
|
+
"path": "../../models/reusableModels",
|
|
475
|
+
"id": "src/models/reusableModels.ts::ThemeTypes"
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
"required": false,
|
|
480
|
+
"optional": false,
|
|
481
|
+
"docs": {
|
|
482
|
+
"tags": [],
|
|
483
|
+
"text": ""
|
|
484
|
+
},
|
|
485
|
+
"getter": false,
|
|
486
|
+
"setter": false,
|
|
487
|
+
"defaultValue": "{\r\n mainText: 'No data available',\r\n supportingText: 'Try adjusting your filters or check back later.',\r\n color: 'gray',\r\n illustrationIcon: 'assets/alert-circle.svg',\r\n theme: 'light',\r\n }"
|
|
398
488
|
},
|
|
399
489
|
"showActionsColumn": {
|
|
400
490
|
"type": "boolean",
|
|
@@ -431,6 +521,30 @@ export class GbTable {
|
|
|
431
521
|
}
|
|
432
522
|
},
|
|
433
523
|
"required": false,
|
|
524
|
+
"optional": false,
|
|
525
|
+
"docs": {
|
|
526
|
+
"tags": [],
|
|
527
|
+
"text": ""
|
|
528
|
+
},
|
|
529
|
+
"getter": false,
|
|
530
|
+
"setter": false,
|
|
531
|
+
"defaultValue": "[\r\n { label: '', action: '', icon: 'assets/more-horizontal.svg', type: 'dropdown' },\r\n // { label: 'View Details', action: 'view_details', icon: 'assets/view.svg', type: 'button' },\r\n // { label: 'Edit', action: 'edit', icon: 'assets/pencil-edit-01.svg', type: 'button' },\r\n ]"
|
|
532
|
+
},
|
|
533
|
+
"dropdownOptions": {
|
|
534
|
+
"type": "unknown",
|
|
535
|
+
"mutable": false,
|
|
536
|
+
"complexType": {
|
|
537
|
+
"original": "DropdownOption[]",
|
|
538
|
+
"resolved": "DropdownOption[]",
|
|
539
|
+
"references": {
|
|
540
|
+
"DropdownOption": {
|
|
541
|
+
"location": "import",
|
|
542
|
+
"path": "../../models/reusableModels",
|
|
543
|
+
"id": "src/models/reusableModels.ts::DropdownOption"
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
"required": false,
|
|
434
548
|
"optional": true,
|
|
435
549
|
"docs": {
|
|
436
550
|
"tags": [],
|
|
@@ -438,7 +552,7 @@ export class GbTable {
|
|
|
438
552
|
},
|
|
439
553
|
"getter": false,
|
|
440
554
|
"setter": false,
|
|
441
|
-
"defaultValue": "[{ label: 'View', action: 'view', disabled: true }]"
|
|
555
|
+
"defaultValue": "[\r\n { label: 'View', action: 'view', icon: 'assets/view.svg', disabled: false },\r\n { label: 'Edit', action: 'edit', icon: 'assets/pencil-edit-01.svg', disabled: false },\r\n { label: 'Delete', action: 'delete', icon: 'assets/delete-02.svg', disabled: true },\r\n ]"
|
|
442
556
|
},
|
|
443
557
|
"stickyFirstColumn": {
|
|
444
558
|
"type": "boolean",
|
|
@@ -518,98 +632,21 @@ export class GbTable {
|
|
|
518
632
|
"setter": false,
|
|
519
633
|
"reflect": false,
|
|
520
634
|
"attribute": "show-checkbox",
|
|
521
|
-
"defaultValue": "
|
|
522
|
-
},
|
|
523
|
-
"paginationMode": {
|
|
524
|
-
"type": "string",
|
|
525
|
-
"mutable": false,
|
|
526
|
-
"complexType": {
|
|
527
|
-
"original": "'internal' | 'external'",
|
|
528
|
-
"resolved": "\"external\" | \"internal\"",
|
|
529
|
-
"references": {}
|
|
530
|
-
},
|
|
531
|
-
"required": false,
|
|
532
|
-
"optional": false,
|
|
533
|
-
"docs": {
|
|
534
|
-
"tags": [],
|
|
535
|
-
"text": ""
|
|
536
|
-
},
|
|
537
|
-
"getter": false,
|
|
538
|
-
"setter": false,
|
|
539
|
-
"reflect": false,
|
|
540
|
-
"attribute": "pagination-mode",
|
|
541
|
-
"defaultValue": "'internal'"
|
|
542
|
-
},
|
|
543
|
-
"currentPage": {
|
|
544
|
-
"type": "number",
|
|
545
|
-
"mutable": true,
|
|
546
|
-
"complexType": {
|
|
547
|
-
"original": "number",
|
|
548
|
-
"resolved": "number",
|
|
549
|
-
"references": {}
|
|
550
|
-
},
|
|
551
|
-
"required": false,
|
|
552
|
-
"optional": true,
|
|
553
|
-
"docs": {
|
|
554
|
-
"tags": [],
|
|
555
|
-
"text": ""
|
|
556
|
-
},
|
|
557
|
-
"getter": false,
|
|
558
|
-
"setter": false,
|
|
559
|
-
"reflect": false,
|
|
560
|
-
"attribute": "current-page",
|
|
561
|
-
"defaultValue": "1"
|
|
562
|
-
},
|
|
563
|
-
"pageSize": {
|
|
564
|
-
"type": "number",
|
|
565
|
-
"mutable": false,
|
|
566
|
-
"complexType": {
|
|
567
|
-
"original": "number",
|
|
568
|
-
"resolved": "number",
|
|
569
|
-
"references": {}
|
|
570
|
-
},
|
|
571
|
-
"required": false,
|
|
572
|
-
"optional": false,
|
|
573
|
-
"docs": {
|
|
574
|
-
"tags": [],
|
|
575
|
-
"text": ""
|
|
576
|
-
},
|
|
577
|
-
"getter": false,
|
|
578
|
-
"setter": false,
|
|
579
|
-
"reflect": false,
|
|
580
|
-
"attribute": "page-size",
|
|
581
|
-
"defaultValue": "10"
|
|
582
|
-
},
|
|
583
|
-
"totalItems": {
|
|
584
|
-
"type": "number",
|
|
585
|
-
"mutable": false,
|
|
586
|
-
"complexType": {
|
|
587
|
-
"original": "number",
|
|
588
|
-
"resolved": "number",
|
|
589
|
-
"references": {}
|
|
590
|
-
},
|
|
591
|
-
"required": false,
|
|
592
|
-
"optional": true,
|
|
593
|
-
"docs": {
|
|
594
|
-
"tags": [],
|
|
595
|
-
"text": ""
|
|
596
|
-
},
|
|
597
|
-
"getter": false,
|
|
598
|
-
"setter": false,
|
|
599
|
-
"reflect": false,
|
|
600
|
-
"attribute": "total-items"
|
|
635
|
+
"defaultValue": "false"
|
|
601
636
|
}
|
|
602
637
|
};
|
|
603
638
|
}
|
|
604
639
|
static get states() {
|
|
605
640
|
return {
|
|
606
641
|
"internalCurrentPage": {},
|
|
642
|
+
"internalPageSize": {},
|
|
607
643
|
"openRowIndex": {},
|
|
608
644
|
"sortKey": {},
|
|
609
645
|
"sortDirection": {},
|
|
610
646
|
"selectedRowIds": {},
|
|
611
647
|
"breakpoint": {},
|
|
612
|
-
"isMobile": {}
|
|
648
|
+
"isMobile": {},
|
|
649
|
+
"isScrollable": {}
|
|
613
650
|
};
|
|
614
651
|
}
|
|
615
652
|
static get events() {
|