Skip to content

Commit

Permalink
fix(deps): remove ember-composable-helpers dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed Nov 28, 2024
1 parent c748a1e commit 60cd03e
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 138 deletions.
14 changes: 14 additions & 0 deletions addon/-private/optional-argument.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import createDecorator from "ember-uikit/-private/decorator";

export default createDecorator(function (
target,
property,
descriptor,
defaultValue = () => {},
) {
return {
get() {
return this.args[property] ?? defaultValue;
},
};
});
2 changes: 1 addition & 1 deletion addon/components/uk-button.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}}
disabled={{@disabled}}
title={{@title}}
{{on "click" (optional @onClick)}}
{{on "click" this.onClick}}
...attributes
>
{{#if @loading}}
Expand Down
3 changes: 3 additions & 0 deletions addon/components/uk-button.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Component from "@glimmer/component";

import color, { COLOR_OPTIONS } from "ember-uikit/-private/color";
import optionalArgument from "ember-uikit/-private/optional-argument";
import size from "ember-uikit/-private/size";
import width from "ember-uikit/-private/width";

Expand All @@ -22,4 +23,6 @@ export default class UkButtonComponent extends Component {

@size({ template: "uk-button-$value$" }) size;
@width width;

@optionalArgument onClick;
}
10 changes: 5 additions & 5 deletions addon/components/uk-sortable.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
cls-empty={{@clsEmpty}}
cls-custom={{@clsCustom}}
{{register-uikit-events
start=(optional @onStart)
stop=(optional @onStop)
moved=(optional @onMoved)
added=(optional @onAdded)
removed=(optional @onRemoved)
start=this.onStart
stop=this.onStop
moved=this.onMoved
added=this.onAdded
removed=this.onRemoved
}}
...attributes
>
Expand Down
11 changes: 11 additions & 0 deletions addon/components/uk-sortable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Component from "@glimmer/component";

import optionalArgument from "ember-uikit/-private/optional-argument";

export default class UkSortableComponent extends Component {
@optionalArgument onStart;
@optionalArgument onStop;
@optionalArgument onMoved;
@optionalArgument onAdded;
@optionalArgument onRemoved;
}
12 changes: 6 additions & 6 deletions addon/components/uk-switcher/content/item.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<li
{{register-uikit-events
beforeshow=(optional @onBeforeShow)
show=(optional @onShow)
shown=(optional @onShown)
beforehide=(optional @onBeforeHide)
hide=(optional @onHide)
hidden=(optional @onHidden)
beforeshow=this.onBeforeShow
show=this.onShow
shown=this.onShown
beforehide=this.onBeforeHide
hide=this.onHide
hidden=this.onHidden
}}
...attributes
>
Expand Down
12 changes: 12 additions & 0 deletions addon/components/uk-switcher/content/item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Component from "@glimmer/component";

import optionalArgument from "ember-uikit/-private/optional-argument";

export default class UkSwitcherContentItemComponent extends Component {
@optionalArgument onBeforeShow;
@optionalArgument onShow;
@optionalArgument onShown;
@optionalArgument onBeforeHide;
@optionalArgument onHide;
@optionalArgument onHidden;
}
1 change: 0 additions & 1 deletion blueprints/ember-uikit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module.exports = {
return this.addAddonsToProject({
packages: [
{ name: "ember-cli-sass" },
{ name: "ember-composable-helpers" },
{ name: "ember-truth-helpers" },
{ name: "ember-focus-trap" },
{ name: "ember-toggle" },
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"ember-auto-import": "^2.10.0",
"ember-cli-babel": "^8.2.0",
"ember-cli-htmlbars": "^6.3.0",
"ember-composable-helpers": "^5.0.0",
"ember-focus-trap": "^1.1.0",
"ember-modifier": "^4.2.0",
"ember-toggle": "^9.0.3",
Expand Down
Loading

0 comments on commit 60cd03e

Please sign in to comment.