Skip to content

Commit

Permalink
chore: Release 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Aug 4, 2022
1 parent 491417a commit 2128b77
Show file tree
Hide file tree
Showing 81 changed files with 4,078 additions and 6 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,41 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.4.0](https://github.com/naver/egjs-conveyer/compare/1.3.1...1.4.0) (2022-08-04)
### :sparkles: Packages
* `@egjs/conveyer` 1.4.0
* `@egjs/react-conveyer` 1.4.0
* `@egjs/svelte-conveyer` 1.4.0
* `@egjs/vue-conveyer` 1.4.0
* `@egjs/vue2-conveyer` 1.4.0
* `@egjs/ngx-conveyer` 1.4.0


### :rocket: New Features

* All
* add cfcs module (#17) ([6dc1715](https://github.com/naver/egjs-conveyer/commit/6dc17158b701fa9cf997bec9dff8dd7be4d79eaf))


### :bug: Bug Fix

* All
* fix isReachStart's default value (#18) ([9c49266](https://github.com/naver/egjs-conveyer/commit/9c492663a45ca2ec0eabdfae85892906003a6fe9))


### :memo: Documentation

* `@egjs/vue2-conveyer`
* fix README ([1eedb60](https://github.com/naver/egjs-conveyer/commit/1eedb608b437c3b401dcd28036aab4b0cbf30fa5))


### :mega: Other

* All
* update packages versions ([491417a](https://github.com/naver/egjs-conveyer/commit/491417a29531c18ecd8dc13b58debf75b3ba3292))



## [1.3.1](https://github.com/naver/egjs-conveyer/compare/1.3.0...1.3.1) (2022-07-01)
### :sparkles: Packages
* `@egjs/conveyer` 1.3.1
Expand Down
4 changes: 2 additions & 2 deletions jsdoc.json
Expand Up @@ -10,8 +10,8 @@
"include": [
"README.md",
"packages/conveyer/src",
"packages/conveyer/node_modules/@egjs/component/src/Component.ts",
"packages/conveyer/node_modules/@egjs/component/src/ComponentEvent.ts"
"node_modules/@egjs/component/src/Component.ts",
"node_modules/@egjs/component/src/ComponentEvent.ts"
],
"includePattern": ".+\\.(j|t)s(doc|x)?$",
"excludePattern": "(^|\\/|\\\\)_"
Expand Down
19 changes: 19 additions & 0 deletions packages/conveyer/CHANGELOG.md
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.4.0](https://github.com/naver/egjs-conveyer/compare/@egjs/conveyer@1.3.1...@egjs/conveyer@1.4.0) (2022-08-04)


### :rocket: New Features

* add cfcs module (#17) ([6dc1715](https://github.com/naver/egjs-conveyer/commit/6dc17158b701fa9cf997bec9dff8dd7be4d79eaf))


### :bug: Bug Fix

* fix isReachStart's default value (#18) ([9c49266](https://github.com/naver/egjs-conveyer/commit/9c492663a45ca2ec0eabdfae85892906003a6fe9))


### :mega: Other

* update packages versions ([491417a](https://github.com/naver/egjs-conveyer/commit/491417a29531c18ecd8dc13b58debf75b3ba3292))



## [1.3.1](https://github.com/naver/egjs-conveyer/compare/@egjs/conveyer@1.3.0...@egjs/conveyer@1.3.1) (2022-07-01)


Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/api/Conveyer.mdx
Expand Up @@ -56,7 +56,7 @@ const conveyer = new Conveyer(".items");
**Type**: boolean
**Default**: false
**Default**: true
```js
import { Conveyer } from "@egjs/conveyer";
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/docusaurus.config.js
Expand Up @@ -159,8 +159,8 @@ module.exports = {
require.resolve('./src/css/examples.css'),
require.resolve('./src/css/custom.css'),
require.resolve('./src/css/scroll-into-view-target.css'),
require.resolve('./node_modules/@egjs/react-flicking/dist/flicking.css'),
require.resolve('./node_modules/@egjs/flicking-plugins/dist/flicking-plugins.css'),
require.resolve('../../node_modules/@egjs/react-flicking/dist/flicking.css'),
require.resolve('../../node_modules/@egjs/flicking-plugins/dist/flicking-plugins.css'),
require.resolve('./src/css/bulma-override.sass')
]
}
Expand Down
Expand Up @@ -56,7 +56,7 @@ const conveyer = new Conveyer(".items");
**Type**: boolean
**Default**: false
**Default**: true
```js
import { Conveyer } from "@egjs/conveyer";
Expand Down
@@ -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>

@@ -0,0 +1,211 @@
---
custom_edit_url: null
---

```ts
class Component
```

<div>

</div>

컴포넌트의 이벤트을 관리할 수 있게 하는 클래스

<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>

버전정보 문자열

**Type**: string

Component.VERSION; // ex) 3.0.0

## Methods

### trigger {#trigger}

<div>

</div>

커스텀 이벤트를 발생시킨다

**Returns**: this
- 컴포넌트 자신의 인스턴스

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|event|string \| ComponentEvent|||발생할 커스텀 이벤트의 이름 또는 ComponentEvent의 인스턴스|
|params|Array&lt;any&gt; \| $ts:...|||커스텀 이벤트가 발생할 때 전달할 데이터|

```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>

이벤트가 한번만 실행된다.

**Returns**: this
- 컴포넌트 자신의 인스턴스

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|eventName|string \| $ts:...|||등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트|
|handlerToAttach|function \| $ts:...|✔️||등록할 이벤트의 핸들러 함수|

```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>

컴포넌트에 이벤트가 등록됐는지 확인한다.

**Returns**: boolean
- 이벤트 등록 여부

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|eventName|string|||등록 여부를 확인할 이벤트의 이름|

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

### on {#on}

<div>

</div>

컴포넌트에 이벤트를 등록한다.

**Returns**: this
- 컴포넌트 자신의 인스턴스

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|eventName|string \| $ts:...|||등록할 이벤트의 이름 또는 이벤트 이름-핸들러 오브젝트|
|handlerToAttach|function \| $ts:...|✔️||등록할 이벤트의 핸들러 함수|

```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>

컴포넌트에 등록된 이벤트를 해제한다.<br/>`eventName`이 주어지지 않았을 경우 모든 이벤트 핸들러를 제거한다.<br/>`handlerToAttach`가 주어지지 않았을 경우 `eventName`에 해당하는 모든 이벤트 핸들러를 제거한다.

**Returns**: this
- 컴포넌트 자신의 인스턴스

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|eventName|string \| $ts:...|✔️||해제할 이벤트의 이름|
|handlerToDetach|function \| $ts:...|✔️||해제할 이벤트의 핸들러 함수|

```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
}
}
```

0 comments on commit 2128b77

Please sign in to comment.