mokkun 0.1.5 → 0.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/README.md +18 -6
- package/bin/cli.mjs +6 -6
- package/bin/viewer.html +78 -3
- package/dist/example.html +225 -0
- package/dist/mokkun.css +1 -1
- package/dist/mokkun.esm.js +14476 -9626
- package/dist/mokkun.esm.js.map +1 -1
- package/dist/mokkun.js +761 -363
- package/dist/mokkun.js.map +1 -1
- package/dist/types/lib.d.ts +109 -0
- package/dist/types/loader/file-loader.d.ts +118 -0
- package/dist/types/loader/index.d.ts +4 -0
- package/dist/types/parser/index.d.ts +5 -0
- package/dist/types/parser/key-normalizer.d.ts +24 -0
- package/dist/types/parser/v2/compile-expand.d.ts +23 -0
- package/dist/types/parser/v2/compile-field.d.ts +28 -0
- package/dist/types/parser/v2/compile-section.d.ts +6 -0
- package/dist/types/parser/v2/compile-v2.d.ts +14 -0
- package/dist/types/parser/v2/compile-warnings.d.ts +17 -0
- package/dist/types/parser/v2/file-spec.d.ts +24 -0
- package/dist/types/parser/v2/index.d.ts +5 -0
- package/dist/types/parser/v2/iso-date.d.ts +10 -0
- package/dist/types/parser/v2/parse-v2.d.ts +24 -0
- package/dist/types/parser/v2/validate-action.d.ts +11 -0
- package/dist/types/parser/v2/validate-app.d.ts +9 -0
- package/dist/types/parser/v2/validate-context.d.ts +41 -0
- package/dist/types/parser/v2/validate-field.d.ts +17 -0
- package/dist/types/parser/v2/validate-keys.d.ts +29 -0
- package/dist/types/parser/v2/validate-list.d.ts +5 -0
- package/dist/types/parser/v2/validate-v2.d.ts +6 -0
- package/dist/types/parser/v2/validate-view.d.ts +6 -0
- package/dist/types/parser/yaml-parser.d.ts +68 -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 +57 -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/renderer-v2/actions.d.ts +30 -0
- package/dist/types/renderer-v2/app-shell.d.ts +15 -0
- package/dist/types/renderer-v2/condition.d.ts +19 -0
- package/dist/types/renderer-v2/context.d.ts +37 -0
- package/dist/types/renderer-v2/fields/choice.d.ts +12 -0
- package/dist/types/renderer-v2/fields/control-label.d.ts +57 -0
- package/dist/types/renderer-v2/fields/date.d.ts +6 -0
- package/dist/types/renderer-v2/fields/display.d.ts +22 -0
- package/dist/types/renderer-v2/fields/file-support.d.ts +15 -0
- package/dist/types/renderer-v2/fields/file.d.ts +9 -0
- package/dist/types/renderer-v2/fields/index.d.ts +20 -0
- package/dist/types/renderer-v2/fields/select.d.ts +17 -0
- package/dist/types/renderer-v2/fields/text.d.ts +26 -0
- package/dist/types/renderer-v2/fields/textarea.d.ts +5 -0
- package/dist/types/renderer-v2/fields/toggle.d.ts +6 -0
- package/dist/types/renderer-v2/icons.d.ts +35 -0
- package/dist/types/renderer-v2/index.d.ts +45 -0
- package/dist/types/renderer-v2/list-cells.d.ts +6 -0
- package/dist/types/renderer-v2/list-data.d.ts +53 -0
- package/dist/types/renderer-v2/mount-parts.d.ts +19 -0
- package/dist/types/renderer-v2/mount-repeat.d.ts +8 -0
- package/dist/types/renderer-v2/mount-section.d.ts +10 -0
- package/dist/types/renderer-v2/mount-visibility.d.ts +13 -0
- package/dist/types/renderer-v2/mount.d.ts +9 -0
- package/dist/types/renderer-v2/role.d.ts +15 -0
- package/dist/types/renderer-v2/section-fields.d.ts +11 -0
- package/dist/types/renderer-v2/section-list.d.ts +8 -0
- package/dist/types/renderer-v2/section-readonly.d.ts +8 -0
- package/dist/types/renderer-v2/section.d.ts +15 -0
- package/dist/types/renderer-v2/styles.d.ts +13 -0
- package/dist/types/renderer-v2/util.d.ts +28 -0
- package/dist/types/renderer-v2/view-state.d.ts +25 -0
- package/dist/types/renderer-v2/view.d.ts +8 -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 +7 -0
- package/dist/types/types/schema-v2.d.ts +270 -0
- package/dist/types/types/schema.d.ts +1712 -0
- package/dist/types/types/theme.d.ts +111 -0
- package/package.json +3 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Map Embed Component
|
|
3
|
+
* Googleマップ埋め込みコンポーネント
|
|
4
|
+
*/
|
|
5
|
+
import type { GoogleMapEmbedField } from '../../types/schema';
|
|
6
|
+
export interface GoogleMapEmbedState {
|
|
7
|
+
url: string;
|
|
8
|
+
isValid: boolean;
|
|
9
|
+
embedUrl: string | null;
|
|
10
|
+
errorMessage: string | null;
|
|
11
|
+
coordinates: {
|
|
12
|
+
lat: number;
|
|
13
|
+
lng: number;
|
|
14
|
+
} | null;
|
|
15
|
+
query: string | null;
|
|
16
|
+
}
|
|
17
|
+
export interface GoogleMapEmbedCallbacks {
|
|
18
|
+
onChange?: (state: GoogleMapEmbedState) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Google Maps URL をバリデート
|
|
22
|
+
*/
|
|
23
|
+
export declare function isValidGoogleMapsUrl(url: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* URL から座標を抽出
|
|
26
|
+
*/
|
|
27
|
+
export declare function extractCoordinates(url: string): {
|
|
28
|
+
lat: number;
|
|
29
|
+
lng: number;
|
|
30
|
+
} | null;
|
|
31
|
+
/**
|
|
32
|
+
* URL から検索クエリを抽出
|
|
33
|
+
*/
|
|
34
|
+
export declare function extractQuery(url: string): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* URL から Place ID を抽出
|
|
37
|
+
*/
|
|
38
|
+
export declare function extractPlaceId(url: string): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Google Maps 埋め込み URL を生成
|
|
41
|
+
*/
|
|
42
|
+
export declare function generateEmbedUrl(url: string, zoom?: number): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Google Maps 埋め込みコンポーネント
|
|
45
|
+
*/
|
|
46
|
+
export declare class GoogleMapEmbed {
|
|
47
|
+
private field;
|
|
48
|
+
private container;
|
|
49
|
+
private callbacks;
|
|
50
|
+
private state;
|
|
51
|
+
private inputElement;
|
|
52
|
+
private previewContainer;
|
|
53
|
+
private errorElement;
|
|
54
|
+
constructor(field: GoogleMapEmbedField, container: HTMLElement, callbacks?: GoogleMapEmbedCallbacks, initialValue?: string);
|
|
55
|
+
private createInitialState;
|
|
56
|
+
/**
|
|
57
|
+
* コンポーネントをレンダリング
|
|
58
|
+
*/
|
|
59
|
+
render(): void;
|
|
60
|
+
private createInputField;
|
|
61
|
+
private createOpenLink;
|
|
62
|
+
private handleInput;
|
|
63
|
+
private handleBlur;
|
|
64
|
+
private handlePaste;
|
|
65
|
+
private updateState;
|
|
66
|
+
private updateErrorDisplay;
|
|
67
|
+
private updatePreview;
|
|
68
|
+
private updateOpenLink;
|
|
69
|
+
/**
|
|
70
|
+
* 現在の状態を取得
|
|
71
|
+
*/
|
|
72
|
+
getState(): GoogleMapEmbedState;
|
|
73
|
+
/**
|
|
74
|
+
* URL を設定
|
|
75
|
+
*/
|
|
76
|
+
setUrl(url: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* コンポーネントを破棄
|
|
79
|
+
*/
|
|
80
|
+
destroy(): void;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Googleマップ埋め込みフィールドをレンダリング
|
|
84
|
+
*/
|
|
85
|
+
export declare function renderGoogleMapEmbedField(field: GoogleMapEmbedField, container: HTMLElement, options?: {
|
|
86
|
+
value?: string;
|
|
87
|
+
onChange?: (fieldId: string, value: unknown) => void;
|
|
88
|
+
}): GoogleMapEmbed;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heading Component
|
|
3
|
+
* 見出しコンポーネント
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* - セマンティックレベル(h1-h6)と視覚的サイズの分離
|
|
7
|
+
* - アクセシビリティを考慮した構造
|
|
8
|
+
* - カラーバリエーション対応
|
|
9
|
+
* - テキスト配置オプション
|
|
10
|
+
*/
|
|
11
|
+
import type { HeadingField } from '../../types/schema';
|
|
12
|
+
/**
|
|
13
|
+
* 見出しの状態
|
|
14
|
+
*/
|
|
15
|
+
export interface HeadingState {
|
|
16
|
+
/** 見出しレベル */
|
|
17
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
18
|
+
/** 見出しテキスト */
|
|
19
|
+
text: string;
|
|
20
|
+
/** サイズバリアント */
|
|
21
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
22
|
+
/** テキスト配置 */
|
|
23
|
+
align?: 'left' | 'center' | 'right';
|
|
24
|
+
/** カラーバリエーション */
|
|
25
|
+
color?: 'default' | 'primary' | 'secondary' | 'muted' | 'danger' | 'success' | 'warning';
|
|
26
|
+
/** アイコン */
|
|
27
|
+
icon?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 見出しのコールバック(拡張用)
|
|
31
|
+
*/
|
|
32
|
+
export interface HeadingCallbacks {
|
|
33
|
+
/** クリック時(インタラクティブな見出しの場合) */
|
|
34
|
+
onClick?: (state: HeadingState) => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 見出しの設定
|
|
38
|
+
*/
|
|
39
|
+
export interface HeadingConfig {
|
|
40
|
+
/** 見出しレベル(h1-h6) */
|
|
41
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
42
|
+
/** 見出しテキスト */
|
|
43
|
+
text: string;
|
|
44
|
+
/** サイズバリアント(デフォルト: levelに基づく) */
|
|
45
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
46
|
+
/** テキスト配置(デフォルト: left) */
|
|
47
|
+
align?: 'left' | 'center' | 'right';
|
|
48
|
+
/** カラーバリエーション(デフォルト: default) */
|
|
49
|
+
color?: 'default' | 'primary' | 'secondary' | 'muted' | 'danger' | 'success' | 'warning';
|
|
50
|
+
/** アイコン(オプション) */
|
|
51
|
+
icon?: string;
|
|
52
|
+
/** ID属性 */
|
|
53
|
+
id?: string;
|
|
54
|
+
/** カスタムCSSクラス */
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 見出しコンポーネント
|
|
59
|
+
*/
|
|
60
|
+
export declare class Heading {
|
|
61
|
+
private config;
|
|
62
|
+
private state;
|
|
63
|
+
private callbacks;
|
|
64
|
+
private container;
|
|
65
|
+
private instanceId;
|
|
66
|
+
constructor(container: HTMLElement, config: HeadingConfig, callbacks?: HeadingCallbacks);
|
|
67
|
+
/**
|
|
68
|
+
* 見出しをレンダリング
|
|
69
|
+
*/
|
|
70
|
+
render(): void;
|
|
71
|
+
/**
|
|
72
|
+
* 見出しテキストを更新
|
|
73
|
+
*/
|
|
74
|
+
setText(text: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* 見出しレベルを更新
|
|
77
|
+
*/
|
|
78
|
+
setLevel(level: 1 | 2 | 3 | 4 | 5 | 6): void;
|
|
79
|
+
/**
|
|
80
|
+
* サイズバリアントを更新
|
|
81
|
+
*/
|
|
82
|
+
setSize(size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'): void;
|
|
83
|
+
/**
|
|
84
|
+
* テキスト配置を更新
|
|
85
|
+
*/
|
|
86
|
+
setAlign(align: 'left' | 'center' | 'right'): void;
|
|
87
|
+
/**
|
|
88
|
+
* カラーバリエーションを更新
|
|
89
|
+
*/
|
|
90
|
+
setColor(color: 'default' | 'primary' | 'secondary' | 'muted' | 'danger' | 'success' | 'warning'): void;
|
|
91
|
+
/**
|
|
92
|
+
* 現在の状態を取得
|
|
93
|
+
*/
|
|
94
|
+
getState(): HeadingState;
|
|
95
|
+
/**
|
|
96
|
+
* 初期状態を作成
|
|
97
|
+
*/
|
|
98
|
+
private createInitialState;
|
|
99
|
+
/**
|
|
100
|
+
* 見出し要素を作成
|
|
101
|
+
*/
|
|
102
|
+
private createHeadingElement;
|
|
103
|
+
/**
|
|
104
|
+
* レベルに基づくデフォルトサイズを取得
|
|
105
|
+
*/
|
|
106
|
+
private getDefaultSizeForLevel;
|
|
107
|
+
/**
|
|
108
|
+
* 見出しフィールドをHTMLとしてレンダリング(静的メソッド)
|
|
109
|
+
* SSR/初期レンダリング用
|
|
110
|
+
*
|
|
111
|
+
* @param field - 見出しフィールド定義
|
|
112
|
+
* @returns 生成されたHTML文字列
|
|
113
|
+
*/
|
|
114
|
+
static renderField(field: HeadingField): string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 見出しコンポーネントを作成
|
|
118
|
+
*/
|
|
119
|
+
export declare function createHeading(container: HTMLElement, config: HeadingConfig, callbacks?: HeadingCallbacks): Heading;
|
|
@@ -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;
|