Skip to content

Commit

Permalink
feat(component): for conversation properties input fields, need to sh…
Browse files Browse the repository at this point in the history
…ow tooltip for AMB fields

Based on the properties passed from unity_
  • Loading branch information
shalini-venkat committed Jan 7, 2025
1 parent 13fdc85 commit dedd7b8
Show file tree
Hide file tree
Showing 17 changed files with 137 additions and 27 deletions.
24 changes: 24 additions & 0 deletions packages/crayons-core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,18 @@ export namespace Components {
* The step attribute is used when the type is `number`. It specifies the interval between legal numbers in a number/decimal input element. Works with the min and max attributes to limit the increments at which a value can be set. Possible values are `any` or a positive floating point number. Default value is `any`
*/
"step": string;
/**
* Optional tooltip for the component, shown on hover of the input box.
*/
"tooltip"?: string;
/**
* The tooltip placement type for the optional tooltip.
*/
"tooltipPlacement"?: PopoverPlacementType;
/**
* Truncate title on text overflow
*/
"truncateOnOverflow": boolean;
/**
* Type of value accepted as the input value. If a user enters a value other than the specified type, the input box is not populated.
*/
Expand Down Expand Up @@ -4288,6 +4300,18 @@ declare namespace LocalJSX {
* The step attribute is used when the type is `number`. It specifies the interval between legal numbers in a number/decimal input element. Works with the min and max attributes to limit the increments at which a value can be set. Possible values are `any` or a positive floating point number. Default value is `any`
*/
"step"?: string;
/**
* Optional tooltip for the component, shown on hover of the input box.
*/
"tooltip"?: string;
/**
* The tooltip placement type for the optional tooltip.
*/
"tooltipPlacement"?: PopoverPlacementType;
/**
* Truncate title on text overflow
*/
"truncateOnOverflow"?: boolean;
/**
* Type of value accepted as the input value. If a user enters a value other than the specified type, the input box is not populated.
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/crayons-core/src/components/country-phone/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ graph TD;
fw-select --> fw-spinner
fw-select --> fw-icon
fw-select --> fw-list-options
fw-select --> fw-tooltip
fw-tag --> fw-tooltip
fw-tag --> fw-avatar
fw-tag --> fw-icon
Expand All @@ -313,6 +314,7 @@ graph TD;
fw-select-option --> fw-avatar
fw-checkbox --> fw-icon
fw-input --> fw-icon
fw-input --> fw-tooltip
style fw-country-phone fill:#f9f,stroke:#333,stroke-width:4px
```
Expand Down
3 changes: 2 additions & 1 deletion packages/crayons-core/src/components/data-table/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2434,10 +2434,11 @@ graph TD;
fw-select-option --> fw-avatar
fw-checkbox --> fw-icon
fw-input --> fw-icon
fw-input --> fw-tooltip
fw-tooltip --> fw-popover
fw-custom-cell-user --> fw-avatar
fw-custom-cell-icon --> fw-icon
fw-custom-cell-paragraph --> fw-tooltip
fw-tooltip --> fw-popover
style fw-data-table fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
2 changes: 2 additions & 0 deletions packages/crayons-core/src/components/datepicker/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ graph TD;
fw-button --> fw-spinner
fw-button --> fw-icon
fw-input --> fw-icon
fw-input --> fw-tooltip
fw-timepicker --> fw-select
fw-timepicker --> fw-select-option
fw-select --> fw-tag
Expand All @@ -758,6 +759,7 @@ graph TD;
fw-select --> fw-spinner
fw-select --> fw-icon
fw-select --> fw-list-options
fw-select --> fw-tooltip
fw-tag --> fw-tooltip
fw-tag --> fw-avatar
fw-tag --> fw-icon
Expand Down
5 changes: 4 additions & 1 deletion packages/crayons-core/src/components/form-control/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,16 @@ graph TD;
fw-form-control --> fw-timepicker
fw-form-control --> fw-file-uploader-2
fw-input --> fw-icon
fw-input --> fw-tooltip
fw-tooltip --> fw-popover
fw-textarea --> fw-tooltip
fw-datepicker --> fw-tooltip
fw-datepicker --> fw-icon
fw-datepicker --> fw-button
fw-datepicker --> fw-input
fw-datepicker --> fw-timepicker
fw-datepicker --> fw-popover
fw-datepicker --> fw-select
fw-tooltip --> fw-popover
fw-button --> fw-spinner
fw-button --> fw-icon
fw-timepicker --> fw-select
Expand All @@ -91,6 +93,7 @@ graph TD;
fw-select --> fw-spinner
fw-select --> fw-icon
fw-select --> fw-list-options
fw-select --> fw-tooltip
fw-tag --> fw-tooltip
fw-tag --> fw-avatar
fw-tag --> fw-icon
Expand Down
5 changes: 4 additions & 1 deletion packages/crayons-core/src/components/form/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3498,14 +3498,16 @@ graph TD;
fw-form-control --> fw-timepicker
fw-form-control --> fw-file-uploader-2
fw-input --> fw-icon
fw-input --> fw-tooltip
fw-tooltip --> fw-popover
fw-textarea --> fw-tooltip
fw-datepicker --> fw-tooltip
fw-datepicker --> fw-icon
fw-datepicker --> fw-button
fw-datepicker --> fw-input
fw-datepicker --> fw-timepicker
fw-datepicker --> fw-popover
fw-datepicker --> fw-select
fw-tooltip --> fw-popover
fw-button --> fw-spinner
fw-button --> fw-icon
fw-timepicker --> fw-select
Expand All @@ -3516,6 +3518,7 @@ graph TD;
fw-select --> fw-spinner
fw-select --> fw-icon
fw-select --> fw-list-options
fw-select --> fw-tooltip
fw-tag --> fw-tooltip
fw-tag --> fw-avatar
fw-tag --> fw-icon
Expand Down
4 changes: 4 additions & 0 deletions packages/crayons-core/src/components/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ $warning-color: $color-casablanca-300;
background-color: $input-disabled-bg;
pointer-events: none;
}

&.truncate {
text-overflow: ellipsis;
}
}
}

Expand Down
21 changes: 21 additions & 0 deletions packages/crayons-core/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@stencil/core';

import { handleKeyDown, renderHiddenField, hasSlot } from '../../utils';
import { PopoverPlacementType } from '../../utils/types';

import FieldControl from '../../function-components/field-control';

Expand Down Expand Up @@ -117,6 +118,21 @@ export class Input {
*/
@Prop() errorText = '';

/**
* Optional tooltip for the component, shown on hover of the input box.
*/
@Prop() tooltip?: string;

/**
* The tooltip placement type for the optional tooltip.
*/
@Prop() tooltipPlacement?: PopoverPlacementType;

/**
* Truncate title on text overflow
*/
@Prop() truncateOnOverflow = false;

/**
* Triggered when the input box comes into focus.
*/
Expand Down Expand Up @@ -271,6 +287,8 @@ export class Input {
warningText={this.warningText}
hasWarningTextSlot={this.hasWarningTextSlot}
required={this.required}
tooltip={this.tooltip}
tooltipPlacement={this.tooltipPlacement}
>
<div
aria-disabled={this.disabled}
Expand Down Expand Up @@ -307,6 +325,9 @@ export class Input {
this.nativeInput = input;
}}
id={this.name}
class={{
truncate: this.truncateOnOverflow,
}}
autoComplete={this.autocomplete}
disabled={this.disabled}
name={this.name}
Expand Down
Loading

0 comments on commit dedd7b8

Please sign in to comment.