-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed ember-arg-types again, in favor of helpers and custom simple …
…decorator
- Loading branch information
1 parent
27a4c6a
commit 25286cc
Showing
10 changed files
with
46 additions
and
165 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 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,9 @@ | ||
import { helper } from '@ember/component/helper'; | ||
import { isBlank } from '@ember/utils'; | ||
|
||
export function sizeClassHelper([prefix, size], { default: defaultValue }) { | ||
size = size ?? defaultValue; | ||
return isBlank(size) ? null : `${prefix}-${size}`; | ||
} | ||
|
||
export default helper(sizeClassHelper); |
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,11 @@ | ||
import { helper } from '@ember/component/helper'; | ||
|
||
export function typeClassHelper([prefix, type], { default: defaultValue, outline = false }) { | ||
type = type ?? defaultValue; | ||
if (outline) { | ||
return `${prefix}-outline-${type}`; | ||
} | ||
return `${prefix}-${type}`; | ||
} | ||
|
||
export default helper(typeClassHelper); |
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,10 @@ | ||
export default function arg(target, key, descriptor) { | ||
let defaultValue = descriptor.initializer ? descriptor.initializer() : undefined; | ||
|
||
return { | ||
get() { | ||
const argValue = this.args[key]; | ||
return argValue !== undefined ? argValue : defaultValue; | ||
} | ||
}; | ||
} |
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 @@ | ||
export { default, eq } from 'ember-bootstrap/helpers/bs-size-class'; |
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 @@ | ||
export { default, eq } from 'ember-bootstrap/helpers/bs-type-class'; |
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.