Skip to content

Commit

Permalink
chore: Release 4.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Jul 26, 2022
1 parent d4aa615 commit d529854
Show file tree
Hide file tree
Showing 59 changed files with 10,761 additions and 2 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.6.0](https://github.com/naver/egjs-infinitegrid/compare/4.5.0...4.6.0) (2022-07-26)
### :sparkles: Packages
* `@egjs/infinitegrid` 4.6.0
* `@egjs/react-infinitegrid` 4.6.0
* `@egjs/svelte-infinitegrid` 4.6.0
* `@egjs/vue-infinitegrid` 4.6.0
* `@egjs/vue3-infinitegrid` 4.6.0
* `@egjs/ngx-infinitegrid` 4.6.0


### :bug: Bug Fix

* `@egjs/infinitegrid`
* fit groups' outlines for start direction (#502) ([51308c0](https://github.com/naver/egjs-infinitegrid/commit/51308c0750caa517d325a320ac2f14dcfc097337))
* fix items to be removed (#500) ([8317f39](https://github.com/naver/egjs-infinitegrid/commit/8317f3926318e468ef49e9f28d54384c12ae3565))
* fix mounted setting (#497) ([6d4a281](https://github.com/naver/egjs-infinitegrid/commit/6d4a281e17570b9049afebe651fd4708d230be36))
* fix outline calculation (#498) ([0446dd4](https://github.com/naver/egjs-infinitegrid/commit/0446dd48f2d532dffc3a460472080fcd78df5724))


### :mega: Other

* All
* update packages versions ([d4aa615](https://github.com/naver/egjs-infinitegrid/commit/d4aa615a8cd3e25b621500e2a7b243dcc9696eef))



## [4.5.0](https://github.com/naver/egjs-infinitegrid/compare/4.4.0...4.5.0) (2022-06-23)
### :sparkles: Packages
* `@egjs/infinitegrid` 4.5.0
Expand Down
3 changes: 2 additions & 1 deletion packages/docs/docs/api/MasonryInfiniteGridOptions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ custom_edit_url: null
|column|number|<p>The number of columns. If the number of columns is 0, it is automatically calculated according to the size of the container. Can be used instead of outlineLength. (default: 0)</p>|
|columnSize|number|<p>The size of the columns. If it is 0, it is calculated as the size of the first item in items. Can be used instead of outlineSize. (default: 0) </p>|
|columnSizeRatio|number|<p>The size ratio(inlineSize / contentSize) of the columns. 0 is not set. (default: 0) </p>|
|align|GridAlign|<p>Align of the position of the items. If you want to use <code>stretch</code>, be sure to set <code>column</code> or <code>columnSize</code> option. (&quot;start&quot;, &quot;center&quot;, &quot;end&quot;, &quot;justify&quot;, &quot;stretch&quot;) (default: &quot;justify&quot;) </p>|
|align|GridAlign|<p>Align of the position of the items. If you want to use <code>stretch</code>, be sure to set <code>column</code>, <code>columnSize</code> or <code>maxStretchColumnSize</code> option. (&quot;start&quot;, &quot;center&quot;, &quot;end&quot;, &quot;justify&quot;, &quot;stretch&quot;) (default: &quot;justify&quot;) </p>|
|columnCalculationThreshold|number|<p>Difference Threshold for Counting Columns. Since offsetSize is calculated by rounding, the number of columns may not be accurate. (default: 1) </p>|
|maxStretchColumnSize|number|<p>If stretch is used, the column can be automatically calculated by setting the maximum size of the column that can be stretched. (default: Infinity) </p>|
|horizontal|boolean||
|percentage|Array&lt;"position" \| "size"&gt; \| boolean||
|isEqualSize|boolean||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ custom_edit_url: null
|column|number|열의 개수. 열의 개수가 0이라면, 컨테이너의 사이즈에 의해 계산이 된다. outlineLength 대신 사용할 수 있다.(default: 0) |
|columnSize|number| 열의 사이즈. 만약 열의 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. outlineSize 대신 사용할 수 있다.(default: 0) |
|columnSizeRatio|number|열의 사이즈 비율(inlineSize / contentSize). 0은 미설정이다. |
|align|GridAlign|아이템들의 위치의 정렬. <code>stretch</code>를 사용하고 싶다면 <code>column</code> 또는 <code>columnSize</code> 옵션을 설정해라. (&quot;start&quot;, &quot;center&quot;, &quot;end&quot;, &quot;justify&quot;, &quot;stretch&quot;) (default: &quot;justify&quot;)|
|align|GridAlign|아이템들의 위치의 정렬. <code>stretch</code>를 사용하고 싶다면 <code>column</code>, <code>columnSize</code> 또는 <code>maxStretchColumnSize</code> 옵션을 설정해라. (&quot;start&quot;, &quot;center&quot;, &quot;end&quot;, &quot;justify&quot;, &quot;stretch&quot;) (default: &quot;justify&quot;)|
|columnCalculationThreshold|number|칼럼 개수를 계산하기 위한 차이 임계값. offset 사이즈는 반올림으로 게산하기 때문에 정확하지 않을 수 있다. (default: 1)|
|maxStretchColumnSize|number|stretch를 사용한 경우 최대로 늘릴 수 있는 column의 사이즈를 설정하여 column을 자동 계산할 수 있다. (default: Infinity)|
|horizontal|boolean||
|percentage|Array&lt;"position" \| "size"&gt; \| boolean||
|isEqualSize|boolean||
Expand Down
Original file line number Diff line number Diff line change
@@ -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 d529854

Please sign in to comment.