mokkun 0.1.5 → 0.1.6
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 +18 -6
- package/bin/cli.mjs +6 -6
- package/bin/viewer.html +2 -2
- package/dist/mokkun.css +1 -1
- package/dist/mokkun.esm.js +4898 -2913
- package/dist/mokkun.esm.js.map +1 -1
- package/dist/mokkun.js +359 -322
- package/dist/mokkun.js.map +1 -1
- package/dist/types/lib.d.ts +80 -0
- package/dist/types/loader/file-loader.d.ts +114 -0
- package/dist/types/loader/index.d.ts +4 -0
- package/dist/types/parser/index.d.ts +4 -0
- package/dist/types/parser/key-normalizer.d.ts +24 -0
- package/dist/types/parser/yaml-parser.d.ts +58 -0
- package/dist/types/renderer/action-handler.d.ts +76 -0
- package/dist/types/renderer/components/accordion-panel.d.ts +144 -0
- package/dist/types/renderer/components/action-buttons.d.ts +183 -0
- package/dist/types/renderer/components/alert-banner.d.ts +43 -0
- package/dist/types/renderer/components/app-header.d.ts +277 -0
- package/dist/types/renderer/components/app-navi.d.ts +167 -0
- package/dist/types/renderer/components/badge.d.ts +134 -0
- package/dist/types/renderer/components/browser.d.ts +134 -0
- package/dist/types/renderer/components/calendar.d.ts +198 -0
- package/dist/types/renderer/components/checkbox.d.ts +132 -0
- package/dist/types/renderer/components/chip.d.ts +120 -0
- package/dist/types/renderer/components/combobox.d.ts +217 -0
- package/dist/types/renderer/components/data-table.d.ts +186 -0
- package/dist/types/renderer/components/date-range-picker.d.ts +203 -0
- package/dist/types/renderer/components/definition-list.d.ts +165 -0
- package/dist/types/renderer/components/delete-confirm-dialog.d.ts +151 -0
- package/dist/types/renderer/components/dialog/action-dialog.d.ts +61 -0
- package/dist/types/renderer/components/dialog/base-dialog.d.ts +125 -0
- package/dist/types/renderer/components/dialog/dialog-types.d.ts +96 -0
- package/dist/types/renderer/components/disclosure.d.ts +118 -0
- package/dist/types/renderer/components/dropdown.d.ts +220 -0
- package/dist/types/renderer/components/duration-input.d.ts +154 -0
- package/dist/types/renderer/components/duration-picker.d.ts +108 -0
- package/dist/types/renderer/components/field-renderer.d.ts +22 -0
- package/dist/types/renderer/components/float-area.d.ts +196 -0
- package/dist/types/renderer/components/form-fields.d.ts +94 -0
- package/dist/types/renderer/components/form-section.d.ts +118 -0
- package/dist/types/renderer/components/google-map-embed.d.ts +88 -0
- package/dist/types/renderer/components/heading.d.ts +119 -0
- package/dist/types/renderer/components/image-uploader.d.ts +271 -0
- package/dist/types/renderer/components/index.d.ts +48 -0
- package/dist/types/renderer/components/information-panel.d.ts +139 -0
- package/dist/types/renderer/components/input.d.ts +222 -0
- package/dist/types/renderer/components/layout.d.ts +71 -0
- package/dist/types/renderer/components/line-clamp.d.ts +170 -0
- package/dist/types/renderer/components/loader.d.ts +104 -0
- package/dist/types/renderer/components/notification-bar.d.ts +251 -0
- package/dist/types/renderer/components/pagination.d.ts +167 -0
- package/dist/types/renderer/components/photo-manager-renderer.d.ts +9 -0
- package/dist/types/renderer/components/radio-button-panel.d.ts +152 -0
- package/dist/types/renderer/components/radio.d.ts +117 -0
- package/dist/types/renderer/components/repeater.d.ts +116 -0
- package/dist/types/renderer/components/response-message.d.ts +180 -0
- package/dist/types/renderer/components/search-input.d.ts +198 -0
- package/dist/types/renderer/components/section-nav.d.ts +151 -0
- package/dist/types/renderer/components/segmented-control.d.ts +143 -0
- package/dist/types/renderer/components/select.d.ts +98 -0
- package/dist/types/renderer/components/status-label.d.ts +146 -0
- package/dist/types/renderer/components/stepper.d.ts +123 -0
- package/dist/types/renderer/components/tabs.d.ts +185 -0
- package/dist/types/renderer/components/textarea.d.ts +173 -0
- package/dist/types/renderer/components/timeline.d.ts +146 -0
- package/dist/types/renderer/components/toggle.d.ts +109 -0
- package/dist/types/renderer/components/tooltip.d.ts +158 -0
- package/dist/types/renderer/components/wizard.d.ts +118 -0
- package/dist/types/renderer/layouts/index.d.ts +5 -0
- package/dist/types/renderer/layouts/shell.d.ts +7 -0
- package/dist/types/renderer/layouts/types.d.ts +34 -0
- package/dist/types/renderer/screen-renderer.d.ts +53 -0
- package/dist/types/renderer/utils/dom.d.ts +29 -0
- package/dist/types/renderer/utils/dummy-data.d.ts +13 -0
- package/dist/types/renderer/utils/field-helpers.d.ts +90 -0
- package/dist/types/renderer/utils/icons.d.ts +13 -0
- package/dist/types/renderer/utils/index.d.ts +6 -0
- package/dist/types/theme/index.d.ts +6 -0
- package/dist/types/theme/theme-manager.d.ts +102 -0
- package/dist/types/types/field-renderable.d.ts +40 -0
- package/dist/types/types/index.d.ts +6 -0
- package/dist/types/types/schema.d.ts +1701 -0
- package/dist/types/types/theme.d.ts +111 -0
- package/package.json +3 -1
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ImageUploader Component
|
|
3
|
+
* 複数画像のアップロード、並び替え、削除ができるコンポーネント
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 画像アイテム
|
|
7
|
+
*/
|
|
8
|
+
export interface ImageItem {
|
|
9
|
+
/** 画像ID */
|
|
10
|
+
id: string;
|
|
11
|
+
/** ファイルオブジェクト(新規アップロードの場合) */
|
|
12
|
+
file: File | null;
|
|
13
|
+
/** プレビューURL */
|
|
14
|
+
previewUrl: string;
|
|
15
|
+
/** ファイル名 */
|
|
16
|
+
name: string;
|
|
17
|
+
/** ファイルサイズ(バイト) */
|
|
18
|
+
size: number;
|
|
19
|
+
/** メイン画像かどうか */
|
|
20
|
+
isMain: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 画像アップローダーの設定
|
|
24
|
+
*/
|
|
25
|
+
export interface ImageUploaderConfig {
|
|
26
|
+
/** コンポーネントID */
|
|
27
|
+
id: string;
|
|
28
|
+
/** ラベル */
|
|
29
|
+
label: string;
|
|
30
|
+
/** 説明 */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** 対応フォーマット */
|
|
33
|
+
acceptedFormats: string[];
|
|
34
|
+
/** 最大ファイルサイズ(バイト) */
|
|
35
|
+
maxFileSize: number;
|
|
36
|
+
/** 最大ファイル数 */
|
|
37
|
+
maxFiles: number;
|
|
38
|
+
/** 最小ファイル数 */
|
|
39
|
+
minFiles?: number;
|
|
40
|
+
/** 必須かどうか */
|
|
41
|
+
required?: boolean;
|
|
42
|
+
/** 無効かどうか */
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
/** フォームエラー状態() */
|
|
45
|
+
error?: boolean;
|
|
46
|
+
/** 複数ファイル選択の可否() */
|
|
47
|
+
multiple?: boolean;
|
|
48
|
+
/** ファイルタイプ制限の表示をドロップゾーン内に表示するか */
|
|
49
|
+
showTypeHintInDropzone?: boolean;
|
|
50
|
+
/** ドロップゾーンのテキストカスタマイズ */
|
|
51
|
+
decorators?: {
|
|
52
|
+
/** ドロップゾーンのメインテキスト */
|
|
53
|
+
dropzoneText?: string;
|
|
54
|
+
/** ドロップゾーンのサブテキスト(ヒント) */
|
|
55
|
+
dropzoneHint?: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* アップロード状態
|
|
60
|
+
*/
|
|
61
|
+
export type UploadStatus = 'pending' | 'uploading' | 'completed' | 'error';
|
|
62
|
+
/**
|
|
63
|
+
* 画像アップローダーの状態
|
|
64
|
+
*/
|
|
65
|
+
export interface ImageUploaderState {
|
|
66
|
+
/** 画像リスト */
|
|
67
|
+
images: ImageItem[];
|
|
68
|
+
/** メイン画像のID */
|
|
69
|
+
mainImageId: string | null;
|
|
70
|
+
/** ドラッグオーバー中かどうか */
|
|
71
|
+
isDraggingOver: boolean;
|
|
72
|
+
/** 並び替え中の画像ID */
|
|
73
|
+
draggingImageId: string | null;
|
|
74
|
+
/** アップロード進捗(ID -> パーセンテージ) */
|
|
75
|
+
uploadProgress: Record<string, number>;
|
|
76
|
+
/** アップロード状態(ID -> ステータス) */
|
|
77
|
+
uploadStatus: Record<string, UploadStatus>;
|
|
78
|
+
/** 拒否されたファイル一覧(UIで表示用) */
|
|
79
|
+
rejectedFiles: RejectedFile[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* 画像アップローダーのコールバック
|
|
83
|
+
*/
|
|
84
|
+
export interface ImageUploaderCallbacks {
|
|
85
|
+
/** 画像追加時 */
|
|
86
|
+
onAdd?: (images: ImageItem[], state: ImageUploaderState) => void;
|
|
87
|
+
/** 画像削除時 */
|
|
88
|
+
onRemove?: (imageId: string, state: ImageUploaderState) => void;
|
|
89
|
+
/** 並び替え時 */
|
|
90
|
+
onReorder?: (images: ImageItem[], state: ImageUploaderState) => void;
|
|
91
|
+
/** メイン画像変更時 */
|
|
92
|
+
onMainChange?: (imageId: string, state: ImageUploaderState) => void;
|
|
93
|
+
/** 変更時 */
|
|
94
|
+
onChange?: (state: ImageUploaderState) => void;
|
|
95
|
+
/** エラー時 */
|
|
96
|
+
onError?: (errors: RejectedFile[]) => void;
|
|
97
|
+
/** 進捗更新時 */
|
|
98
|
+
onProgress?: (imageId: string, progress: number) => void;
|
|
99
|
+
/** ファイル選択時(のonSelectFilesに対応) */
|
|
100
|
+
onSelectFiles?: (files: File[], state: ImageUploaderState) => void;
|
|
101
|
+
/** アップロード完了時 */
|
|
102
|
+
onUploadComplete?: (imageId: string, state: ImageUploaderState) => void;
|
|
103
|
+
/** アップロードエラー時 */
|
|
104
|
+
onUploadError?: (imageId: string, error: string, state: ImageUploaderState) => void;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* バリデーション結果
|
|
108
|
+
*/
|
|
109
|
+
export interface ValidationResult {
|
|
110
|
+
/** 有効かどうか */
|
|
111
|
+
valid: boolean;
|
|
112
|
+
/** エラーメッセージ */
|
|
113
|
+
errors: string[];
|
|
114
|
+
/** 拒否理由のコード */
|
|
115
|
+
reasonCode?: RejectionReason;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* 拒否理由の種類
|
|
119
|
+
*/
|
|
120
|
+
export type RejectionReason = 'invalid-format' | 'file-too-large' | 'max-files-exceeded';
|
|
121
|
+
/**
|
|
122
|
+
* 拒否されたファイル
|
|
123
|
+
*/
|
|
124
|
+
export interface RejectedFile {
|
|
125
|
+
/** ファイル */
|
|
126
|
+
file: File;
|
|
127
|
+
/** 拒否理由 */
|
|
128
|
+
reason: string;
|
|
129
|
+
/** 拒否理由のコード */
|
|
130
|
+
reasonCode: RejectionReason;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* ファイル追加結果
|
|
134
|
+
*/
|
|
135
|
+
export interface AddFilesResult {
|
|
136
|
+
/** 追加された画像 */
|
|
137
|
+
added: ImageItem[];
|
|
138
|
+
/** 拒否されたファイル */
|
|
139
|
+
rejected: RejectedFile[];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* ファイルサイズをフォーマット
|
|
143
|
+
*/
|
|
144
|
+
export declare function formatFileSize(bytes: number): string;
|
|
145
|
+
/**
|
|
146
|
+
* ファイルバリデーション
|
|
147
|
+
*/
|
|
148
|
+
export declare function validateFile(file: File, config: ImageUploaderConfig): ValidationResult;
|
|
149
|
+
/**
|
|
150
|
+
* 画像アップローダーコンポーネント
|
|
151
|
+
*/
|
|
152
|
+
export declare class ImageUploader {
|
|
153
|
+
private config;
|
|
154
|
+
private state;
|
|
155
|
+
private callbacks;
|
|
156
|
+
private container;
|
|
157
|
+
private fileInputRef;
|
|
158
|
+
constructor(config: ImageUploaderConfig, container: HTMLElement, callbacks?: ImageUploaderCallbacks, initialImages?: ImageItem[]);
|
|
159
|
+
/**
|
|
160
|
+
* コンポーネントをレンダリング
|
|
161
|
+
*/
|
|
162
|
+
render(): void;
|
|
163
|
+
/**
|
|
164
|
+
* ファイルを追加
|
|
165
|
+
*/
|
|
166
|
+
addFiles(files: File[]): AddFilesResult;
|
|
167
|
+
/**
|
|
168
|
+
* 画像を削除
|
|
169
|
+
*/
|
|
170
|
+
removeImage(imageId: string): boolean;
|
|
171
|
+
/**
|
|
172
|
+
* 画像を移動
|
|
173
|
+
*/
|
|
174
|
+
moveImage(imageId: string, direction: 'up' | 'down'): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* 画像の順序を変更
|
|
177
|
+
*/
|
|
178
|
+
reorderImages(imageIds: string[]): void;
|
|
179
|
+
/**
|
|
180
|
+
* メイン画像を設定
|
|
181
|
+
*/
|
|
182
|
+
setMainImage(imageId: string): boolean;
|
|
183
|
+
/**
|
|
184
|
+
* アップロード進捗を設定
|
|
185
|
+
*/
|
|
186
|
+
setUploadProgress(imageId: string, progress: number): void;
|
|
187
|
+
/**
|
|
188
|
+
* アップロード状態を設定
|
|
189
|
+
*/
|
|
190
|
+
setUploadStatus(imageId: string, status: UploadStatus, errorMessage?: string): void;
|
|
191
|
+
/**
|
|
192
|
+
* 一括アップロード開始(複数ファイルのアップロードを開始する際に使用)
|
|
193
|
+
*/
|
|
194
|
+
startBatchUpload(imageIds: string[]): void;
|
|
195
|
+
/**
|
|
196
|
+
* アップロードがアクティブかどうかを取得
|
|
197
|
+
*/
|
|
198
|
+
hasActiveUploads(): boolean;
|
|
199
|
+
/**
|
|
200
|
+
* 全画像をクリア
|
|
201
|
+
*/
|
|
202
|
+
clear(): void;
|
|
203
|
+
/**
|
|
204
|
+
* コンポーネントを破棄(リソースを解放)
|
|
205
|
+
*/
|
|
206
|
+
destroy(): void;
|
|
207
|
+
/**
|
|
208
|
+
* 現在の状態を取得
|
|
209
|
+
*/
|
|
210
|
+
getState(): ImageUploaderState;
|
|
211
|
+
/**
|
|
212
|
+
* 値を取得(フォーム送信用)
|
|
213
|
+
*/
|
|
214
|
+
getValue(): ImageItem[];
|
|
215
|
+
/**
|
|
216
|
+
* メイン画像IDを取得
|
|
217
|
+
*/
|
|
218
|
+
getMainImageId(): string | null;
|
|
219
|
+
/**
|
|
220
|
+
* ファイル選択ダイアログを開く
|
|
221
|
+
*/
|
|
222
|
+
openFileDialog(): void;
|
|
223
|
+
/**
|
|
224
|
+
* 初期状態を作成
|
|
225
|
+
*/
|
|
226
|
+
private createInitialState;
|
|
227
|
+
/**
|
|
228
|
+
* ヘッダーをレンダリング
|
|
229
|
+
*/
|
|
230
|
+
private renderHeader;
|
|
231
|
+
/**
|
|
232
|
+
* 画像グリッドをレンダリング
|
|
233
|
+
*/
|
|
234
|
+
private renderImageGrid;
|
|
235
|
+
/**
|
|
236
|
+
* 画像アイテムをレンダリング
|
|
237
|
+
*/
|
|
238
|
+
private renderImageItem;
|
|
239
|
+
/**
|
|
240
|
+
* ドロップゾーンをレンダリング
|
|
241
|
+
*/
|
|
242
|
+
private renderDropzone;
|
|
243
|
+
/**
|
|
244
|
+
* ヒントをレンダリング
|
|
245
|
+
*/
|
|
246
|
+
private renderHints;
|
|
247
|
+
/**
|
|
248
|
+
* 拒否されたファイル一覧をレンダリング
|
|
249
|
+
*/
|
|
250
|
+
private renderRejectedFiles;
|
|
251
|
+
/**
|
|
252
|
+
* 拒否されたファイル一覧をクリア
|
|
253
|
+
*/
|
|
254
|
+
clearRejectedFiles(): void;
|
|
255
|
+
/**
|
|
256
|
+
* ファイル選択ハンドラ
|
|
257
|
+
*/
|
|
258
|
+
private handleFileSelect;
|
|
259
|
+
/**
|
|
260
|
+
* ドラッグオーバーハンドラ
|
|
261
|
+
*/
|
|
262
|
+
private handleDragOver;
|
|
263
|
+
/**
|
|
264
|
+
* ドラッグリーブハンドラ
|
|
265
|
+
*/
|
|
266
|
+
private handleDragLeave;
|
|
267
|
+
/**
|
|
268
|
+
* ドロップハンドラ
|
|
269
|
+
*/
|
|
270
|
+
private handleDrop;
|
|
271
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Components Export
|
|
3
|
+
*/
|
|
4
|
+
export { Wizard, type WizardState, type WizardCallbacks } from './wizard';
|
|
5
|
+
export { Repeater, type RepeaterState, type RepeaterItem, type RepeaterCallbacks } from './repeater';
|
|
6
|
+
export { Tabs, type TabsState, type TabsCallbacks, type TabDefinition, type TabsConfig } from './tabs';
|
|
7
|
+
export { DataTable, type DataTableState, type DataTableCallbacks, renderDataTableField } from './data-table';
|
|
8
|
+
export { renderField, type RenderFieldOptions } from './field-renderer';
|
|
9
|
+
export { FormSection, type FormSectionConfig, type FormSectionState, type FormSectionCallbacks, createConfigFromSchema, renderFormSections, renderFormSectionsWithDividers, } from './form-section';
|
|
10
|
+
export { ActionButtonGroup, type ActionButton, type ActionButtonGroupConfig, type ActionButtonGroupState, type ActionButtonGroupCallbacks, type ButtonAlignment, } from './action-buttons';
|
|
11
|
+
export { GoogleMapEmbed, renderGoogleMapEmbedField, isValidGoogleMapsUrl, generateEmbedUrl, extractCoordinates, extractQuery, extractPlaceId, type GoogleMapEmbedState, type GoogleMapEmbedCallbacks, } from './google-map-embed';
|
|
12
|
+
export { SectionNav, type SectionDefinition, type SectionNavState, type SectionNavCallbacks, type SectionNavConfig, } from './section-nav';
|
|
13
|
+
export { DeleteConfirmDialog, type DeleteConfirmDialogConfig, type DeleteConfirmDialogCallbacks, type DeleteConfirmDialogState, type DependencyInfo, } from './delete-confirm-dialog';
|
|
14
|
+
export { Checkbox, createCheckbox, type CheckboxState, type CheckboxCallbacks, type CheckboxConfig, } from './checkbox';
|
|
15
|
+
export { Toggle, createToggle, type ToggleState, type ToggleCallbacks, type ToggleConfig, } from './toggle';
|
|
16
|
+
export { RadioButton, createRadioButton, type RadioButtonState, type RadioButtonCallbacks, type RadioButtonConfig, } from './radio';
|
|
17
|
+
export { Textarea, createTextarea, type TextareaState, type TextareaCallbacks, type TextareaConfig, } from './textarea';
|
|
18
|
+
export { Badge, createBadge, type BadgeState, type BadgeCallbacks, type BadgeConfig, } from './badge';
|
|
19
|
+
export { Chip, createChip, type ChipState, type ChipCallbacks, type ChipConfig, } from './chip';
|
|
20
|
+
export { Select, createSelect, } from './select';
|
|
21
|
+
export { ImageUploader, type ImageItem, type ImageUploaderConfig, type ImageUploaderState, type ImageUploaderCallbacks, type ValidationResult, type RejectedFile, type AddFilesResult, validateFile, formatFileSize, } from './image-uploader';
|
|
22
|
+
export { Heading, createHeading, type HeadingState, type HeadingCallbacks, type HeadingConfig, } from './heading';
|
|
23
|
+
export { Input, createInput, type InputState, type InputCallbacks, type InputConfig, } from './input';
|
|
24
|
+
export { Dropdown, createDropdown, createMenuButton, createFilterDropdown, createSortDropdown, type MenuItem, type ActionMenuItem, type DividerMenuItem, type FilterMenuItem, type SortMenuItem, type DropdownVariant, type DropdownPlacement, type DropdownState, type DropdownCallbacks, type DropdownConfig, } from './dropdown';
|
|
25
|
+
export { Tooltip, createTooltip, type TooltipState, type TooltipCallbacks, type TooltipConfig, type TooltipPosition, } from './tooltip';
|
|
26
|
+
export { Pagination, createPagination, type PaginationState, type PaginationCallbacks, type PaginationConfig, } from './pagination';
|
|
27
|
+
export { AccordionPanel, createAccordionPanel, type AccordionItem, type IconPosition, type HeadingType, type AccordionPanelState, type AccordionPanelCallbacks, type AccordionPanelConfig, } from './accordion-panel';
|
|
28
|
+
export { Stepper, createStepper, type Step, type HorizontalStep, type VerticalStep, type StepperStatus, type StepperStatusWithText, type StepperConfig, type StepperState, type StepperCallbacks, } from './stepper';
|
|
29
|
+
export { StatusLabel, createStatusLabel, type StatusLabelState, type StatusLabelCallbacks, type StatusLabelConfig, type StatusLabelType, type StatusLabelSize, type StatusLabelIconType, } from './status-label';
|
|
30
|
+
export { FloatArea, createFloatArea, type FloatAreaState, type FloatAreaCallbacks, type FloatAreaConfig, type FloatAreaButton, type ResponseMessage as FloatAreaResponseMessage, type ResponseMessageType as FloatAreaResponseMessageType, type FloatAreaPosition, type FloatAreaAlignment, } from './float-area';
|
|
31
|
+
export { Loader, createLoader, type LoaderState, type LoaderCallbacks, type LoaderConfig, } from './loader';
|
|
32
|
+
export { RadioButtonPanel, createRadioButtonPanel, type RadioButtonPanelOption, type RadioButtonPanelState, type RadioButtonPanelCallbacks, type RadioButtonPanelConfig, } from './radio-button-panel';
|
|
33
|
+
export { DefinitionList, createDefinitionList, type DefinitionListItem, type DefinitionListGroup, type DefinitionListState, type DefinitionListCallbacks, type DefinitionListConfig, type TermStyleType, } from './definition-list';
|
|
34
|
+
export { Combobox, type ComboboxOption, type ComboboxConfig, type ComboboxState, type ComboboxCallbacks, } from './combobox';
|
|
35
|
+
export { SegmentedControl, createSegmentedControl, type SegmentedControlOption, type SegmentedControlState, type SegmentedControlCallbacks, type SegmentedControlConfig, } from './segmented-control';
|
|
36
|
+
export { Timeline, createTimeline, type TimelineItemConfig, type TimelineConfig, type TimelineState, type TimelineCallbacks, type TimelineTimeFormat, type TimelineIconType, } from './timeline';
|
|
37
|
+
export { ResponseMessage, createResponseMessage, type ResponseMessageState, type ResponseMessageCallbacks, type ResponseMessageConfig, type ResponseMessageType, } from './response-message';
|
|
38
|
+
export { NotificationBar, NotificationBarStack, createNotificationBar, createNotificationBarStack, type NotificationBarType, type NotificationBarState, type NotificationBarCallbacks, type NotificationBarConfig, type NotificationItem, type NotificationBarStackState, type NotificationBarStackCallbacks, type NotificationBarStackConfig, } from './notification-bar';
|
|
39
|
+
export { Disclosure, createDisclosure, type DisclosureState, type DisclosureCallbacks, type DisclosureConfig, } from './disclosure';
|
|
40
|
+
export { LineClamp, createLineClamp, type MaxLines, type LineClampState, type LineClampCallbacks, type LineClampConfig, } from './line-clamp';
|
|
41
|
+
export { InformationPanel, createInformationPanel, type InformationPanelState, type InformationPanelCallbacks, type InformationPanelConfig, type InformationPanelType, } from './information-panel';
|
|
42
|
+
export { AppNavi, createAppNavi, type AppNaviItem, type AppNaviButtonItem, type AppNaviAnchorItem, type AppNaviDropdownItem, type AppNaviDropdownMenuItem, type AppNaviState, type AppNaviCallbacks, type AppNaviConfig, } from './app-navi';
|
|
43
|
+
export { AppHeader, createAppHeader, type Tenant, type UserInfo, type NavItem, type NavDropdownItem, type AppLauncherItem, type AppHeaderState, type AppHeaderCallbacks, type AppHeaderConfig, } from './app-header';
|
|
44
|
+
export { Browser, createBrowser, type BrowserItem, type BrowserState, type BrowserCallbacks, type BrowserConfig, } from './browser';
|
|
45
|
+
export { Calendar, createCalendar, type CalendarState, type CalendarCallbacks, type CalendarConfig, } from './calendar';
|
|
46
|
+
export { DateRangePicker, createDateRangePicker, getDefaultPresets, type DateRange, type DateRangePreset, type DateRangePickerState, type DateRangePickerCallbacks, type DateRangePickerConfig, } from './date-range-picker';
|
|
47
|
+
export { SearchInput, createSearchInput, type SearchInputState, type SearchInputCallbacks, type SearchInputConfig, type KeyboardShortcut, } from './search-input';
|
|
48
|
+
export { AlertBanner, createAlertBanner, type AlertBannerType, type AlertBannerState, type AlertBannerCallbacks, type AlertBannerConfig, } from './alert-banner';
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InformationPanel Component
|
|
3
|
+
* 情報パネルコンポーネント
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* - タイプ(info/success/warning/error/sync)
|
|
7
|
+
* - アイコン表示
|
|
8
|
+
* - 開閉ボタン(toggleable)
|
|
9
|
+
* - タイトル付き(必須)
|
|
10
|
+
* - 太字表示(bold)
|
|
11
|
+
* - アクセシビリティ対応(ARIA属性)
|
|
12
|
+
*
|
|
13
|
+
* @see https://smarthr.design/products/components/information-panel/
|
|
14
|
+
*/
|
|
15
|
+
import type { InputField } from '../../types/schema';
|
|
16
|
+
/**
|
|
17
|
+
* 情報パネルのタイプ
|
|
18
|
+
* - info: 一般情報(青)
|
|
19
|
+
* - success: 成功・完了(緑)
|
|
20
|
+
* - warning: 警告・注意(黄)
|
|
21
|
+
* - error: エラー(赤)
|
|
22
|
+
* - sync: 同期中(灰色)
|
|
23
|
+
*/
|
|
24
|
+
export type InformationPanelType = 'info' | 'success' | 'warning' | 'error' | 'sync';
|
|
25
|
+
/**
|
|
26
|
+
* 情報パネルの状態
|
|
27
|
+
*/
|
|
28
|
+
export interface InformationPanelState {
|
|
29
|
+
/** パネルが展開されているか(toggleableの場合) */
|
|
30
|
+
active: boolean;
|
|
31
|
+
/** 非表示状態 */
|
|
32
|
+
hidden: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 情報パネルのコールバック
|
|
36
|
+
*/
|
|
37
|
+
export interface InformationPanelCallbacks {
|
|
38
|
+
/** 開閉ボタンクリック時 */
|
|
39
|
+
onClickTrigger?: (active: boolean) => void;
|
|
40
|
+
/** 閉じるボタンクリック時(非toggleable時) */
|
|
41
|
+
onClose?: () => void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 情報パネルの設定
|
|
45
|
+
*/
|
|
46
|
+
export interface InformationPanelConfig {
|
|
47
|
+
/** パネルのタイトル(必須) */
|
|
48
|
+
title: string;
|
|
49
|
+
/** パネルの内容(HTML文字列またはHTMLElement) */
|
|
50
|
+
content: string | HTMLElement;
|
|
51
|
+
/** タイプ(デフォルト: info) */
|
|
52
|
+
type?: InformationPanelType;
|
|
53
|
+
/** 開閉ボタンを表示するか(デフォルト: false) */
|
|
54
|
+
toggleable?: boolean;
|
|
55
|
+
/** 初期展開状態(toggleableの場合、デフォルト: true) */
|
|
56
|
+
defaultActive?: boolean;
|
|
57
|
+
/** タイトルを太字にするか(デフォルト: false) */
|
|
58
|
+
bold?: boolean;
|
|
59
|
+
/** 閉じるボタンを表示するか(デフォルト: false) */
|
|
60
|
+
closable?: boolean;
|
|
61
|
+
/** ID属性 */
|
|
62
|
+
id?: string;
|
|
63
|
+
/** カスタムCSSクラス */
|
|
64
|
+
className?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 情報パネルコンポーネント
|
|
68
|
+
*/
|
|
69
|
+
export declare class InformationPanel {
|
|
70
|
+
private config;
|
|
71
|
+
private state;
|
|
72
|
+
private callbacks;
|
|
73
|
+
private container;
|
|
74
|
+
private instanceId;
|
|
75
|
+
private contentElement;
|
|
76
|
+
constructor(container: HTMLElement, config: InformationPanelConfig, callbacks?: InformationPanelCallbacks);
|
|
77
|
+
/**
|
|
78
|
+
* 情報パネルをレンダリング
|
|
79
|
+
*/
|
|
80
|
+
render(): void;
|
|
81
|
+
/**
|
|
82
|
+
* パネルを開く
|
|
83
|
+
*/
|
|
84
|
+
open(): void;
|
|
85
|
+
/**
|
|
86
|
+
* パネルを閉じる
|
|
87
|
+
*/
|
|
88
|
+
close(): void;
|
|
89
|
+
/**
|
|
90
|
+
* パネルの開閉を切り替え
|
|
91
|
+
*/
|
|
92
|
+
toggle(): void;
|
|
93
|
+
/**
|
|
94
|
+
* パネルが開いているか確認
|
|
95
|
+
*/
|
|
96
|
+
isActive(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* パネルを非表示にする
|
|
99
|
+
*/
|
|
100
|
+
hide(): void;
|
|
101
|
+
/**
|
|
102
|
+
* パネルを表示する
|
|
103
|
+
*/
|
|
104
|
+
show(): void;
|
|
105
|
+
/**
|
|
106
|
+
* 現在の状態を取得
|
|
107
|
+
*/
|
|
108
|
+
getState(): Readonly<InformationPanelState>;
|
|
109
|
+
/**
|
|
110
|
+
* タイトルを更新
|
|
111
|
+
*/
|
|
112
|
+
setTitle(title: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* コンテンツを更新
|
|
115
|
+
*/
|
|
116
|
+
setContent(content: string | HTMLElement): void;
|
|
117
|
+
/**
|
|
118
|
+
* タイプを更新
|
|
119
|
+
*/
|
|
120
|
+
setType(type: InformationPanelType): void;
|
|
121
|
+
/**
|
|
122
|
+
* コンポーネントを破棄
|
|
123
|
+
*/
|
|
124
|
+
destroy(): void;
|
|
125
|
+
private createInitialState;
|
|
126
|
+
private renderHeader;
|
|
127
|
+
private renderIcon;
|
|
128
|
+
private renderTitle;
|
|
129
|
+
private renderActions;
|
|
130
|
+
private renderToggleButton;
|
|
131
|
+
private renderCloseButton;
|
|
132
|
+
private renderContent;
|
|
133
|
+
private updateActiveState;
|
|
134
|
+
static renderField(field: InputField): string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* 情報パネルを作成
|
|
138
|
+
*/
|
|
139
|
+
export declare function createInformationPanel(container: HTMLElement, config: InformationPanelConfig, callbacks?: InformationPanelCallbacks): InformationPanel;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input Component
|
|
3
|
+
* 汎用テキスト入力コンポーネント
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Prefix/Suffix support
|
|
7
|
+
* - Validation display
|
|
8
|
+
* - Size variants (small/medium/large)
|
|
9
|
+
* - Input types (text/email/password/number/tel/url)
|
|
10
|
+
* - Clear button
|
|
11
|
+
* - Error states
|
|
12
|
+
*/
|
|
13
|
+
import type { TextField, NumberField, DatePickerField, TimePickerField } from '../../types/schema';
|
|
14
|
+
/**
|
|
15
|
+
* 入力の状態
|
|
16
|
+
*/
|
|
17
|
+
export interface InputState {
|
|
18
|
+
/** 現在の値 */
|
|
19
|
+
value: string;
|
|
20
|
+
/** 無効化状態 */
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
/** 読み取り専用状態 */
|
|
23
|
+
readonly: boolean;
|
|
24
|
+
/** エラー状態 */
|
|
25
|
+
error: boolean;
|
|
26
|
+
/** エラーメッセージ */
|
|
27
|
+
errorMessage?: string;
|
|
28
|
+
/** フォーカス状態 */
|
|
29
|
+
focused: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 入力のコールバック
|
|
33
|
+
*/
|
|
34
|
+
export interface InputCallbacks {
|
|
35
|
+
/** 値変更時 */
|
|
36
|
+
onChange?: (value: string, state: InputState) => void;
|
|
37
|
+
/** フォーカス時 */
|
|
38
|
+
onFocus?: (state: InputState) => void;
|
|
39
|
+
/** ブラー時 */
|
|
40
|
+
onBlur?: (state: InputState) => void;
|
|
41
|
+
/** クリアボタン押下時 */
|
|
42
|
+
onClear?: (state: InputState) => void;
|
|
43
|
+
/** Enter キー押下時 */
|
|
44
|
+
onEnter?: (value: string, state: InputState) => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 入力の設定
|
|
48
|
+
*/
|
|
49
|
+
export interface InputConfig {
|
|
50
|
+
/** 初期値 */
|
|
51
|
+
defaultValue?: string;
|
|
52
|
+
/** プレースホルダー */
|
|
53
|
+
placeholder?: string;
|
|
54
|
+
/** 無効化 */
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
/** 読み取り専用 */
|
|
57
|
+
readonly?: boolean;
|
|
58
|
+
/** 必須 */
|
|
59
|
+
required?: boolean;
|
|
60
|
+
/** サイズ */
|
|
61
|
+
size?: 'small' | 'medium' | 'large';
|
|
62
|
+
/** 入力タイプ */
|
|
63
|
+
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
|
64
|
+
/** name属性(フォーム用) */
|
|
65
|
+
name?: string;
|
|
66
|
+
/** プレフィックス(アイコンやテキスト) */
|
|
67
|
+
prefix?: string | HTMLElement;
|
|
68
|
+
/** サフィックス(アイコンやテキスト) */
|
|
69
|
+
suffix?: string | HTMLElement;
|
|
70
|
+
/** クリアボタン表示 */
|
|
71
|
+
clearable?: boolean;
|
|
72
|
+
/** 自動フォーカス */
|
|
73
|
+
autoFocus?: boolean;
|
|
74
|
+
/** オートコンプリート */
|
|
75
|
+
autoComplete?: string;
|
|
76
|
+
/** エラーメッセージ(初期値) */
|
|
77
|
+
errorMessage?: string;
|
|
78
|
+
/** aria-label */
|
|
79
|
+
ariaLabel?: string;
|
|
80
|
+
/** aria-describedby */
|
|
81
|
+
ariaDescribedBy?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 入力コンポーネント
|
|
85
|
+
*/
|
|
86
|
+
export declare class Input {
|
|
87
|
+
private config;
|
|
88
|
+
private state;
|
|
89
|
+
private callbacks;
|
|
90
|
+
private container;
|
|
91
|
+
private instanceId;
|
|
92
|
+
private inputElement;
|
|
93
|
+
constructor(container: HTMLElement, config?: InputConfig, callbacks?: InputCallbacks);
|
|
94
|
+
/**
|
|
95
|
+
* 入力フィールドをレンダリング
|
|
96
|
+
*/
|
|
97
|
+
render(): void;
|
|
98
|
+
/**
|
|
99
|
+
* 値を設定
|
|
100
|
+
*/
|
|
101
|
+
setValue(value: string): void;
|
|
102
|
+
/**
|
|
103
|
+
* 値を取得
|
|
104
|
+
*/
|
|
105
|
+
getValue(): string;
|
|
106
|
+
/**
|
|
107
|
+
* エラー状態を設定
|
|
108
|
+
*/
|
|
109
|
+
setError(error: boolean, errorMessage?: string): void;
|
|
110
|
+
/**
|
|
111
|
+
* 無効化状態を設定
|
|
112
|
+
*/
|
|
113
|
+
setDisabled(disabled: boolean): void;
|
|
114
|
+
/**
|
|
115
|
+
* 読み取り専用状態を設定
|
|
116
|
+
*/
|
|
117
|
+
setReadonly(readonly: boolean): void;
|
|
118
|
+
/**
|
|
119
|
+
* フォーカス
|
|
120
|
+
*/
|
|
121
|
+
focus(): void;
|
|
122
|
+
/**
|
|
123
|
+
* ブラー
|
|
124
|
+
*/
|
|
125
|
+
blur(): void;
|
|
126
|
+
/**
|
|
127
|
+
* クリア
|
|
128
|
+
*/
|
|
129
|
+
clear(): void;
|
|
130
|
+
/**
|
|
131
|
+
* 状態を取得
|
|
132
|
+
*/
|
|
133
|
+
getState(): InputState;
|
|
134
|
+
/**
|
|
135
|
+
* 破棄
|
|
136
|
+
*/
|
|
137
|
+
destroy(): void;
|
|
138
|
+
/**
|
|
139
|
+
* 初期状態を作成
|
|
140
|
+
*/
|
|
141
|
+
private createInitialState;
|
|
142
|
+
/**
|
|
143
|
+
* data-state属性の値を取得
|
|
144
|
+
*/
|
|
145
|
+
private getDataState;
|
|
146
|
+
/**
|
|
147
|
+
* 入力グループをレンダリング
|
|
148
|
+
*/
|
|
149
|
+
private renderInputGroup;
|
|
150
|
+
/**
|
|
151
|
+
* 入力フィールドをレンダリング
|
|
152
|
+
*/
|
|
153
|
+
private renderInput;
|
|
154
|
+
/**
|
|
155
|
+
* Prefix/Suffixをレンダリング
|
|
156
|
+
*/
|
|
157
|
+
private renderAffix;
|
|
158
|
+
/**
|
|
159
|
+
* クリアボタンをレンダリング
|
|
160
|
+
*/
|
|
161
|
+
private renderClearButton;
|
|
162
|
+
/**
|
|
163
|
+
* エラーメッセージをレンダリング
|
|
164
|
+
*/
|
|
165
|
+
private renderError;
|
|
166
|
+
/**
|
|
167
|
+
* 入力イベント
|
|
168
|
+
*/
|
|
169
|
+
private handleInput;
|
|
170
|
+
/**
|
|
171
|
+
* クリアボタンの表示/非表示を更新(フォーカスを失わないように部分更新)
|
|
172
|
+
*/
|
|
173
|
+
private updateClearButton;
|
|
174
|
+
/**
|
|
175
|
+
* フォーカスイベント
|
|
176
|
+
*/
|
|
177
|
+
private handleFocus;
|
|
178
|
+
/**
|
|
179
|
+
* ブラーイベント
|
|
180
|
+
*/
|
|
181
|
+
private handleBlur;
|
|
182
|
+
/**
|
|
183
|
+
* キーダウンイベント
|
|
184
|
+
*/
|
|
185
|
+
private handleKeyDown;
|
|
186
|
+
/**
|
|
187
|
+
* クリアイベント
|
|
188
|
+
*/
|
|
189
|
+
private handleClear;
|
|
190
|
+
/**
|
|
191
|
+
* 入力フィールドをHTMLとしてレンダリング(静的メソッド)
|
|
192
|
+
* SSR/初期レンダリング用
|
|
193
|
+
*
|
|
194
|
+
* @param field - 入力フィールド定義(text, number, date_picker, time_picker)
|
|
195
|
+
* @returns 生成されたHTML文字列
|
|
196
|
+
*/
|
|
197
|
+
static renderField(field: TextField | NumberField | DatePickerField | TimePickerField): string;
|
|
198
|
+
/**
|
|
199
|
+
* テキストフィールドをHTMLとしてレンダリング(静的メソッド)
|
|
200
|
+
* @internal renderFieldから呼び出される内部メソッド
|
|
201
|
+
*/
|
|
202
|
+
private static renderTextField;
|
|
203
|
+
/**
|
|
204
|
+
* 数値フィールドをHTMLとしてレンダリング(静的メソッド)
|
|
205
|
+
* @internal renderFieldから呼び出される内部メソッド
|
|
206
|
+
*/
|
|
207
|
+
private static renderNumberField;
|
|
208
|
+
/**
|
|
209
|
+
* 日付選択フィールドをHTMLとしてレンダリング(静的メソッド)
|
|
210
|
+
* @internal renderFieldから呼び出される内部メソッド
|
|
211
|
+
*/
|
|
212
|
+
private static renderDatePickerField;
|
|
213
|
+
/**
|
|
214
|
+
* 時間選択フィールドをHTMLとしてレンダリング(静的メソッド)
|
|
215
|
+
* @internal renderFieldから呼び出される内部メソッド
|
|
216
|
+
*/
|
|
217
|
+
private static renderTimePickerField;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* 入力コンポーネントを作成
|
|
221
|
+
*/
|
|
222
|
+
export declare function createInput(container: HTMLElement, config?: InputConfig, callbacks?: InputCallbacks): Input;
|