Skip to content

Commit

Permalink
Merge pull request #2017 from smeup/revert-2012-kup-data-table-actions
Browse files Browse the repository at this point in the history
Revert "feat: Kup data table actions with commands integrated"
  • Loading branch information
delbono-smeup authored Aug 12, 2024
2 parents 7a06af4 + 5a03202 commit 53be2ef
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 714 deletions.
330 changes: 0 additions & 330 deletions packages/ketchup/src/assets/data-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1356,286 +1356,6 @@ const mockedRows = [
},
];

const mockedColumnsActions = [
{
decimals: 0,
isEditable: false,
isKey: false,
name: 'X$RIGA',
obj: {
k: '',
p: '',
t: 'NR',
},
title: 'ROW',
tooltip: false,
},
{
isEditable: false,
isKey: false,
name: 'X$ARTI',
title: 'ITEM',
tooltip: false,
},
{
decimals: 0,
isEditable: false,
isKey: false,
name: 'X$QTA',
obj: {
k: '',
p: '',
t: 'NR',
},
title: 'QTY\nCART',
tooltip: false,
},
{
isEditable: false,
isKey: false,
name: 'X$CFG',
obj: {
k: '',
p: 'COD_VER',
t: 'VO',
},
size: '70px',
title: 'CFG',
tooltip: false,
},
];

