input-duration 2.1.1 → 2.2.2

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
@@ -52,13 +52,12 @@
52
52
  <div>
53
53
  </div>
54
54
  <div align="center">
55
- <a href="https://6mxpg2.csb.app/" target="_blank">Demo</a>
56
- ·
57
- <a href="https://stephanluis.github.io/input-duration/" target="_blank">Docs</a>
58
- ·
59
55
  <a href="https://codesandbox.io/s/peaceful-waterfall-6mxpg2?file=/index.html" target="_blank">
60
56
  Fiddle
61
- </a>
57
+ </a> ·
58
+ <a href="https://6mxpg2.csb.app/" target="_blank">Demo</a>
59
+ ·
60
+ <a href="https://stephanluis.github.io/input-duration/" target="_blank">Docs</a>
62
61
  ·
63
62
  <a href="https://github.com/StephanLuis/input-duration/issues">Bugs</a>
64
63
  ·
@@ -115,6 +114,7 @@ Time inputs <input type='time'> are updated by browsers in unwanted ways! Safa
115
114
  <img src="readme/codeDrawing.png" alt="drawing" width="60%"/>
116
115
 
117
116
  <!-- [![HTML Screen Shot][html-screenshot]](https://example.com) -->
117
+ *note input-duration needs closing tag!
118
118
 
119
119
  <h3> Bob is rescued by INPUT-DURATION! </h3>
120
120
 
@@ -222,7 +222,7 @@ import chronlyhms from 'https://cdn.jsdelivr.net/npm/input-duration/+esm'
222
222
  <!-- USAGE EXAMPLES -->
223
223
  ## Usage
224
224
 
225
- input-duration requires a <input-duration> element . There's no more HTML than that.
225
+ input-duration requires a `<input-duration>` element . There's no more HTML than that, but don't forget the closing tag. Native Input elements don't have them!
226
226
  ```sh
227
227
 
228
228
  <input-duration id='bob'></input-duration>
@@ -93,7 +93,7 @@
93
93
 
94
94
  <dt class="tag-source">Source:</dt>
95
95
  <dd class="tag-source"><ul class="dummy"><li>
96
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line12">line 12</a>
96
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line14">line 14</a>
97
97
  </li></ul></dd>
98
98
 
99
99
 
@@ -199,7 +199,7 @@ so in js use var x = document.querySelector("#bobPrepop").value;
199
199
 
200
200
  <dt class="tag-source">Source:</dt>
201
201
  <dd class="tag-source"><ul class="dummy"><li>
202
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line41">line 41</a>
202
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line43">line 43</a>
203
203
  </li></ul></dd>
204
204
 
205
205
 
@@ -262,7 +262,7 @@ so in js use document.querySelector("#bobPrepop").value = "05:05:05.005"
262
262
 
263
263
  <dt class="tag-source">Source:</dt>
264
264
  <dd class="tag-source"><ul class="dummy"><li>
265
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line68">line 68</a>
265
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line70">line 70</a>
266
266
  </li></ul></dd>
267
267
 
268
268
 
@@ -343,7 +343,7 @@ the change event of the input
343
343
 
344
344
  <dt class="tag-source">Source:</dt>
345
345
  <dd class="tag-source"><ul class="dummy"><li>
346
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line520">line 520</a>
346
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line523">line 523</a>
347
347
  </li></ul></dd>
348
348
 
349
349
 
@@ -439,7 +439,7 @@ the change event of the input
439
439
 
440
440
  <dt class="tag-source">Source:</dt>
441
441
  <dd class="tag-source"><ul class="dummy"><li>
442
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line155">line 155</a>
442
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line158">line 158</a>
443
443
  </li></ul></dd>
444
444
 
445
445
 
@@ -535,7 +535,7 @@ the click event of the input
535
535
 
536
536
  <dt class="tag-source">Source:</dt>
537
537
  <dd class="tag-source"><ul class="dummy"><li>
538
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line548">line 548</a>
538
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line551">line 551</a>
539
539
  </li></ul></dd>
540
540
 
541
541
 
@@ -630,7 +630,7 @@ the click event of the input
630
630
 
631
631
  <dt class="tag-source">Source:</dt>
632
632
  <dd class="tag-source"><ul class="dummy"><li>
633
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line226">line 226</a>
633
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line229">line 229</a>
634
634
  </li></ul></dd>
635
635
 
636
636
 
@@ -726,7 +726,7 @@ the change event of the input
726
726
 
727
727
  <dt class="tag-source">Source:</dt>
728
728
  <dd class="tag-source"><ul class="dummy"><li>
729
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line343">line 343</a>
729
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line346">line 346</a>
730
730
  </li></ul></dd>
731
731
 
732
732
 
@@ -821,7 +821,7 @@ the change event of the input
821
821
 
822
822
  <dt class="tag-source">Source:</dt>
823
823
  <dd class="tag-source"><ul class="dummy"><li>
824
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line409">line 409</a>
824
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line412">line 412</a>
825
825
  </li></ul></dd>
826
826
 
827
827
 
@@ -916,7 +916,7 @@ the change event of the input
916
916
 
917
917
  <dt class="tag-source">Source:</dt>
918
918
  <dd class="tag-source"><ul class="dummy"><li>
919
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line133">line 133</a>
919
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line135">line 135</a>
920
920
  </li></ul></dd>
921
921
 
922
922
 
@@ -1004,7 +1004,7 @@ the change event of the input
1004
1004
 
1005
1005
  <dt class="tag-source">Source:</dt>
1006
1006
  <dd class="tag-source"><ul class="dummy"><li>
1007
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line585">line 585</a>
1007
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line602">line 602</a>
1008
1008
  </li></ul></dd>
1009
1009
 
1010
1010
 
@@ -1092,7 +1092,7 @@ the change event of the input
1092
1092
 
1093
1093
  <dt class="tag-source">Source:</dt>
1094
1094
  <dd class="tag-source"><ul class="dummy"><li>
1095
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line601">line 601</a>
1095
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line618">line 618</a>
1096
1096
  </li></ul></dd>
1097
1097
 
1098
1098
 
@@ -1181,7 +1181,7 @@ the keypress event of the input
1181
1181
 
1182
1182
  <dt class="tag-source">Source:</dt>
1183
1183
  <dd class="tag-source"><ul class="dummy"><li>
1184
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line561">line 561</a>
1184
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line564">line 564</a>
1185
1185
  </li></ul></dd>
1186
1186
 
1187
1187
 
@@ -1218,6 +1218,95 @@ the keypress event of the input
1218
1218
 
1219
1219
 
1220
1220
 
1221
+
1222
+
1223
+
1224
+
1225
+
1226
+
1227
+ <h4 class="name" id="removeEprop"><span class="type-signature"></span>removeEprop<span class="signature">()</span><span class="type-signature"></span></h4>
1228
+
1229
+
1230
+
1231
+
1232
+
1233
+
1234
+ <div class="description">
1235
+ Stop event propigation from the timeCase up through the DOM so when keys
1236
+ are being used they don't affect other controls (like volume on plyr)
1237
+ </div>
1238
+
1239
+
1240
+
1241
+
1242
+
1243
+
1244
+
1245
+
1246
+
1247
+
1248
+
1249
+
1250
+
1251
+ <dl class="details">
1252
+
1253
+
1254
+
1255
+
1256
+
1257
+
1258
+
1259
+
1260
+
1261
+
1262
+
1263
+
1264
+
1265
+
1266
+
1267
+
1268
+
1269
+
1270
+
1271
+
1272
+
1273
+
1274
+
1275
+
1276
+
1277
+
1278
+ <dt class="tag-source">Source:</dt>
1279
+ <dd class="tag-source"><ul class="dummy"><li>
1280
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line586">line 586</a>
1281
+ </li></ul></dd>
1282
+
1283
+
1284
+
1285
+
1286
+
1287
+
1288
+
1289
+ </dl>
1290
+
1291
+
1292
+
1293
+
1294
+
1295
+
1296
+
1297
+
1298
+
1299
+
1300
+
1301
+
1302
+
1303
+
1304
+
1305
+
1306
+
1307
+
1308
+
1309
+
1221
1310
 
1222
1311
 
1223
1312
 
@@ -1240,7 +1329,7 @@ the keypress event of the input
1240
1329
  <br class="clear">
1241
1330
 
1242
1331
  <footer>
1243
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Jul 06 2023 16:38:37 GMT+0000 (GMT)
1332
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Fri Sep 29 2023 11:02:59 GMT+0000 (GMT)
1244
1333
  </footer>
1245
1334
 
1246
1335
  <script> prettyPrint(); </script>
package/docs/index.html CHANGED
@@ -168,7 +168,7 @@
168
168
  <br class="clear">
169
169
 
170
170
  <footer>
171
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Jul 06 2023 16:38:37 GMT+0000 (GMT)
171
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Fri Sep 29 2023 11:02:59 GMT+0000 (GMT)
172
172
  </footer>
173
173
 
174
174
  <script> prettyPrint(); </script>
@@ -27,6 +27,8 @@
27
27
  <section>
28
28
  <article>
29
29
  <pre class="prettyprint source linenums"><code>/**
30
+ * This is jsdoc 'auto' documentation see https://jsdoc.app/
31
+ *
30
32
  * @fileoverview INPUT-DURATION
31
33
  * @file INPUT-DURATION
32
34
  * @author Stephan Luis
@@ -169,6 +171,7 @@ class InputDuration extends HTMLElement {
169
171
  this.addNumericInput();
170
172
  this.addClicksToActivate();
171
173
  this.nonNumericBugInHTML();
174
+ this.removeEprop();
172
175
 
173
176
  }
174
177
 
@@ -260,7 +263,7 @@ class InputDuration extends HTMLElement {
260
263
  var template = document.createElement('template');
261
264
 
262
265
  template.innerHTML = `
263
- &lt;input id="inShadow" type="number" class="sH D2 ts_digit" name="startHours" data-tp="1" min="-1" max="100" value="00" >
266
+ &lt;input type="number" class="sH D2 ts_digit" name="startHours" data-tp="1" min="-1" max="100" value="00" >
264
267
  &lt;span class="bds-h">:&lt;/span>
265
268
  &lt;input type="number" class="sM D2 ts_digit" name="startMinutes" data-tp="2" min="-1" max="60" value="00">
266
269
  &lt;span class="bds-m">:&lt;/span>
@@ -602,7 +605,21 @@ class InputDuration extends HTMLElement {
602
605
  }));
