@reco-inc/upbox-ui 1.1.4 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FigmaConnect.md +1 -0
- package/dist/FigmaConnect.md +1 -0
- package/dist/components/button/Button.d.ts +15 -5
- package/dist/components/button/Button.stories.d.ts +11 -13
- package/dist/index.mjs +1247 -1229
- package/package.json +1 -1
package/FigmaConnect.md
CHANGED
|
@@ -136,6 +136,7 @@
|
|
|
136
136
|
| Vue Prop | 타입 | 기본값 | 설명 |
|
|
137
137
|
|---|---|---|---|
|
|
138
138
|
| `loading` | `boolean` | `false` | 로딩 스피너 자동 노출, 클릭 무시 |
|
|
139
|
+
| `autoLoading` | `boolean` | `false` | 클릭 핸들러가 돌려준 Promise 가 끝날 때까지 스스로 loading |
|
|
139
140
|
| `block` | `boolean` | `false` | 가로 100% |
|
|
140
141
|
| `type` | `button / submit / reset` | `button` | 네이티브 `type` |
|
|
141
142
|
| `class` | `string` | - | 추가 클래스 |
|
package/dist/FigmaConnect.md
CHANGED
|
@@ -136,6 +136,7 @@
|
|
|
136
136
|
| Vue Prop | 타입 | 기본값 | 설명 |
|
|
137
137
|
|---|---|---|---|
|
|
138
138
|
| `loading` | `boolean` | `false` | 로딩 스피너 자동 노출, 클릭 무시 |
|
|
139
|
+
| `autoLoading` | `boolean` | `false` | 클릭 핸들러가 돌려준 Promise 가 끝날 때까지 스스로 loading |
|
|
139
140
|
| `block` | `boolean` | `false` | 가로 100% |
|
|
140
141
|
| `type` | `button / submit / reset` | `button` | 네이티브 `type` |
|
|
141
142
|
| `class` | `string` | - | 추가 클래스 |
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'vue';
|
|
2
|
+
export type ButtonClickHandler = (event: MouseEvent) => unknown;
|
|
2
3
|
export interface ButtonProps {
|
|
3
4
|
variant?: 'primary' | 'destructive' | 'secondary' | 'tertiary';
|
|
4
5
|
theme?: 'filled' | 'outlined';
|
|
@@ -6,6 +7,18 @@ export interface ButtonProps {
|
|
|
6
7
|
block?: boolean;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
loading?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 클릭 핸들러가 Promise 를 돌려주면 끝날 때까지 스스로 loading 상태를 유지한다.
|
|
12
|
+
* 그 사이 다시 누른 클릭은 무시한다. 핸들러는 API 호출(과 성공 후 화면 이동)을 `await` 하거나 `return` 해야 한다
|
|
13
|
+
*/
|
|
14
|
+
autoLoading?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* `@click` 핸들러. emit 이 아니라 prop 으로 받아야 핸들러가 돌려준 Promise 를 기다릴 수 있다.
|
|
17
|
+
* reka 트리거의 `as-child` 로 감싸면 트리거 핸들러와 합쳐져 배열로 들어온다
|
|
18
|
+
*/
|
|
19
|
+
onClick?: ButtonClickHandler | ButtonClickHandler[];
|
|
20
|
+
/** `@click.once` 핸들러. emit 을 쓰던 때처럼 처음 한 번만 부른다 */
|
|
21
|
+
onClickOnce?: ButtonClickHandler | ButtonClickHandler[];
|
|
9
22
|
type?: 'button' | 'submit' | 'reset';
|
|
10
23
|
class?: HTMLAttributes['class'];
|
|
11
24
|
}
|
|
@@ -18,11 +31,7 @@ declare function __VLS_template(): {
|
|
|
18
31
|
rootEl: HTMLButtonElement;
|
|
19
32
|
};
|
|
20
33
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
21
|
-
declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
|
-
click: (event: MouseEvent) => any;
|
|
23
|
-
}, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{
|
|
24
|
-
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
25
|
-
}>, {
|
|
34
|
+
declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
|
|
26
35
|
disabled: boolean;
|
|
27
36
|
type: "button" | "submit" | "reset";
|
|
28
37
|
size: "xsmall" | "small" | "regular" | "large" | "xlarge";
|
|
@@ -30,6 +39,7 @@ declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}
|
|
|
30
39
|
loading: boolean;
|
|
31
40
|
variant: "primary" | "destructive" | "secondary" | "tertiary";
|
|
32
41
|
block: boolean;
|
|
42
|
+
autoLoading: boolean;
|
|
33
43
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
34
44
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
35
45
|
export default _default;
|
|
@@ -2,11 +2,7 @@ import { StoryObj } from '@storybook/vue3-vite';
|
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
4
|
component: {
|
|
5
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./Button').ButtonProps> & Readonly<{
|
|
6
|
-
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
7
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
-
click: (event: MouseEvent) => any;
|
|
9
|
-
}, import('vue').PublicProps, {
|
|
5
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./Button').ButtonProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
10
6
|
disabled: boolean;
|
|
11
7
|
type: "button" | "submit" | "reset";
|
|
12
8
|
size: "xsmall" | "small" | "regular" | "large" | "xlarge";
|
|
@@ -14,6 +10,7 @@ declare const meta: {
|
|
|
14
10
|
loading: boolean;
|
|
15
11
|
variant: "primary" | "destructive" | "secondary" | "tertiary";
|
|
16
12
|
block: boolean;
|
|
13
|
+
autoLoading: boolean;
|
|
17
14
|
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLButtonElement, import('vue').ComponentProvideOptions, {
|
|
18
15
|
P: {};
|
|
19
16
|
B: {};
|
|
@@ -21,9 +18,7 @@ declare const meta: {
|
|
|
21
18
|
C: {};
|
|
22
19
|
M: {};
|
|
23
20
|
Defaults: {};
|
|
24
|
-
}, Readonly<import('./Button').ButtonProps> & Readonly<{
|
|
25
|
-
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
26
|
-
}>, {}, {}, {}, {}, {
|
|
21
|
+
}, Readonly<import('./Button').ButtonProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
27
22
|
disabled: boolean;
|
|
28
23
|
type: "button" | "submit" | "reset";
|
|
29
24
|
size: "xsmall" | "small" | "regular" | "large" | "xlarge";
|
|
@@ -31,15 +26,12 @@ declare const meta: {
|
|
|
31
26
|
loading: boolean;
|
|
32
27
|
variant: "primary" | "destructive" | "secondary" | "tertiary";
|
|
33
28
|
block: boolean;
|
|
29
|
+
autoLoading: boolean;
|
|
34
30
|
}>;
|
|
35
31
|
__isFragment?: never;
|
|
36
32
|
__isTeleport?: never;
|
|
37
33
|
__isSuspense?: never;
|
|
38
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('./Button').ButtonProps> & Readonly<{
|
|
39
|
-
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
40
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
41
|
-
click: (event: MouseEvent) => any;
|
|
42
|
-
}, string, {
|
|
34
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('./Button').ButtonProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
43
35
|
disabled: boolean;
|
|
44
36
|
type: "button" | "submit" | "reset";
|
|
45
37
|
size: "xsmall" | "small" | "regular" | "large" | "xlarge";
|
|
@@ -47,6 +39,7 @@ declare const meta: {
|
|
|
47
39
|
loading: boolean;
|
|
48
40
|
variant: "primary" | "destructive" | "secondary" | "tertiary";
|
|
49
41
|
block: boolean;
|
|
42
|
+
autoLoading: boolean;
|
|
50
43
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
51
44
|
$slots: {
|
|
52
45
|
default?(_: {}): any;
|
|
@@ -86,6 +79,11 @@ export declare const Primary: Story;
|
|
|
86
79
|
export declare const Variants: Story;
|
|
87
80
|
export declare const Sizes: Story;
|
|
88
81
|
export declare const Loading: Story;
|
|
82
|
+
/**
|
|
83
|
+
* `auto-loading` 을 붙이면 클릭 핸들러가 돌려준 Promise 가 끝날 때까지 스스로 loading 이 된다.
|
|
84
|
+
* 그 사이 다시 누른 클릭은 무시되어, 저장 요청이 두 번 나가지 않는다.
|
|
85
|
+
*/
|
|
86
|
+
export declare const AutoLoading: Story;
|
|
89
87
|
export declare const Disabled: Story;
|
|
90
88
|
/**
|
|
91
89
|
* 특정 조건에 걸려 액션을 수행할 수 없는 경우에는 버튼을 `disabled` 로 막지 않는다.
|