@tabler/core 1.3.1 → 1.4.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 +42 -0
- package/dist/css/tabler-flags.css +1 -1
- package/dist/css/tabler-flags.min.css +1 -1
- package/dist/css/tabler-flags.rtl.css +1 -1
- package/dist/css/tabler-flags.rtl.min.css +1 -1
- package/dist/css/tabler-marketing.css +1 -1
- package/dist/css/tabler-marketing.min.css +1 -1
- package/dist/css/tabler-marketing.rtl.css +1 -1
- package/dist/css/tabler-marketing.rtl.min.css +1 -1
- package/dist/css/tabler-payments.css +1 -1
- package/dist/css/tabler-payments.min.css +1 -1
- package/dist/css/tabler-payments.rtl.css +1 -1
- package/dist/css/tabler-payments.rtl.min.css +1 -1
- package/dist/css/tabler-props.css +74 -74
- package/dist/css/tabler-props.css.map +1 -1
- package/dist/css/tabler-props.min.css +2 -2
- package/dist/css/tabler-props.min.css.map +1 -1
- package/dist/css/tabler-props.rtl.css +74 -74
- package/dist/css/tabler-props.rtl.css.map +1 -1
- package/dist/css/tabler-props.rtl.min.css +2 -2
- package/dist/css/tabler-props.rtl.min.css.map +1 -1
- package/dist/css/tabler-socials.css +1 -1
- package/dist/css/tabler-socials.min.css +1 -1
- package/dist/css/tabler-socials.rtl.css +1 -1
- package/dist/css/tabler-socials.rtl.min.css +1 -1
- package/dist/css/tabler-themes.css +1 -1
- package/dist/css/tabler-themes.min.css +1 -1
- package/dist/css/tabler-themes.rtl.css +1 -1
- package/dist/css/tabler-themes.rtl.min.css +1 -1
- package/dist/css/tabler-vendors.css +1 -1
- package/dist/css/tabler-vendors.min.css +1 -1
- package/dist/css/tabler-vendors.rtl.css +1 -1
- package/dist/css/tabler-vendors.rtl.min.css +1 -1
- package/dist/css/tabler.css +649 -428
- package/dist/css/tabler.css.map +1 -1
- package/dist/css/tabler.min.css +2 -2
- package/dist/css/tabler.min.css.map +1 -1
- package/dist/css/tabler.rtl.css +647 -428
- package/dist/css/tabler.rtl.css.map +1 -1
- package/dist/css/tabler.rtl.min.css +2 -2
- package/dist/css/tabler.rtl.min.css.map +1 -1
- package/dist/js/tabler-theme.esm.js +1 -1
- package/dist/js/tabler-theme.esm.js.map +1 -1
- package/dist/js/tabler-theme.esm.min.js +1 -1
- package/dist/js/tabler-theme.js +1 -1
- package/dist/js/tabler-theme.js.map +1 -1
- package/dist/js/tabler-theme.min.js +2 -2
- package/dist/js/tabler-theme.min.js.map +1 -1
- package/dist/js/tabler.esm.js +4 -4
- package/dist/js/tabler.esm.js.map +1 -1
- package/dist/js/tabler.esm.min.js +4 -4
- package/dist/js/tabler.esm.min.js.map +1 -1
- package/dist/js/tabler.js +4 -4
- package/dist/js/tabler.js.map +1 -1
- package/dist/js/tabler.min.js +4 -4
- package/dist/js/tabler.min.js.map +1 -1
- package/dist/libs/@melloware/coloris/dist/esm/coloris.js +9 -3
- package/dist/libs/@melloware/coloris/dist/esm/coloris.min.js +1 -1
- package/dist/libs/@melloware/coloris/dist/umd/coloris.js +9 -3
- package/dist/libs/@melloware/coloris/dist/umd/coloris.min.js +1 -1
- package/dist/libs/@melloware/coloris/package.json +1 -1
- package/dist/libs/countup.js/README.md +2 -2
- package/dist/libs/countup.js/dist/countUp.d.ts +3 -2
- package/dist/libs/countup.js/dist/countUp.js +11 -2
- package/dist/libs/countup.js/dist/countUp.min.js +1 -1
- package/dist/libs/countup.js/dist/countUp.umd.js +1 -1
- package/dist/libs/countup.js/package.json +1 -1
- package/dist/libs/countup.js/src/countUp.spec.ts +75 -25
- package/dist/libs/countup.js/src/countUp.ts +13 -3
- package/dist/libs/fslightbox/index.js +1 -1
- package/dist/libs/fslightbox/package.json +1 -1
- package/dist/libs/fullcalendar/index.global.js +49 -20
- package/dist/libs/fullcalendar/index.global.min.js +2 -2
- package/dist/libs/fullcalendar/package.json +7 -7
- package/dist/libs/jsvectormap/dist/jsvectormap.cjs +240 -224
- package/dist/libs/jsvectormap/dist/jsvectormap.css +83 -57
- package/dist/libs/jsvectormap/dist/jsvectormap.esm.js +240 -224
- package/dist/libs/jsvectormap/dist/jsvectormap.js +240 -224
- package/dist/libs/jsvectormap/dist/jsvectormap.min.css +1 -1
- package/dist/libs/jsvectormap/dist/jsvectormap.min.js +1 -1
- package/dist/libs/jsvectormap/package.json +1 -1
- package/dist/libs/jsvectormap/src/js/components/base.js +0 -5
- package/dist/libs/jsvectormap/src/js/components/concerns/interactable.js +2 -7
- package/dist/libs/jsvectormap/src/js/components/line.js +38 -10
- package/dist/libs/jsvectormap/src/js/components/marker.js +72 -33
- package/dist/libs/jsvectormap/src/js/components/region.js +0 -5
- package/dist/libs/jsvectormap/src/js/components/route.js +76 -0
- package/dist/libs/jsvectormap/src/js/components/tooltip.js +0 -5
- package/dist/libs/jsvectormap/src/js/core/createLines.js +25 -24
- package/dist/libs/jsvectormap/src/js/core/createMarkers.js +15 -20
- package/dist/libs/jsvectormap/src/js/core/createRoutes.js +16 -0
- package/dist/libs/jsvectormap/src/js/core/repositionLines.js +22 -18
- package/dist/libs/jsvectormap/src/js/core/setupContainerEvents.js +2 -2
- package/dist/libs/jsvectormap/src/js/core/setupContainerTouchEvents.js +2 -2
- package/dist/libs/jsvectormap/src/js/core/setupElementEvents.js +7 -3
- package/dist/libs/jsvectormap/src/js/core/setupZoomButtons.js +23 -6
- package/dist/libs/jsvectormap/src/js/defaults/options.js +1 -0
- package/dist/libs/jsvectormap/src/js/eventHandler.js +0 -5
- package/dist/libs/jsvectormap/src/js/index.js +0 -5
- package/dist/libs/jsvectormap/src/js/legend.js +1 -9
- package/dist/libs/jsvectormap/src/js/map.js +36 -13
- package/dist/libs/jsvectormap/src/js/scales/ordinalScale.js +0 -5
- package/dist/libs/jsvectormap/src/js/series.js +0 -5
- package/dist/libs/jsvectormap/src/js/svg/baseElement.js +0 -5
- package/dist/libs/jsvectormap/src/js/svg/canvasElement.js +2 -7
- package/dist/libs/jsvectormap/src/js/svg/imageElement.js +0 -5
- package/dist/libs/jsvectormap/src/js/svg/shapeElement.js +0 -5
- package/dist/libs/jsvectormap/src/js/svg/textElement.js +0 -5
- package/dist/libs/jsvectormap/src/scss/_variables.scss +37 -0
- package/dist/libs/jsvectormap/src/scss/jsvectormap.scss +104 -112
- package/dist/libs/signature_pad/dist/signature_pad.js +133 -87
- package/dist/libs/signature_pad/dist/signature_pad.js.map +1 -1
- package/dist/libs/signature_pad/dist/signature_pad.min.js +2 -2
- package/dist/libs/signature_pad/dist/signature_pad.min.js.map +1 -1
- package/dist/libs/signature_pad/dist/signature_pad.umd.js +133 -87
- package/dist/libs/signature_pad/dist/signature_pad.umd.js.map +1 -1
- package/dist/libs/signature_pad/dist/signature_pad.umd.min.js +2 -2
- package/dist/libs/signature_pad/dist/signature_pad.umd.min.js.map +1 -1
- package/dist/libs/signature_pad/dist/types/signature_pad.d.ts +4 -1
- package/dist/libs/signature_pad/docs/js/signature_pad.umd.min.js +2 -2
- package/dist/libs/signature_pad/docs/js/signature_pad.umd.min.js.map +1 -1
- package/dist/libs/signature_pad/package.json +19 -19
- package/dist/libs/signature_pad/src/signature_pad.ts +84 -28
- package/package.json +9 -9
- package/scss/_bootstrap-components.scss +0 -1
- package/scss/_core.scss +1 -0
- package/scss/_variables.scss +78 -48
- package/scss/layout/_animations.scss +52 -17
- package/scss/layout/_navbar.scss +8 -4
- package/scss/ui/_breadcrumbs.scss +31 -0
- package/scss/ui/_buttons.scss +92 -20
- package/scss/ui/_cards.scss +4 -2
- package/scss/ui/_dropdowns.scss +1 -1
- package/scss/ui/_grid.scss +2 -2
- package/scss/ui/_lists.scss +8 -8
- package/scss/ui/_nav.scss +1 -1
- package/scss/ui/_pagination.scss +4 -4
- package/scss/ui/_stars.scss +0 -4
- package/scss/ui/_switch-icon.scss +6 -2
- package/scss/ui/_tables.scss +1 -1
- package/scss/utils/_hover.scss +47 -0
- package/scss/vendor/_nouislider.scss +2 -2
|
@@ -1,155 +1,147 @@
|
|
|
1
|
-
|
|
2
|
-
$classPrefix: jvm- !default;
|
|
3
|
-
$border-color: #e5e7eb !default;
|
|
4
|
-
$box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !default;
|
|
1
|
+
@import './variables';
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
$tooltip-bg-color: #5c5cff !default;
|
|
10
|
-
$tooltip-radius: 3px !default;
|
|
11
|
-
$tooltip-font-size: smaller !default;
|
|
12
|
-
$tooltip-padding: 3px 5px !default;
|
|
3
|
+
:root {
|
|
4
|
+
--jvm-border-color: #{$border-color};
|
|
5
|
+
--jvm-box-shadow: #{$box-shadow};
|
|
13
6
|
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
// Tooltip
|
|
8
|
+
--jvm-tooltip-font-size: #{$tooltip-font-size};
|
|
9
|
+
--jvm-tooltip-bg-color: #{$tooltip-bg-color};
|
|
10
|
+
--jvm-tooltip-color: #{$tooltip-color};
|
|
11
|
+
--jvm-tooltip-padding: #{$tooltip-padding};
|
|
12
|
+
--jvm-tooltip-shadow: var(--jvm-box-shadow);
|
|
13
|
+
--jvm-tooltip-radius: #{$tooltip-radius};
|
|
20
14
|
|
|
21
|
-
//
|
|
22
|
-
|
|
15
|
+
// Zoom buttons
|
|
16
|
+
--jvm-zoom-btn-bg-color: #{$zoom-btn-bg-color};
|
|
17
|
+
--jvm-zoom-btn-color: #{$zoom-btn-color};
|
|
18
|
+
--jvm-zoom-btn-size: #{$zoom-btn-size};
|
|
19
|
+
--jvm-zoom-btn-radius: #{$zoom-btn-radius};
|
|
23
20
|
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
// Series
|
|
22
|
+
--jvm-series-container-right: #{$series-container-right};
|
|
23
|
+
|
|
24
|
+
// Legends
|
|
25
|
+
--jvm-legend-bg-color: #{$legend-bg-color};
|
|
26
|
+
--jvm-legend-radius: #{$legend-radius};
|
|
27
|
+
--jvm-legend-margin-left: #{$legend-margin-left};
|
|
28
|
+
--jvm-legend-padding: #{$legend-padding};
|
|
29
|
+
|
|
30
|
+
// Legend title
|
|
31
|
+
--jvm-legend-title-padding-bottom: #{$legend-title-padding-bottom};
|
|
32
|
+
--jvm-legend-title-margin-bottom: #{$legend-title-margin-bottom};
|
|
33
|
+
|
|
34
|
+
// Legend ticks
|
|
35
|
+
--jvm-legend-tick-margin-top: #{$legend-tick-margin-top};
|
|
36
|
+
--jvm-legend-tick-sample-radius: #{$legend-tick-sample-radius};
|
|
37
|
+
--jvm-legend-tick-sample-height: #{$legend-tick-sample-height};
|
|
38
|
+
--jvm-legend-tick-sample-width: #{$legend-tick-sample-width};
|
|
39
|
+
--jvm-legend-tick-text-font-size: #{$legend-tick-text-font-size};
|
|
40
|
+
--jvm-legend-tick-text-margin-top: #{$legend-tick-text-margin-top};
|
|
41
|
+
}
|
|
41
42
|
|
|
42
43
|
// Global resets
|
|
43
|
-
|
|
44
|
-
image, text, .#{$classPrefix}zoomin, .#{$classPrefix}zoomout { user-select: none }
|
|
44
|
+
image, text, .jvm-zoom-btn { user-select: none }
|
|
45
45
|
|
|
46
46
|
// jsVectorMap container
|
|
47
|
-
|
|
48
|
-
touch-action: none;
|
|
47
|
+
.jvm-container {
|
|
49
48
|
position: relative;
|
|
50
|
-
overflow: hidden;
|
|
51
49
|
height: 100%;
|
|
52
50
|
width: 100%;
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
// Tooltip
|
|
56
|
-
|
|
57
|
-
border-radius:
|
|
58
|
-
background-color:
|
|
59
|
-
|
|
60
|
-
font-size:
|
|
61
|
-
box-shadow:
|
|
62
|
-
padding:
|
|
54
|
+
.jvm-tooltip {
|
|
55
|
+
border-radius: var(--jvm-tooltip-radius);
|
|
56
|
+
background-color: var(--jvm-tooltip-bg-color);
|
|
57
|
+
color: var(--jvm-tooltip-color);
|
|
58
|
+
font-size: var(--jvm-tooltip-font-size);
|
|
59
|
+
box-shadow: var(--jvm-tooltip-shadow);
|
|
60
|
+
padding: var(--jvm-tooltip-padding);
|
|
63
61
|
white-space: nowrap;
|
|
64
62
|
position: absolute;
|
|
65
63
|
display: none;
|
|
66
|
-
color: #FFF;
|
|
67
64
|
&.active {
|
|
68
65
|
display: block;
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
68
|
|
|
72
69
|
// Zoom buttons
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
.jvm-zoom-btn {
|
|
71
|
+
background-color: var(--jvm-zoom-btn-bg-color);
|
|
72
|
+
color: var(--jvm-zoom-btn-color);
|
|
73
|
+
border-radius: var(--jvm-zoom-btn-radius);
|
|
74
|
+
height: var(--jvm-zoom-btn-size);
|
|
75
|
+
width: var(--jvm-zoom-btn-size);
|
|
77
76
|
box-sizing: border-box;
|
|
78
77
|
position: absolute;
|
|
79
|
-
line-height: 10px;
|
|
80
|
-
cursor: pointer;
|
|
81
|
-
color: #FFF;
|
|
82
|
-
height: 15px;
|
|
83
|
-
width: 15px;
|
|
84
78
|
left: 10px;
|
|
79
|
+
line-height: var(--jvm-zoom-btn-size);
|
|
80
|
+
text-align: center;
|
|
81
|
+
cursor: pointer;
|
|
85
82
|
|
|
86
|
-
|
|
87
|
-
top:
|
|
83
|
+
&.jvm-zoomin {
|
|
84
|
+
top: var(--jvm-zoom-btn-size)
|
|
88
85
|
}
|
|
89
86
|
|
|
90
|
-
|
|
91
|
-
top:
|
|
87
|
+
&.jvm-zoomout {
|
|
88
|
+
top: calc(var(--jvm-zoom-btn-size) * 2 + (var(--jvm-zoom-btn-size) / 3));
|
|
92
89
|
}
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
// Series
|
|
96
|
-
|
|
97
|
-
right: $series-container-right;
|
|
93
|
+
.jvm-series-container {
|
|
98
94
|
position: absolute;
|
|
95
|
+
right: var(--jvm-series-container-right);
|
|
96
|
+
&.jvm-series-h { bottom: 15px }
|
|
97
|
+
&.jvm-series-v {
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
gap: 0.75rem;
|
|
101
|
+
top: 15px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
99
104
|
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
// Legends
|
|
106
|
+
.jvm-legend {
|
|
107
|
+
background-color: var(--jvm-legend-bg-color);
|
|
108
|
+
border: 1px solid var(--jvm-border-color);
|
|
109
|
+
margin-left: var(--jvm-legend-margin-left);
|
|
110
|
+
border-radius: var(--jvm-legend-radius);
|
|
111
|
+
padding: var(--jvm-legend-padding);
|
|
112
|
+
box-shadow: var(--jvm-box-shadow);
|
|
113
|
+
}
|
|
102
114
|
|
|
103
|
-
|
|
104
|
-
|
|
115
|
+
.jvm-legend-title {
|
|
116
|
+
line-height: 1;
|
|
117
|
+
border-bottom: 1px solid var(--jvm-border-color);
|
|
118
|
+
padding-bottom: var(--jvm-legend-title-padding-bottom);
|
|
119
|
+
margin-bottom: var(--jvm-legend-title-margin-bottom);
|
|
120
|
+
text-align: left;
|
|
121
|
+
}
|
|
105
122
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
border-color: $border-color;
|
|
113
|
-
padding: $legend-padding;
|
|
114
|
-
box-shadow: $box-shadow;
|
|
115
|
-
float: left;
|
|
116
|
-
|
|
117
|
-
.#{$classPrefix}legend-title {
|
|
118
|
-
line-height: 1;
|
|
119
|
-
border-bottom: 1px solid $border-color;
|
|
120
|
-
padding-bottom: $legend-title-padding-bottom;
|
|
121
|
-
margin-bottom: $legend-title-margin-bottom;
|
|
122
|
-
text-align: left;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.#{$classPrefix}legend-inner {
|
|
126
|
-
overflow: hidden;
|
|
127
|
-
|
|
128
|
-
.#{$classPrefix}legend-tick {
|
|
129
|
-
overflow: hidden;
|
|
130
|
-
min-width: 40px;
|
|
131
|
-
&:not(:first-child) {
|
|
132
|
-
margin-top: $legend-tick-margin-top;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.#{$classPrefix}legend-tick-sample {
|
|
136
|
-
border-radius: $legend-tick-sample-radius;
|
|
137
|
-
margin-right: .65rem;
|
|
138
|
-
height: $legend-tick-sample-height;
|
|
139
|
-
width: $legend-tick-sample-width;
|
|
140
|
-
float: left;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.#{$classPrefix}legend-tick-text {
|
|
144
|
-
font-size: $legend-tick-text-font-size;
|
|
145
|
-
text-align: center;
|
|
146
|
-
float: left;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
123
|
+
.jvm-legend-tick {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
min-width: 40px;
|
|
127
|
+
&:not(:first-child) {
|
|
128
|
+
margin-top: var(--jvm-legend-tick-margin-top);
|
|
150
129
|
}
|
|
151
130
|
}
|
|
152
131
|
|
|
132
|
+
.jvm-legend-tick-sample {
|
|
133
|
+
border-radius: var(--jvm-legend-tick-sample-radius);
|
|
134
|
+
margin-right: 0.45rem;
|
|
135
|
+
height: var(--jvm-legend-tick-sample-height);
|
|
136
|
+
width: var(--jvm-legend-tick-sample-width);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.jvm-legend-tick-text {
|
|
140
|
+
font-size: var(--jvm-legend-tick-text-font-size);
|
|
141
|
+
text-align: center;
|
|
142
|
+
line-height: 1;
|
|
143
|
+
}
|
|
144
|
+
|
|
153
145
|
// Line animation
|
|
154
146
|
.jvm-line[animation="true"] {
|
|
155
147
|
-webkit-animation: jvm-line-animation 10s linear forwards infinite;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Signature Pad v5.0.
|
|
2
|
+
* Signature Pad v5.0.10 | https://github.com/szimek/signature_pad
|
|
3
3
|
* (c) 2025 Szymon Nowak | Released under the MIT license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -160,82 +160,6 @@ class SignaturePad extends SignatureEventTarget {
|
|
|
160
160
|
this._data = [];
|
|
161
161
|
this._lastVelocity = 0;
|
|
162
162
|
this._lastWidth = 0;
|
|
163
|
-
this._handleMouseDown = (event) => {
|
|
164
|
-
if (!this._isLeftButtonPressed(event, true) || this._drawingStroke) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
this._strokeBegin(this._pointerEventToSignatureEvent(event));
|
|
168
|
-
};
|
|
169
|
-
this._handleMouseMove = (event) => {
|
|
170
|
-
if (!this._isLeftButtonPressed(event, true) || !this._drawingStroke) {
|
|
171
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(event), false);
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(event));
|
|
175
|
-
};
|
|
176
|
-
this._handleMouseUp = (event) => {
|
|
177
|
-
if (this._isLeftButtonPressed(event)) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(event));
|
|
181
|
-
};
|
|
182
|
-
this._handleTouchStart = (event) => {
|
|
183
|
-
if (event.targetTouches.length !== 1 || this._drawingStroke) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
if (event.cancelable) {
|
|
187
|
-
event.preventDefault();
|
|
188
|
-
}
|
|
189
|
-
this._strokeBegin(this._touchEventToSignatureEvent(event));
|
|
190
|
-
};
|
|
191
|
-
this._handleTouchMove = (event) => {
|
|
192
|
-
if (event.targetTouches.length !== 1) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (event.cancelable) {
|
|
196
|
-
event.preventDefault();
|
|
197
|
-
}
|
|
198
|
-
if (!this._drawingStroke) {
|
|
199
|
-
this._strokeEnd(this._touchEventToSignatureEvent(event), false);
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
this._strokeMoveUpdate(this._touchEventToSignatureEvent(event));
|
|
203
|
-
};
|
|
204
|
-
this._handleTouchEnd = (event) => {
|
|
205
|
-
if (event.targetTouches.length !== 0) {
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
if (event.cancelable) {
|
|
209
|
-
event.preventDefault();
|
|
210
|
-
}
|
|
211
|
-
this.canvas.removeEventListener('touchmove', this._handleTouchMove);
|
|
212
|
-
this._strokeEnd(this._touchEventToSignatureEvent(event));
|
|
213
|
-
};
|
|
214
|
-
this._handlePointerDown = (event) => {
|
|
215
|
-
if (!event.isPrimary || !this._isLeftButtonPressed(event) || this._drawingStroke) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
event.preventDefault();
|
|
219
|
-
this._strokeBegin(this._pointerEventToSignatureEvent(event));
|
|
220
|
-
};
|
|
221
|
-
this._handlePointerMove = (event) => {
|
|
222
|
-
if (!event.isPrimary) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
if (!this._isLeftButtonPressed(event, true) || !this._drawingStroke) {
|
|
226
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(event), false);
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
event.preventDefault();
|
|
230
|
-
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(event));
|
|
231
|
-
};
|
|
232
|
-
this._handlePointerUp = (event) => {
|
|
233
|
-
if (!event.isPrimary || this._isLeftButtonPressed(event)) {
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
event.preventDefault();
|
|
237
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(event));
|
|
238
|
-
};
|
|
239
163
|
this.velocityFilterWeight = options.velocityFilterWeight || 0.7;
|
|
240
164
|
this.minWidth = options.minWidth || 0.5;
|
|
241
165
|
this.maxWidth = options.maxWidth || 2.5;
|
|
@@ -249,6 +173,15 @@ class SignaturePad extends SignatureEventTarget {
|
|
|
249
173
|
this._strokeMoveUpdate = this.throttle
|
|
250
174
|
? throttle(SignaturePad.prototype._strokeUpdate, this.throttle)
|
|
251
175
|
: SignaturePad.prototype._strokeUpdate;
|
|
176
|
+
this._handleMouseDown = this._handleMouseDown.bind(this);
|
|
177
|
+
this._handleMouseMove = this._handleMouseMove.bind(this);
|
|
178
|
+
this._handleMouseUp = this._handleMouseUp.bind(this);
|
|
179
|
+
this._handleTouchStart = this._handleTouchStart.bind(this);
|
|
180
|
+
this._handleTouchMove = this._handleTouchMove.bind(this);
|
|
181
|
+
this._handleTouchEnd = this._handleTouchEnd.bind(this);
|
|
182
|
+
this._handlePointerDown = this._handlePointerDown.bind(this);
|
|
183
|
+
this._handlePointerMove = this._handlePointerMove.bind(this);
|
|
184
|
+
this._handlePointerUp = this._handlePointerUp.bind(this);
|
|
252
185
|
this._ctx = canvas.getContext('2d', this.canvasContextOptions);
|
|
253
186
|
this.clear();
|
|
254
187
|
this.on();
|
|
@@ -261,6 +194,7 @@ class SignaturePad extends SignatureEventTarget {
|
|
|
261
194
|
this._data = [];
|
|
262
195
|
this._reset(this._getPointGroupOptions());
|
|
263
196
|
this._isEmpty = true;
|
|
197
|
+
this._strokePointerId = undefined;
|
|
264
198
|
}
|
|
265
199
|
fromDataURL(dataUrl, options = {}) {
|
|
266
200
|
return new Promise((resolve, reject) => {
|
|
@@ -325,7 +259,7 @@ class SignaturePad extends SignatureEventTarget {
|
|
|
325
259
|
var _a;
|
|
326
260
|
const canvasWindow = window.document === this.canvas.ownerDocument
|
|
327
261
|
? window
|
|
328
|
-
: (_a = this.canvas.ownerDocument.defaultView) !== null && _a !== void 0 ? _a : this.canvas.ownerDocument;
|
|
262
|
+
: ((_a = this.canvas.ownerDocument.defaultView) !== null && _a !== void 0 ? _a : this.canvas.ownerDocument);
|
|
329
263
|
return {
|
|
330
264
|
addEventListener: canvasWindow.addEventListener.bind(canvasWindow),
|
|
331
265
|
removeEventListener: canvasWindow.removeEventListener.bind(canvasWindow),
|
|
@@ -378,6 +312,103 @@ class SignaturePad extends SignatureEventTarget {
|
|
|
378
312
|
pressure: touch.force,
|
|
379
313
|
};
|
|
380
314
|
}
|
|
315
|
+
_handleMouseDown(event) {
|
|
316
|
+
if (!this._isLeftButtonPressed(event, true) || this._drawingStroke) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
this._strokeBegin(this._pointerEventToSignatureEvent(event));
|
|
320
|
+
}
|
|
321
|
+
;
|
|
322
|
+
_handleMouseMove(event) {
|
|
323
|
+
if (!this._isLeftButtonPressed(event, true) || !this._drawingStroke) {
|
|
324
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(event), false);
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(event));
|
|
328
|
+
}
|
|
329
|
+
;
|
|
330
|
+
_handleMouseUp(event) {
|
|
331
|
+
if (this._isLeftButtonPressed(event)) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(event));
|
|
335
|
+
}
|
|
336
|
+
;
|
|
337
|
+
_handleTouchStart(event) {
|
|
338
|
+
if (event.targetTouches.length !== 1 || this._drawingStroke) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
if (event.cancelable) {
|
|
342
|
+
event.preventDefault();
|
|
343
|
+
}
|
|
344
|
+
this._strokeBegin(this._touchEventToSignatureEvent(event));
|
|
345
|
+
}
|
|
346
|
+
;
|
|
347
|
+
_handleTouchMove(event) {
|
|
348
|
+
if (event.targetTouches.length !== 1) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
if (event.cancelable) {
|
|
352
|
+
event.preventDefault();
|
|
353
|
+
}
|
|
354
|
+
if (!this._drawingStroke) {
|
|
355
|
+
this._strokeEnd(this._touchEventToSignatureEvent(event), false);
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
this._strokeMoveUpdate(this._touchEventToSignatureEvent(event));
|
|
359
|
+
}
|
|
360
|
+
;
|
|
361
|
+
_handleTouchEnd(event) {
|
|
362
|
+
if (event.targetTouches.length !== 0) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (event.cancelable) {
|
|
366
|
+
event.preventDefault();
|
|
367
|
+
}
|
|
368
|
+
this._strokeEnd(this._touchEventToSignatureEvent(event));
|
|
369
|
+
}
|
|
370
|
+
;
|
|
371
|
+
_getPointerId(event) {
|
|
372
|
+
return event.persistentDeviceId || event.pointerId;
|
|
373
|
+
}
|
|
374
|
+
_allowPointerId(event, allowUndefined = false) {
|
|
375
|
+
if (typeof this._strokePointerId === 'undefined') {
|
|
376
|
+
return allowUndefined;
|
|
377
|
+
}
|
|
378
|
+
return this._getPointerId(event) === this._strokePointerId;
|
|
379
|
+
}
|
|
380
|
+
_handlePointerDown(event) {
|
|
381
|
+
if (this._drawingStroke ||
|
|
382
|
+
!this._isLeftButtonPressed(event) ||
|
|
383
|
+
!this._allowPointerId(event, true)) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
this._strokePointerId = this._getPointerId(event);
|
|
387
|
+
event.preventDefault();
|
|
388
|
+
this._strokeBegin(this._pointerEventToSignatureEvent(event));
|
|
389
|
+
}
|
|
390
|
+
;
|
|
391
|
+
_handlePointerMove(event) {
|
|
392
|
+
if (!this._allowPointerId(event)) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
if (!this._isLeftButtonPressed(event, true) || !this._drawingStroke) {
|
|
396
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(event), false);
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
event.preventDefault();
|
|
400
|
+
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(event));
|
|
401
|
+
}
|
|
402
|
+
;
|
|
403
|
+
_handlePointerUp(event) {
|
|
404
|
+
if (this._isLeftButtonPressed(event) ||
|
|
405
|
+
!this._allowPointerId(event)) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
event.preventDefault();
|
|
409
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(event));
|
|
410
|
+
}
|
|
411
|
+
;
|
|
381
412
|
_getPointGroupOptions(group) {
|
|
382
413
|
return {
|
|
383
414
|
penColor: group && 'penColor' in group ? group.penColor : this.penColor,
|
|
@@ -400,16 +431,24 @@ class SignaturePad extends SignatureEventTarget {
|
|
|
400
431
|
const { addEventListener } = this._getListenerFunctions();
|
|
401
432
|
switch (event.event.type) {
|
|
402
433
|
case 'mousedown':
|
|
403
|
-
addEventListener('mousemove', this._handleMouseMove
|
|
404
|
-
|
|
434
|
+
addEventListener('mousemove', this._handleMouseMove, {
|
|
435
|
+
passive: false,
|
|
436
|
+
});
|
|
437
|
+
addEventListener('mouseup', this._handleMouseUp, { passive: false });
|
|
405
438
|
break;
|
|
406
439
|
case 'touchstart':
|
|
407
|
-
addEventListener('touchmove', this._handleTouchMove
|
|
408
|
-
|
|
440
|
+
addEventListener('touchmove', this._handleTouchMove, {
|
|
441
|
+
passive: false,
|
|
442
|
+
});
|
|
443
|
+
addEventListener('touchend', this._handleTouchEnd, { passive: false });
|
|
409
444
|
break;
|
|
410
445
|
case 'pointerdown':
|
|
411
|
-
addEventListener('pointermove', this._handlePointerMove
|
|
412
|
-
|
|
446
|
+
addEventListener('pointermove', this._handlePointerMove, {
|
|
447
|
+
passive: false,
|
|
448
|
+
});
|
|
449
|
+
addEventListener('pointerup', this._handlePointerUp, {
|
|
450
|
+
passive: false,
|
|
451
|
+
});
|
|
413
452
|
break;
|
|
414
453
|
}
|
|
415
454
|
this._drawingStroke = true;
|
|
@@ -462,18 +501,25 @@ class SignaturePad extends SignatureEventTarget {
|
|
|
462
501
|
this._strokeUpdate(event);
|
|
463
502
|
}
|
|
464
503
|
this._drawingStroke = false;
|
|
504
|
+
this._strokePointerId = undefined;
|
|
465
505
|
this.dispatchEvent(new CustomEvent('endStroke', { detail: event }));
|
|
466
506
|
}
|
|
467
507
|
_handlePointerEvents() {
|
|
468
508
|
this._drawingStroke = false;
|
|
469
|
-
this.canvas.addEventListener('pointerdown', this._handlePointerDown
|
|
509
|
+
this.canvas.addEventListener('pointerdown', this._handlePointerDown, {
|
|
510
|
+
passive: false,
|
|
511
|
+
});
|
|
470
512
|
}
|
|
471
513
|
_handleMouseEvents() {
|
|
472
514
|
this._drawingStroke = false;
|
|
473
|
-
this.canvas.addEventListener('mousedown', this._handleMouseDown
|
|
515
|
+
this.canvas.addEventListener('mousedown', this._handleMouseDown, {
|
|
516
|
+
passive: false,
|
|
517
|
+
});
|
|
474
518
|
}
|
|
475
519
|
_handleTouchEvents() {
|
|
476
|
-
this.canvas.addEventListener('touchstart', this._handleTouchStart
|
|
520
|
+
this.canvas.addEventListener('touchstart', this._handleTouchStart, {
|
|
521
|
+
passive: false,
|
|
522
|
+
});
|
|
477
523
|
}
|
|
478
524
|
_reset(options) {
|
|
479
525
|
this._lastPoints = [];
|