Skip to content

Commit

Permalink
chore: Release 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
youjin-ahn committed Sep 22, 2023
1 parent 34785f2 commit 40b491b
Show file tree
Hide file tree
Showing 74 changed files with 3,444 additions and 0 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.7.0](https://github.com/naver/egjs-conveyer/compare/1.6.2...1.7.0) (2023-09-22)
### :sparkles: Packages
* `@egjs/conveyer` 1.7.0
* `@egjs/react-conveyer` 1.7.0
* `@egjs/svelte-conveyer` 1.7.0
* `@egjs/vue-conveyer` 1.7.0
* `@egjs/vue2-conveyer` 1.7.0
* `@egjs/ngx-conveyer` 1.7.0


### :rocket: New Features

* `@egjs/conveyer`
* add useResizeObserver option (#51) ([57138e7](https://github.com/naver/egjs-conveyer/commit/57138e7923e00705e6d275bbd750c2e0db90cfea))


### :house: Code Refactoring

* `@egjs/conveyer`
* remove itemElements member ([c666863](https://github.com/naver/egjs-conveyer/commit/c6668637661dcb062fd98b5058af6fc987ca200f))


### :mega: Other

* All
* update packages versions ([34785f2](https://github.com/naver/egjs-conveyer/commit/34785f27897a3c7b983bc9f18ce50fdc517c9757))



## [1.6.2](https://github.com/naver/egjs-conveyer/compare/1.6.1...1.6.2) (2023-08-25)
### :sparkles: Packages
* `@egjs/conveyer` 1.6.2
Expand Down
19 changes: 19 additions & 0 deletions packages/conveyer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.7.0](https://github.com/naver/egjs-conveyer/compare/@egjs/[email protected]...@egjs/[email protected]) (2023-09-22)


### :rocket: New Features

* add useResizeObserver option (#51) ([57138e7](https://github.com/naver/egjs-conveyer/commit/57138e7923e00705e6d275bbd750c2e0db90cfea))


### :house: Code Refactoring

* remove itemElements member ([c666863](https://github.com/naver/egjs-conveyer/commit/c6668637661dcb062fd98b5058af6fc987ca200f))


### :mega: Other

* update packages versions ([34785f2](https://github.com/naver/egjs-conveyer/commit/34785f27897a3c7b983bc9f18ce50fdc517c9757))



## [1.6.2](https://github.com/naver/egjs-conveyer/compare/@egjs/[email protected]...@egjs/[email protected]) (2023-08-25)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
custom_edit_url: null
---

```ts
const CONVEYER_METHODS
```

<div>

</div>

<p>egjs-conveyer<br />Copyright (c) 2022-present NAVER Corp.<br />MIT license</p>

211 changes: 211 additions & 0 deletions packages/docs/versioned_docs/version-1.7.0/api/Component.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
---
custom_edit_url: null
---

```ts
class Component
```

<div>

</div>

<p>A class used to manage events in a component</p>

<div className="container">
<div className="row mb-2"><div className="col col--6"><strong>Properties</strong></div><div className="col col--6"><strong>Methods</strong></div></div>
<div className="row"><div className="col col--6"><a href="#VERSION">VERSION</a><span className="badge badge--info margin-left--sm">static</span></div><div className="col col--6"><a href="#trigger">trigger</a><br/><a href="#once">once</a><br/><a href="#hasOn">hasOn</a><br/><a href="#on">on</a><br/><a href="#off">off</a></div></div>
</div>

## Properties
### VERSION {#VERSION}

<div>
<span className="badge badge--info">static</span>
</div>

<p>Version info string</p>

**Type**: string

Component.VERSION; // ex) 3.0.0

## Methods

### trigger {#trigger}

<div>

</div>

<p>Trigger a custom event.</p>

**Returns**: this
- <p>An instance of the component itself</p>

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|event|string \| ComponentEvent|||<p>The name of the custom event to be triggered or an instance of the ComponentEvent</p>|
|params|Array&lt;any&gt; \| $ts:...|||<p>Event data to be sent when triggering a custom event </p>|

```ts
import Component, { ComponentEvent } from "@egjs/component";
class Some extends Component<{
beforeHi: ComponentEvent<{ foo: number; bar: string }>;
hi: { foo: { a: number; b: boolean } };
someEvent: (foo: number, bar: string) => void;
someOtherEvent: void; // When there's no event argument
}> {
some(){
if(this.trigger("beforeHi")){ // When event call to stop return false.
this.trigger("hi");// fire hi event.
}
}
}
const some = new Some();
some.on("beforeHi", e => {
if(condition){
e.stop(); // When event call to stop, `hi` event not call.
}
// `currentTarget` is component instance.
console.log(some === e.currentTarget); // true
typeof e.foo; // number
typeof e.bar; // string
});
some.on("hi", e => {
typeof e.foo.b; // boolean
});
// If you want to more know event design. You can see article.
// https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F
```

### once {#once}

<div>

</div>

<p>Executed event just one time.</p>

**Returns**: this
- <p>An instance of the component itself</p>

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|eventName|string \| $ts:...|||<p>The name of the event to be attached or an event name - event handler mapped object.</p>|
|handlerToAttach|function \| $ts:...|✔️||<p>The handler function of the event to be attached </p>|

```ts
import Component, { ComponentEvent } from "@egjs/component";
class Some extends Component<{
hi: ComponentEvent;
}> {
hi() {
alert("hi");
}
thing() {
this.once("hi", this.hi);
}
}
var some = new Some();
some.thing();
some.trigger(new ComponentEvent("hi"));
// fire alert("hi");
some.trigger(new ComponentEvent("hi"));
// Nothing happens
```

### hasOn {#hasOn}

<div>

</div>

<p>Checks whether an event has been attached to a component.</p>

**Returns**: boolean
- <p>Indicates whether the event is attached. </p>

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|eventName|string|||<p>The name of the event to be attached </p>|

```ts
import Component from "@egjs/component";
class Some extends Component<{
hi: void;
}> {
some() {
this.hasOn("hi");// check hi event.
}
}
```

### on {#on}

<div>

</div>

<p>Attaches an event to a component.</p>

**Returns**: this
- <p>An instance of a component itself</p>

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|eventName|string \| $ts:...|||<p>The name of the event to be attached or an event name - event handler mapped object.</p>|
|handlerToAttach|function \| $ts:...|✔️||<p>The handler function of the event to be attached </p>|

```ts
import Component, { ComponentEvent } from "@egjs/component";
class Some extends Component<{
hi: void;
}> {
hi() {
console.log("hi");
}
some() {
this.on("hi",this.hi); //attach event
}
}
```

### off {#off}

<div>

</div>

<p>Detaches an event from the component.<br/>If the <code>eventName</code> is not given this will detach all event handlers attached.<br/>If the <code>handlerToDetach</code> is not given, this will detach all event handlers for <code>eventName</code>.</p>

**Returns**: this
- <p>An instance of a component itself </p>

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|eventName|string \| $ts:...|✔️||<p>The name of the event to be detached </p>|
|handlerToDetach|function \| $ts:...|✔️||<p>The handler function of the event to be detached </p>|

```ts
import Component, { ComponentEvent } from "@egjs/component";
class Some extends Component<{
hi: void;
}> {
hi() {
console.log("hi");
}
some() {
this.off("hi",this.hi); //detach event
}
}
```

Loading

0 comments on commit 40b491b

Please sign in to comment.