Skip to content

Commit

Permalink
feat(SFINT-3327): Ensure button is exported properly + page for test
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart committed Jul 24, 2020
1 parent ae406ae commit 5a1c9ed
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
21 changes: 21 additions & 0 deletions pages/toggle_action_button.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@
<div class="CoveoSearchbox" data-enable-omnibox="true"></div>
</div>

<div>
<h2>Disabled Disableable Toggle Button</h2>
<br />
<button
id="disabled-button"
class="CoveoDisableableToggleActionButton"
data-activate-icon='&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78.997 78.997" height="298.571" width="298.571"&gt;&lt;circle r="39.499" cy="120.385" cx="84.1" transform="translate(-44.601 -80.887)"/&gt;&lt;/svg&gt;'
data-disabled-icon='&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78.997 78.997" height="298.571" width="298.571"&gt;&lt;circle r="39.499" cy="120.385" cx="84.1" transform="translate(-44.601 -80.887)"/&gt;&lt;/svg&gt;'
data-disabled-tooltip="Disabled feature"
data-activate-tooltip="Activate feature"
data-deactivate-tooltip="Deactivate feature"
data-deactivate-icon='&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78.997 78.997" height="298.571" width="298.571"&gt;&lt;path d="M39.434 0A39.499 39.499 0 000 39.498a39.499 39.499 0 0039.498 39.5 39.499 39.499 0 0039.5-39.5A39.499 39.499 0 0039.497 0a39.499 39.499 0 00-.064 0zm.59 7.273a31.948 31.948 0 0131.948 31.949A31.948 31.948 0 0140.023 71.17 31.948 31.948 0 018.075 39.222 31.948 31.948 0 0140.023 7.273z"/&gt;&lt;/svg&gt;'
></button>
<button
title="Disable Coveo button"
onclick="Coveo.get(document.getElementById('disabled-button'), 'DisableableToggleActionButton').disable()"
>
Disable the button above
</button>
</div>

<div>
<h2>Toggle Button</h2>
<br />
Expand Down
1 change: 1 addition & 0 deletions src/Index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

export { ActionButton } from './components/ActionButton/ActionButton';
export { ToggleActionButton } from './components/ActionButton/ToggleActionButton';
export { DisableableToggleActionButton } from './components/ActionButton/DisableableToggleActionButton';
export { AttachResult } from './components/AttachResult/AttachResult';
export { UserActivity } from './components/UserActions/UserActivity';
export { UserActions } from './components/UserActions/UserActions';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ActionButton/DisableableActionButton.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$disable-color: $primary-color-light;

button.CoveoActionButton.coveo-actionbutton.coveo-actionbutton-disabled {
background-color: $activated-color;
background-color: $primary-color-lightest;
border-color: $disable-color;

.coveo-actionbutton_icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ export class DisableableToggleActionButton extends Component implements ITogglea
}
}

Initialization.registerAutoCreateComponent(ToggleActionButton);
Initialization.registerAutoCreateComponent(DisableableToggleActionButton);
1 change: 1 addition & 0 deletions src/sass/Index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import '../components/ActionButton/ActionButton.scss';
@import '../components/ActionButton/ToggleActionButton.scss';
@import '../components/ActionButton/DisableableActionButton.scss';
@import '../components/AttachResult/AttachResult.scss';
@import '../components/UserActions/UserActions.scss';
@import '../components/ViewedByCustomer/ViewedByCustomer.scss';
Expand Down

0 comments on commit 5a1c9ed

Please sign in to comment.