tiny-essentials 1.28.1 → 1.28.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.
Files changed (211) hide show
  1. package/changelog/1/28/2.md +43 -0
  2. package/dist/_/numbers.d.mts +91 -16
  3. package/dist/v1/TinyBasicsEs.min.js +1 -1
  4. package/dist/v1/TinyEssentials.min.js +1 -1
  5. package/dist/v1/TinyMediaPlayer.min.js +1 -1
  6. package/dist/v1/TinyRadioFm.min.js +1 -1
  7. package/dist/v1/basics/array.d.mts +14 -14
  8. package/dist/v1/basics/clock.cjs +15 -15
  9. package/dist/v1/basics/clock.d.mts +21 -21
  10. package/dist/v1/basics/clock.mjs +15 -15
  11. package/dist/v1/basics/collision.d.mts +245 -104
  12. package/dist/v1/basics/deprecated/html.d.mts +33 -33
  13. package/dist/v1/basics/extendObjType/Buffer.d.mts +1 -1
  14. package/dist/v1/basics/fullScreen.d.mts +47 -7
  15. package/dist/v1/basics/html.d.mts +52 -61
  16. package/dist/v1/basics/index.d.mts +11 -67
  17. package/dist/v1/basics/mediaContent.cjs +65 -23
  18. package/dist/v1/basics/mediaContent.d.mts +144 -73
  19. package/dist/v1/basics/mediaContent.mjs +65 -23
  20. package/dist/v1/basics/objChecker.d.mts +2 -2
  21. package/dist/v1/basics/objFilter.cjs +31 -7
  22. package/dist/v1/basics/objFilter.d.mts +10 -13
  23. package/dist/v1/basics/objFilter.mjs +31 -7
  24. package/dist/v1/basics/simpleMath.d.mts +21 -21
  25. package/dist/v1/basics/text.d.mts +34 -46
  26. package/dist/v1/build/ColorSafeStringify.d.mts +1 -1
  27. package/dist/v1/build/TinyAdvancedRaffle.d.mts +1 -1
  28. package/dist/v1/build/TinyAfterScrollWatcher.d.mts +1 -1
  29. package/dist/v1/build/TinyAnalogClock.d.mts +1 -1
  30. package/dist/v1/build/TinyArrayComparator.d.mts +1 -1
  31. package/dist/v1/build/TinyArrayPaginator.d.mts +1 -1
  32. package/dist/v1/build/TinyClassManager.d.mts +1 -1
  33. package/dist/v1/build/TinyClipboard.d.mts +1 -1
  34. package/dist/v1/build/TinyColorConverter.d.mts +1 -1
  35. package/dist/v1/build/TinyColorValidator.d.mts +1 -1
  36. package/dist/v1/build/TinyCookieConsent.d.mts +1 -1
  37. package/dist/v1/build/TinyDayNightCycle.d.mts +1 -1
  38. package/dist/v1/build/TinyDomReadyManager.d.mts +1 -1
  39. package/dist/v1/build/TinyDragDropDetector.d.mts +1 -1
  40. package/dist/v1/build/TinyDragger.d.mts +1 -1
  41. package/dist/v1/build/TinyElementObserver.d.mts +1 -1
  42. package/dist/v1/build/TinyGamepad.d.mts +1 -1
  43. package/dist/v1/build/TinyHtml.d.mts +1 -1
  44. package/dist/v1/build/TinyI18.d.mts +1 -1
  45. package/dist/v1/build/TinyIframeEvents.d.mts +1 -1
  46. package/dist/v1/build/TinyInventory.d.mts +1 -1
  47. package/dist/v1/build/TinyInventoryTrader.d.mts +1 -1
  48. package/dist/v1/build/TinyLevelUp.d.mts +1 -1
  49. package/dist/v1/build/TinyLoadingScreen.d.mts +1 -1
  50. package/dist/v1/build/TinyLocalStorage.d.mts +1 -1
  51. package/dist/v1/build/TinyMediaPlayer.d.mts +1 -1
  52. package/dist/v1/build/TinyNeedBar.d.mts +1 -1
  53. package/dist/v1/build/TinyNewWinEvents.d.mts +1 -1
  54. package/dist/v1/build/TinyNotifications.d.mts +1 -1
  55. package/dist/v1/build/TinyNotifyCenter.d.mts +1 -1
  56. package/dist/v1/build/TinyPromiseQueue.d.mts +1 -1
  57. package/dist/v1/build/TinyRadioFm.d.mts +1 -1
  58. package/dist/v1/build/TinyRateLimiter.d.mts +1 -1
  59. package/dist/v1/build/TinySimpleDice.d.mts +1 -1
  60. package/dist/v1/build/TinySmartScroller.d.mts +1 -1
  61. package/dist/v1/build/TinyTextDiffer.d.mts +1 -1
  62. package/dist/v1/build/TinyTextRangeEditor.d.mts +1 -1
  63. package/dist/v1/build/TinyTextarea.d.mts +1 -1
  64. package/dist/v1/build/TinyTimeout.d.mts +1 -1
  65. package/dist/v1/build/TinyToastNotify.d.mts +1 -1
  66. package/dist/v1/build/TinyUploadClicker.d.mts +1 -1
  67. package/dist/v1/build/UltraRandomMsgGen.d.mts +1 -1
  68. package/dist/v1/fileManager/asyncFuncs.d.mts +13 -13
  69. package/dist/v1/fileManager/index.d.mts +3 -29
  70. package/dist/v1/fileManager/normalFuncs.d.mts +22 -22
  71. package/dist/v1/index.d.mts +53 -139
  72. package/dist/v1/libs/ColorSafeStringify.d.mts +3 -12
  73. package/dist/v1/libs/TinyAdvancedRaffle.d.mts +60 -103
  74. package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +11 -18
  75. package/dist/v1/libs/TinyAnalogClock.d.mts +8 -11
  76. package/dist/v1/libs/TinyArrayComparator.d.mts +14 -20
  77. package/dist/v1/libs/TinyArrayPaginator.d.mts +22 -26
  78. package/dist/v1/libs/TinyClassManager/TinyPluginInliner.d.mts +8 -8
  79. package/dist/v1/libs/TinyClassManager.cjs +5 -7
  80. package/dist/v1/libs/TinyClassManager.d.mts +16 -16
  81. package/dist/v1/libs/TinyClassManager.mjs +5 -6
  82. package/dist/v1/libs/TinyClipboard.d.mts +8 -3
  83. package/dist/v1/libs/TinyColorConverter.d.mts +8 -31
  84. package/dist/v1/libs/TinyColorValidator.d.mts +145 -184
  85. package/dist/v1/libs/TinyCookieConsent.d.mts +17 -17
  86. package/dist/v1/libs/TinyDayNightCycle.d.mts +85 -110
  87. package/dist/v1/libs/TinyDomReadyManager.d.mts +8 -16
  88. package/dist/v1/libs/TinyDragDropDetector.d.mts +30 -30
  89. package/dist/v1/libs/TinyDragger.d.mts +82 -81
  90. package/dist/v1/libs/TinyElementObserver.d.mts +25 -28
  91. package/dist/v1/libs/TinyGamepad.cjs +0 -1
  92. package/dist/v1/libs/TinyGamepad.d.mts +50 -122
  93. package/dist/v1/libs/TinyGamepad.mjs +0 -1
  94. package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.cjs +2 -25
  95. package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.d.mts +19 -25
  96. package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.mjs +3 -27
  97. package/dist/v1/libs/TinyHtml/TinyHtmlButton.cjs +2 -1
  98. package/dist/v1/libs/TinyHtml/TinyHtmlButton.d.mts +55 -55
  99. package/dist/v1/libs/TinyHtml/TinyHtmlButton.mjs +2 -1
  100. package/dist/v1/libs/TinyHtml/TinyHtmlCanvas.d.mts +6 -6
  101. package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.cjs +8 -4
  102. package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.d.mts +19 -21
  103. package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.mjs +7 -4
  104. package/dist/v1/libs/TinyHtml/TinyHtmlEmbed.d.mts +8 -8
  105. package/dist/v1/libs/TinyHtml/TinyHtmlForm.d.mts +18 -18
  106. package/dist/v1/libs/TinyHtml/TinyHtmlIcon.d.mts +5 -6
  107. package/dist/v1/libs/TinyHtml/TinyHtmlIframe.d.mts +19 -19
  108. package/dist/v1/libs/TinyHtml/TinyHtmlImage.cjs +0 -28
  109. package/dist/v1/libs/TinyHtml/TinyHtmlImage.d.mts +22 -28
  110. package/dist/v1/libs/TinyHtml/TinyHtmlImage.mjs +1 -27
  111. package/dist/v1/libs/TinyHtml/TinyHtmlInput.d.mts +11 -11
  112. package/dist/v1/libs/TinyHtml/TinyHtmlLink.d.mts +23 -23
  113. package/dist/v1/libs/TinyHtml/TinyHtmlMedia.d.mts +26 -26
  114. package/dist/v1/libs/TinyHtml/TinyHtmlScript.cjs +4 -30
  115. package/dist/v1/libs/TinyHtml/TinyHtmlScript.d.mts +20 -26
  116. package/dist/v1/libs/TinyHtml/TinyHtmlScript.mjs +5 -32
  117. package/dist/v1/libs/TinyHtml/TinyHtmlSelect.d.mts +19 -19
  118. package/dist/v1/libs/TinyHtml/TinyHtmlStyle.d.mts +8 -8
  119. package/dist/v1/libs/TinyHtml/TinyHtmlTemplate.d.mts +26 -28
  120. package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.cjs +14 -15
  121. package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.d.mts +32 -32
  122. package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.mjs +15 -15
  123. package/dist/v1/libs/TinyHtml/index.d.mts +102 -45
  124. package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.cjs +11 -9
  125. package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.d.mts +21 -21
  126. package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.mjs +11 -9
  127. package/dist/v1/libs/TinyHtml/input/TinyHtmlFileInput.d.mts +11 -11
  128. package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.cjs +4 -4
  129. package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.d.mts +17 -13
  130. package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.mjs +4 -4
  131. package/dist/v1/libs/TinyHtml/input/TinyHtmlImageInput.d.mts +21 -21
  132. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.cjs +5 -4
  133. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.d.mts +14 -14
  134. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.mjs +5 -4
  135. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.cjs +4 -3
  136. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.d.mts +10 -10
  137. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.mjs +4 -3
  138. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.cjs +4 -3
  139. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.d.mts +19 -19
  140. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.mjs +4 -3
  141. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.cjs +5 -4
  142. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.d.mts +11 -11
  143. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.mjs +5 -4
  144. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.cjs +4 -3
  145. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.d.mts +15 -11
  146. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.mjs +4 -3
  147. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.cjs +49 -21
  148. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.d.mts +34 -20
  149. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.mjs +45 -20
  150. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.cjs +1 -1
  151. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.d.mts +14 -14
  152. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.mjs +1 -1
  153. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.cjs +1 -1
  154. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.d.mts +14 -14
  155. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.mjs +1 -1
  156. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.cjs +48 -25
  157. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.d.mts +27 -21
  158. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.mjs +40 -27
  159. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.cjs +1 -1
  160. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.d.mts +14 -14
  161. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.mjs +1 -1
  162. package/dist/v1/libs/TinyHtml/input/number/TinyHtmlNumberInput.d.mts +14 -14
  163. package/dist/v1/libs/TinyHtml/input/number/TinyHtmlRangeInput.d.mts +14 -14
  164. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlEmailInput.d.mts +25 -21
  165. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlPasswordInput.d.mts +18 -18
  166. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlSearchInput.d.mts +33 -29
  167. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTelInput.d.mts +22 -22
  168. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTextInput.d.mts +18 -18
  169. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlUrlInput.d.mts +31 -27
  170. package/dist/v1/libs/TinyHtml/media/TinyHtmlAudio.d.mts +35 -11
  171. package/dist/v1/libs/TinyHtml/media/TinyHtmlObject.d.mts +10 -10
  172. package/dist/v1/libs/TinyHtml/media/TinyHtmlSource.d.mts +12 -12
  173. package/dist/v1/libs/TinyHtml/media/TinyHtmlVideo.d.mts +35 -27
  174. package/dist/v1/libs/TinyHtml.cjs +3 -4
  175. package/dist/v1/libs/TinyHtml.d.mts +1503 -1731
  176. package/dist/v1/libs/TinyHtml.mjs +3 -4
  177. package/dist/v1/libs/TinyI18.d.mts +23 -61
  178. package/dist/v1/libs/TinyIframeEvents.cjs +1 -1
  179. package/dist/v1/libs/TinyIframeEvents.d.mts +29 -38
  180. package/dist/v1/libs/TinyIframeEvents.mjs +1 -1
  181. package/dist/v1/libs/TinyInventory.d.mts +78 -141
  182. package/dist/v1/libs/TinyInventoryTrader.d.mts +19 -22
  183. package/dist/v1/libs/TinyLevelUp.d.mts +10 -13
  184. package/dist/v1/libs/TinyLoadingScreen.d.mts +21 -31
  185. package/dist/v1/libs/TinyLocalStorage.d.mts +11 -36
  186. package/dist/v1/libs/TinyMamdaniInferenceSystem.d.mts +37 -23
  187. package/dist/v1/libs/TinyMediaPlayer.cjs +5 -3
  188. package/dist/v1/libs/TinyMediaPlayer.d.mts +102 -109
  189. package/dist/v1/libs/TinyMediaPlayer.mjs +5 -3
  190. package/dist/v1/libs/TinyNeedBar.d.mts +25 -37
  191. package/dist/v1/libs/TinyNewWinEvents.d.mts +29 -32
  192. package/dist/v1/libs/TinyNotifications.d.mts +6 -6
  193. package/dist/v1/libs/TinyNotifyCenter.d.mts +15 -21
  194. package/dist/v1/libs/TinyPromiseQueue.d.mts +11 -11
  195. package/dist/v1/libs/TinyRadioFm.cjs +32 -12
  196. package/dist/v1/libs/TinyRadioFm.d.mts +44 -80
  197. package/dist/v1/libs/TinyRadioFm.mjs +29 -12
  198. package/dist/v1/libs/TinyRateLimiter.d.mts +26 -39
  199. package/dist/v1/libs/TinySimpleDice.d.mts +17 -36
  200. package/dist/v1/libs/TinySmartScroller.d.mts +50 -60
  201. package/dist/v1/libs/TinyTextDiffer.d.mts +11 -14
  202. package/dist/v1/libs/TinyTextRangeEditor.d.mts +8 -8
  203. package/dist/v1/libs/TinyTextarea.d.mts +31 -31
  204. package/dist/v1/libs/TinyTimeout.d.mts +14 -14
  205. package/dist/v1/libs/TinyToastNotify.cjs +1 -1
  206. package/dist/v1/libs/TinyToastNotify.d.mts +15 -23
  207. package/dist/v1/libs/TinyToastNotify.mjs +1 -1
  208. package/dist/v1/libs/TinyUploadClicker.d.mts +38 -14
  209. package/dist/v1/libs/UltraRandomMsgGen.d.mts +44 -84
  210. package/dist/v1/libs/utils.d.mts +5 -1
  211. package/package.json +2 -2
