-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding visibility controls to interactive items
- Loading branch information
Showing
12 changed files
with
274 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,45 @@ | ||
<span class="btn-wrapper {{@wrapperClass}} inline-flex rounded-md {{if this.isNotSecondary 'shadow-sm'}} {{if @isLoading 'is-loading'}}" {{did-insert this.setupComponent}}> | ||
<button | ||
class="btn {{if @isLoading 'btn-is-loading'}} {{if @outline 'btn-outline'}} btn-{{or @type 'default'}} btn-{{or @size 'sm'}}" | ||
disabled={{this.isDisabled}} | ||
...attributes | ||
type={{or @buttonType "button"}} | ||
{{on "click" this.onClick}} | ||
> | ||
{{#if @isLoading}} | ||
<span class="btn-icon-wrapper btn-loading-icon-wrapper" data-icon-prefix={{@iconPrefix}}> | ||
<Spinner @width={{or @loaderWidth 14}} @height={{or @loaderHeight 14}} /> | ||
</span> | ||
{{#if this.visible}} | ||
<span class="btn-wrapper {{@wrapperClass}} inline-flex rounded-md {{if this.isNotSecondary 'shadow-sm'}} {{if @isLoading 'is-loading'}}" {{did-insert this.setupComponent}}> | ||
<button | ||
class="btn {{if @isLoading 'btn-is-loading'}} {{if @outline 'btn-outline'}} btn-{{or @type 'default'}} btn-{{or @size 'sm'}}" | ||
disabled={{this.isDisabled}} | ||
...attributes | ||
type={{or @buttonType "button"}} | ||
{{on "click" this.onClick}} | ||
> | ||
{{#if @isLoading}} | ||
<span class="btn-icon-wrapper btn-loading-icon-wrapper" data-icon-prefix={{@iconPrefix}}> | ||
<Spinner @width={{or @loaderWidth 14}} @height={{or @loaderHeight 14}} /> | ||
</span> | ||
{{/if}} | ||
{{#if this.showIcon}} | ||
<span class="btn-icon-wrapper" data-icon-prefix={{@iconPrefix}}> | ||
<FaIcon | ||
@prefix={{@iconPrefix}} | ||
@icon={{@icon}} | ||
@size={{@iconSize}} | ||
@rotation={{@iconRotation}} | ||
@flip={{@iconFlip}} | ||
@spin={{@iconSpin}} | ||
class="{{if @text 'mr-2'}} {{@iconClass}}" | ||
/> | ||
</span> | ||
{{/if}} | ||
{{#if @text}} | ||
<span class="{{@textClass}} {{if @responsive 'sm:hidden'}}"> | ||
{{@text}} | ||
</span> | ||
{{/if}} | ||
{{yield}} | ||
</button> | ||
{{#if this.disabledByPermission}} | ||
<Attach::Tooltip @class="clean" @animation="scale" @placement={{or @tooltipPlacement "top"}}> | ||
<InputInfo @text={{t "common.unauthorized"}} /> | ||
</Attach::Tooltip> | ||
{{else if @helpText}} | ||
<Attach::Tooltip @class="clean" @animation="scale" @placement={{or @tooltipPlacement "top"}}> | ||
<InputInfo @text={{@helpText}} @exampleText={{@exampleText}} /> | ||
</Attach::Tooltip> | ||
{{/if}} | ||
{{#if this.showIcon}} | ||
<span class="btn-icon-wrapper" data-icon-prefix={{@iconPrefix}}> | ||
<FaIcon | ||
@prefix={{@iconPrefix}} | ||
@icon={{@icon}} | ||
@size={{@iconSize}} | ||
@rotation={{@iconRotation}} | ||
@flip={{@iconFlip}} | ||
@spin={{@iconSpin}} | ||
class="{{if @text 'mr-2'}} {{@iconClass}}" | ||
/> | ||
</span> | ||
{{/if}} | ||
{{#if @text}} | ||
<span class="{{@textClass}} {{if @responsive 'sm:hidden'}}"> | ||
{{@text}} | ||
</span> | ||
{{/if}} | ||
{{yield}} | ||
</button> | ||
{{#if this.disabledByPermission}} | ||
<Attach::Tooltip @class="clean" @animation="scale" @placement={{or @tooltipPlacement "top"}}> | ||
<InputInfo @text={{t "common.unauthorized"}} /> | ||
</Attach::Tooltip> | ||
{{else if @helpText}} | ||
<Attach::Tooltip @class="clean" @animation="scale" @placement={{or @tooltipPlacement "top"}}> | ||
<InputInfo @text={{@helpText}} @exampleText={{@exampleText}} /> | ||
</Attach::Tooltip> | ||
{{/if}} | ||
</span> | ||
</span> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,77 @@ | ||
<BasicDropdown | ||
id={{@dropdownId}} | ||
class={{@wrapperClass}} | ||
@renderInPlace={{@renderInPlace}} | ||
@registerAPI={{this.onRegisterAPI}} | ||
@horizontalPosition={{@horizontalPosition}} | ||
@verticalPosition={{@verticalPosition}} | ||
@calculatePosition={{@calculatePosition}} | ||
@defaultClass={{@defaultClass}} | ||
@matchTriggerWidth={{@matchTriggerWidth}} | ||
@onOpen={{@onOpen}} | ||
@onClose={{@onClose}} | ||
@disabled={{this.disabled}} | ||
{{did-insert this.onInsert}} | ||
as |dd| | ||
> | ||
<dd.Trigger class={{@triggerClass}} {{did-insert this.onTriggerInsert}}> | ||
{{#if @buttonComponent}} | ||
{{component | ||
@buttonComponent | ||
buttonComponentArgs=this.buttonComponentArgs | ||
text=@text | ||
class=(concat @buttonClass (if dd.isOpen " dd-is-open")) | ||
wrapperClass=@buttonWrapperClass | ||
type=this.type | ||
active=@active | ||
size=this.buttonSize | ||
isLoading=@isLoading | ||
disabled=this.disabled | ||
textClass=@textClass | ||
helpText=@helpText | ||
tooltipPlacement=@tooltipPlacement | ||
img=@img | ||
imgClass=@imgClass | ||
alt=@alt | ||
}} | ||
{{else}} | ||
<Button | ||
title={{@text}} | ||
class="{{@buttonClass}} {{if dd.isOpen 'dd-is-open'}}" | ||
@wrapperClass={{@buttonWrapperClass}} | ||
@type={{this.type}} | ||
@active={{@active}} | ||
@size={{this.buttonSize}} | ||
@isLoading={{@isLoading}} | ||
disabled={{this.disabled}} | ||
{{did-insert this.onButtonInsert}} | ||
...attributes | ||
> | ||
{{#if @icon}} | ||
<FaIcon @icon={{@icon}} @prefix={{@iconPrefix}} @size={{@iconSize}} class="{{@iconClass}} {{if @text 'mr-2'}}" /> | ||
{{/if}} | ||
{{#if @img}} | ||
<img src={{@img}} class={{@imgClass}} alt={{or @alt "image"}} /> | ||
{{/if}} | ||
{{#if (and (not this.doesntHavePermissions) @helpText)}} | ||
<Attach::Tooltip @class="clean" @animation="scale" @placement={{or @tooltipPlacement "top"}}> | ||
<InputInfo @text={{@helpText}} /> | ||
</Attach::Tooltip> | ||
{{/if}} | ||
<div class="{{@textClass}} truncate"> | ||
{{@text}} | ||
</div> | ||
</Button> | ||
{{/if}} | ||
{{#if this.doesntHavePermissions}} | ||
<Attach::Tooltip @class="clean" @animation="scale" @placement={{or @tooltipPlacement "top"}}> | ||
<InputInfo @text={{t "common.unauthorized"}} /> | ||
</Attach::Tooltip> | ||
{{/if}} | ||
</dd.Trigger> | ||
<dd.Content class={{@contentClass}} @overlay={{@overlay}}> | ||
{{yield dd}} | ||
</dd.Content> | ||
</BasicDropdown> | ||
{{#if this.visible}} | ||
<BasicDropdown | ||
id={{@dropdownId}} | ||
class={{@wrapperClass}} | ||
@renderInPlace={{@renderInPlace}} | ||
@registerAPI={{this.onRegisterAPI}} | ||
@horizontalPosition={{@horizontalPosition}} | ||
@verticalPosition={{@verticalPosition}} | ||
@calculatePosition={{@calculatePosition}} | ||
@defaultClass={{@defaultClass}} | ||
@matchTriggerWidth={{@matchTriggerWidth}} | ||
@onOpen={{@onOpen}} | ||
@onClose={{@onClose}} | ||
@disabled={{this.disabled}} | ||
{{did-insert this.onInsert}} | ||
as |dd| | ||
> | ||
<dd.Trigger class={{@triggerClass}} {{did-insert this.onTriggerInsert}}> | ||
{{#if @buttonComponent}} | ||
{{component | ||
@buttonComponent | ||
buttonComponentArgs=this.buttonComponentArgs | ||
text=@text | ||
class=(concat @buttonClass (if dd.isOpen " dd-is-open")) | ||
wrapperClass=@buttonWrapperClass | ||
type=this.type | ||
active=@active | ||
size=this.buttonSize | ||
isLoading=@isLoading | ||
disabled=this.disabled | ||
textClass=@textClass | ||
helpText=@helpText | ||
tooltipPlacement=@tooltipPlacement | ||
img=@img | ||
imgClass=@imgClass | ||
alt=@alt | ||
}} | ||
{{else}} | ||
<Button | ||
title={{@text}} | ||
class="{{@buttonClass}} {{if dd.isOpen 'dd-is-open'}}" | ||
@wrapperClass={{@buttonWrapperClass}} | ||
@type={{this.type}} | ||
@active={{@active}} | ||
@size={{this.buttonSize}} | ||
@isLoading={{@isLoading}} | ||
disabled={{this.disabled}} | ||
{{did-insert this.onButtonInsert}} | ||
...attributes | ||
> | ||
{{#if @icon}} | ||
<FaIcon @icon={{@icon}} @prefix={{@iconPrefix}} @size={{@iconSize}} class="{{@iconClass}} {{if @text 'mr-2'}}" /> | ||
{{/if}} | ||
{{#if @img}} | ||
<img src={{@img}} class={{@imgClass}} alt={{or @alt "image"}} /> | ||
{{/if}} | ||
{{#if (and (not this.doesntHavePermissions) @helpText)}} | ||
<Attach::Tooltip @class="clean" @animation="scale" @placement={{or @tooltipPlacement "top"}}> | ||
<InputInfo @text={{@helpText}} /> | ||
</Attach::Tooltip> | ||
{{/if}} | ||
<div class="{{@textClass}} truncate"> | ||
{{@text}} | ||
</div> | ||
</Button> | ||
{{/if}} | ||
{{#if this.doesntHavePermissions}} | ||
<Attach::Tooltip @class="clean" @animation="scale" @placement={{or @tooltipPlacement "top"}}> | ||
<InputInfo @text={{t "common.unauthorized"}} /> | ||
</Attach::Tooltip> | ||
{{/if}} | ||
</dd.Trigger> | ||
<dd.Content class={{@contentClass}} @overlay={{@overlay}}> | ||
{{yield dd}} | ||
</dd.Content> | ||
</BasicDropdown> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.