@opsnow-mcp/opsnow-mcp-common-ui-server 1.0.20 → 1.0.22
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/build/components/examples/opsnow-common-forms-examples-data.js +16 -0
- package/build/components/examples/opsnow-common-layout-examples-data.js +25 -0
- package/build/components/examples/opsnow-common-select-examples-data.js +15 -0
- package/build/components/opsnow-common-forms.js +3 -0
- package/build/components/opsnow-common-layout.js +3 -0
- package/build/components/opsnow-common-select.js +3 -0
- package/build/index.js +1 -1
- package/package.json +1 -1
|
@@ -136,6 +136,22 @@ export const ButtonExamples = [
|
|
|
136
136
|
title: 'medium-outlined-error',
|
|
137
137
|
code: `<OpsnowCommonButton label="Label" variant="outlined" color="error" onClick={muiButtonTest} />`,
|
|
138
138
|
description: '중간 크기의 Outlined Error 버튼 예제입니다.'
|
|
139
|
+
},
|
|
140
|
+
// === Loading examples ===
|
|
141
|
+
{
|
|
142
|
+
title: 'loading-contained-primary',
|
|
143
|
+
code: `<OpsnowCommonButton label="Save" loading onClick={handleSave} />`,
|
|
144
|
+
description: 'Contained Primary 버튼의 로딩 상태 예제입니다.'
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
title: 'loading-outlined-primary',
|
|
148
|
+
code: `<OpsnowCommonButton label="Submit" variant="outlined" loading onClick={handleSubmit} />`,
|
|
149
|
+
description: 'Outlined Primary 버튼의 로딩 상태 예제입니다.'
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
title: 'loading-text-primary',
|
|
153
|
+
code: `<OpsnowCommonButton label="Load More" variant="text" loading onClick={handleLoadMore} />`,
|
|
154
|
+
description: 'Text Primary 버튼의 로딩 상태 예제입니다.'
|
|
139
155
|
}
|
|
140
156
|
];
|
|
141
157
|
export const BadgeExamples = [
|
|
@@ -69,4 +69,29 @@ export const MegaFilterExamples = [
|
|
|
69
69
|
description: '벤더 선택, 날짜 범위, 필터 기능이 포함된 MegaFilter 예제입니다.',
|
|
70
70
|
code: `<OpsnowCommonMegaFilter filters={filters} vendors={vendors} selectedVendor={selectedVendor} onVendorChange={handleVendorChange} onFilterChange={handleFilterChange} selectedDateRange={selectedDateRange} onDateRangeChange={handleDateRangeChange} locale="ko" title="필터" clearAllText="전체 초기화" applyText="적용" cancelText="취소" />`,
|
|
71
71
|
},
|
|
72
|
+
{
|
|
73
|
+
title: 'megafilter-button-click-apply',
|
|
74
|
+
description: '버튼 클릭 시 필터를 적용하는 방식의 MegaFilter 예제입니다. addText로 개별 필터 추가 버튼 텍스트를 설정하고, onFilterChange를 async로 처리합니다.',
|
|
75
|
+
code: `<OpsnowCommonMegaFilter
|
|
76
|
+
filters={sampleFilters}
|
|
77
|
+
vendors={vendorOptions}
|
|
78
|
+
selectedVendor={selectedVendor}
|
|
79
|
+
onVendorChange={(vendor) => setSelectedVendor(vendor)}
|
|
80
|
+
onFilterChange={async (newFilterState) => {
|
|
81
|
+
await fetchData(newFilterState);
|
|
82
|
+
setFilterState(newFilterState);
|
|
83
|
+
}}
|
|
84
|
+
selectedDateRange={selectedDateRange}
|
|
85
|
+
onDateRangeChange={(range) => setSelectedDateRange(range)}
|
|
86
|
+
locale="en"
|
|
87
|
+
title="Filters"
|
|
88
|
+
clearAllText="Clear All"
|
|
89
|
+
clearText="Clear"
|
|
90
|
+
applyText="Apply"
|
|
91
|
+
addText="Add"
|
|
92
|
+
cancelText="Cancel"
|
|
93
|
+
searchPlaceholder="Search..."
|
|
94
|
+
noItemsText="No items found"
|
|
95
|
+
/>`,
|
|
96
|
+
},
|
|
72
97
|
];
|
|
@@ -102,5 +102,20 @@ export const AutocompleteExamples = [
|
|
|
102
102
|
title: 'Autocomplete - 비동기 로딩',
|
|
103
103
|
code: `<OpsnowCommonAutocomplete items={asyncItems} loading={loading} value={value} onChange={setValue} label="Select Async Option" />`,
|
|
104
104
|
description: '비동기 데이터 로딩/로딩 상태 오토컴플리트 예제입니다.'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: 'Autocomplete - Label + Placeholder (단일)',
|
|
108
|
+
code: `<OpsnowCommonAutocomplete items={[{ value: '1', label: 'Option 1' }, { value: '2', label: 'Option 2' }, { value: '3', label: 'Option 3' }]} multiple={false} value={value} onChange={setValue} label="Category" placeholder="Select a category" />`,
|
|
109
|
+
description: 'label과 placeholder를 함께 사용하는 단일 선택 오토컴플리트 예제입니다.'
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
title: 'Autocomplete - Label + Placeholder (다중)',
|
|
113
|
+
code: `<OpsnowCommonAutocomplete items={[{ value: '1', label: 'Option 1' }, { value: '2', label: 'Option 2' }, { value: '3', label: 'Option 3' }]} multiple value={value} onChange={setValue} label="Tags" placeholder="Search tags..." useCheckboxOption />`,
|
|
114
|
+
description: 'label과 placeholder를 함께 사용하는 다중 선택 오토컴플리트 예제입니다.'
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
title: 'Autocomplete - Placeholder only (no label)',
|
|
118
|
+
code: `<OpsnowCommonAutocomplete items={[{ value: '1', label: 'Option 1' }, { value: '2', label: 'Option 2' }, { value: '3', label: 'Option 3' }]} multiple={false} value={value} onChange={setValue} placeholder="Search..." />`,
|
|
119
|
+
description: 'label 없이 placeholder만 사용하는 오토컴플리트 예제입니다.'
|
|
105
120
|
}
|
|
106
121
|
];
|
|
@@ -12,6 +12,7 @@ export const ButtonSchema = z.object({
|
|
|
12
12
|
iconPosition: z.enum(["left", "right"]).optional().describe("아이콘 위치"),
|
|
13
13
|
iconOnly: z.boolean().optional().describe("아이콘만 표시"),
|
|
14
14
|
disabled: z.boolean().optional().describe("비활성화 여부"),
|
|
15
|
+
loading: z.boolean().optional().describe("로딩 상태"),
|
|
15
16
|
onClick: z.string().optional().describe("클릭 이벤트 핸들러")
|
|
16
17
|
});
|
|
17
18
|
// Badge 컴포넌트 관련 스키마 정의
|
|
@@ -300,6 +301,8 @@ export function createFormsComponent() {
|
|
|
300
301
|
props.push(`iconOnly`);
|
|
301
302
|
if (args.disabled)
|
|
302
303
|
props.push(`disabled`);
|
|
304
|
+
if (args.loading)
|
|
305
|
+
props.push(`loading`);
|
|
303
306
|
if (args.onClick)
|
|
304
307
|
props.push(`onClick={${args.onClick}}`);
|
|
305
308
|
const code = `<OpsnowCommonButton ${props.join(' ')} />`;
|
|
@@ -34,6 +34,7 @@ const MegaFilterSchema = z.object({
|
|
|
34
34
|
cancelText: z.string().optional().describe("취소 버튼 텍스트"),
|
|
35
35
|
searchPlaceholder: z.string().optional().describe("검색 입력 placeholder"),
|
|
36
36
|
noItemsText: z.string().optional().describe("검색 결과 없음 텍스트"),
|
|
37
|
+
addText: z.string().optional().describe("개별 필터 추가 버튼 텍스트"),
|
|
37
38
|
});
|
|
38
39
|
export function createGridLayoutComponent() {
|
|
39
40
|
return [
|
|
@@ -123,6 +124,8 @@ export function createGridLayoutComponent() {
|
|
|
123
124
|
props.push(`searchPlaceholder="${args.searchPlaceholder}"`);
|
|
124
125
|
if (args.noItemsText)
|
|
125
126
|
props.push(`noItemsText="${args.noItemsText}"`);
|
|
127
|
+
if (args.addText)
|
|
128
|
+
props.push(`addText="${args.addText}"`);
|
|
126
129
|
const code = `<OpsnowCommonMegaFilter\n ${props.join('\n ')}\n/>`;
|
|
127
130
|
return {
|
|
128
131
|
content: [
|
|
@@ -31,6 +31,7 @@ export const AutocompleteSelectSchema = z.object({
|
|
|
31
31
|
disableCloseOnSelect: z.boolean().optional().default(false).describe("선택 시 닫힘 방지 여부"),
|
|
32
32
|
loading: z.boolean().optional().default(false).describe("로딩 상태 표시 여부"),
|
|
33
33
|
label: z.string().optional().describe("라벨 텍스트"),
|
|
34
|
+
placeholder: z.string().optional().describe("플레이스홀더 텍스트"),
|
|
34
35
|
disabled: z.boolean().optional().default(false).describe("전체 비활성화 여부")
|
|
35
36
|
});
|
|
36
37
|
// Select 컴포넌트 함수 - 배열 반환
|
|
@@ -114,6 +115,8 @@ export function createSelectComponent() {
|
|
|
114
115
|
props.push(`loading`);
|
|
115
116
|
if (args.label)
|
|
116
117
|
props.push(`label=\"${args.label}\"`);
|
|
118
|
+
if (args.placeholder)
|
|
119
|
+
props.push(`placeholder=\"${args.placeholder}\"`);
|
|
117
120
|
if (args.disabled)
|
|
118
121
|
props.push(`disabled`);
|
|
119
122
|
props.push(`onChange={setValue}`);
|
package/build/index.js
CHANGED
|
@@ -67,7 +67,7 @@ Before implementing OpsnowCommonDataGrid, you MUST use getUIExamples tool with '
|
|
|
67
67
|
<OpsnowCommonDataGrid usedSearch={true} />
|
|
68
68
|
|
|
69
69
|
Reference example: "Insert Button Inside the Common Grid Search Section"
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
2. Grid Bottom Pagination - You MUST use built-in pagination prop:
|
|
72
72
|
|
|
73
73
|
[CORRECT] Using built-in pagination:
|