@sellmate/design-system-vue 1.0.69 โ 1.0.70
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/README.md +219 -66
- package/dist/components.js +10 -4
- package/lib/components.ts +10 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,111 +2,264 @@
|
|
|
2
2
|
|
|
3
3
|
Vue 3 component wrappers for Sellmate Design System built with Stencil web components.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install @sellmate/design-system-vue
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
---
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
yarn add @sellmate/design-system-vue
|
|
15
|
-
```
|
|
13
|
+
## Project Setup
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
### Vue 3 (Vite)
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
**1. CSS ์ ์ญ import + ํ๋ฌ๊ทธ์ธ ๋ฑ๋ก** โ `src/main.ts`
|
|
20
18
|
|
|
21
19
|
```ts
|
|
22
|
-
import '@sellmate/design-system/styles.css';
|
|
23
20
|
import { createApp } from 'vue';
|
|
24
|
-
import
|
|
21
|
+
import '@sellmate/design-system/styles.css';
|
|
22
|
+
import { StencilVuePlugin, SdModalVuePlugin } from '@sellmate/design-system-vue';
|
|
25
23
|
import App from './App.vue';
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
createApp(App)
|
|
26
|
+
.use(StencilVuePlugin) // ์ปค์คํ
์๋ฆฌ๋จผํธ ์ ์ญ ๋ฑ๋ก (ํ์)
|
|
27
|
+
.use(SdModalVuePlugin) // sdModal.create Vue ์ปดํฌ๋ํธ ์ง์ (ํ์)
|
|
28
|
+
.mount('#app');
|
|
31
29
|
```
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
> **`StencilVuePlugin`์ ํ์์
๋๋ค.** React์ ๋ฌ๋ฆฌ Vue ๋ํผ ์ปดํฌ๋ํธ๋ import ์์ ์ ์ปค์คํ
์๋ฆฌ๋จผํธ๋ฅผ ์๋ ๋ฑ๋กํ์ง ์์ผ๋ฏ๋ก, ํ๋ฌ๊ทธ์ธ์ ํตํ ๋ช
์์ ๋ฑ๋ก์ด ํ์ํฉ๋๋ค.
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
**2. SdModalContainer ์ต์๋จ ๋ฐฐ์น** โ `src/App.vue`
|
|
36
34
|
|
|
37
|
-
|
|
35
|
+
`sdModal`์ `sd-modal-container`๋ฅผ ์๋์ผ๋ก ์์ฑํ์ง๋ง, z-index ์ ์ด ๋ฐ ๋ ๋ ์์น๋ฅผ ๋ช
์์ ์ผ๋ก ์ง์ ํ๋ ค๋ฉด ๋ฃจํธ์ ๋ฐฐ์นํฉ๋๋ค.
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
```vue
|
|
38
|
+
<template>
|
|
39
|
+
<SdModalContainer />
|
|
40
|
+
<RouterView />
|
|
41
|
+
</template>
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import { SdModalContainer } from '@sellmate/design-system-vue';
|
|
45
|
+
</script>
|
|
43
46
|
```
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
---
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
## Utility Functions
|
|
51
|
+
|
|
52
|
+
### `sdModal` โ `@sellmate/design-system-vue`
|
|
53
|
+
|
|
54
|
+
Vue ์ปดํฌ๋ํธ๋ฅผ ๋ชจ๋ฌ๋ก ์ด ์ ์๋ Vue-aware ๋ฒ์ ์
๋๋ค.
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { sdModal } from '@sellmate/design-system-vue';
|
|
58
|
+
|
|
59
|
+
// Confirm ๋ชจ๋ฌ
|
|
60
|
+
sdModal
|
|
61
|
+
.confirm({
|
|
62
|
+
type: 'positive' | 'negative' | 'default',
|
|
63
|
+
title: '์ ๋ชฉ',
|
|
64
|
+
topMessage: ['๋ฉ์์ง'],
|
|
65
|
+
mainButtonLabel: 'ํ์ธ',
|
|
66
|
+
subButtonLabel: '์ทจ์',
|
|
67
|
+
persistent: false, // true ์ ESC/๋ฐฑ๋๋กญ์ผ๋ก ๋ซ๊ธฐ ๋ถ๊ฐ
|
|
68
|
+
})
|
|
69
|
+
.onOk(() => {})
|
|
70
|
+
.onCancel(() => {})
|
|
71
|
+
.onClose(() => {});
|
|
72
|
+
|
|
73
|
+
// Vue ์ปดํฌ๋ํธ๋ฅผ ๋ชจ๋ฌ๋ก ์ด๊ธฐ
|
|
74
|
+
sdModal.create({
|
|
75
|
+
component: MyModalComponent,
|
|
76
|
+
componentProps: { title: '์ ๋ชฉ' }, // ์ปดํฌ๋ํธ์ ์ ๋ฌํ props
|
|
77
|
+
persistent: true,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// Loading ๋ชจ๋ฌ
|
|
81
|
+
const dialog = sdModal.loading({ state: 'loading' });
|
|
82
|
+
dialog.update({ state: 'error', message: '์ค๋ฅ ๋ฐ์' });
|
|
83
|
+
dialog.close();
|
|
84
|
+
|
|
85
|
+
// ์ ์ญ ์ค์
|
|
86
|
+
sdModal.configure({ zIndex: 1000 });
|
|
49
87
|
```
|
|
50
88
|
|
|
51
|
-
|
|
89
|
+
> **React์์ ์ฐจ์ด**: `sdModal.create`์ Vue ์ปดํฌ๋ํธ๋ฅผ ์ ๋ฌํ๋ฉด ๋ฉ์ธ ์ฑ์ ์ปจํ
์คํธ(`provide/inject`, ํ๋ฌ๊ทธ์ธ, `compilerOptions` ๋ฑ)๊ฐ **์๋์ผ๋ก ์์๋ฉ๋๋ค**. `SdModalVuePlugin`์ด ์ค์น๋์ง ์์ ๊ฒฝ์ฐ ์๋ฌ๊ฐ ๋ฐ์ํฉ๋๋ค.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### `sdToast` โ `@sellmate/design-system`
|
|
52
94
|
|
|
53
95
|
```ts
|
|
54
|
-
import {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
96
|
+
import { sdToast } from '@sellmate/design-system';
|
|
97
|
+
|
|
98
|
+
// ํ ์คํธ ์์ฑ
|
|
99
|
+
await sdToast.create('๋ฉ์์ง', 'success' | 'error' | 'warning' | 'info');
|
|
100
|
+
|
|
101
|
+
// ๊ฐ๋ณ/์ ์ฒด ๋ซ๊ธฐ
|
|
102
|
+
await sdToast.dismiss(id);
|
|
103
|
+
await sdToast.dismissAll();
|
|
104
|
+
|
|
105
|
+
// ์ ์ญ ์ค์
|
|
106
|
+
sdToast.configure({
|
|
107
|
+
position: 'top-right',
|
|
108
|
+
maxVisible: 5,
|
|
109
|
+
defaultDuration: 3000,
|
|
110
|
+
zIndex: 9999,
|
|
67
111
|
});
|
|
68
112
|
```
|
|
69
113
|
|
|
70
|
-
|
|
114
|
+
> `sdToast`๋ `sd-toast-container`๋ฅผ ์๋์ผ๋ก ์์ฑํ๋ฏ๋ก ๋ณ๋์ Provider ๋ฐฐ์น๊ฐ ๋ถํ์ํฉ๋๋ค.
|
|
71
115
|
|
|
72
|
-
|
|
116
|
+
---
|
|
73
117
|
|
|
74
|
-
|
|
75
|
-
<template>
|
|
76
|
-
<div>
|
|
77
|
-
<SdButton @click="handleClick"> Click me </SdButton>
|
|
78
|
-
</div>
|
|
79
|
-
</template>
|
|
118
|
+
### `sdLoading` โ `@sellmate/design-system`
|
|
80
119
|
|
|
81
|
-
|
|
82
|
-
import {
|
|
120
|
+
```ts
|
|
121
|
+
import { sdLoading } from '@sellmate/design-system';
|
|
83
122
|
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
123
|
+
const hide = sdLoading.show(); // ์ ์ฒดํ๋ฉด ๋ก๋ฉ ํ์
|
|
124
|
+
hide(); // ๋ก๋ฉ ์จ๊น
|
|
125
|
+
|
|
126
|
+
sdLoading.show({ message: '์ฒ๋ฆฌ ์ค...' });
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Available Components
|
|
132
|
+
|
|
133
|
+
### ์
๋ ฅ
|
|
134
|
+
|
|
135
|
+
| ์ปดํฌ๋ํธ | ์ค๋ช
|
|
|
136
|
+
| ----------------------- | -------------------- |
|
|
137
|
+
| `SdInput` | ํ
์คํธ ์
๋ ฅ |
|
|
138
|
+
| `SdNumberInput` | ์ซ์ ์
๋ ฅ |
|
|
139
|
+
| `SdTextarea` | ๋ฉํฐ๋ผ์ธ ํ
์คํธ ์
๋ ฅ |
|
|
140
|
+
| `SdBarcodeInput` | ๋ฐ์ฝ๋ ์ค์บ๋ ์
๋ ฅ |
|
|
141
|
+
| `SdCheckbox` | ์ฒดํฌ๋ฐ์ค |
|
|
142
|
+
| `SdRadio` | ๋ผ๋์ค ๋ฒํผ |
|
|
143
|
+
| `SdRadioGroup` | ๋ผ๋์ค ๊ทธ๋ฃน |
|
|
144
|
+
| `SdRadioButton` | ๋ฒํผํ ๋ผ๋์ค |
|
|
145
|
+
| `SdSwitch` | ์ค์์น ํ ๊ธ |
|
|
146
|
+
| `SdToggle` | ํ ๊ธ |
|
|
147
|
+
| `SdSelect` | ๋จ์ผ ์ ํ ๋๋กญ๋ค์ด |
|
|
148
|
+
| `SdSelectGroup` | ๊ทธ๋ฃนํ ๋จ์ผ ์ ํ |
|
|
149
|
+
| `SdSelectMultiple` | ๋ค์ค ์ ํ ๋๋กญ๋ค์ด |
|
|
150
|
+
| `SdSelectMultipleGroup` | ๊ทธ๋ฃนํ ๋ค์ค ์ ํ |
|
|
151
|
+
| `SdSelectV2` | ๋จ์ผ/๋ค์ค ์ ํ V2 |
|
|
152
|
+
| `SdDatePicker` | ๋ ์ง ์ ํ |
|
|
153
|
+
| `SdDateRangePicker` | ๋ ์ง ๋ฒ์ ์ ํ |
|
|
154
|
+
| `SdFilePicker` | ํ์ผ ์ ํ |
|
|
155
|
+
|
|
156
|
+
### ๋ฒํผ
|
|
157
|
+
|
|
158
|
+
| ์ปดํฌ๋ํธ | ์ค๋ช
|
|
|
159
|
+
| ------------------ | ---------------- |
|
|
160
|
+
| `SdButton` | ๊ธฐ๋ณธ ๋ฒํผ |
|
|
161
|
+
| `SdButtonV2` | ๋ฒํผ V2 |
|
|
162
|
+
| `SdGhostButton` | ๊ณ ์คํธ ๋ฒํผ |
|
|
163
|
+
| `SdDropdownButton` | ๋๋กญ๋ค์ด ๋ฒํผ |
|
|
164
|
+
| `SdTextLink` | ํ
์คํธ ๋งํฌ ๋ฒํผ |
|
|
165
|
+
|
|
166
|
+
### ํ์
|
|
167
|
+
|
|
168
|
+
| ์ปดํฌ๋ํธ | ์ค๋ช
|
|
|
169
|
+
| -------------------- | ---------------------- |
|
|
170
|
+
| `SdTag` | ํ๊ทธ |
|
|
171
|
+
| `SdBadge` | ๋ฑ์ง |
|
|
172
|
+
| `SdIcon` | ์์ด์ฝ |
|
|
173
|
+
| `SdTooltip` | ํดํ |
|
|
174
|
+
| `SdPopover` | ํ์ค๋ฒ |
|
|
175
|
+
| `SdProgress` | ์งํ ๋ฐ |
|
|
176
|
+
| `SdCircleProgress` | ์ํ ์งํ ๋ฐ |
|
|
177
|
+
| `SdLoadingContainer` | ๋ก๋ฉ ์ค๋ฒ๋ ์ด ์ปจํ
์ด๋ |
|
|
178
|
+
| `SdGuide` | ๊ฐ์ด๋ ํ
์คํธ |
|
|
179
|
+
| `SdCard` | ์นด๋ |
|
|
180
|
+
| `SdCalendar` | ์บ๋ฆฐ๋ ํ์ |
|
|
181
|
+
|
|
182
|
+
### ๋ ์ด์์ / ๊ตฌ์กฐ
|
|
183
|
+
|
|
184
|
+
| ์ปดํฌ๋ํธ | ์ค๋ช
|
|
|
185
|
+
| -------------- | ------------------------------------ |
|
|
186
|
+
| `SdField` | ํผ ํ๋ ๋ํผ (label + input + error) |
|
|
187
|
+
| `SdForm` | ํผ ์ ํจ์ฑ ๊ฒ์ฌ ์ปจํ
์ด๋ |
|
|
188
|
+
| `SdTabs` | ํญ ๋ค๋น๊ฒ์ด์
|
|
|
189
|
+
| `SdTable` | ๋ฐ์ดํฐ ํ
์ด๋ธ |
|
|
190
|
+
| `SdPagination` | ํ์ด์ง๋ค์ด์
|
|
|
191
|
+
|
|
192
|
+
### ๋ชจ๋ฌ / ์๋ฆผ
|
|
193
|
+
|
|
194
|
+
| ์ปดํฌ๋ํธ | ์ค๋ช
|
|
|
195
|
+
| ------------------ | ------------------------------------ |
|
|
196
|
+
| `SdModalContainer` | sdModal Provider (๋ฃจํธ์ 1ํ ๋ฐฐ์น) |
|
|
197
|
+
| `SdConfirmModal` | Confirm ๋ชจ๋ฌ (์ง์ ๋ ๋) |
|
|
198
|
+
| `SdActionModal` | Action ๋ชจ๋ฌ (์ง์ ๋ ๋) |
|
|
199
|
+
| `SdLoadingModal` | Loading ๋ชจ๋ฌ (์ง์ ๋ ๋) |
|
|
200
|
+
| `SdToastContainer` | Toast ์ปจํ
์ด๋ (sdToast๊ฐ ์๋ ์์ฑ) |
|
|
201
|
+
| `SdToast` | ๊ฐ๋ณ Toast |
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Available Types
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
import type {
|
|
209
|
+
// Table
|
|
210
|
+
SdTableColumn,
|
|
211
|
+
SdTableRow,
|
|
212
|
+
// Select
|
|
213
|
+
SelectOption,
|
|
214
|
+
SelectOptionGroup,
|
|
215
|
+
// Radio
|
|
216
|
+
RadioValue,
|
|
217
|
+
RadioOption,
|
|
218
|
+
// Button
|
|
219
|
+
ButtonVariant,
|
|
220
|
+
ButtonSize,
|
|
221
|
+
ButtonV2Name,
|
|
222
|
+
DropdownButtonItem,
|
|
223
|
+
// Form
|
|
224
|
+
Rule,
|
|
225
|
+
ValidatableField,
|
|
226
|
+
// Checkbox
|
|
227
|
+
CheckedType,
|
|
228
|
+
// Tag
|
|
229
|
+
TagName,
|
|
230
|
+
// Toast
|
|
231
|
+
ToastType,
|
|
232
|
+
// DateBox
|
|
233
|
+
DateBoxType,
|
|
234
|
+
// Tabs
|
|
235
|
+
TabOption,
|
|
236
|
+
// sdModal
|
|
237
|
+
SdModalCreateOption,
|
|
238
|
+
} from '@sellmate/design-system-vue';
|
|
88
239
|
```
|
|
89
240
|
|
|
90
|
-
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Composables
|
|
244
|
+
|
|
245
|
+
### `useSdTableVirtualScroll`
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
import { useSdTableVirtualScroll } from '@sellmate/design-system-vue';
|
|
249
|
+
|
|
250
|
+
const { virtualRows, totalHeight, scrollToIndex } = useSdTableVirtualScroll({
|
|
251
|
+
rowCount: data.length,
|
|
252
|
+
rowHeight: 48,
|
|
253
|
+
containerHeight: 400,
|
|
254
|
+
});
|
|
255
|
+
```
|
|
91
256
|
|
|
92
|
-
|
|
93
|
-
- `SdInput` - Input component
|
|
94
|
-
- `SdCheckbox` - Checkbox component
|
|
95
|
-
- `SdSelect` - Select dropdown component
|
|
96
|
-
- `SdTableBackup` - Table component
|
|
97
|
-
- `SdTag` - Tag component
|
|
98
|
-
- `SdIcon` - Icon component
|
|
99
|
-
- `SdTooltip` - Tooltip component
|
|
100
|
-
- `SdPopover` - Popover component
|
|
101
|
-
- `SdDatePicker` - Date picker component
|
|
102
|
-
- `SdDateRangePicker` - Date range picker component
|
|
103
|
-
- `SdPagination` - Pagination component
|
|
257
|
+
---
|
|
104
258
|
|
|
105
|
-
##
|
|
259
|
+
## Requirements
|
|
106
260
|
|
|
107
261
|
- Vue 3.0.0 or higher
|
|
108
|
-
- @sellmate/design-system (peer dependency)
|
|
109
262
|
|
|
110
|
-
##
|
|
263
|
+
## License
|
|
111
264
|
|
|
112
265
|
MIT
|
package/dist/components.js
CHANGED
|
@@ -461,8 +461,10 @@ export const SdPopover = /*@__PURE__*/ defineContainer('sd-popover', undefined,
|
|
|
461
461
|
'messages',
|
|
462
462
|
'buttons',
|
|
463
463
|
'menuClass',
|
|
464
|
-
'
|
|
465
|
-
'
|
|
464
|
+
'useClose',
|
|
465
|
+
'sdShowChange'
|
|
466
|
+
], [
|
|
467
|
+
'sdShowChange'
|
|
466
468
|
]);
|
|
467
469
|
export const SdPortal = /*@__PURE__*/ defineContainer('sd-portal', undefined, [
|
|
468
470
|
'to',
|
|
@@ -748,9 +750,13 @@ export const SdSelectV2Trigger = /*@__PURE__*/ defineContainer('sd-select-v2-tri
|
|
|
748
750
|
'placeholder',
|
|
749
751
|
'disabled',
|
|
750
752
|
'isOpen',
|
|
751
|
-
'sdTriggerClick'
|
|
753
|
+
'sdTriggerClick',
|
|
754
|
+
'sdTriggerFocus',
|
|
755
|
+
'sdTriggerBlur'
|
|
752
756
|
], [
|
|
753
|
-
'sdTriggerClick'
|
|
757
|
+
'sdTriggerClick',
|
|
758
|
+
'sdTriggerFocus',
|
|
759
|
+
'sdTriggerBlur'
|
|
754
760
|
]);
|
|
755
761
|
export const SdSwitch = /*@__PURE__*/ defineContainer('sd-switch', undefined, [
|
|
756
762
|
'value',
|
package/lib/components.ts
CHANGED
|
@@ -538,8 +538,10 @@ export const SdPopover: StencilVueComponent<JSX.SdPopover> = /*@__PURE__*/ defin
|
|
|
538
538
|
'messages',
|
|
539
539
|
'buttons',
|
|
540
540
|
'menuClass',
|
|
541
|
-
'
|
|
542
|
-
'
|
|
541
|
+
'useClose',
|
|
542
|
+
'sdShowChange'
|
|
543
|
+
], [
|
|
544
|
+
'sdShowChange'
|
|
543
545
|
]);
|
|
544
546
|
|
|
545
547
|
|
|
@@ -868,9 +870,13 @@ export const SdSelectV2Trigger: StencilVueComponent<JSX.SdSelectV2Trigger> = /*@
|
|
|
868
870
|
'placeholder',
|
|
869
871
|
'disabled',
|
|
870
872
|
'isOpen',
|
|
871
|
-
'sdTriggerClick'
|
|
873
|
+
'sdTriggerClick',
|
|
874
|
+
'sdTriggerFocus',
|
|
875
|
+
'sdTriggerBlur'
|
|
872
876
|
], [
|
|
873
|
-
'sdTriggerClick'
|
|
877
|
+
'sdTriggerClick',
|
|
878
|
+
'sdTriggerFocus',
|
|
879
|
+
'sdTriggerBlur'
|
|
874
880
|
]);
|
|
875
881
|
|
|
876
882
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sellmate/design-system-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.70",
|
|
4
4
|
"description": "Design System - Vue Component Wrappers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"vue": "^3.4.38"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@sellmate/design-system": "^1.0.
|
|
48
|
+
"@sellmate/design-system": "^1.0.70",
|
|
49
49
|
"@stencil/vue-output-target": "^0.11.8"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|