Skip to content

Commit

Permalink
DOC-458 Icon documentation revision
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeaudoincoveo committed Feb 13, 2017
1 parent c67b6ba commit c69207a
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions src/ui/Icon/Icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ export interface IIconOptions {
}

/**
* This component is intended to be used inside a result template, which must in turn be used inside a
* {@link ResultList} component.
*
* The Icon component outputs the corresponding icon for a given file type. The component searches for a suitable icon
* from those available in the framework. If no suitable icon is found, the component outputs a generic icon instead.
* from those available in the Coveo JavaScript Search Framework. If the component finds no suitable icon, it instead
* outputs a generic icon.
*
* For more information on result templates, see
* <a target="_blank" href="https://developers.coveo.com/x/v4okAg">Step 6 - Result Templates</a> of the Getting Started
* with the JavaScript Search Framework V1 tutorial.
* This component is a result template component (see [Result Templates](https://developers.coveo.com/x/aIGfAQ)).
*/
export class Icon extends Component {
static ID = 'Icon';
Expand All @@ -43,32 +39,36 @@ export class Icon extends Component {
/**
* Specifies the value that the Icon component should output as its CSS class instead of the auto-selected value.
*
* Default value is `undefined`, and the framework will find a suitable icon based on the result file type.
* Default value is `undefined`, which means that the Coveo JavaScript Search Framework outputs a suitable icon
* depending on the result file type.
*/
value: ComponentOptions.buildIconOption(),

/**
* Specifies whether the Icon component should output the smaller version of the icon instead of of the regular one.
* Specifies whether the Icon component should output the smaller version of the icon instead of the regular one.
*
* Default value is `false`.
*/
small: ComponentOptions.buildBooleanOption(),

/**
* Specifies whether the Icon component should force the output icon to display its caption/label or not.
* Specifies whether the Icon component should force the output icon to display its caption/label.
*
* **Note:**
*
* Due to limited screen real estate, setting this option to `true` has no effect on icons set into insight panels.
* > Due to limited screen real estate, setting this option to `true` has no effect on icons used inside Coveo for
* > Salesforce Insight Panels.
*
* Default value is `undefined`, and the framework will determine if the icon needs to display a caption/label based
* of the result file type.
* Default value is `undefined`, which means that the Coveo JavaScript Search Framework determines whether the icon
* needs to display a caption/label depending on the result file type.
*/
withLabel: ComponentOptions.buildBooleanOption(),

/**
* Specifies what text should be displayed on the icon caption/label.
* Specifies what text to display as the icon caption/label.
*
* Default value is `undefined`, and the framework will determine what text the icon needs to display based on the
* result file type.
* Default value is `undefined`, which means that the Coveo JavaScript Search Framework determines what text the icon
* needs to display depending on the result file type.
*/
labelValue: ComponentOptions.buildLocalizedStringOption()
};
Expand All @@ -79,11 +79,12 @@ export class Icon extends Component {
];

/**
* Creates a new Icon component
* @param element
* @param options
* @param bindings
* @param result
* Creates a new Icon component.
* @param element The HTMLElement on which to instantiate the component.
* @param options The options for the Icon component.
* @param bindings The bindings that the component requires to function normally. If not set, these will be
* automatically resolved (with a slower execution time).
* @param result The result to associate the component with.
*/
constructor(public element: HTMLElement, public options?: IIconOptions, bindings?: IComponentBindings, public result?: IQueryResult) {
super(element, Icon.ID, bindings);
Expand Down

0 comments on commit c69207a

Please sign in to comment.