@@ -27,10 +27,9 @@ class TinyHtmlAnchor extends TinyHtmlTemplate {
27
27
  * @param {string} [config.target] - Target attribute.
28
28
  * @param {string} [config.rel] - Relationship of the linked resource.
29
29
  * @param {string} [config.hreflang] - Language of the linked resource.
30
- * @param {string|string[]} [config.ping] - URLs to send pings to.
30
+ * @param {string} [config.ping] - URLs to send pings to.
31
31
  * @param {'no-referrer'|'no-referrer-when-downgrade'|'origin'|'origin-when-cross-origin'|'same-origin'|'strict-origin'|'strict-origin-when-cross-origin'|'unsafe-url'} [config.referrerpolicy] - Referrer policy.
32
32
  * @param {string} [config.type] - MIME type of the linked resource.
33
- * @param {boolean|string|string[]} [config.attributionsrc] - Enables Attribution Reporting.
34
33
  * @param {string|boolean} [config.download] - Download filename (or boolean to enable).
35
34
  * @param {boolean} [config.allowHtml=false] - Whether to allow HTML inside the link.
36
35
  * @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes.
@@ -46,7 +45,6 @@ class TinyHtmlAnchor extends TinyHtmlTemplate {
46
45
  ping,
47
46
  referrerpolicy,
48
47
  type,
49
- attributionsrc,
50
48
  download,
51
49
  allowHtml = false,
52
50
  tags = [],
@@ -64,7 +62,6 @@ class TinyHtmlAnchor extends TinyHtmlTemplate {
64
62
  if (ping !== undefined) this.ping = ping;
65
63
  if (referrerpolicy !== undefined) this.referrerpolicy = referrerpolicy;
66
64
  if (type !== undefined) this.type = type;
67
- if (attributionsrc !== undefined) this.attributionsrc = attributionsrc;
68
65
  if (download !== undefined) this.download = download;
69
66
 
70
67
  if (typeof allowHtml !== 'boolean')
@@ -116,9 +113,8 @@ class TinyHtmlAnchor extends TinyHtmlTemplate {
116
113
  return this.attrString('hreflang');
117
114
  }
118
115
 
119
- /** @param {string|string[]} ping */
116
+ /** @param {string} ping */
120
117
  set ping(ping) {
121
- if (Array.isArray(ping)) ping = ping.join(' ');
122
118
  if (typeof ping !== 'string')
123
119
  throw new TypeError('TinyHtmlAnchor: "ping" must be a string or string[].');
124
120
  this.setAttr('ping', ping);
@@ -160,25 +156,6 @@ class TinyHtmlAnchor extends TinyHtmlTemplate {
160
156
  return this.attrString('type');
161
157
  }
162
158
 
163
- /** @param {boolean|string|string[]} attributionsrc */
164
- set attributionsrc(attributionsrc) {
165
- if (attributionsrc === true) {
166
- this.addProp('attributionsrc');
167
- } else if (typeof attributionsrc === 'string') {
168
- this.setAttr('attributionsrc', attributionsrc);
169
- } else if (Array.isArray(attributionsrc)) {
170
- this.setAttr('attributionsrc', attributionsrc.join(' '));
171
- } else {
172
- throw new TypeError(
173
- 'TinyHtmlAnchor: "attributionsrc" must be a boolean, string, or string[].',
174
- );
175
- }
176
- }
177
- /** @returns {string|null} */
178
- get attributionsrc() {
179
- return this.attrString('attributionsrc');
180
- }
181
-
182
159
  /** @param {string|boolean} download */
183
160
  set download(download) {
184
161
  if (typeof download !== 'string' && typeof download !== 'boolean')
@@ -1,4 +1,5 @@
1
- export default TinyHtmlAnchor;
1
+ import TinyHtml from '../TinyHtml.mjs';
2
+ import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
2
3
  /**
3
4
  * TinyHtmlAnchor is a helper class for managing <a> elements.
4
5
  * It provides strongly-typed getters and setters for attributes like href,
@@ -23,30 +24,28 @@ declare class TinyHtmlAnchor extends TinyHtmlTemplate<HTMLAnchorElement> {
23
24
  * @param {string} [config.target] - Target attribute.
24
25
  * @param {string} [config.rel] - Relationship of the linked resource.
25
26
  * @param {string} [config.hreflang] - Language of the linked resource.
26
- * @param {string|string[]} [config.ping] - URLs to send pings to.
27
+ * @param {string} [config.ping] - URLs to send pings to.
27
28
  * @param {'no-referrer'|'no-referrer-when-downgrade'|'origin'|'origin-when-cross-origin'|'same-origin'|'strict-origin'|'strict-origin-when-cross-origin'|'unsafe-url'} [config.referrerpolicy] - Referrer policy.
28
29
  * @param {string} [config.type] - MIME type of the linked resource.
29
- * @param {boolean|string|string[]} [config.attributionsrc] - Enables Attribution Reporting.
30
30
  * @param {string|boolean} [config.download] - Download filename (or boolean to enable).
31
31
  * @param {boolean} [config.allowHtml=false] - Whether to allow HTML inside the link.
32
32
  * @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes.
33
33
  * @param {string} [config.mainClass=''] - Main CSS class.
34
34
  * @throws {TypeError} If any attribute is invalid.
35
35
  */
36
- constructor({ href, label, target, rel, hreflang, ping, referrerpolicy, type, attributionsrc, download, allowHtml, tags, mainClass, }: {
36
+ constructor({ href, label, target, rel, hreflang, ping, referrerpolicy, type, download, allowHtml, tags, mainClass, }: {
37
37
  href: string;
38
- label?: string | Element | TinyHtml<any> | undefined;
39
- target?: string | undefined;
40
- rel?: string | undefined;
41
- hreflang?: string | undefined;
42
- ping?: string | string[] | undefined;
43
- referrerpolicy?: "origin" | "same-origin" | "no-referrer" | "no-referrer-when-downgrade" | "origin-when-cross-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url" | undefined;
44
- type?: string | undefined;
45
- attributionsrc?: string | boolean | string[] | undefined;
46
- download?: string | boolean | undefined;
47
- allowHtml?: boolean | undefined;
48
- tags?: string | string[] | Set<string> | undefined;
49
- mainClass?: string | undefined;
38
+ label?: string | Element | TinyHtml<any>;
39
+ target?: string;
40
+ rel?: string;
41
+ hreflang?: string;
42
+ ping?: string;
43
+ referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
44
+ type?: string;
45
+ download?: string | boolean;
46
+ allowHtml?: boolean;
47
+ tags?: string | string[] | Set<string>;
48
+ mainClass?: string;
50
49
  });
51
50
  /** @param {string} href */
52
51
  set href(href: string);
@@ -64,22 +63,18 @@ declare class TinyHtmlAnchor extends TinyHtmlTemplate<HTMLAnchorElement> {
64
63
  set hreflang(hreflang: string);
65
64
  /** @returns {string|null} */
66
65
  get hreflang(): string | null;
67
- /** @param {string|string[]} ping */
68
- set ping(ping: string | string[]);
66
+ /** @param {string} ping */
67
+ set ping(ping: string);
69
68
  /** @returns {string|null} */
70
69
  get ping(): string | null;
71
70
  /** @param {'no-referrer'|'no-referrer-when-downgrade'|'origin'|'origin-when-cross-origin'|'same-origin'|'strict-origin'|'strict-origin-when-cross-origin'|'unsafe-url'} referrerpolicy */
72
- set referrerpolicy(referrerpolicy: "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url");
71
+ set referrerpolicy(referrerpolicy: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url');
73
72
  /** @returns {string|null} */
74
73
  get referrerpolicy(): string | null;
75
74
  /** @param {string} type */
76
75
  set type(type: string);
77
76
  /** @returns {string|null} */
78
77
  get type(): string | null;
79
- /** @param {boolean|string|string[]} attributionsrc */
80
- set attributionsrc(attributionsrc: boolean | string | string[]);
81
- /** @returns {string|null} */
82
- get attributionsrc(): string | null;
83
78
  /** @param {string|boolean} download */
84
79
  set download(download: string | boolean);
85
80
  /** @returns {string|boolean|null} */
@@ -93,6 +88,5 @@ declare class TinyHtmlAnchor extends TinyHtmlTemplate<HTMLAnchorElement> {
93
88
  */
94
89
  setLabel(label: string | Element | TinyHtml<any>, allowHtml?: boolean): this;
95
90
  }
96
- import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
97
- import TinyHtml from '../TinyHtml.mjs';
91
+ export default TinyHtmlAnchor;
98
92
  //# sourceMappingURL=TinyHtmlAnchor.d.mts.map
@@ -24,17 +24,16 @@ class TinyHtmlAnchor extends TinyHtmlTemplate {
24
24
  * @param {string} [config.target] - Target attribute.
25
25
  * @param {string} [config.rel] - Relationship of the linked resource.
26
26
  * @param {string} [config.hreflang] - Language of the linked resource.
27
- * @param {string|string[]} [config.ping] - URLs to send pings to.
27
+ * @param {string} [config.ping] - URLs to send pings to.
28
28
  * @param {'no-referrer'|'no-referrer-when-downgrade'|'origin'|'origin-when-cross-origin'|'same-origin'|'strict-origin'|'strict-origin-when-cross-origin'|'unsafe-url'} [config.referrerpolicy] - Referrer policy.
29
29
  * @param {string} [config.type] - MIME type of the linked resource.
30
- * @param {boolean|string|string[]} [config.attributionsrc] - Enables Attribution Reporting.
31
30
  * @param {string|boolean} [config.download] - Download filename (or boolean to enable).
32
31
  * @param {boolean} [config.allowHtml=false] - Whether to allow HTML inside the link.
33
32
  * @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes.
34
33
  * @param {string} [config.mainClass=''] - Main CSS class.
35
34
  * @throws {TypeError} If any attribute is invalid.
36
35
  */
37
- constructor({ href, label, target, rel, hreflang, ping, referrerpolicy, type, attributionsrc, download, allowHtml = false, tags = [], mainClass = '', }) {
36
+ constructor({ href, label, target, rel, hreflang, ping, referrerpolicy, type, download, allowHtml = false, tags = [], mainClass = '', }) {
38
37
  super(document.createElement('a'), tags, mainClass);
39
38
  if (typeof href !== 'string' || !href.trim())
40
39
  throw new TypeError('TinyHtmlAnchor: "href" must be a non-empty string.');
@@ -51,8 +50,6 @@ class TinyHtmlAnchor extends TinyHtmlTemplate {
51
50
  this.referrerpolicy = referrerpolicy;
52
51
  if (type !== undefined)
53
52
  this.type = type;
54
- if (attributionsrc !== undefined)
55
- this.attributionsrc = attributionsrc;
56
53
  if (download !== undefined)
57
54
  this.download = download;
58
55
  if (typeof allowHtml !== 'boolean')
@@ -100,10 +97,8 @@ class TinyHtmlAnchor extends TinyHtmlTemplate {
100
97
  get hreflang() {
101
98
  return this.attrString('hreflang');
102
99
  }
103
- /** @param {string|string[]} ping */
100
+ /** @param {string} ping */
104
101
  set ping(ping) {
105
- if (Array.isArray(ping))
106
- ping = ping.join(' ');
107
102
  if (typeof ping !== 'string')
108
103
  throw new TypeError('TinyHtmlAnchor: "ping" must be a string or string[].');
109
104
  this.setAttr('ping', ping);
@@ -142,25 +137,6 @@ class TinyHtmlAnchor extends TinyHtmlTemplate {
142
137
  get type() {
143
138
  return this.attrString('type');
144
139
  }
145
- /** @param {boolean|string|string[]} attributionsrc */
146
- set attributionsrc(attributionsrc) {
147
- if (attributionsrc === true) {
148
- this.addProp('attributionsrc');
149
- }
150
- else if (typeof attributionsrc === 'string') {
151
- this.setAttr('attributionsrc', attributionsrc);
152
- }
153
- else if (Array.isArray(attributionsrc)) {
154
- this.setAttr('attributionsrc', attributionsrc.join(' '));
155
- }
156
- else {
157
- throw new TypeError('TinyHtmlAnchor: "attributionsrc" must be a boolean, string, or string[].');
158
- }
159
- }
160
- /** @returns {string|null} */
161
- get attributionsrc() {
162
- return this.attrString('attributionsrc');
163
- }
164
140
  /** @param {string|boolean} download */
165
141
  set download(download) {
166
142
  if (typeof download !== 'string' && typeof download !== 'boolean')
@@ -306,11 +306,12 @@ class TinyHtmlButton extends TinyHtmlTemplate {
306
306
 
307
307
  /** @returns {string|null} */
308
308
  get value() {
309
- return this.attr('value');
309
+ return this.valTxt();
310
310
  }
311
311
  set value(val) {
312
312
  if (typeof val !== 'string') throw new TypeError('TinyHtmlButton.value must be a string.');
313
313
  this.setAttr('value', val);
314
+ this.setVal(val);
314
315
  }
315
316
  }
316
317
 
@@ -1,4 +1,5 @@
1
- export default TinyHtmlButton;
1
+ import TinyHtml from '../TinyHtml.mjs';
2
+ import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
2
3
  /**
3
4
  * TinyHtmlButton is a helper class for <button> elements with full attribute support and validation.
4
5
  * It extends TinyHtmlTemplate for direct DOM manipulation.
@@ -56,95 +57,94 @@ declare class TinyHtmlButton extends TinyHtmlTemplate<HTMLButtonElement> {
56
57
  */
57
58
  constructor({ label, tags, allowHtml, type, autofocus, command, commandfor, disabled, form, formaction, formenctype, formmethod, formnovalidate, formtarget, name, popovertarget, popovertargetaction, value, mainClass, }: {
58
59
  label: string | Element | TinyHtml<any>;
59
- tags?: string | string[] | Set<string> | undefined;
60
- allowHtml?: boolean | undefined;
61
- type?: "button" | "reset" | "submit" | undefined;
62
- autofocus?: boolean | undefined;
63
- command?: "close" | "show-modal" | "request-close" | "show-popover" | "hide-popover" | "toggle-popover" | undefined;
64
- commandfor?: string | undefined;
65
- disabled?: boolean | undefined;
66
- form?: string | undefined;
67
- formaction?: string | undefined;
68
- formenctype?: "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | undefined;
69
- formmethod?: "dialog" | "get" | "post" | undefined;
70
- formnovalidate?: boolean | undefined;
71
- formtarget?: "_blank" | "_self" | "_parent" | "_top" | "_unfencedTop" | undefined;
72
- name?: string | undefined;
73
- popovertarget?: string | undefined;
74
- popovertargetaction?: "hide" | "show" | "toggle" | undefined;
75
- value?: string | undefined;
76
- mainClass?: string | undefined;
60
+ tags?: string | string[] | Set<string>;
61
+ allowHtml?: boolean;
62
+ type?: 'button' | 'submit' | 'reset';
63
+ autofocus?: boolean;
64
+ command?: 'show-modal' | 'close' | 'request-close' | 'show-popover' | 'hide-popover' | 'toggle-popover';
65
+ commandfor?: string;
66
+ disabled?: boolean;
67
+ form?: string;
68
+ formaction?: string;
69
+ formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
70
+ formmethod?: 'get' | 'post' | 'dialog';
71
+ formnovalidate?: boolean;
72
+ formtarget?: '_self' | '_blank' | '_parent' | '_top' | '_unfencedTop';
73
+ name?: string;
74
+ popovertarget?: string;
75
+ popovertargetaction?: 'show' | 'hide' | 'toggle';
76
+ value?: string;
77
+ mainClass?: string;
77
78
  });
78
- /** @param {'button'|'submit'|'reset'} val */
79
- set type(val: "button" | "submit" | "reset");
79
+ /**
80
+ * Updates the button label with text, HTML, or an element.
81
+ *
82
+ * @param {string|Element|TinyHtml<any>} label - The new label.
83
+ * @param {boolean} [allowHtml=false] - Whether to allow raw HTML or DOM elements.
84
+ * @returns {this}
85
+ * @throws {TypeError} If the label is invalid.
86
+ * @throws {Error} If DOM/HTML is passed but allowHtml=false.
87
+ */
88
+ setLabel(label: string | Element | TinyHtml<any>, allowHtml?: boolean): this;
80
89
  /** @returns {string|null} */
81
90
  get type(): string | null;
82
- /** @param {boolean} state */
83
- set autofocus(state: boolean);
91
+ /** @param {'button'|'submit'|'reset'} val */
92
+ set type(val: 'button' | 'submit' | 'reset');
84
93
  /** @returns {boolean} */
85
- get autofocus(): boolean;
94
+ get disabled(): boolean;
86
95
  /** @param {boolean} state */
87
96
  set disabled(state: boolean);
88
97
  /** @returns {boolean} */
89
- get disabled(): boolean;
98
+ get autofocus(): boolean;
90
99
  /** @param {boolean} state */
91
- set formnovalidate(state: boolean);
100
+ set autofocus(state: boolean);
92
101
  /** @returns {boolean} */
93
102
  get formnovalidate(): boolean;
94
- /** @param {'show-modal'|'close'|'request-close'|'show-popover'|'hide-popover'|'toggle-popover'} cmd */
95
- set command(cmd: "show-modal" | "close" | "request-close" | "show-popover" | "hide-popover" | "toggle-popover");
103
+ /** @param {boolean} state */
104
+ set formnovalidate(state: boolean);
96
105
  /** @returns {string|null} */
97
106
  get command(): string | null;
107
+ /** @param {'show-modal'|'close'|'request-close'|'show-popover'|'hide-popover'|'toggle-popover'} cmd */
108
+ set command(cmd: 'show-modal' | 'close' | 'request-close' | 'show-popover' | 'hide-popover' | 'toggle-popover');
109
+ /** @returns {string|null} */
110
+ get commandfor(): string | null;
98
111
  /** @param {string} val */
99
112
  set commandfor(val: string);
100
113
  /** @returns {string|null} */
101
- get commandfor(): string | null;
114
+ get form(): string | null;
102
115
  /** @param {string} val */
103
116
  set form(val: string);
104
117
  /** @returns {string|null} */
105
- get form(): string | null;
118
+ get formaction(): string | null;
106
119
  /** @param {string} val */
107
120
  set formaction(val: string);
108
121
  /** @returns {string|null} */
109
- get formaction(): string | null;
122
+ get formenctype(): string | null;
110
123
  /** @param {'application/x-www-form-urlencoded'|'multipart/form-data'|'text/plain'} val */
111
- set formenctype(val: "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain");
124
+ set formenctype(val: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain');
112
125
  /** @returns {string|null} */
113
- get formenctype(): string | null;
126
+ get formmethod(): string | null;
114
127
  /** @param {'get'|'post'|'dialog'} val */
115
- set formmethod(val: "get" | "post" | "dialog");
128
+ set formmethod(val: 'get' | 'post' | 'dialog');
116
129
  /** @returns {string|null} */
117
- get formmethod(): string | null;
130
+ get formtarget(): string | null;
118
131
  /** @param {'_self'|'_blank'|'_parent'|'_top'|'_unfencedTop'} val */
119
- set formtarget(val: "_self" | "_blank" | "_parent" | "_top" | "_unfencedTop");
132
+ set formtarget(val: '_self' | '_blank' | '_parent' | '_top' | '_unfencedTop');
120
133
  /** @returns {string|null} */
121
- get formtarget(): string | null;
134
+ get name(): string | null;
122
135
  /** @param {string} val */
123
136
  set name(val: string);
124
137
  /** @returns {string|null} */
125
- get name(): string | null;
138
+ get popovertarget(): string | null;
126
139
  /** @param {string} val */
127
140
  set popovertarget(val: string);
128
141
  /** @returns {string|null} */
129
- get popovertarget(): string | null;
130
- /** @param {'show'|'hide'|'toggle'} val */
131
- set popovertargetaction(val: "show" | "hide" | "toggle");
132
- /** @returns {string|null} */
133
142
  get popovertargetaction(): string | null;
134
- set value(val: string | null);
143
+ /** @param {'show'|'hide'|'toggle'} val */
144
+ set popovertargetaction(val: 'show' | 'hide' | 'toggle');
135
145
  /** @returns {string|null} */
136
146
  get value(): string | null;
137
- /**
138
- * Updates the button label with text, HTML, or an element.
139
- *
140
- * @param {string|Element|TinyHtml<any>} label - The new label.
141
- * @param {boolean} [allowHtml=false] - Whether to allow raw HTML or DOM elements.
142
- * @returns {this}
143
- * @throws {TypeError} If the label is invalid.
144
- * @throws {Error} If DOM/HTML is passed but allowHtml=false.
145
- */
146
- setLabel(label: string | Element | TinyHtml<any>, allowHtml?: boolean): this;
147
+ set value(val: string | null);
147
148
  }
148
- import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
149
- import TinyHtml from '../TinyHtml.mjs';
149
+ export default TinyHtmlButton;
150
150
  //# sourceMappingURL=TinyHtmlButton.d.mts.map
@@ -279,12 +279,13 @@ class TinyHtmlButton extends TinyHtmlTemplate {
279
279
  }
280
280
  /** @returns {string|null} */
281
281
  get value() {
282
- return this.attr('value');
282
+ return this.valTxt();
283
283
  }
284
284
  set value(val) {
285
285
  if (typeof val !== 'string')
286
286
  throw new TypeError('TinyHtmlButton.value must be a string.');
287
287
  this.setAttr('value', val);
288
+ this.setVal(val);
288
289
  }
289
290
  }
290
291
  export default TinyHtmlButton;
@@ -1,4 +1,4 @@
1
- export default TinyHtmlCanvas;
1
+ import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
2
2
  /**
3
3
  * TinyHtmlCanvas is a helper for <canvas> elements,
4
4
  * providing a direct way to configure its size and retrieve the rendering context.
@@ -19,10 +19,10 @@ declare class TinyHtmlCanvas extends TinyHtmlTemplate<HTMLCanvasElement> {
19
19
  * @param {string} [config.mainClass=""] - Main CSS class.
20
20
  */
21
21
  constructor({ width, height, tags, mainClass }?: {
22
- width?: number | undefined;
23
- height?: number | undefined;
24
- tags?: string | string[] | Set<string> | undefined;
25
- mainClass?: string | undefined;
22
+ width?: number;
23
+ height?: number;
24
+ tags?: string | string[] | Set<string>;
25
+ mainClass?: string;
26
26
  });
27
27
  /**
28
28
  * Gets the rendering context of the canvas.
@@ -32,5 +32,5 @@ declare class TinyHtmlCanvas extends TinyHtmlTemplate<HTMLCanvasElement> {
32
32
  */
33
33
  getContext(type?: string, options?: any): RenderingContext | null;
34
34
  }
35
- import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
35
+ export default TinyHtmlCanvas;
36
36
  //# sourceMappingURL=TinyHtmlCanvas.d.mts.map
@@ -2,6 +2,10 @@
2
2
 
3
3
  var TinyHtmlTemplate = require('./TinyHtmlTemplate.cjs');
4
4
 
5
+ /**
6
+ * @typedef {{value: string, label?: string}} DatalistOption
7
+ */
8
+
5
9
  /**
6
10
  * TinyHtmlDatalist is a helper class for creating and managing <datalist> elements.
7
11
  * A <datalist> provides predefined options for <input> elements via the `list` attribute.
@@ -25,7 +29,7 @@ class TinyHtmlDatalist extends TinyHtmlTemplate {
25
29
  * @param {string} [config.id] - The unique identifier for the datalist (to be linked with <input list="...">).
26
30
  * @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes.
27
31
  * @param {string} [config.mainClass=""] - Main CSS class.
28
- * @param {Array<{value: string, label?: string}>} [config.options=[]] - Initial <option> elements.
32
+ * @param {Array<DatalistOption>} [config.options=[]] - Initial <option> elements.
29
33
  */
30
34
  constructor({ id, tags = [], mainClass = '', options = [] } = {}) {
31
35
  super(document.createElement('datalist'), tags, mainClass);
@@ -34,7 +38,7 @@ class TinyHtmlDatalist extends TinyHtmlTemplate {
34
38
  if (options !== undefined) this.options = options;
35
39
  }
36
40
 
37
- /** @param {Array<{value: string, label?: string}>} options */
41
+ /** @param {Array<DatalistOption>} options */
38
42
  set options(options) {
39
43
  if (!Array.isArray(options)) {
40
44
  throw new TypeError('TinyHtmlDatalist: "options" must be an array.');
@@ -46,13 +50,13 @@ class TinyHtmlDatalist extends TinyHtmlTemplate {
46
50
  }
47
51
  }
48
52
 
49
- /** @returns {Array<{value: string, label: string|null}>} */
53
+ /** @returns {Array<DatalistOption>} */
50
54
  get options() {
51
55
  return Array.from(this.el.children)
52
56
  .filter((child) => child instanceof HTMLOptionElement)
53
57
  .map((opt) => ({
54
58
  value: opt.value,
55
- label: opt.label || null,
59
+ label: opt.label,
56
60
  }));
57
61
  }
58
62
 
@@ -1,4 +1,11 @@
1
- export default TinyHtmlDatalist;
1
+ import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
2
+ export type DatalistOption = {
3
+ value: string;
4
+ label?: string;
5
+ };
6
+ /**
7
+ * @typedef {{value: string, label?: string}} DatalistOption
8
+ */
2
9
  /**
3
10
  * TinyHtmlDatalist is a helper class for creating and managing <datalist> elements.
4
11
  * A <datalist> provides predefined options for <input> elements via the `list` attribute.
@@ -22,27 +29,18 @@ declare class TinyHtmlDatalist extends TinyHtmlTemplate<HTMLDataListElement> {
22
29
  * @param {string} [config.id] - The unique identifier for the datalist (to be linked with <input list="...">).
23
30
  * @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes.
24
31
  * @param {string} [config.mainClass=""] - Main CSS class.
25
- * @param {Array<{value: string, label?: string}>} [config.options=[]] - Initial <option> elements.
32
+ * @param {Array<DatalistOption>} [config.options=[]] - Initial <option> elements.
26
33
  */
27
34
  constructor({ id, tags, mainClass, options }?: {
28
- id?: string | undefined;
29
- tags?: string | string[] | Set<string> | undefined;
30
- mainClass?: string | undefined;
31
- options?: {
32
- value: string;
33
- label?: string;
34
- }[] | undefined;
35
+ id?: string;
36
+ tags?: string | string[] | Set<string>;
37
+ mainClass?: string;
38
+ options?: Array<DatalistOption>;
35
39
  });
36
- /** @param {Array<{value: string, label?: string}>} options */
37
- set options(options: Array<{
38
- value: string;
39
- label?: string;
40
- }>);
41
- /** @returns {Array<{value: string, label: string|null}>} */
42
- get options(): Array<{
43
- value: string;
44
- label: string | null;
45
- }>;
40
+ /** @param {Array<DatalistOption>} options */
41
+ set options(options: Array<DatalistOption>);
42
+ /** @returns {Array<DatalistOption>} */
43
+ get options(): Array<DatalistOption>;
46
44
  /**
47
45
  * Adds a new <option> to the datalist.
48
46
  * @param {Object} config - Option configuration.
@@ -52,7 +50,7 @@ declare class TinyHtmlDatalist extends TinyHtmlTemplate<HTMLDataListElement> {
52
50
  */
53
51
  addOption({ value, label }: {
54
52
  value: string;
55
- label?: string | undefined;
53
+ label?: string;
56
54
  }): HTMLOptionElement;
57
55
  /**
58
56
  * Removes an option by its value.
@@ -61,5 +59,5 @@ declare class TinyHtmlDatalist extends TinyHtmlTemplate<HTMLDataListElement> {
61
59
  */
62
60
  removeOption(value: string): boolean;
63
61
  }
64
- import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
62
+ export default TinyHtmlDatalist;
65
63
  //# sourceMappingURL=TinyHtmlDatalist.d.mts.map
@@ -1,4 +1,7 @@
1
1
  import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
2
+ /**
3
+ * @typedef {{value: string, label?: string}} DatalistOption
4
+ */
2
5
  /**
3
6
  * TinyHtmlDatalist is a helper class for creating and managing <datalist> elements.
4
7
  * A <datalist> provides predefined options for <input> elements via the `list` attribute.
@@ -22,7 +25,7 @@ class TinyHtmlDatalist extends TinyHtmlTemplate {
22
25
  * @param {string} [config.id] - The unique identifier for the datalist (to be linked with <input list="...">).
23
26
  * @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes.
24
27
  * @param {string} [config.mainClass=""] - Main CSS class.
25
- * @param {Array<{value: string, label?: string}>} [config.options=[]] - Initial <option> elements.
28
+ * @param {Array<DatalistOption>} [config.options=[]] - Initial <option> elements.
26
29
  */
27
30
  constructor({ id, tags = [], mainClass = '', options = [] } = {}) {
28
31
  super(document.createElement('datalist'), tags, mainClass);
@@ -31,7 +34,7 @@ class TinyHtmlDatalist extends TinyHtmlTemplate {
31
34
  if (options !== undefined)
32
35
  this.options = options;
33
36
  }
34
- /** @param {Array<{value: string, label?: string}>} options */
37
+ /** @param {Array<DatalistOption>} options */
35
38
  set options(options) {
36
39
  if (!Array.isArray(options)) {
37
40
  throw new TypeError('TinyHtmlDatalist: "options" must be an array.');
@@ -42,13 +45,13 @@ class TinyHtmlDatalist extends TinyHtmlTemplate {
42
45
  this.addOption(opt);
43
46
  }
44
47
  }
45
- /** @returns {Array<{value: string, label: string|null}>} */
48
+ /** @returns {Array<DatalistOption>} */
46
49
  get options() {
47
50
  return Array.from(this.el.children)
48
51
  .filter((child) => child instanceof HTMLOptionElement)
49
52
  .map((opt) => ({
50
53
  value: opt.value,
51
- label: opt.label || null,
54
+ label: opt.label,
52
55
  }));
53
56
  }
54
57
  /**
@@ -1,4 +1,4 @@
1
- export default TinyHtmlEmbed;
1
+ import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
2
2
  /**
3
3
  * TinyHtmlEmbed is a helper class for creating and managing <embed> elements,
4
4
  * typically used to embed external interactive content or media such as PDFs or plugins.
@@ -37,12 +37,12 @@ declare class TinyHtmlEmbed extends TinyHtmlTemplate<HTMLEmbedElement> {
37
37
  * @throws {TypeError} If `height` is not a number or string.
38
38
  */
39
39
  constructor({ src, type, width, height, tags, mainClass }?: {
40
- src?: string | undefined;
41
- type?: string | undefined;
42
- width?: string | number | undefined;
43
- height?: string | number | undefined;
44
- tags?: string | string[] | Set<string> | undefined;
45
- mainClass?: string | undefined;
40
+ src?: string;
41
+ type?: string;
42
+ width?: number | string;
43
+ height?: number | string;
44
+ tags?: string | string[] | Set<string>;
45
+ mainClass?: string;
46
46
  });
47
47
  /** @param {string} src */
48
48
  set src(src: string);
@@ -53,5 +53,5 @@ declare class TinyHtmlEmbed extends TinyHtmlTemplate<HTMLEmbedElement> {
53
53
  /** @returns {string|null} */
54
54
  get type(): string | null;
55
55
  }
56
- import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
56
+ export default TinyHtmlEmbed;
57
57
  //# sourceMappingURL=TinyHtmlEmbed.d.mts.map