603
606
  }
604
607
 
608
+ /**
609
+ * Stop event propigation from the timeCase up through the DOM so when keys
610
+ * are being used they don't affect other controls (like volume on plyr)
611
+ * @method
612
+ */
613
+
614
+ removeEprop() {
615
+
616
+ document.querySelector('input-duration').shadowRoot.querySelector('.timeCase')
617
+ .addEventListener('keydown', function (event) { event.stopPropagation();});
605
618
 
619
+ }
620
+
621
+
622
+
606
623
  // formatting and behaviour options
607
624
 
608
625
  /**
@@ -662,7 +679,7 @@ export default customElements.define('input-duration', InputDuration);
662
679
  <br class="clear">
663
680
 
664
681
  <footer>
665
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Jul 06 2023 16:38:37 GMT+0000 (GMT)
682
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Fri Sep 29 2023 11:02:59 GMT+0000 (GMT)
666
683
  </footer>
667
684
 
668
685
  <script> prettyPrint(); </script>
package/index.js CHANGED
@@ -1,4 +1,9 @@
1
1
  /**
2
+ * This is jsdoc 'auto' documentation see https://jsdoc.app/
3
+ * npm install -g jsdoc
4
+ * jsdoc index.js -d ./docs/
5
+ *
6
+ *
2
7
  * @fileoverview INPUT-DURATION
3
8
  * @file INPUT-DURATION
4
9
  * @author Stephan Luis
@@ -141,6 +146,7 @@ class InputDuration extends HTMLElement {
141
146
  this.addNumericInput();
142
147
  this.addClicksToActivate();
143
148
  this.nonNumericBugInHTML();
149
+ this.removeEprop();
144
150
 
145
151
  }
146
152
 
@@ -232,7 +238,7 @@ class InputDuration extends HTMLElement {
232
238
  var template = document.createElement('template');
233
239
 
234
240
  template.innerHTML = `
235
- <input id="inShadow" type="number" class="sH D2 ts_digit" name="startHours" data-tp="1" min="-1" max="100" value="00" >
241
+ <input type="number" class="sH D2 ts_digit" name="startHours" data-tp="1" min="-1" max="100" value="00" >
236
242
  <span class="bds-h">:</span>
237
243
  <input type="number" class="sM D2 ts_digit" name="startMinutes" data-tp="2" min="-1" max="60" value="00">
238
244
  <span class="bds-m">:</span>
@@ -574,7 +580,21 @@ class InputDuration extends HTMLElement {
574
580
  }));
575
581
  }
576
582
 
583
+ /**
584
+ * Stop event propigation from the timeCase up through the DOM so when keys
585
+ * are being used they don't affect other controls (like volume on plyr)
586
+ * @method
587
+ */
588
+
589
+ removeEprop() {
590
+
591
+ document.querySelector('input-duration').shadowRoot.querySelector('.timeCase')
592
+ .addEventListener('keydown', function (event) { event.stopPropagation();});
577
593
 
594
+ }
595
+
596
+
597
+
578
598
  // formatting and behaviour options
579
599
 
580
600
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "input-duration",
3
- "version": "2.1.1",
3
+ "version": "2.2.2",
4
4
  "author": "Stephan Luis <stephan@learnsense.org>",
5
5
  "description": "This is the 'Input-Duration'! It is a webcomponent that provides an hour, minute, second, and millisecond control for HTML5.",
6
6
  "browser": "indexjs",