const mockedRowsActions = [
{
cells: {
X$RIGA: {
data: {
size: 4,
helperEnabled: false,
maxLength: 4,
integers: 4,
},
isEditable: false,
obj: {
k: '1',
p: '',
t: 'NR',
},
value: '1',
displayedValue: '1',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
X$CFG: {
isEditable: false,
obj: {
k: '000050',
p: 'COD_VER',
t: 'VO',
},
value: '000050',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
X$ARTI: {
data: {
size: 80,
helperEnabled: false,
hiddenCounter: true,
maxLength: 80,
},
isEditable: false,
obj: {
k: 'MAP000061 PRESSED TUBE PTFE G400 50x25x300',
p: '',
t: '',
},
value: 'MAP000061 PRESSED TUBE PTFE G400 50x25x300',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
X$QTA: {
data: {
size: 15,
helperEnabled: false,
maxLength: 15,
integers: 15,
},
isEditable: false,
obj: {
k: '2',
p: '',
t: 'NR',
},
value: '2',
displayedValue: '2',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
},
cssClass: 'clickable',
id: '0',
object: '',
readOnly: true,
},
{
cells: {
X$RIGA: {
data: {
size: 4,
helperEnabled: false,
maxLength: 4,
integers: 4,
},
isEditable: false,
obj: {
k: '2',
p: '',
t: 'NR',
},
value: '2',
displayedValue: '2',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
X$CFG: {
isEditable: false,
obj: {
k: '000051',
p: 'COD_VER',
t: 'VO',
},
value: '000051',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
X$ARTI: {
data: {
size: 80,
helperEnabled: false,
hiddenCounter: true,
maxLength: 80,
},
isEditable: false,
obj: {
k: 'MAP000014 PRESSED TUBE PTFE G200 25x25x200',
p: '',
t: '',
},
value: 'MAP000014 PRESSED TUBE PTFE G200 25x25x200',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
X$QTA: {
data: {
size: 15,
helperEnabled: false,
maxLength: 15,
integers: 15,
},
isEditable: false,
obj: {
k: '5',
p: '',
t: 'NR',
},
value: '5',
displayedValue: '5',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
},
cssClass: 'clickable',
id: '1',
object: '',
readOnly: true,
},
{
cells: {
X$RIGA: {
data: {
size: 4,
helperEnabled: false,
maxLength: 4,
integers: 4,
},
isEditable: false,
obj: {
k: '3',
p: '',
t: 'NR',
},
value: '3',
displayedValue: '3',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
X$CFG: {
isEditable: false,
obj: {
k: '000052',
p: 'COD_VER',
t: 'VO',
},
value: '000052',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
X$ARTI: {
data: {
size: 80,
helperEnabled: false,
hiddenCounter: true,
maxLength: 80,
},
isEditable: false,
obj: {
k: 'MEP000001 METALLIC PLIER',
p: '',
t: '',
},
value: 'MEP000001 METALLIC PLIER',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
X$QTA: {
data: {
size: 15,
helperEnabled: false,
maxLength: 15,
integers: 15,
},
isEditable: false,
obj: {
k: '1',
p: '',
t: 'NR',
},
value: '1',
displayedValue: '1',
element: {
's-hn': 'KUP-DATA-TABLE',
},
},
},
cssClass: 'clickable',
id: '2',
object: '',
readOnly: true,
},
];

const sortRows = [
...mockedRows,
{
Expand Down Expand Up @@ -2155,44 +1875,6 @@ const defaultData = {
rows: mockedRows,
};

const defaultDataWithActions = {
columns: mockedColumnsActions,
rows: mockedRowsActions,
};

const defaultCommands = [
{
obj: {
k: '000050',
p: 'COD_VER',
t: 'VO',
},
icon: 'view-quilt',
text: 'Scheda',
showIcon: 'true',
},
{
obj: {
k: '000050',
p: 'COD_VER',
t: 'VO',
},
icon: 'delete',
text: 'Elimina',
showIcon: 'true',
},
{
obj: {
k: '000051',
p: 'COD_VER',
t: 'VO',
},
icon: 'edit',
text: 'Modifica',
showIcon: 'true',
},
];

const filterObjectData = {
columns: objColumns,
rows: objRows,
Expand Down Expand Up @@ -132421,18 +132103,6 @@ const rowActions = [
rowActionsTable.data = defaultData;
rowActionsTable.rowActions = rowActions;

const rowActionsWithCommands = document.getElementById(
'row-actions-with-commands'
);
rowActionsWithCommands.rowActions = [
{
text: 'Action #1',
icon: 'account',
},
];
rowActionsWithCommands.data = defaultDataWithActions;
rowActionsWithCommands.commands = defaultCommands;

const textfieldColumn = [
{
name: 'FLD1',
Expand Down
12 changes: 2 additions & 10 deletions packages/ketchup/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { KupAutocompleteEventPayload, KupAutocompleteIconClickEventPayload } fro
import { BadgeType } from "./components/kup-badge/kup-badge-declarations";
import { KupBoxAutoSelectEventPayload, KupBoxClickEventPayload, KupBoxContextMenuEventPayload, KupBoxData, KupBoxKanban, KupBoxLayout, KupBoxLoadMoreClickEventPayload, KupBoxRow, KupBoxRowActionClickEventPayload, KupBoxSelectedEventPayload, LoadMoreMode } from "./components/kup-box/kup-box-declarations";
import { KupStore } from "./components/kup-state/kup-store";
import { KupCommands, KupDataCell, KupDataColumn, KupDataDataset, KupDataNewColumnOptions, KupDataNewColumnTypes, KupDataRowAction } from "./managers/kup-data/kup-data-declarations";
import { KupDataCell, KupDataColumn, KupDataDataset, KupDataNewColumnOptions, KupDataNewColumnTypes, KupDataRowAction } from "./managers/kup-data/kup-data-declarations";
import { FButtonAlign, FButtonProps, FButtonStyling } from "./f-components/f-button/f-button-declarations";
import { KupButtonClickEventPayload } from "./components/kup-button/kup-button-declarations";
import { KupButtonListClickEventPayload, KupButtonListNode } from "./components/kup-button-list/kup-button-list-declarations";
Expand Down Expand Up @@ -64,7 +64,7 @@ export { KupAutocompleteEventPayload, KupAutocompleteIconClickEventPayload } fro
export { BadgeType } from "./components/kup-badge/kup-badge-declarations";
export { KupBoxAutoSelectEventPayload, KupBoxClickEventPayload, KupBoxContextMenuEventPayload, KupBoxData, KupBoxKanban, KupBoxLayout, KupBoxLoadMoreClickEventPayload, KupBoxRow, KupBoxRowActionClickEventPayload, KupBoxSelectedEventPayload, LoadMoreMode } from "./components/kup-box/kup-box-declarations";
export { KupStore } from "./components/kup-state/kup-store";
export { KupCommands, KupDataCell, KupDataColumn, KupDataDataset, KupDataNewColumnOptions, KupDataNewColumnTypes, KupDataRowAction } from "./managers/kup-data/kup-data-declarations";
export { KupDataCell, KupDataColumn, KupDataDataset, KupDataNewColumnOptions, KupDataNewColumnTypes, KupDataRowAction } from "./managers/kup-data/kup-data-declarations";
export { FButtonAlign, FButtonProps, FButtonStyling } from "./f-components/f-button/f-button-declarations";
export { KupButtonClickEventPayload } from "./components/kup-button/kup-button-declarations";
export { KupButtonListClickEventPayload, KupButtonListNode } from "./components/kup-button-list/kup-button-list-declarations";
Expand Down Expand Up @@ -1384,10 +1384,6 @@ export namespace Components {
* Collapses all groups.
*/
"collapseAll": () => Promise<void>;
/**
* Sets the commands for the rows
*/
"commands": Array<KupCommands>;
/**
* Custom style of the component. For more information: https://smeup.github.io/ketchup/#/customization
*/
Expand Down Expand Up @@ -6624,10 +6620,6 @@ declare namespace LocalJSX {
* @default false
*/
"autoFillMissingCells"?: boolean;
/**
* Sets the commands for the rows
*/
"commands"?: Array<KupCommands>;
/**
* Custom style of the component. For more information: https://smeup.github.io/ketchup/#/customization
*/
Expand Down
Loading

0 comments on commit 53be2ef

Please sign in to comment.