Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kup-card-list: options are now props. #1741

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ export default {
default: 'null',
try: 'json',
},
{
prop: 'decvalueCol',
description: 'Sets the decimal value column.',
type: 'string',
default: '""',
try: 'field',
},
{
prop: 'descrCol',
description: 'Sets the description column.',
type: 'string',
default: '""',
try: 'field',
},
{
prop: 'fullWidth',
description:
Expand All @@ -81,13 +95,69 @@ export default {
default: 'false',
try: 'switch',
},
{
prop: 'iconCol',
description: 'Sets the icon column.',
type: 'string',
default: '""',
try: 'field',
},
{
prop: 'iconcolorCol',
description: 'Sets the icon color column.',
type: 'string',
default: '""',
try: 'field',
},
{
prop: 'intvalueCol',
description: 'Sets the integer value column.',
type: 'string',
default: '""',
try: 'field',
},
{
prop: 'isClickable',
description: 'Sets whether a single card is clickable or not.',
type: 'boolean',
default: 'false',
try: 'switch',
},
{
prop: 'layoutCol',
description: 'Sets the layout column.',
type: 'string',
default: '""',
try: 'field',
},
{
prop: 'measureCol',
description: 'Sets the measure column.',
type: 'string',
default: '""',
try: 'field',
},
{
prop: 'textcolorCol',
description: 'Sets the text color column.',
type: 'string',
default: '""',
try: 'field',
},
{
prop: 'valueCol',
description: 'Sets the value column.',
type: 'string',
default: '""',
try: 'field',
},
{
prop: 'valuecolorCol',
description: 'Sets the value color column.',
type: 'string',
default: '""',
try: 'field',
},
],
};
},
Expand All @@ -101,52 +171,42 @@ function createComp() {
{
name: 'ICO',
title: 'Icona',
cardListOption: 'icon',
},
{
name: 'UM',
title: 'Um',
cardListOption: 'measure',
},
{
name: 'TEXT',
title: 'Testo',
cardListOption: 'descr',
},
{
name: 'VALUE',
title: 'Valore',
cardListOption: 'value',
},
{
name: 'INTVAL',
title: 'Valore parte intera',
cardListOption: 'intvalue',
},
{
name: 'DECVAL',
title: 'Valore parte decimale',
cardListOption: 'decvalue',
},
{
name: 'TEXTCOLOR',
title: 'Colore del testo',
cardListOption: 'textcolor',
},
{
name: 'VALUECOLOR',
title: 'Colore del valore',
cardListOption: 'valuecolor',
},
{
name: 'ICOCOLOR',
title: "Colore dell'icona",
cardListOption: 'iconcolor',
},
{
name: 'LAYOUT',
title: 'Layout della riga',
cardListOption: 'layout',
},
],
rows: [
Expand Down Expand Up @@ -801,6 +861,16 @@ function createComp() {
},
],
};
comp.decvalueCol = 'DECVAL';
comp.descrCol = 'TEXT';
comp.iconCol = 'ICO';
comp.iconcolorCol = 'ICOCOLOR';
comp.intvalueCol = 'INTVAL';
comp.layoutCol = 'LAYOUT';
comp.measureCol = 'UM';
comp.textcolorCol = 'TEXTCOLOR';
comp.valueCol = 'VALUE';
comp.valuecolorCol = 'VALUECOLOR';
return comp;
}
</script>
4 changes: 2 additions & 2 deletions packages/ketchup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
"vanilla-picker": "^2.12.1"
},
"devDependencies": {
"@stencil/core": "^4.3.0",
"@stencil/core": "^4.4.0",
"@stencil/react-output-target": "0.5.3",
"@stencil/sass": "^3.0.5",
"@stencil/sass": "^3.0.6",
"jest": "^27.4.5",
"jest-cli": "^27.4.5",
"jest-html-reporter": "^3.7.1",
Expand Down
21 changes: 12 additions & 9 deletions packages/ketchup/src/assets/card-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ const data = {
{
name: 'ICO',
title: 'Icona',
cardListOption: 'icon',
},
{
name: 'UM',
title: 'Um',
cardListOption: 'measure',
},
{
name: 'TEXT',
title: 'Testo',
cardListOption: 'descr',
},
{
name: 'VALUE',
Expand All @@ -23,32 +20,26 @@ const data = {
{
name: 'INTVAL',
title: 'Valore parte intera',
cardListOption: 'intvalue',
},
{
name: 'DECVAL',
title: 'Valore parte decimale',
cardListOption: 'decvalue',
},
{
name: 'TEXTCOLOR',
title: 'Colore del testo',
cardListOption: 'textcolor',
},
{
name: 'VALUECOLOR',
title: 'Colore del valore',
cardListOption: 'valuecolor',
},
{
name: 'ICOCOLOR',
title: "Colore dell'icona",
cardListOption: 'iconcolor',
},
{
name: 'LAYOUT',
title: 'Layout della riga',
cardListOption: 'layout',
},
],
rows: [
Expand Down Expand Up @@ -705,5 +696,17 @@ const data = {
};

const list = document.createElement('kup-card-list');

list.data = data;
list.decvalueCol = 'DECVAL';
list.descrCol = 'TEXT';
list.iconCol = 'ICO';
list.iconcolorCol = 'ICOCOLOR';
list.intvalueCol = 'INTVAL';
list.layoutCol = 'LAYOUT';
list.measureCol = 'UM';
list.textcolorCol = 'TEXTCOLOR';
list.valueCol = 'VALUE';
list.valuecolorCol = 'VALUECOLOR';

document.body.appendChild(list);
100 changes: 100 additions & 0 deletions packages/ketchup/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,16 @@ export namespace Components {
* @default null
*/
"data": KupCardListData;
/**
* Sets the decimal value column.
* @default ""
*/
"decvalueCol": string;
/**
* Sets the description column.
* @default ""
*/
"descrCol": string;
/**
* Sets whether the component occupies all available width.
* @default true
Expand All @@ -683,11 +693,36 @@ export namespace Components {
* @default false
*/
"horizontal": boolean;
/**
* Sets the icon column.
* @default ""
*/
"iconCol": string;
/**
* Sets the icon color column.
* @default ""
*/
"iconcolorCol": string;
/**
* Sets the integer value column.
* @default ""
*/
"intvalueCol": string;
/**
* Sets whether a single card is clickable or not.
* @default false
*/
"isClickable": boolean;
/**
* Sets the layout column.
* @default ""
*/
"layoutCol": string;
/**
* Sets the unit of measure column.
* @default ""
*/
"measureCol": string;
/**
* This method is used to trigger a new render of the component.
*/
Expand All @@ -697,6 +732,21 @@ export namespace Components {
* @param props - Object containing props that will be set to the component.
*/
"setProps": (props: GenericObject) => Promise<void>;
/**
* Sets the text color column.
* @default ""
*/
"textcolorCol": string;
/**
* Sets the value column.
* @default ""
*/
"valueCol": string;
/**
* Sets the value color column.
* @default ""
*/
"valuecolorCol": string;
}
interface KupCell {
/**
Expand Down Expand Up @@ -4490,6 +4540,16 @@ declare namespace LocalJSX {
* @default null
*/
"data"?: KupCardListData;
/**
* Sets the decimal value column.
* @default ""
*/
"decvalueCol"?: string;
/**
* Sets the description column.
* @default ""
*/
"descrCol"?: string;
/**
* Sets whether the component occupies all available width.
* @default true
Expand All @@ -4500,12 +4560,52 @@ declare namespace LocalJSX {
* @default false
*/
"horizontal"?: boolean;
/**
* Sets the icon column.
* @default ""
*/
"iconCol"?: string;
/**
* Sets the icon color column.
* @default ""
*/
"iconcolorCol"?: string;
/**
* Sets the integer value column.
* @default ""
*/
"intvalueCol"?: string;
/**
* Sets whether a single card is clickable or not.
* @default false
*/
"isClickable"?: boolean;
/**
* Sets the layout column.
* @default ""
*/
"layoutCol"?: string;
/**
* Sets the unit of measure column.
* @default ""
*/
"measureCol"?: string;
"onKup-cardlist-click"?: (event: KupCardListCustomEvent<KupCardListClickEventPayload>) => void;
/**
* Sets the text color column.
* @default ""
*/
"textcolorCol"?: string;
/**
* Sets the value column.
* @default ""
*/
"valueCol"?: string;
/**
* Sets the value color column.
* @default ""
*/
"valuecolorCol"?: string;
}
interface KupCell {
/**
Expand Down
Loading