- isSelect=true
- isSelect=false
Promise;
+ /**
+ * Sets the type of the chip
+ * @default FChipSize.MEDIUM
+ */
+ "sizing": FChipSize;
+ /**
+ * Sets the style of the chip
+ * @default FChipStyling.RAISED
+ */
+ "styling": FChipStyling;
/**
* The type of chip. Available types: input, filter, choice or empty for default.
* @default FChipType.STANDARD
@@ -1082,6 +1092,11 @@ export namespace Components {
"swatchOnly": boolean;
}
interface KupCombobox {
+ /**
+ * Set alert message
+ * @default '''
+ */
+ "alert": string;
/**
* Custom style of the component.
* @default ""
@@ -1100,6 +1115,11 @@ export namespace Components {
* Sets how to show the selected item value. Suported values: "code", "description", "both".
*/
"displayMode": ItemsDisplayMode;
+ /**
+ * Set error message
+ * @default '''
+ */
+ "error": string;
/**
* Used to retrieve component's props values.
* @param descriptions - When provided and true, the result will be the list of props with their description.
@@ -1111,14 +1131,54 @@ export namespace Components {
* @returns Value of the component.
*/
"getValue": () => Promise;
+ /**
+ * When set, its content will be shown as a help text below the field.
+ * @default null
+ */
+ "helper": string;
+ /**
+ * When true, the helper will be displayed.
+ * @default true
+ */
+ "helperEnabled": boolean;
+ /**
+ * When set, the helper will be shown only when the field is focused.
+ * @default false
+ */
+ "helperWhenFocused": boolean;
+ /**
+ * When set, the text-field will show this icon.
+ * @default null
+ */
+ "icon": string;
/**
* Sets the initial value of the component
*/
"initialValue": string;
+ /**
+ * Enables a clear trailing icon.
+ * @default false
+ */
+ "isClearable": boolean;
/**
* Lets the combobox behave as a select element.
*/
"isSelect": boolean;
+ /**
+ * When set, its content will be shown as a label.
+ * @default null
+ */
+ "label": string;
+ /**
+ * When set to true, the label will be on the left of the component.
+ * @default false
+ */
+ "leadingLabel": boolean;
+ /**
+ * Sets the component to read only state, making it not editable, but interactable. Used in combobox component when it behaves as a select.
+ * @default false
+ */
+ "readOnly": boolean;
/**
* This method is used to trigger a new render of the component.
*/
@@ -1145,6 +1205,16 @@ export namespace Components {
* When true shows the drop-down icon, for open list.
*/
"showDropDownIcon": boolean;
+ /**
+ * Sets the type of the button
+ * @default KupComponentSizing.MEDIUM
+ */
+ "sizing": KupComponentSizing;
+ /**
+ * When set, the icon will be shown after the text.
+ * @default false
+ */
+ "trailingIcon": boolean;
}
interface KupCustomTaskListHeader {
"doubleView"?: boolean;
@@ -5888,6 +5958,16 @@ declare namespace LocalJSX {
* Triggered when the removal icon on input chips is clicked.
*/
"onKup-chip-iconclick"?: (event: KupChipCustomEvent) => void;
+ /**
+ * Sets the type of the chip
+ * @default FChipSize.MEDIUM
+ */
+ "sizing"?: FChipSize;
+ /**
+ * Sets the style of the chip
+ * @default FChipStyling.RAISED
+ */
+ "styling"?: FChipStyling;
/**
* The type of chip. Available types: input, filter, choice or empty for default.
* @default FChipType.STANDARD
@@ -5924,6 +6004,11 @@ declare namespace LocalJSX {
"swatchOnly"?: boolean;
}
interface KupCombobox {
+ /**
+ * Set alert message
+ * @default '''
+ */
+ "alert"?: string;
/**
* Custom style of the component.
* @default ""
@@ -5942,14 +6027,54 @@ declare namespace LocalJSX {
* Sets how to show the selected item value. Suported values: "code", "description", "both".
*/
"displayMode"?: ItemsDisplayMode;
+ /**
+ * Set error message
+ * @default '''
+ */
+ "error"?: string;
+ /**
+ * When set, its content will be shown as a help text below the field.
+ * @default null
+ */
+ "helper"?: string;
+ /**
+ * When true, the helper will be displayed.
+ * @default true
+ */
+ "helperEnabled"?: boolean;
+ /**
+ * When set, the helper will be shown only when the field is focused.
+ * @default false
+ */
+ "helperWhenFocused"?: boolean;
+ /**
+ * When set, the text-field will show this icon.
+ * @default null
+ */
+ "icon"?: string;
/**
* Sets the initial value of the component
*/
"initialValue"?: string;
+ /**
+ * Enables a clear trailing icon.
+ * @default false
+ */
+ "isClearable"?: boolean;
/**
* Lets the combobox behave as a select element.
*/
"isSelect"?: boolean;
+ /**
+ * When set, its content will be shown as a label.
+ * @default null
+ */
+ "label"?: string;
+ /**
+ * When set to true, the label will be on the left of the component.
+ * @default false
+ */
+ "leadingLabel"?: boolean;
"onKup-combobox-blur"?: (event: KupComboboxCustomEvent) => void;
"onKup-combobox-change"?: (event: KupComboboxCustomEvent) => void;
"onKup-combobox-click"?: (event: KupComboboxCustomEvent) => void;
@@ -5957,6 +6082,11 @@ declare namespace LocalJSX {
"onKup-combobox-iconclick"?: (event: KupComboboxCustomEvent) => void;
"onKup-combobox-input"?: (event: KupComboboxCustomEvent) => void;
"onKup-combobox-itemclick"?: (event: KupComboboxCustomEvent) => void;
+ /**
+ * Sets the component to read only state, making it not editable, but interactable. Used in combobox component when it behaves as a select.
+ * @default false
+ */
+ "readOnly"?: boolean;
/**
* Sets how to return the selected item value. Suported values: "code", "description", "both".
*/
@@ -5965,6 +6095,16 @@ declare namespace LocalJSX {
* When true shows the drop-down icon, for open list.
*/
"showDropDownIcon"?: boolean;
+ /**
+ * Sets the type of the button
+ * @default KupComponentSizing.MEDIUM
+ */
+ "sizing"?: KupComponentSizing;
+ /**
+ * When set, the icon will be shown after the text.
+ * @default false
+ */
+ "trailingIcon"?: boolean;
}
interface KupCustomTaskListHeader {
"doubleView"?: boolean;
diff --git a/packages/ketchup/src/components/kup-badge/styles/kup-badge-main.scss b/packages/ketchup/src/components/kup-badge/styles/kup-badge-main.scss
index 9453b7a89c..ccad9da6e6 100644
--- a/packages/ketchup/src/components/kup-badge/styles/kup-badge-main.scss
+++ b/packages/ketchup/src/components/kup-badge/styles/kup-badge-main.scss
@@ -48,7 +48,7 @@
font-size: 0.625em;
min-height: var(--kup_badge_min_size);
min-width: var(--kup_badge_min_size);
- padding: var(--kup_badge_padding) calc(var(--kup_badge_padding) * 1.25);
+ padding: var(--kup_badge_padding) calc(var(--kup_badge_padding));
text-align: center;
display: flex;
justify-content: center;
diff --git a/packages/ketchup/src/components/kup-chip/kup-chip.tsx b/packages/ketchup/src/components/kup-chip/kup-chip.tsx
index c41b4f4816..efbf4fb710 100644
--- a/packages/ketchup/src/components/kup-chip/kup-chip.tsx
+++ b/packages/ketchup/src/components/kup-chip/kup-chip.tsx
@@ -17,7 +17,9 @@ import {
} from '../../managers/kup-manager/kup-manager';
import { FChip } from '../../f-components/f-chip/f-chip';
import {
+ FChipSize,
FChipsProps,
+ FChipStyling,
FChipType,
} from '../../f-components/f-chip/f-chip-declarations';
import {
@@ -80,6 +82,16 @@ export class KupChip {
* @default FChipType.STANDARD
*/
@Prop() type: FChipType = FChipType.STANDARD;
+ /**
+ * Sets the type of the chip
+ * @default FChipSize.MEDIUM
+ */
+ @Prop() sizing: FChipSize = FChipSize.MEDIUM;
+ /**
+ * Sets the style of the chip
+ * @default FChipStyling.RAISED
+ */
+ @Prop() styling: FChipStyling = FChipStyling.RAISED;
/*-------------------------------------------------*/
/* I n t e r n a l V a r i a b l e s */
@@ -356,9 +368,14 @@ export class KupChip {
onExpansionClick: [],
onFocus: [],
onIconClick: [],
+ primary: this.rootElement.classList.contains('kup-primary')
+ ? true
+ : false,
secondary: this.rootElement.classList.contains('kup-secondary')
? true
: false,
+ sizing: this.sizing,
+ styling: this.styling,
success: this.rootElement.classList.contains('kup-success')
? true
: false,
diff --git a/packages/ketchup/src/components/kup-chip/readme.md b/packages/ketchup/src/components/kup-chip/readme.md
index 912407ded3..67aef88461 100644
--- a/packages/ketchup/src/components/kup-chip/readme.md
+++ b/packages/ketchup/src/components/kup-chip/readme.md
@@ -5,13 +5,15 @@
## Properties
-| Property | Attribute | Description | Type | Default |
-| ------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -------------------- |
-| `customStyle` | `custom-style` | Custom style of the component. | `string` | `''` |
-| `data` | -- | List of elements. | `KupChipNode[]` | `[]` |
-| `displayId` | `display-id` | When enabled, the chip's text will display both the id and the value. | `boolean` | `false` |
-| `enableInput` | `enable-input` | When enabled, it's possible to add items to the chip's dataset through an input slot (kup-autocomplete, kup-combobox, kup-text-field). | `boolean` | `false` |
-| `type` | `type` | The type of chip. Available types: input, filter, choice or empty for default. | `FChipType.CHOICE \| FChipType.FILTER \| FChipType.INPUT \| FChipType.STANDARD` | `FChipType.STANDARD` |
+| Property | Attribute | Description | Type | Default |
+| ------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | --------------------- |
+| `customStyle` | `custom-style` | Custom style of the component. | `string` | `''` |
+| `data` | -- | List of elements. | `KupChipNode[]` | `[]` |
+| `displayId` | `display-id` | When enabled, the chip's text will display both the id and the value. | `boolean` | `false` |
+| `enableInput` | `enable-input` | When enabled, it's possible to add items to the chip's dataset through an input slot (kup-autocomplete, kup-combobox, kup-text-field). | `boolean` | `false` |
+| `sizing` | `sizing` | Sets the type of the chip | `FChipSize.MEDIUM \| FChipSize.SMALL` | `FChipSize.MEDIUM` |
+| `styling` | `styling` | Sets the style of the chip | `FChipStyling.OUTLINED \| FChipStyling.RAISED` | `FChipStyling.RAISED` |
+| `type` | `type` | The type of chip. Available types: input, filter, choice or empty for default. | `FChipType.CHOICE \| FChipType.FILTER \| FChipType.INPUT \| FChipType.STANDARD` | `FChipType.STANDARD` |
## Events
diff --git a/packages/ketchup/src/components/kup-combobox/kup-combobox-declarations.ts b/packages/ketchup/src/components/kup-combobox/kup-combobox-declarations.ts
index 419f139f1d..6bf0d58b6e 100644
--- a/packages/ketchup/src/components/kup-combobox/kup-combobox-declarations.ts
+++ b/packages/ketchup/src/components/kup-combobox/kup-combobox-declarations.ts
@@ -11,9 +11,12 @@ export enum KupComboboxProps {
disabled = 'Defaults at false. When set to true, the component is disabled.',
displayMode = 'Sets how to show the selected item value. Suported values: "code", "description", "both".',
initialValue = 'Sets the initial value of the component',
+ isClearable = 'Enables a clear trailing icon.',
isSelect = 'Lets the combobox behave as a select element.',
selectMode = 'Sets how to return the selected item value. Suported values: "code", "description", "both".',
showDropDownIcon = 'When true shows the drop-down icon, for open list.',
+ label = 'When set, its content will be shown as a label.',
+ leadingLabel = 'When set to true, the label will be on the left of the component.',
}
export interface KupComboboxEventPayload extends KupEventPayload {
diff --git a/packages/ketchup/src/components/kup-combobox/kup-combobox.tsx b/packages/ketchup/src/components/kup-combobox/kup-combobox.tsx
index 2529d4e102..e8bc295477 100644
--- a/packages/ketchup/src/components/kup-combobox/kup-combobox.tsx
+++ b/packages/ketchup/src/components/kup-combobox/kup-combobox.tsx
@@ -12,7 +12,11 @@ import {
State,
Watch,
} from '@stencil/core';
-import type { GenericObject, KupComponent } from '../../types/GenericTypes';
+import {
+ GenericObject,
+ KupComponent,
+ KupComponentSizing,
+} from '../../types/GenericTypes';
import {
KupManager,
kupManagerInstance,
@@ -35,6 +39,7 @@ import { getProps, setProps } from '../../utils/utils';
import { componentWrapperId } from '../../variables/GenericVariables';
import { KupManagerClickCb } from '../../managers/kup-manager/kup-manager-declarations';
import { KupDynamicPositionPlacement } from '../../managers/kup-dynamic-position/kup-dynamic-position-declarations';
+import { FTextFieldProps } from '../../f-components/f-text-field/f-text-field-declarations';
@Component({
tag: 'kup-combobox',
@@ -55,6 +60,11 @@ export class KupCombobox {
/* P r o p s */
/*-------------------------------------------------*/
+ /**
+ * Set alert message
+ * @default '''
+ */
+ @Prop() alert: string = '';
/**
* Custom style of the component.
* @default ""
@@ -73,14 +83,59 @@ export class KupCombobox {
* Sets how to show the selected item value. Suported values: "code", "description", "both".
*/
@Prop() displayMode: ItemsDisplayMode = ItemsDisplayMode.DESCRIPTION;
+ /**
+ * Set error message
+ * @default '''
+ */
+ @Prop() error: string = '';
+ /**
+ * When set, its content will be shown as a help text below the field.
+ * @default null
+ */
+ @Prop() helper: string = null;
+ /**
+ * When true, the helper will be displayed.
+ * @default true
+ */
+ @Prop() helperEnabled: boolean = true;
+ /**
+ * When set, the helper will be shown only when the field is focused.
+ * @default false
+ */
+ @Prop() helperWhenFocused: boolean = false;
+ /**
+ * When set, the text-field will show this icon.
+ * @default null
+ */
+ @Prop() icon: string = null;
/**
* Sets the initial value of the component
*/
@Prop() initialValue: string = '';
+ /**
+ * Enables a clear trailing icon.
+ * @default false
+ */
+ @Prop() isClearable: boolean = false;
/**
* Lets the combobox behave as a select element.
*/
@Prop({ reflect: true }) isSelect: boolean = false;
+ /**
+ * When set, its content will be shown as a label.
+ * @default null
+ */
+ @Prop() label: string = null;
+ /**
+ * When set to true, the label will be on the left of the component.
+ * @default false
+ */
+ @Prop() leadingLabel: boolean = false;
+ /**
+ * Sets the component to read only state, making it not editable, but interactable. Used in combobox component when it behaves as a select.
+ * @default false
+ */
+ @Prop() readOnly: boolean = false;
/**
* Sets how to return the selected item value. Suported values: "code", "description", "both".
*/
@@ -89,6 +144,16 @@ export class KupCombobox {
* When true shows the drop-down icon, for open list.
*/
@Prop() showDropDownIcon: boolean = true;
+ /**
+ * Sets the type of the button
+ * @default KupComponentSizing.MEDIUM
+ */
+ @Prop() sizing: KupComponentSizing = KupComponentSizing.MEDIUM;
+ /**
+ * When set, the icon will be shown after the text.
+ * @default false
+ */
+ @Prop() trailingIcon: boolean = false;
/*-------------------------------------------------*/
/* I n t e r n a l V a r i a b l e s */
@@ -371,6 +436,10 @@ export class KupCombobox {
if (this.#isListOpened()) {
return;
}
+ // Manage list open while helperline is displayed
+ const hasError = this.error.trim().length > 0;
+ const hasAlert = this.alert.trim().length > 0;
+ const topOffset = hasError || hasAlert ? -20 : 0;
this.#textfieldWrapper.classList.add('toggled');
this.#listEl.menuVisible = true;
this.#listEl.filter = '';
@@ -386,7 +455,7 @@ export class KupCombobox {
this.#kupManager.dynamicPosition.register(
this.#listEl,
this.#textfieldWrapper,
- 0,
+ topOffset,
KupDynamicPositionPlacement.AUTO,
true
);
@@ -495,11 +564,35 @@ export class KupCombobox {
}
render() {
+ const props: FTextFieldProps = {
+ alert: this.alert,
+ danger: this.rootElement.classList.contains('kup-danger')
+ ? true
+ : false,
+ disabled: this.disabled,
+ error: this.error,
+ helper: this.helper,
+ icon: this.icon,
+ info: this.rootElement.classList.contains('kup-info')
+ ? true
+ : false,
+ isClearable: this.isClearable,
+ label: this.label,
+ leadingLabel: this.leadingLabel,
+ readOnly: this.readOnly,
+ sizing: this.sizing,
+ success: this.rootElement.classList.contains('kup-success')
+ ? true
+ : false,
+ value: this.value,
+ warning: this.rootElement.classList.contains('kup-warning')
+ ? true
+ : false,
+ };
const fullHeight: boolean =
this.rootElement.classList.contains('kup-full-height');
const fullWidth: boolean =
this.rootElement.classList.contains('kup-full-width');
-
return (