Angular 署名フィールド | ng-hub-ui-signature
マウス、タッチ、ペン入力をスケーラブルな SVG フォーム値として保存する、アクセシブルな Angular 署名フィールド。取り消し、やり直し、PNG エクスポートに対応します。
API リファレンス
signature の完全な仕様をここにまとめました。バインド、リッスン、プロジェクション、テーマ設定ができるすべてが一か所に集約されています。必要なものを接続し、好きなようにスタイリングしてください — standalone で signal フレンドリーです。
インプット
9 個のインプットで signature を調整。通常の Angular @Input と同じようにバインドできます。
| 名前 | 型 | デフォルト | 説明 |
|---|---|---|---|
label | string | '' | Visible field label. |
formText | string | '' | Helper text shown below the drawing surface. |
height | number | 160 | Logical canvas height in CSS pixels. |
strokeColor | string | 'currentColor' | Colour recorded in new SVG strokes. |
strokeWidth | number | 2 | Base width recorded in new SVG strokes. |
readonly | boolean | false | Prevents drawing while preserving the signature. |
controls | boolean | true | Shows clear, undo and redo actions. |
labels | Partial<HubSignatureLabels> | {} | Overrides the application-wide translated action labels for this field only. |
ariaLabel | string | 'Signature' | Accessible name for the drawing surface. |
アウトプット
signature の動作に反応 — ロジックを接続できる 1 個のイベント。
| 名前 | 型 | 説明 |
|---|---|---|
valueChange | EventEmitter<string> | Emits the SVG value after a user-originated change. |
メソッド
signature をコードから操作 — プログラム操作のための 5 個のメソッドを備えています。
| 名前 | シグネチャ | 戻り値 | 説明 |
|---|---|---|---|
clear | clear(): void | — | Removes every stroke and emits the empty value. |
undo | undo(): void | — | Removes the most recently committed stroke. |
redo | redo(): void | — | Restores the most recently undone stroke. |
toSvg | toSvg(): string | — | Returns the scalable SVG form value. |
toDataUrl | toDataUrl(type?: string): string | — | Exports the rendered signature, PNG by default. |
テンプレート
テンプレートはまだドキュメント化されていません。