Angular 署名フィールド | ng-hub-ui-signature

マウス、タッチ、ペン入力をスケーラブルな SVG フォーム値として保存する、アクセシブルな Angular 署名フィールド。取り消し、やり直し、PNG エクスポートに対応します。

API リファレンス

signature の完全な仕様をここにまとめました。バインド、リッスン、プロジェクション、テーマ設定ができるすべてが一か所に集約されています。必要なものを接続し、好きなようにスタイリングしてください — standalone で signal フレンドリーです。

インプット

9 個のインプットで signature を調整。通常の Angular @Input と同じようにバインドできます。

名前デフォルト説明
labelstring''Visible field label.
formTextstring''Helper text shown below the drawing surface.
heightnumber160Logical canvas height in CSS pixels.
strokeColorstring'currentColor'Colour recorded in new SVG strokes.
strokeWidthnumber2Base width recorded in new SVG strokes.
readonlybooleanfalsePrevents drawing while preserving the signature.
controlsbooleantrueShows clear, undo and redo actions.
labelsPartial<HubSignatureLabels>{}Overrides the application-wide translated action labels for this field only.
ariaLabelstring'Signature'Accessible name for the drawing surface.

アウトプット

signature の動作に反応 — ロジックを接続できる 1 個のイベント。

名前説明
valueChangeEventEmitter<string>Emits the SVG value after a user-originated change.

メソッド

signature をコードから操作 — プログラム操作のための 5 個のメソッドを備えています。

名前シグネチャ戻り値説明
clearclear(): voidRemoves every stroke and emits the empty value.
undoundo(): voidRemoves the most recently committed stroke.
redoredo(): voidRestores the most recently undone stroke.
toSvgtoSvg(): stringReturns the scalable SVG form value.
toDataUrltoDataUrl(type?: string): stringExports the rendered signature, PNG by default.

テンプレート

テンプレートはまだドキュメント化されていません。