-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor all component to ember v4
BREAKING CHANGE: This version drops support for Ember < v3.24 and requires `ember-auto-import` v2. Please check [the migration guide](/docs/migration-v5) for further instructions.
- Loading branch information
Showing
226 changed files
with
6,802 additions
and
8,349 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
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
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,13 +1,10 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
extends: "octane", | ||
extends: ["recommended", "ember-template-lint-plugin-prettier:recommended"], | ||
plugins: ["ember-template-lint-plugin-prettier"], | ||
rules: { | ||
"no-action": "warn", | ||
"no-implicit-this": "warn", | ||
"no-curly-component-invocation": "warn", | ||
"require-input-label": "warn", | ||
"no-obsolete-elements": "warn", | ||
"no-yield-only": "warn", | ||
"require-input-label": false, | ||
"no-obsolete-elements": false, | ||
}, | ||
}; |
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,34 @@ | ||
import createDecorator from "ember-uikit/-private/decorator"; | ||
import { validatedDecorator } from "ember-uikit/-private/validated"; | ||
|
||
export const COLOR_OPTIONS = { | ||
NONE: "", | ||
DEFAULT: "default", | ||
MUTED: "muted", | ||
PRIMARY: "primary", | ||
SECONDARY: "secondary", | ||
SUCCESS: "success", | ||
WARNING: "warning", | ||
DANGER: "danger", | ||
LINK: "link", | ||
TEXT: "text", | ||
}; | ||
|
||
export default createDecorator(function ( | ||
target, | ||
property, | ||
descriptor, | ||
{ | ||
template = "uk-$value$-background", | ||
options = Object.values(COLOR_OPTIONS), | ||
defaultValue = COLOR_OPTIONS.DEFAULT, | ||
...args | ||
} = {} | ||
) { | ||
return validatedDecorator(target, property, descriptor, { | ||
template, | ||
options, | ||
defaultValue, | ||
...args, | ||
}); | ||
}); |
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,24 @@ | ||
export function isDescriptor(possibleDesc) { | ||
const [target, key, desc] = possibleDesc; | ||
|
||
return ( | ||
possibleDesc.length === 3 && | ||
typeof target === "object" && | ||
target !== null && | ||
typeof key === "string" && | ||
typeof desc === "object" && | ||
desc !== null && | ||
"enumerable" in desc && | ||
"configurable" in desc | ||
); | ||
} | ||
|
||
export default function createDecorator(fn) { | ||
return function (...args) { | ||
if (isDescriptor(args)) { | ||
return fn(...args); | ||
} | ||
|
||
return (...desc) => fn(...desc, ...args); | ||
}; | ||
} |
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,104 @@ | ||
import { camelize } from "@ember/string"; | ||
|
||
import createDecorator from "ember-uikit/-private/decorator"; | ||
import { validatedDecorator } from "ember-uikit/-private/validated"; | ||
|
||
export const FLEX_HORIZONTAL_OPTIONS = { | ||
LEFT: "left", | ||
CENTER: "center", | ||
RIGHT: "right", | ||
BETWEEN: "between", | ||
AROUND: "around", | ||
}; | ||
|
||
export const FLEX_VERTICAL_OPTIONS = { | ||
STRETCH: "stretch", | ||
TOP: "top", | ||
MIDDLE: "middle", | ||
BOTTOM: "bottom", | ||
}; | ||
|
||
export const FLEX_DIRECTION_OPTIONS = { | ||
ROW: "row", | ||
ROW_REVERSE: "row-reverse", | ||
COLUMN: "column", | ||
COLUMN_REVERSE: "column-reverse", | ||
}; | ||
|
||
export const FLEX_WRAP_OPTIONS = { | ||
WRAP: "wrap", | ||
WRAP_REVERSE: "wrap-reverse", | ||
NOWRAP: "nowrap", | ||
}; | ||
|
||
export const FLEX_WRAP_ALIGNMENT_OPTIONS = { | ||
STRETCH: "stretch", | ||
BETWEEN: "between", | ||
AROUND: "around", | ||
TOP: "top", | ||
MIDDLE: "middle", | ||
BOTTOM: "bottom", | ||
}; | ||
|
||
export default createDecorator(function ( | ||
target, | ||
property, | ||
descriptor, | ||
{ prefix = "flex" } = {} | ||
) { | ||
const propConfig = [ | ||
{ | ||
name: camelize(`${prefix}-horizontal`), | ||
options: Object.values(FLEX_HORIZONTAL_OPTIONS), | ||
}, | ||
{ | ||
name: camelize(`${prefix}-vertical`), | ||
options: Object.values(FLEX_VERTICAL_OPTIONS), | ||
}, | ||
{ | ||
name: camelize(`${prefix}-direction`), | ||
options: Object.values(FLEX_DIRECTION_OPTIONS), | ||
}, | ||
{ | ||
name: camelize(`${prefix}-wrap`), | ||
options: Object.values(FLEX_WRAP_OPTIONS), | ||
}, | ||
{ | ||
name: camelize(`${prefix}-wrap-alignment`), | ||
options: Object.values(FLEX_WRAP_ALIGNMENT_OPTIONS), | ||
template: "uk-flex-wrap-$value$", | ||
}, | ||
]; | ||
|
||
propConfig.forEach(({ name, options, template }) => { | ||
Object.defineProperty( | ||
target, | ||
name, | ||
validatedDecorator( | ||
target, | ||
name, | ||
{}, | ||
{ | ||
template: template ?? `uk-flex-$value$`, | ||
options, | ||
} | ||
) | ||
); | ||
}); | ||
|
||
return { | ||
get() { | ||
const flex = this.args[property] ?? descriptor.initializer?.(); | ||
const inline = this.args[camelize(`${prefix}-inline`)]; | ||
|
||
return [ | ||
...(flex ? ["uk-flex"] : []), | ||
...(inline ? ["uk-flex-inline"] : []), | ||
...propConfig.map(({ name }) => this[name]), | ||
] | ||
.filter(Boolean) | ||
.join(" ") | ||
.trim(); | ||
}, | ||
}; | ||
}); |
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,20 @@ | ||
import createDecorator from "ember-uikit/-private/decorator"; | ||
import { validatedDecorator } from "ember-uikit/-private/validated"; | ||
|
||
export const SIZE_OPTIONS = { | ||
DEFAULT: "", | ||
SMALL: "small", | ||
LARGE: "large", | ||
}; | ||
|
||
export default createDecorator(function ( | ||
target, | ||
property, | ||
descriptor, | ||
{ options = Object.values(SIZE_OPTIONS), ...args } = {} | ||
) { | ||
return validatedDecorator(target, property, descriptor, { | ||
options, | ||
...args, | ||
}); | ||
}); |
Oops, something went wrong.