@uibit/signature 0.1.0 → 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 CHANGED
@@ -1,6 +1,16 @@
1
1
  # Signature Pad
2
2
 
3
- [Interactive Demonstration](https://rawlings.github.io/uibit/components/signature-pad)
3
+ [![NPM Version](https://img.shields.io/npm/v/@uibit/signature.svg?style=flat-square&color=black)](https://www.npmjs.com/package/@uibit/signature)
4
+
5
+
6
+ [Interactive Demonstration](https://rawlings.github.io/uibit/components/signature)
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @uibit/signature
12
+ ```
13
+
4
14
 
5
15
  Signature Pad is a signature capture component that allows users to write signatures on digital forms. By providing smooth, high-fidelity stroke tracking for mouse, touch, and stylus inputs, it streamlines document workflows and digital authorization processes.
6
16
 
@@ -31,7 +31,7 @@
31
31
  "declarations": [
32
32
  {
33
33
  "kind": "class",
34
- "description": "Canvas area for capturing freehand signatures or drawings using touch or\nmouse gestures, rendered immediately as smooth bezier-curved vector lines\nwith simulated pen pressure.",
34
+ "description": "Canvas area for capturing freehand signatures or drawings using touch or",
35
35
  "name": "Signature",
36
36
  "cssProperties": [
37
37
  {
@@ -114,6 +114,15 @@
114
114
  }
115
115
  ],
116
116
  "members": [
117
+ {
118
+ "kind": "field",
119
+ "name": "value",
120
+ "type": {
121
+ "text": "string"
122
+ },
123
+ "description": "The signature image data URL.",
124
+ "attribute": "value"
125
+ },
117
126
  {
118
127
  "kind": "field",
119
128
  "name": "hideClear",
@@ -337,6 +346,211 @@
337
346
  {
338
347
  "kind": "method",
339
348
  "name": "formResetCallback"
349
+ },
350
+ {
351
+ "kind": "field",
352
+ "name": "locale",
353
+ "type": {
354
+ "text": "string"
355
+ },
356
+ "default": "''",
357
+ "description": "BCP 47 locale string for formatting and localization. Defaults to inherited document language.",
358
+ "attribute": "locale",
359
+ "inheritedFrom": {
360
+ "name": "UIBitElement",
361
+ "module": "../../platform/core/src/element.ts"
362
+ }
363
+ },
364
+ {
365
+ "kind": "field",
366
+ "name": "resolvedLocale",
367
+ "type": {
368
+ "text": "string | undefined"
369
+ },
370
+ "description": "Resolves the active locale for formatting and localization.\nChecks the `locale` property first, then traverses up the DOM to find\nthe nearest ancestor with a `lang` attribute, and finally falls back\nto undefined (which defaults to browser locale).",
371
+ "readonly": true,
372
+ "inheritedFrom": {
373
+ "name": "UIBitElement",
374
+ "module": "../../platform/core/src/element.ts"
375
+ }
376
+ },
377
+ {
378
+ "kind": "field",
379
+ "name": "_disposables",
380
+ "type": {
381
+ "text": "Set<() => void>"
382
+ },
383
+ "privacy": "private",
384
+ "default": "new Set()",
385
+ "inheritedFrom": {
386
+ "name": "UIBitElement",
387
+ "module": "../../platform/core/src/element.ts"
388
+ }
389
+ },
390
+ {
391
+ "kind": "method",
392
+ "name": "createProperty",
393
+ "static": true,
394
+ "parameters": [
395
+ {
396
+ "name": "name",
397
+ "type": {
398
+ "text": "PropertyKey"
399
+ }
400
+ },
401
+ {
402
+ "name": "options",
403
+ "optional": true,
404
+ "type": {
405
+ "text": "PropertyDeclaration"
406
+ }
407
+ }
408
+ ],
409
+ "description": "Overrides createProperty to automatically map camelCase property names\nto kebab-case attribute names by default.",
410
+ "inheritedFrom": {
411
+ "name": "UIBitElement",
412
+ "module": "../../platform/core/src/element.ts"
413
+ }
414
+ },
415
+ {
416
+ "kind": "method",
417
+ "name": "finalizeStyles",
418
+ "static": true,
419
+ "return": {
420
+ "type": {
421
+ "text": "Array<any>"
422
+ }
423
+ },
424
+ "parameters": [
425
+ {
426
+ "name": "styles",
427
+ "optional": true,
428
+ "type": {
429
+ "text": "CSSResultGroup"
430
+ }
431
+ }
432
+ ],
433
+ "description": "Automatically prepends basic layout resets (border-box) to the\ncomponent's final styles.",
434
+ "inheritedFrom": {
435
+ "name": "UIBitElement",
436
+ "module": "../../platform/core/src/element.ts"
437
+ }
438
+ },
439
+ {
440
+ "kind": "method",
441
+ "name": "dispatchCustomEvent",
442
+ "return": {
443
+ "type": {
444
+ "text": "boolean"
445
+ }
446
+ },
447
+ "parameters": [
448
+ {
449
+ "name": "name",
450
+ "type": {
451
+ "text": "string"
452
+ }
453
+ },
454
+ {
455
+ "name": "detail",
456
+ "optional": true,
457
+ "type": {
458
+ "text": "T"
459
+ }
460
+ },
461
+ {
462
+ "name": "options",
463
+ "optional": true,
464
+ "type": {
465
+ "text": "Omit<CustomEventInit<T>, 'detail'>"
466
+ }
467
+ }
468
+ ],
469
+ "description": "Helper to dispatch a custom event with standard bubbles and composed options.",
470
+ "inheritedFrom": {
471
+ "name": "UIBitElement",
472
+ "module": "../../platform/core/src/element.ts"
473
+ }
474
+ },
475
+ {
476
+ "kind": "method",
477
+ "name": "getCssPropertyValue",
478
+ "return": {
479
+ "type": {
480
+ "text": "string"
481
+ }
482
+ },
483
+ "parameters": [
484
+ {
485
+ "name": "propertyName",
486
+ "type": {
487
+ "text": "string"
488
+ }
489
+ }
490
+ ],
491
+ "description": "Helper to retrieve a computed CSS custom property value from the element.",
492
+ "inheritedFrom": {
493
+ "name": "UIBitElement",
494
+ "module": "../../platform/core/src/element.ts"
495
+ }
496
+ },
497
+ {
498
+ "kind": "method",
499
+ "name": "registerDisposable",
500
+ "parameters": [
501
+ {
502
+ "name": "cleanup",
503
+ "type": {
504
+ "text": "() => void"
505
+ }
506
+ }
507
+ ],
508
+ "description": "Register a cleanup function to be executed when the element is disconnected from the DOM.",
509
+ "inheritedFrom": {
510
+ "name": "UIBitElement",
511
+ "module": "../../platform/core/src/element.ts"
512
+ }
513
+ },
514
+ {
515
+ "kind": "method",
516
+ "name": "listen",
517
+ "return": {
518
+ "type": {
519
+ "text": "() => void"
520
+ }
521
+ },
522
+ "parameters": [
523
+ {
524
+ "name": "target",
525
+ "type": {
526
+ "text": "EventTarget"
527
+ }
528
+ },
529
+ {
530
+ "name": "type",
531
+ "type": {
532
+ "text": "K"
533
+ }
534
+ },
535
+ {
536
+ "name": "listener",
537
+ "type": {
538
+ "text": "(this: EventTarget, ev: HTMLElementEventMap[K]) => any"
539
+ }
540
+ },
541
+ {
542
+ "name": "options",
543
+ "optional": true,
544
+ "type": {
545
+ "text": "boolean | AddEventListenerOptions"
546
+ }
547
+ }
548
+ ],
549
+ "description": "Utility to add an event listener that is automatically cleaned up when the element is disconnected.",
550
+ "inheritedFrom": {
551
+ "name": "UIBitElement",
552
+ "module": "../../platform/core/src/element.ts"
553
+ }
340
554
  }
341
555
  ],
342
556
  "events": [
@@ -344,7 +558,7 @@
344
558
  "type": {
345
559
  "text": "{ isEmpty: boolean; dataUrl: string }"
346
560
  },
347
- "description": "Fired after each stroke ends",
561
+ "description": "Dispatched when value changes",
348
562
  "name": "signature-change"
349
563
  },
350
564
  {
@@ -356,6 +570,14 @@
356
570
  }
357
571
  ],
358
572
  "attributes": [
573
+ {
574
+ "name": "value",
575
+ "type": {
576
+ "text": "string"
577
+ },
578
+ "description": "The signature image data URL.",
579
+ "fieldName": "value"
580
+ },
359
581
  {
360
582
  "name": "hide-clear",
361
583
  "type": {
@@ -364,6 +586,29 @@
364
586
  "default": "false",
365
587
  "description": "Whether to hide the clear button.",
366
588
  "fieldName": "hideClear"
589
+ },
590
+ {
591
+ "name": "locale",
592
+ "type": {
593
+ "text": "string"
594
+ },
595
+ "default": "''",
596
+ "description": "BCP 47 locale string for formatting and localization. Defaults to inherited document language.",
597
+ "fieldName": "locale",
598
+ "inheritedFrom": {
599
+ "name": "UIBitElement",
600
+ "module": "../../platform/core/src/element.ts"
601
+ }
602
+ }
603
+ ],
604
+ "cssStates": [
605
+ {
606
+ "name": "empty",
607
+ "description": "Active when the signature pad has no drawing inputs."
608
+ },
609
+ {
610
+ "name": "drawing",
611
+ "description": "Active when the user is drawing on the canvas."
367
612
  }
368
613
  ],
369
614
  "mixins": [
@@ -376,6 +621,7 @@
376
621
  "name": "UIBitElement",
377
622
  "package": "@uibit/core"
378
623
  },
624
+ "summary": "A canvas-based signature pad drawing component with smooth strokes.\nmouse gestures, rendered immediately as smooth bezier-curved vector lines\nwith simulated pen pressure.",
379
625
  "tagName": "uibit-signature",
380
626
  "customElement": true
381
627
  }
@@ -412,6 +658,250 @@
412
658
  "path": "src/types.ts",
413
659
  "declarations": [],
414
660
  "exports": []
661
+ },
662
+ {
663
+ "kind": "javascript-module",
664
+ "path": "../../platform/core/src/element.ts",
665
+ "declarations": [
666
+ {
667
+ "kind": "class",
668
+ "description": "A foundational base class for all UIBit web components.\nProvides custom event helpers, default kebab-case attribute mapping,\nautomatic cleanup/disposable tracking, and auto-injected reset styles.",
669
+ "name": "UIBitElement",
670
+ "members": [
671
+ {
672
+ "kind": "field",
673
+ "name": "locale",
674
+ "type": {
675
+ "text": "string"
676
+ },
677
+ "default": "''",
678
+ "description": "BCP 47 locale string for formatting and localization. Defaults to inherited document language.",
679
+ "attribute": "locale"
680
+ },
681
+ {
682
+ "kind": "field",
683
+ "name": "resolvedLocale",
684
+ "type": {
685
+ "text": "string | undefined"
686
+ },
687
+ "description": "Resolves the active locale for formatting and localization.\nChecks the `locale` property first, then traverses up the DOM to find\nthe nearest ancestor with a `lang` attribute, and finally falls back\nto undefined (which defaults to browser locale).",
688
+ "readonly": true
689
+ },
690
+ {
691
+ "kind": "field",
692
+ "name": "_disposables",
693
+ "type": {
694
+ "text": "Set<() => void>"
695
+ },
696
+ "privacy": "private",
697
+ "default": "new Set()"
698
+ },
699
+ {
700
+ "kind": "method",
701
+ "name": "createProperty",
702
+ "static": true,
703
+ "parameters": [
704
+ {
705
+ "name": "name",
706
+ "type": {
707
+ "text": "PropertyKey"
708
+ }
709
+ },
710
+ {
711
+ "name": "options",
712
+ "optional": true,
713
+ "type": {
714
+ "text": "PropertyDeclaration"
715
+ }
716
+ }
717
+ ],
718
+ "description": "Overrides createProperty to automatically map camelCase property names\nto kebab-case attribute names by default."
719
+ },
720
+ {
721
+ "kind": "method",
722
+ "name": "finalizeStyles",
723
+ "static": true,
724
+ "return": {
725
+ "type": {
726
+ "text": "Array<any>"
727
+ }
728
+ },
729
+ "parameters": [
730
+ {
731
+ "name": "styles",
732
+ "optional": true,
733
+ "type": {
734
+ "text": "CSSResultGroup"
735
+ }
736
+ }
737
+ ],
738
+ "description": "Automatically prepends basic layout resets (border-box) to the\ncomponent's final styles."
739
+ },
740
+ {
741
+ "kind": "method",
742
+ "name": "dispatchCustomEvent",
743
+ "return": {
744
+ "type": {
745
+ "text": "boolean"
746
+ }
747
+ },
748
+ "parameters": [
749
+ {
750
+ "name": "name",
751
+ "type": {
752
+ "text": "string"
753
+ }
754
+ },
755
+ {
756
+ "name": "detail",
757
+ "optional": true,
758
+ "type": {
759
+ "text": "T"
760
+ }
761
+ },
762
+ {
763
+ "name": "options",
764
+ "optional": true,
765
+ "type": {
766
+ "text": "Omit<CustomEventInit<T>, 'detail'>"
767
+ }
768
+ }
769
+ ],
770
+ "description": "Helper to dispatch a custom event with standard bubbles and composed options."
771
+ },
772
+ {
773
+ "kind": "method",
774
+ "name": "getCssPropertyValue",
775
+ "return": {
776
+ "type": {
777
+ "text": "string"
778
+ }
779
+ },
780
+ "parameters": [
781
+ {
782
+ "name": "propertyName",
783
+ "type": {
784
+ "text": "string"
785
+ }
786
+ }
787
+ ],
788
+ "description": "Helper to retrieve a computed CSS custom property value from the element."
789
+ },
790
+ {
791
+ "kind": "method",
792
+ "name": "registerDisposable",
793
+ "parameters": [
794
+ {
795
+ "name": "cleanup",
796
+ "type": {
797
+ "text": "() => void"
798
+ }
799
+ }
800
+ ],
801
+ "description": "Register a cleanup function to be executed when the element is disconnected from the DOM."
802
+ },
803
+ {
804
+ "kind": "method",
805
+ "name": "listen",
806
+ "return": {
807
+ "type": {
808
+ "text": "() => void"
809
+ }
810
+ },
811
+ "parameters": [
812
+ {
813
+ "name": "target",
814
+ "type": {
815
+ "text": "EventTarget"
816
+ }
817
+ },
818
+ {
819
+ "name": "type",
820
+ "type": {
821
+ "text": "K"
822
+ }
823
+ },
824
+ {
825
+ "name": "listener",
826
+ "type": {
827
+ "text": "(this: EventTarget, ev: HTMLElementEventMap[K]) => any"
828
+ }
829
+ },
830
+ {
831
+ "name": "options",
832
+ "optional": true,
833
+ "type": {
834
+ "text": "boolean | AddEventListenerOptions"
835
+ }
836
+ }
837
+ ],
838
+ "description": "Utility to add an event listener that is automatically cleaned up when the element is disconnected."
839
+ },
840
+ {
841
+ "kind": "method",
842
+ "name": "listen",
843
+ "return": {
844
+ "type": {
845
+ "text": "() => void"
846
+ }
847
+ },
848
+ "parameters": [
849
+ {
850
+ "name": "target",
851
+ "type": {
852
+ "text": "EventTarget"
853
+ }
854
+ },
855
+ {
856
+ "name": "type",
857
+ "type": {
858
+ "text": "string"
859
+ }
860
+ },
861
+ {
862
+ "name": "listener",
863
+ "type": {
864
+ "text": "EventListenerOrEventListenerObject"
865
+ }
866
+ },
867
+ {
868
+ "name": "options",
869
+ "optional": true,
870
+ "type": {
871
+ "text": "boolean | AddEventListenerOptions"
872
+ }
873
+ }
874
+ ]
875
+ }
876
+ ],
877
+ "attributes": [
878
+ {
879
+ "name": "locale",
880
+ "type": {
881
+ "text": "string"
882
+ },
883
+ "default": "''",
884
+ "description": "BCP 47 locale string for formatting and localization. Defaults to inherited document language.",
885
+ "fieldName": "locale"
886
+ }
887
+ ],
888
+ "superclass": {
889
+ "name": "LitElement",
890
+ "package": "lit"
891
+ },
892
+ "customElement": true
893
+ }
894
+ ],
895
+ "exports": [
896
+ {
897
+ "kind": "js",
898
+ "name": "UIBitElement",
899
+ "declaration": {
900
+ "name": "UIBitElement",
901
+ "module": "../../platform/core/src/element.ts"
902
+ }
903
+ }
904
+ ]
415
905
  }
416
906
  ]
417
907
  }
@@ -1,66 +1,84 @@
1
- import { Component, ChangeDetectionStrategy, ElementRef, input, effect, output, booleanAttribute, forwardRef } from '@angular/core';
1
+ import { Component, ChangeDetectionStrategy, ElementRef, model, input, effect, output, booleanAttribute, forwardRef } from '@angular/core';
2
2
  import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';
3
3
  import '@uibit/signature';
4
4
  import type { Signature as HTMLElementClass } from '@uibit/signature';
5
-
6
5
  @Component({
7
- selector: 'uibit-signature',
8
- template: '<ng-content></ng-content>',
9
- changeDetection: ChangeDetectionStrategy.OnPush,
10
- standalone: true,
11
- providers: [
12
- {
13
- provide: NG_VALUE_ACCESSOR,
14
- useExisting: forwardRef(() => NgxSignature),
15
- multi: true
6
+ selector: 'uibit-signature',
7
+ template: '<ng-content></ng-content>',
8
+ changeDetection: ChangeDetectionStrategy.OnPush,
9
+ standalone: true,
10
+ providers: [
11
+ {
12
+ provide: NG_VALUE_ACCESSOR,
13
+ useExisting: forwardRef(()=>NgxSignature),
14
+ multi: true
15
+ }
16
+ ],
17
+ host: {
18
+ '(signature-change)': 'signatureChange.emit($event); value.set($event.detail?.value !== undefined ? $event.detail.value : $event.target.value); handleInput($event)',
19
+ '(signature-clear)': 'signatureClear.emit($event)'
16
20
  }
17
- ],
18
- host: {
19
- '(signature-change)': 'signatureChange.emit($event); handleInput()',
20
- '(signature-clear)': 'signatureClear.emit($event); handleInput()',
21
- '(blur)': 'handleBlur()',
22
- '(change)': 'handleInput()',
23
- '(input)': 'handleInput()'
24
- }
25
21
  })
26
22
  export class NgxSignature implements ControlValueAccessor {
27
- constructor(private el: ElementRef<HTMLElementClass>) {
28
- effect(() => {
29
- if (this.el.nativeElement) {
30
- this.el.nativeElement.hideClear = this.hideClear();
31
- }
23
+ constructor(private el: ElementRef<HTMLElementClass>){
24
+ effect(()=>{
25
+ if (this.el.nativeElement) {
26
+ this.el.nativeElement.value = this.value();
27
+ }
28
+ });
29
+ effect(()=>{
30
+ if (this.el.nativeElement) {
31
+ this.el.nativeElement.hideClear = this.hideClear();
32
+ }
33
+ });
34
+ effect(()=>{
35
+ if (this.el.nativeElement) {
36
+ this.el.nativeElement.locale = this.locale();
37
+ }
38
+ });
39
+ }
40
+ readonly value = model<string>(undefined);
41
+ readonly hideClear = input<boolean, any>(false, {
42
+ transform: booleanAttribute
32
43
  });
33
- }
34
-
35
- readonly hideClear = input<boolean, any>(false, { transform: booleanAttribute });
36
-
37
- readonly signatureChange = output<CustomEvent<{ isEmpty: boolean; dataUrl: string }>>();
38
- readonly signatureClear = output<CustomEvent<{ previouslyEmpty: boolean }>>();
39
-
40
- private _onChange: (value: any) => void = () => {};
41
- private _onTouched: () => void = () => {};
42
-
43
- writeValue(value: any): void {
44
- this.el.nativeElement.value = value;
45
- }
46
-
47
- registerOnChange(fn: any): void {
48
- this._onChange = fn;
49
- }
50
-
51
- registerOnTouched(fn: any): void {
52
- this._onTouched = fn;
53
- }
54
-
55
- setDisabledState(isDisabled: boolean): void {
56
- this.el.nativeElement.disabled = isDisabled;
57
- }
58
-
59
- handleInput() {
60
- this._onChange(this.el.nativeElement.value);
61
- }
62
-
63
- handleBlur() {
64
- this._onTouched();
65
- }
44
+ readonly locale = input<string>('');
45
+ readonly signatureChange = output<CustomEvent<{
46
+ isEmpty: boolean;
47
+ dataUrl: string;
48
+ }>>();
49
+ readonly signatureClear = output<CustomEvent<{
50
+ previouslyEmpty: boolean;
51
+ }>>();
52
+ private _onChange: (value: any) => void = ()=>{};
53
+ private _onTouched: () => void = ()=>{};
54
+ writeValue(value: any): void {
55
+ if (value !== undefined) {
56
+ this.value.set(value);
57
+ }
58
+ }
59
+ registerOnChange(fn: any): void {
60
+ this._onChange = fn;
61
+ }
62
+ registerOnTouched(fn: any): void {
63
+ this._onTouched = fn;
64
+ }
65
+ setDisabledState(isDisabled: boolean): void {
66
+ const el = this.el.nativeElement;
67
+ if ('disabled' in el) {
68
+ (el as any).disabled = isDisabled;
69
+ }
70
+ if (isDisabled) {
71
+ el.setAttribute('disabled', '');
72
+ } else {
73
+ el.removeAttribute('disabled');
74
+ }
75
+ }
76
+ handleInput(event: any) {
77
+ const val = event.target.value;
78
+ this.value.set(val);
79
+ this._onChange(val);
80
+ }
81
+ handleBlur() {
82
+ this._onTouched();
83
+ }
66
84
  }
@@ -4,7 +4,13 @@ import '@uibit/signature';
4
4
  declare global {
5
5
  namespace astroHTML.JSX {
6
6
  interface IntrinsicElements {
7
- 'uibit-signature': Partial<HTMLElementClass> & astroHTML.JSX.HTMLAttributes;
7
+ 'uibit-signature': Partial<HTMLElementClass> & astroHTML.JSX.HTMLAttributes & {
8
+ value?: string;
9
+ hideClear?: boolean;
10
+ locale?: string;
11
+ "on:signature-change"?: (event: CustomEvent<{ isEmpty: boolean; dataUrl: string }>) => void;
12
+ "on:signature-clear"?: (event: CustomEvent<{ previouslyEmpty: boolean }>) => void;
13
+ };
8
14
  }
9
15
  }
10
16
  }
@@ -6,7 +6,13 @@ declare module 'preact' {
6
6
  namespace JSX {
7
7
  interface IntrinsicElements {
8
8
  'uibit-signature': JSX.HTMLAttributes<HTMLElementClass> & {
9
+ value?: string;
9
10
  hideClear?: boolean;
11
+ locale?: string;
12
+ onSignatureChange?: (event: CustomEvent<{ isEmpty: boolean; dataUrl: string }>) => void;
13
+ "on:signature-change"?: (event: CustomEvent<{ isEmpty: boolean; dataUrl: string }>) => void;
14
+ onSignatureClear?: (event: CustomEvent<{ previouslyEmpty: boolean }>) => void;
15
+ "on:signature-clear"?: (event: CustomEvent<{ previouslyEmpty: boolean }>) => void;
10
16
  };
11
17
  }
12
18
  }
@@ -0,0 +1,114 @@
1
+ import React, { useRef, useEffect, useLayoutEffect, useImperativeHandle } from 'react';
2
+ import type { Signature as HTMLElementClass } from '@uibit/signature';
3
+ import '@uibit/signature';
4
+ const useTypeOfLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
5
+ export interface SignatureProps extends Omit<React.HTMLAttributes<HTMLElementClass>, 'value' | 'hideClear' | 'locale' | 'onSignatureChange' | 'onSignatureClear'> {
6
+ children?: React.ReactNode;
7
+ value?: string;
8
+ hideClear?: boolean;
9
+ locale?: string;
10
+ onSignatureChange?: (event: CustomEvent<{
11
+ isEmpty: boolean;
12
+ dataUrl: string;
13
+ }>) => void;
14
+ onSignatureClear?: (event: CustomEvent<{
15
+ previouslyEmpty: boolean;
16
+ }>) => void;
17
+ }
18
+ export const Signature = ({ ref, children, ...props }: SignatureProps & {
19
+ ref?: React.Ref<HTMLElementClass>;
20
+ })=>{
21
+ const innerRef = useRef<HTMLElementClass>(null);
22
+ const propsRef = useRef(props);
23
+ propsRef.current = props;
24
+ useImperativeHandle(ref, ()=>innerRef.current!);
25
+ useTypeOfLayoutEffect(()=>{
26
+ const element = innerRef.current;
27
+ if (element && props.value !== undefined) {
28
+ (element as any).value = props.value;
29
+ }
30
+ }, [
31
+ props.value
32
+ ]);
33
+ useTypeOfLayoutEffect(()=>{
34
+ const element = innerRef.current;
35
+ if (element && props.hideClear !== undefined) {
36
+ (element as any).hideClear = props.hideClear;
37
+ }
38
+ }, [
39
+ props.hideClear
40
+ ]);
41
+ useTypeOfLayoutEffect(()=>{
42
+ const element = innerRef.current;
43
+ if (element && props.locale !== undefined) {
44
+ (element as any).locale = props.locale;
45
+ }
46
+ }, [
47
+ props.locale
48
+ ]);
49
+ useTypeOfLayoutEffect(()=>{
50
+ const element = innerRef.current;
51
+ if (!element) return;
52
+ const handleEvent = (event: Event)=>{
53
+ if (propsRef.current.onSignatureChange) {
54
+ propsRef.current.onSignatureChange(event as any);
55
+ }
56
+ };
57
+ element.addEventListener('signature-change', handleEvent);
58
+ return ()=>{
59
+ element.removeEventListener('signature-change', handleEvent);
60
+ };
61
+ }, []);
62
+ useTypeOfLayoutEffect(()=>{
63
+ const element = innerRef.current;
64
+ if (!element) return;
65
+ const handleEvent = (event: Event)=>{
66
+ if (propsRef.current.onSignatureClear) {
67
+ propsRef.current.onSignatureClear(event as any);
68
+ }
69
+ };
70
+ element.addEventListener('signature-clear', handleEvent);
71
+ return ()=>{
72
+ element.removeEventListener('signature-clear', handleEvent);
73
+ };
74
+ }, []);
75
+ const domProps = {
76
+ ...props
77
+ };
78
+ const customPropNames = [
79
+ 'value',
80
+ 'hideClear',
81
+ 'locale',
82
+ 'onSignatureChange',
83
+ 'onSignatureClear'
84
+ ];
85
+ for (const key of customPropNames){
86
+ delete (domProps as any)[key];
87
+ }
88
+ return React.createElement('uibit-signature', {
89
+ ref: innerRef,
90
+ ...domProps
91
+ }, children);
92
+ };
93
+ declare global {
94
+ namespace React {
95
+ namespace JSX {
96
+ interface IntrinsicElements {
97
+ 'uibit-signature': React.ClassAttributes<HTMLElementClass> & React.HTMLAttributes<HTMLElementClass> & {
98
+ children?: React.ReactNode;
99
+ class?: string;
100
+ value?: string;
101
+ hideClear?: boolean;
102
+ locale?: string;
103
+ onSignatureChange?: (event: CustomEvent<{
104
+ isEmpty: boolean;
105
+ dataUrl: string;
106
+ }>) => void;
107
+ onSignatureClear?: (event: CustomEvent<{
108
+ previouslyEmpty: boolean;
109
+ }>) => void;
110
+ };
111
+ }
112
+ }
113
+ }
114
+ }
@@ -6,9 +6,11 @@ declare module 'solid-js' {
6
6
  namespace JSX {
7
7
  interface IntrinsicElements {
8
8
  'uibit-signature': Partial<HTMLElementClass> & JSX.HTMLAttributes<HTMLElementClass> & {
9
- hideClear?: boolean;
10
- "on:signature-change"?: (event: CustomEvent) => void;
11
- "on:signature-clear"?: (event: CustomEvent) => void;
9
+ value?: string;
10
+ hideClear?: boolean;
11
+ locale?: string;
12
+ "on:signature-change"?: (event: CustomEvent<{ isEmpty: boolean; dataUrl: string }>) => void;
13
+ "on:signature-clear"?: (event: CustomEvent<{ previouslyEmpty: boolean }>) => void;
12
14
  };
13
15
  }
14
16
  }
@@ -5,7 +5,13 @@ declare module '@stencil/core' {
5
5
  export namespace JSX {
6
6
  interface IntrinsicElements {
7
7
  'uibit-signature': HTMLElementClass & {
8
+ value?: string;
8
9
  hideClear?: boolean;
10
+ locale?: string;
11
+ onSignatureChange?: (event: CustomEvent<{ isEmpty: boolean; dataUrl: string }>) => void;
12
+ "on:signature-change"?: (event: CustomEvent<{ isEmpty: boolean; dataUrl: string }>) => void;
13
+ onSignatureClear?: (event: CustomEvent<{ previouslyEmpty: boolean }>) => void;
14
+ "on:signature-clear"?: (event: CustomEvent<{ previouslyEmpty: boolean }>) => void;
9
15
  };
10
16
  }
11
17
  }
@@ -1,30 +1,69 @@
1
1
  <script lang="ts">
2
2
  import '@uibit/signature';
3
3
  import type { Signature as HTMLElementClass } from '@uibit/signature';
4
-
5
- let {
6
- hideClear = undefined,
7
- hint = undefined,
8
- clear-label = undefined,
9
- children
4
+
5
+ let {
6
+ value = $bindable(),
7
+ hideClear = $bindable(),
8
+ locale = $bindable(),
9
+ hint = undefined,
10
+ clear-label = undefined,
11
+ children,
12
+ ...restProps
10
13
  } = $props<{
11
- children?: any;
14
+ children?: import('svelte').Snippet;
15
+ value?: string;
12
16
  hideClear?: boolean;
17
+ locale?: string;
13
18
  hint?: import('svelte').Snippet;
14
19
  clear-label?: import('svelte').Snippet;
20
+ [key: string]: any;
15
21
  }>();
16
-
17
- let elementRef: HTMLElementClass | null = $state(null);
18
-
19
- $effect(() => {
20
- if (elementRef && hideClear !== undefined) {
22
+
23
+ let elementRef: HTMLElementClass | null = $state(null);
24
+
25
+ $effect(() => {
26
+ if (elementRef && value !== undefined && elementRef.value !== value) {
27
+ elementRef.value = value;
28
+ }
29
+ if (elementRef && hideClear !== undefined && elementRef.hideClear !== hideClear) {
21
30
  elementRef.hideClear = hideClear;
22
31
  }
32
+ if (elementRef && locale !== undefined && elementRef.locale !== locale) {
33
+ elementRef.locale = locale;
34
+ }
23
35
  });
24
-
36
+
37
+ $effect(() => {
38
+ const element = elementRef;
39
+ if (!element) return;
40
+
41
+ const handleEvent = () => {
42
+ if (value !== element.value) {
43
+ value = element.value as any;
44
+ }
45
+ if (hideClear !== element.hideClear) {
46
+ hideClear = element.hideClear as any;
47
+ }
48
+ if (locale !== element.locale) {
49
+ locale = element.locale as any;
50
+ }
51
+ };
52
+
53
+ const events = ['change', 'input', 'signature-change', 'signature-clear'];
54
+ for (const event of events) {
55
+ element.addEventListener(event, handleEvent);
56
+ }
57
+ return () => {
58
+ for (const event of events) {
59
+ element.removeEventListener(event, handleEvent);
60
+ }
61
+ };
62
+ });
63
+
25
64
  </script>
26
65
 
27
- <uibit-signature bind:this={elementRef} {...$$restProps}>
66
+ <uibit-signature bind:this={elementRef} {...restProps}>
28
67
  {#if hint}
29
68
  <div slot="hint">
30
69
  {@render hint()}
@@ -1,27 +1,93 @@
1
- import { defineComponent, h } from 'vue';
1
+ import { defineComponent, h, ref, watch } from 'vue';
2
2
  import type { Signature as HTMLElementClass } from '@uibit/signature';
3
3
  import '@uibit/signature';
4
-
5
4
  export const Signature = defineComponent({
6
- name: 'Signature',
7
- props: {
8
- hideClear: { type: [String, Number, Boolean, Array, Object] as any }
9
- },
10
- emits: ['signature-change', 'signature-clear'],
11
- setup(props, { slots, emit }) {
12
- return () => {
13
- const eventListeners: Record<string, any> = {};
14
- eventListeners['onSignature-change'] = (event: Event) => {
15
- emit('signature-change', event);
16
- };
17
- eventListeners['onSignature-clear'] = (event: Event) => {
18
- emit('signature-clear', event);
19
- };
20
-
21
- return h('uibit-signature', {
22
- ...props,
23
- ...eventListeners
24
- }, slots.default?.());
25
- };
26
- }
5
+ name: 'Signature',
6
+ props: {
7
+ value: {
8
+ type: [
9
+ String,
10
+ Number,
11
+ Boolean,
12
+ Array,
13
+ Object
14
+ ] as any
15
+ },
16
+ hideClear: {
17
+ type: [
18
+ String,
19
+ Number,
20
+ Boolean,
21
+ Array,
22
+ Object
23
+ ] as any
24
+ },
25
+ locale: {
26
+ type: [
27
+ String,
28
+ Number,
29
+ Boolean,
30
+ Array,
31
+ Object
32
+ ] as any
33
+ },
34
+ modelValue: {
35
+ type: [
36
+ String,
37
+ Number,
38
+ Boolean,
39
+ Array,
40
+ Object
41
+ ] as any
42
+ }
43
+ },
44
+ emits: [
45
+ 'signature-change',
46
+ 'signature-clear',
47
+ 'update:modelValue'
48
+ ],
49
+ setup (props, { slots, emit }) {
50
+ const elementRef = ref<HTMLElementClass | null>(null);
51
+ if (true) {
52
+ watch(()=>props.modelValue, (newVal)=>{
53
+ if (elementRef.value && newVal !== undefined && elementRef.value.value !== newVal) {
54
+ elementRef.value.value = newVal;
55
+ }
56
+ });
57
+ watch(()=>props.value, (newVal)=>{
58
+ if (elementRef.value && newVal !== undefined && elementRef.value.value !== newVal) {
59
+ elementRef.value.value = newVal;
60
+ }
61
+ });
62
+ }
63
+ watch(()=>props.hideClear, (newVal)=>{
64
+ if (elementRef.value && newVal !== undefined) {
65
+ (elementRef.value as any).hideClear = newVal;
66
+ }
67
+ });
68
+ watch(()=>props.locale, (newVal)=>{
69
+ if (elementRef.value && newVal !== undefined) {
70
+ (elementRef.value as any).locale = newVal;
71
+ }
72
+ });
73
+ return ()=>{
74
+ const eventListeners: Record<string, any> = {};
75
+ eventListeners['onSignature-change'] = (event: Event)=>{
76
+ emit('signature-change', event);
77
+ emit('update:modelValue', (event.target as any).value);
78
+ };
79
+ eventListeners['onSignature-clear'] = (event: Event)=>{
80
+ emit('signature-clear', event);
81
+ };
82
+ const mergedProps = {
83
+ ...props,
84
+ ...eventListeners,
85
+ ref: elementRef
86
+ };
87
+ if (true && props.modelValue !== undefined) {
88
+ (mergedProps as any).value = props.modelValue;
89
+ }
90
+ return h('uibit-signature', mergedProps, slots.default?.());
91
+ };
92
+ }
27
93
  });
@@ -2,10 +2,12 @@ import { UIBitElement } from '@uibit/core';
2
2
  declare const Signature_base: import("@uibit/form-internals").Constructor<import("@uibit/form-internals").FormAssociatedInterface> & typeof UIBitElement;
3
3
  /**
4
4
  * Canvas area for capturing freehand signatures or drawings using touch or
5
+
6
+ * @summary A canvas-based signature pad drawing component with smooth strokes.
5
7
  * mouse gestures, rendered immediately as smooth bezier-curved vector lines
6
8
  * with simulated pen pressure.
7
9
  *
8
- * @fires {{ isEmpty: boolean; dataUrl: string }} signature-change - Fired after each stroke ends
10
+ * @fires {{ isEmpty: boolean; dataUrl: string }} signature-change - Dispatched when value changes
9
11
  * @fires {{ previouslyEmpty: boolean }} signature-clear - Fired when the canvas is cleared
10
12
  *
11
13
  * @slot hint - Placeholder text shown when the pad is empty. Defaults to "Sign here".
@@ -26,9 +28,16 @@ declare const Signature_base: import("@uibit/form-internals").Constructor<import
26
28
  * @csspart canvas - The drawing canvas element
27
29
  * @csspart hint - The "Sign here" placeholder hint
28
30
  * @csspart clear-button - The clear button
29
- */
31
+
32
+ * @cssstate empty - Active when the signature pad has no drawing inputs.
33
+ * @cssstate drawing - Active when the user is drawing on the canvas.*/
30
34
  export declare class Signature extends Signature_base {
31
35
  static styles: import("lit").CSSResult;
36
+ /**
37
+ * The signature image data URL.
38
+ * @modelEvent signature-change
39
+ */
40
+ value: string;
32
41
  /** Whether to hide the clear button. */
33
42
  hideClear: boolean;
34
43
  private isEmpty;
@@ -1 +1 @@
1
- {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../src/signature.ts"],"names":[],"mappings":"AACA,OAAO,EAAsC,YAAY,EAAE,MAAM,aAAa,CAAC;;AAM/E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBACa,SAAU,SAAQ,cAAiC;IAC9D,MAAM,CAAC,MAAM,0BAkGX;IAEF,wCAAwC;IACc,SAAS,UAAS;IAE/D,OAAO,CAAC,OAAO,CAAQ;IAEhC,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,GAAG,CAA4B;IACvC,OAAO,CAAC,OAAO,CAAyB;IACxC,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAK;IAEzB,YAAY,SAYX;IAED,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,iBAAiB;IA0CzB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,kBAAkB;IAS1B,uFAAuF;IACvF,SAAS,CAAC,IAAI,SAAc,GAAG,MAAM,CAGpC;IAED,qFAAqF;IACrF,KAAK,IAAI,MAAM,CA0Bd;IAED,uCAAuC;IACvC,KAAK,SAQJ;IAEQ,iBAAiB,SAUzB;IAED,MAAM,oCAkBL;CACF;eAEc,SAAS"}
1
+ {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../src/signature.ts"],"names":[],"mappings":"AACA,OAAO,EAAsC,YAAY,EAAE,MAAM,aAAa,CAAC;;AAM/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uEA8BuE;AACvE,qBACa,SAAU,SAAQ,cAAiC;IAC9D,MAAM,CAAC,MAAM,0BAkGX;IAEF;;;OAGG;IAEK,KAAK,EAAE,MAAM,CAAC;IAEtB,wCAAwC;IACc,SAAS,UAAS;IAE/D,OAAO,CAAC,OAAO,CAAQ;IAEhC,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,GAAG,CAA4B;IACvC,OAAO,CAAC,OAAO,CAAyB;IACxC,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAK;IAEzB,YAAY,SAYX;IAED,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,iBAAiB;IA0CzB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,kBAAkB;IAS1B,uFAAuF;IACvF,SAAS,CAAC,IAAI,SAAc,GAAG,MAAM,CAGpC;IAED,qFAAqF;IACrF,KAAK,IAAI,MAAM,CA0Bd;IAED,uCAAuC;IACvC,KAAK,SAQJ;IAEQ,iBAAiB,SAUzB;IAED,MAAM,oCAkBL;CACF;eAEc,SAAS"}
package/dist/signature.js CHANGED
@@ -11,10 +11,12 @@ import { property, state } from 'lit/decorators.js';
11
11
  import { FormAssociatedMixin } from '@uibit/form-internals';
12
12
  /**
13
13
  * Canvas area for capturing freehand signatures or drawings using touch or
14
+
15
+ * @summary A canvas-based signature pad drawing component with smooth strokes.
14
16
  * mouse gestures, rendered immediately as smooth bezier-curved vector lines
15
17
  * with simulated pen pressure.
16
18
  *
17
- * @fires {{ isEmpty: boolean; dataUrl: string }} signature-change - Fired after each stroke ends
19
+ * @fires {{ isEmpty: boolean; dataUrl: string }} signature-change - Dispatched when value changes
18
20
  * @fires {{ previouslyEmpty: boolean }} signature-clear - Fired when the canvas is cleared
19
21
  *
20
22
  * @slot hint - Placeholder text shown when the pad is empty. Defaults to "Sign here".
@@ -35,7 +37,9 @@ import { FormAssociatedMixin } from '@uibit/form-internals';
35
37
  * @csspart canvas - The drawing canvas element
36
38
  * @csspart hint - The "Sign here" placeholder hint
37
39
  * @csspart clear-button - The clear button
38
- */
40
+
41
+ * @cssstate empty - Active when the signature pad has no drawing inputs.
42
+ * @cssstate drawing - Active when the user is drawing on the canvas.*/
39
43
  let Signature = class Signature extends FormAssociatedMixin(UIBitElement) {
40
44
  constructor() {
41
45
  super(...arguments);
@@ -363,6 +367,9 @@ let Signature = class Signature extends FormAssociatedMixin(UIBitElement) {
363
367
  `;
364
368
  }
365
369
  };
370
+ __decorate([
371
+ property({ type: String })
372
+ ], Signature.prototype, "value", void 0);
366
373
  __decorate([
367
374
  property({ type: Boolean, attribute: 'hide-clear' })
368
375
  ], Signature.prototype, "hideClear", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"signature.js","sourceRoot":"","sources":["../src/signature.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,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AE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;4CAAmB;AAEvD;IAAhB,KAAK,EAAE;0CAAwB;AA/GrB,SAAS;IADrB,aAAa,CAAC,iBAAiB,CAAC;GACpB,SAAS,CA+VrB;;AAED,eAAe,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uibit/signature",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "A canvas drawing area that captures freehand signatures or messages using touch or mouse gestures, rendered immediately as smooth bezier-curved vector lines with simulated pen pressure.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,7 +11,7 @@
11
11
  "import": "./dist/index.js"
12
12
  },
13
13
  "./custom-elements.json": "./custom-elements.json",
14
- "./react": "./dist/frameworks/react/index.d.ts",
14
+ "./react": "./dist/frameworks/react/index.ts",
15
15
  "./vue": "./dist/frameworks/vue/index.ts",
16
16
  "./svelte": "./dist/frameworks/svelte/index.svelte",
17
17
  "./angular": "./dist/frameworks/angular/index.ts",
@@ -48,13 +48,13 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "lucide": "^1.24.0",
51
- "@uibit/core": "0.1.0",
51
+ "@uibit/core": "0.2.0",
52
52
  "@uibit/form-internals": "0.1.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "lit": "^3.3.3",
56
56
  "typescript": "7.0.2",
57
- "@uibit/codegen": "0.1.0"
57
+ "@uibit/codegen": "0.2.0"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "lit": "^3.0.0",
@@ -85,9 +85,9 @@
85
85
  "tagName": "uibit-signature"
86
86
  },
87
87
  "scripts": {
88
- "build": "cem analyze --globs 'src/**/*.ts' --litelement && uibit-codegen --package . && tsc",
89
- "dev": "concurrently \"cem analyze --globs 'src/**/*.ts' --litelement --watch\" \"tsc --watch\"",
90
- "analyze": "cem analyze --globs 'src/**/*.ts' --litelement",
88
+ "build": "cem analyze --config ../custom-elements-manifest.config.js && uibit-codegen --package . && tsc",
89
+ "dev": "concurrently \"cem analyze --config ../custom-elements-manifest.config.js --watch\" \"tsc --watch\"",
90
+ "analyze": "cem analyze --config ../custom-elements-manifest.config.js",
91
91
  "typecheck": "tsc --noEmit",
92
92
  "test": "vitest run -c ../../../vitest.config.ts --passWithNoTests"
93
93
  }
@@ -1,19 +0,0 @@
1
- import type { HTMLAttributes, ClassAttributes } from 'react';
2
- import type { Signature as HTMLElementClass } from '@uibit/signature';
3
- import '@uibit/signature';
4
-
5
- declare global {
6
- namespace React {
7
- namespace JSX {
8
- interface IntrinsicElements {
9
- 'uibit-signature': ClassAttributes<HTMLElementClass> & HTMLAttributes<HTMLElementClass> & {
10
- children?: React.ReactNode;
11
- class?: string;
12
- hideClear?: boolean;
13
- onSignatureChange?: (event: any) => void;
14
- onSignatureClear?: (event: any) => void;
15
- };
16
- }
17
- }
18
- }
19
- }