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

DOC-458 Icon documentation revision #353

Merged
merged 1 commit into from
Feb 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I add defaultValue: false here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. We should remove the misleading comment though.

Default value is undefined


/**
* 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