-
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.
Merge pull request #429 from appuniversum/feat/deprecate-au-input-fea…
…tures Deprecate some `AuInput` features
- Loading branch information
Showing
6 changed files
with
268 additions
and
116 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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { hbs } from 'ember-cli-htmlbars'; | ||
import { icons } from '../../../assets/icons'; | ||
|
||
export default { | ||
title: 'Components/Forms/Input/AuInput', | ||
argTypes: { | ||
error: { control: 'boolean', description: 'Add an error state' }, | ||
warning: { control: 'boolean', description: 'Add an warning state' }, | ||
disabled: { | ||
control: 'boolean', | ||
description: 'Adds a disabled state to the input', | ||
}, | ||
width: { | ||
control: 'select', | ||
options: ['default', 'block'], | ||
description: 'Display the input as a block element', | ||
}, | ||
icon: { | ||
control: 'select', | ||
options: icons, | ||
description: | ||
'Adds an icon (using an icon implies the use @width="block")', | ||
}, | ||
iconAlignment: { | ||
control: 'select', | ||
options: ['left', 'right'], | ||
description: 'Choose the position of the icon', | ||
}, | ||
value: { | ||
control: 'text', | ||
}, | ||
}, | ||
parameters: { | ||
layout: 'padded', | ||
}, | ||
}; | ||
|
||
const Template = (args) => ({ | ||
template: hbs` | ||
<AuLabel for="input">Input</AuLabel> | ||
<AuInput | ||
@error={{this.error}} | ||
@warning={{this.warning}} | ||
@disabled={{this.disabled}} | ||
@width={{this.width}} | ||
@icon={{this.icon}} | ||
@iconAlignment={{this.iconAlignment}} | ||
value={{this.value}} | ||
id="input" | ||
/>`, | ||
context: args, | ||
}); | ||
|
||
export const Component = Template.bind({}); | ||
Component.args = { | ||
error: false, | ||
warning: false, | ||
disabled: false, | ||
width: '', | ||
icon: '', | ||
iconAlignment: 'left', | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { hbs } from 'ember-cli-htmlbars'; | ||
|
||
export default { | ||
title: 'Components/Forms/Input/Inputmasking', | ||
argTypes: { | ||
value: { | ||
control: 'text', | ||
}, | ||
mask: { | ||
control: 'text', | ||
}, | ||
placeholder: { | ||
control: 'text', | ||
}, | ||
}, | ||
parameters: { | ||
layout: 'padded', | ||
}, | ||
}; | ||
|
||
const Template = (args) => ({ | ||
template: hbs` | ||
<AuContent class="au-u-max-width-small"> | ||
<p> | ||
You can add input masking to the AuInput by applying the <AuPill>{{"{{au-inputmask}}"}}</AuPill> modifier. It is a simple wrapper around the inputmask library. Usage instructions can be found in the <AuLinkExternal href="https://github.com/RobinHerbots/Inputmask">inputmask repo</AuLinkExternal>. | ||
</p> | ||
</AuContent> | ||
<br> | ||
<AuLabel for="masked-input">Masked input</AuLabel> | ||
<AuInput | ||
id="masked-input" | ||
value={{this.value}} | ||
{{au-inputmask options=(hash | ||
mask=this.mask | ||
placeholder=this.placeholder | ||
)}} | ||
/>`, | ||
context: args, | ||
}); | ||
|
||
export const Component = Template.bind({}); | ||
Component.args = { | ||
mask: '99.99.99-999.99', | ||
placeholder: '_', | ||
}; |
Oops, something went wrong.