tiny-essentials 1.28.1 → 1.28.3
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/changelog/1/28/2.md +43 -0
- package/changelog/1/28/3.md +9 -0
- package/dist/_/numbers.d.mts +91 -16
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyMediaPlayer.min.js +1 -1
- package/dist/v1/TinyRadioFm.min.js +1 -1
- package/dist/v1/basics/array.d.mts +14 -14
- package/dist/v1/basics/clock.cjs +15 -15
- package/dist/v1/basics/clock.d.mts +21 -21
- package/dist/v1/basics/clock.mjs +15 -15
- package/dist/v1/basics/collision.d.mts +245 -104
- package/dist/v1/basics/deprecated/html.d.mts +33 -33
- package/dist/v1/basics/extendObjType/Buffer.d.mts +1 -1
- package/dist/v1/basics/fullScreen.d.mts +47 -7
- package/dist/v1/basics/html.d.mts +52 -61
- package/dist/v1/basics/index.cjs +2 -0
- package/dist/v1/basics/index.d.mts +11 -67
- package/dist/v1/basics/index.mjs +2 -2
- package/dist/v1/basics/mediaContent.cjs +65 -23
- package/dist/v1/basics/mediaContent.d.mts +144 -73
- package/dist/v1/basics/mediaContent.mjs +65 -23
- package/dist/v1/basics/objChecker.d.mts +2 -2
- package/dist/v1/basics/objFilter.cjs +50 -16
- package/dist/v1/basics/objFilter.d.mts +34 -13
- package/dist/v1/basics/objFilter.mjs +48 -16
- package/dist/v1/basics/simpleMath.d.mts +21 -21
- package/dist/v1/basics/text.d.mts +34 -46
- package/dist/v1/build/ColorSafeStringify.d.mts +1 -1
- package/dist/v1/build/TinyAdvancedRaffle.d.mts +1 -1
- package/dist/v1/build/TinyAfterScrollWatcher.d.mts +1 -1
- package/dist/v1/build/TinyAnalogClock.d.mts +1 -1
- package/dist/v1/build/TinyArrayComparator.d.mts +1 -1
- package/dist/v1/build/TinyArrayPaginator.d.mts +1 -1
- package/dist/v1/build/TinyClassManager.d.mts +1 -1
- package/dist/v1/build/TinyClipboard.d.mts +1 -1
- package/dist/v1/build/TinyColorConverter.d.mts +1 -1
- package/dist/v1/build/TinyColorValidator.d.mts +1 -1
- package/dist/v1/build/TinyCookieConsent.d.mts +1 -1
- package/dist/v1/build/TinyDayNightCycle.d.mts +1 -1
- package/dist/v1/build/TinyDomReadyManager.d.mts +1 -1
- package/dist/v1/build/TinyDragDropDetector.d.mts +1 -1
- package/dist/v1/build/TinyDragger.d.mts +1 -1
- package/dist/v1/build/TinyElementObserver.d.mts +1 -1
- package/dist/v1/build/TinyGamepad.d.mts +1 -1
- package/dist/v1/build/TinyHtml.d.mts +1 -1
- package/dist/v1/build/TinyI18.d.mts +1 -1
- package/dist/v1/build/TinyIframeEvents.d.mts +1 -1
- package/dist/v1/build/TinyInventory.d.mts +1 -1
- package/dist/v1/build/TinyInventoryTrader.d.mts +1 -1
- package/dist/v1/build/TinyLevelUp.d.mts +1 -1
- package/dist/v1/build/TinyLoadingScreen.d.mts +1 -1
- package/dist/v1/build/TinyLocalStorage.d.mts +1 -1
- package/dist/v1/build/TinyMediaPlayer.d.mts +1 -1
- package/dist/v1/build/TinyNeedBar.d.mts +1 -1
- package/dist/v1/build/TinyNewWinEvents.d.mts +1 -1
- package/dist/v1/build/TinyNotifications.d.mts +1 -1
- package/dist/v1/build/TinyNotifyCenter.d.mts +1 -1
- package/dist/v1/build/TinyPromiseQueue.d.mts +1 -1
- package/dist/v1/build/TinyRadioFm.d.mts +1 -1
- package/dist/v1/build/TinyRateLimiter.d.mts +1 -1
- package/dist/v1/build/TinySimpleDice.d.mts +1 -1
- package/dist/v1/build/TinySmartScroller.d.mts +1 -1
- package/dist/v1/build/TinyTextDiffer.d.mts +1 -1
- package/dist/v1/build/TinyTextRangeEditor.d.mts +1 -1
- package/dist/v1/build/TinyTextarea.d.mts +1 -1
- package/dist/v1/build/TinyTimeout.d.mts +1 -1
- package/dist/v1/build/TinyToastNotify.d.mts +1 -1
- package/dist/v1/build/TinyUploadClicker.d.mts +1 -1
- package/dist/v1/build/UltraRandomMsgGen.d.mts +1 -1
- package/dist/v1/fileManager/asyncFuncs.d.mts +13 -13
- package/dist/v1/fileManager/index.d.mts +3 -29
- package/dist/v1/fileManager/normalFuncs.d.mts +22 -22
- package/dist/v1/index.cjs +2 -0
- package/dist/v1/index.d.mts +53 -139
- package/dist/v1/index.mjs +2 -2
- package/dist/v1/libs/ColorSafeStringify.d.mts +3 -12
- package/dist/v1/libs/TinyAdvancedRaffle.d.mts +60 -103
- package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +11 -18
- package/dist/v1/libs/TinyAnalogClock.d.mts +8 -11
- package/dist/v1/libs/TinyArrayComparator.d.mts +14 -20
- package/dist/v1/libs/TinyArrayPaginator.d.mts +22 -26
- package/dist/v1/libs/TinyClassManager/TinyPluginInliner.d.mts +8 -8
- package/dist/v1/libs/TinyClassManager.cjs +5 -7
- package/dist/v1/libs/TinyClassManager.d.mts +16 -16
- package/dist/v1/libs/TinyClassManager.mjs +5 -6
- package/dist/v1/libs/TinyClipboard.d.mts +8 -3
- package/dist/v1/libs/TinyColorConverter.d.mts +8 -31
- package/dist/v1/libs/TinyColorValidator.d.mts +145 -184
- package/dist/v1/libs/TinyCookieConsent.d.mts +17 -17
- package/dist/v1/libs/TinyDayNightCycle.d.mts +85 -110
- package/dist/v1/libs/TinyDomReadyManager.d.mts +8 -16
- package/dist/v1/libs/TinyDragDropDetector.d.mts +30 -30
- package/dist/v1/libs/TinyDragger.d.mts +82 -81
- package/dist/v1/libs/TinyElementObserver.d.mts +25 -28
- package/dist/v1/libs/TinyGamepad.cjs +0 -1
- package/dist/v1/libs/TinyGamepad.d.mts +50 -122
- package/dist/v1/libs/TinyGamepad.mjs +0 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.cjs +2 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.d.mts +19 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.mjs +3 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.cjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.d.mts +55 -55
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.mjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlCanvas.d.mts +6 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.cjs +8 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.d.mts +19 -21
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.mjs +7 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlEmbed.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlForm.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/TinyHtmlIcon.d.mts +5 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlIframe.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.cjs +0 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.d.mts +22 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.mjs +1 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/TinyHtmlLink.d.mts +23 -23
- package/dist/v1/libs/TinyHtml/TinyHtmlMedia.d.mts +26 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.cjs +4 -30
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.d.mts +20 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.mjs +5 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlSelect.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlStyle.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlTemplate.d.mts +26 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.cjs +14 -15
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.d.mts +32 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.mjs +15 -15
- package/dist/v1/libs/TinyHtml/index.d.mts +102 -45
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.cjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.mjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlFileInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.cjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.d.mts +17 -13
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.mjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlImageInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.d.mts +15 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.cjs +49 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.d.mts +34 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.mjs +45 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.cjs +48 -25
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.d.mts +27 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.mjs +40 -27
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlNumberInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlRangeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlEmailInput.d.mts +25 -21
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlPasswordInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlSearchInput.d.mts +33 -29
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTelInput.d.mts +22 -22
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTextInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlUrlInput.d.mts +31 -27
- package/dist/v1/libs/TinyHtml/media/TinyHtmlAudio.d.mts +35 -11
- package/dist/v1/libs/TinyHtml/media/TinyHtmlObject.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/media/TinyHtmlSource.d.mts +12 -12
- package/dist/v1/libs/TinyHtml/media/TinyHtmlVideo.d.mts +35 -27
- package/dist/v1/libs/TinyHtml.cjs +3 -4
- package/dist/v1/libs/TinyHtml.d.mts +1503 -1731
- package/dist/v1/libs/TinyHtml.mjs +3 -4
- package/dist/v1/libs/TinyI18.d.mts +23 -61
- package/dist/v1/libs/TinyIframeEvents.cjs +1 -1
- package/dist/v1/libs/TinyIframeEvents.d.mts +29 -38
- package/dist/v1/libs/TinyIframeEvents.mjs +1 -1
- package/dist/v1/libs/TinyInventory.d.mts +78 -141
- package/dist/v1/libs/TinyInventoryTrader.d.mts +19 -22
- package/dist/v1/libs/TinyLevelUp.d.mts +10 -13
- package/dist/v1/libs/TinyLoadingScreen.d.mts +21 -31
- package/dist/v1/libs/TinyLocalStorage.d.mts +11 -36
- package/dist/v1/libs/TinyMamdaniInferenceSystem.d.mts +37 -23
- package/dist/v1/libs/TinyMediaPlayer.cjs +5 -3
- package/dist/v1/libs/TinyMediaPlayer.d.mts +102 -109
- package/dist/v1/libs/TinyMediaPlayer.mjs +5 -3
- package/dist/v1/libs/TinyNeedBar.d.mts +25 -37
- package/dist/v1/libs/TinyNewWinEvents.d.mts +29 -32
- package/dist/v1/libs/TinyNotifications.d.mts +6 -6
- package/dist/v1/libs/TinyNotifyCenter.d.mts +15 -21
- package/dist/v1/libs/TinyPromiseQueue.d.mts +11 -11
- package/dist/v1/libs/TinyRadioFm.cjs +32 -12
- package/dist/v1/libs/TinyRadioFm.d.mts +44 -80
- package/dist/v1/libs/TinyRadioFm.mjs +29 -12
- package/dist/v1/libs/TinyRateLimiter.d.mts +26 -39
- package/dist/v1/libs/TinySimpleDice.d.mts +17 -36
- package/dist/v1/libs/TinySmartScroller.d.mts +50 -60
- package/dist/v1/libs/TinyTextDiffer.d.mts +11 -14
- package/dist/v1/libs/TinyTextRangeEditor.d.mts +8 -8
- package/dist/v1/libs/TinyTextarea.d.mts +31 -31
- package/dist/v1/libs/TinyTimeout.d.mts +14 -14
- package/dist/v1/libs/TinyToastNotify.cjs +1 -1
- package/dist/v1/libs/TinyToastNotify.d.mts +15 -23
- package/dist/v1/libs/TinyToastNotify.mjs +1 -1
- package/dist/v1/libs/TinyUploadClicker.d.mts +38 -14
- package/dist/v1/libs/UltraRandomMsgGen.d.mts +44 -84
- package/dist/v1/libs/utils.d.mts +5 -1
- package/docs/v1/basics/deprecated/objFilter.md +14 -0
- package/docs/v1/basics/objFilter.md +31 -17
- package/package.json +2 -2
|
@@ -19,14 +19,13 @@ class TinyHtmlScript extends TinyHtmlTemplate {
|
|
|
19
19
|
* @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes.
|
|
20
20
|
* @param {string} [config.mainClass=""] - Main CSS class.
|
|
21
21
|
* @param {string} [config.content=""] - Inline script content (ignored if src is provided).
|
|
22
|
-
* @param {string
|
|
22
|
+
* @param {string[]} [config.blocking] - Space-separated list of blocking tokens (currently only "render").
|
|
23
23
|
* @param {"anonymous" | "use-credentials"} [config.crossorigin] - CORS setting ("anonymous" or "use-credentials").
|
|
24
24
|
* @param {"auto"|"high"|"low"} [config.fetchpriority="auto"] - Fetch priority.
|
|
25
25
|
* @param {string} [config.integrity] - Subresource integrity hash (only valid with src).
|
|
26
26
|
* @param {boolean} [config.nomodule=false] - Whether to prevent execution in browsers supporting modules.
|
|
27
27
|
* @param {string} [config.nonce] - Cryptographic nonce for CSP.
|
|
28
28
|
* @param {string} [config.referrerpolicy] - Referrer policy.
|
|
29
|
-
* @param {boolean|string|string[]} [config.attributionsrc] - Boolean or list of URLs for attribution reporting.
|
|
30
29
|
*/
|
|
31
30
|
constructor({
|
|
32
31
|
src,
|
|
@@ -43,7 +42,6 @@ class TinyHtmlScript extends TinyHtmlTemplate {
|
|
|
43
42
|
nomodule = false,
|
|
44
43
|
nonce,
|
|
45
44
|
referrerpolicy,
|
|
46
|
-
attributionsrc,
|
|
47
45
|
} = {}) {
|
|
48
46
|
super(document.createElement('script'), tags, mainClass);
|
|
49
47
|
|
|
@@ -58,7 +56,6 @@ class TinyHtmlScript extends TinyHtmlTemplate {
|
|
|
58
56
|
this.nomodule = nomodule;
|
|
59
57
|
if (nonce !== undefined) this.nonce = nonce;
|
|
60
58
|
if (referrerpolicy !== undefined) this.referrerpolicy = referrerpolicy;
|
|
61
|
-
if (attributionsrc !== undefined) this.attributionsrc = attributionsrc;
|
|
62
59
|
|
|
63
60
|
if (!src && content) this.content = content;
|
|
64
61
|
}
|
|
@@ -107,13 +104,12 @@ class TinyHtmlScript extends TinyHtmlTemplate {
|
|
|
107
104
|
return this.hasProp('defer');
|
|
108
105
|
}
|
|
109
106
|
|
|
110
|
-
/** @param {string
|
|
107
|
+
/** @param {string[]} blocking */
|
|
111
108
|
set blocking(blocking) {
|
|
112
|
-
const
|
|
113
|
-
for (const v of values) {
|
|
109
|
+
for (const v of blocking) {
|
|
114
110
|
if (v !== 'render') throw new Error(`TinyHtmlScript: invalid blocking token "${v}".`);
|
|
115
111
|
}
|
|
116
|
-
this.setAttr('blocking',
|
|
112
|
+
this.setAttr('blocking', blocking.join(' '));
|
|
117
113
|
}
|
|
118
114
|
/** @returns {string[]|null} */
|
|
119
115
|
get blocking() {
|
|
@@ -187,28 +183,6 @@ class TinyHtmlScript extends TinyHtmlTemplate {
|
|
|
187
183
|
return this.attrString('referrerpolicy');
|
|
188
184
|
}
|
|
189
185
|
|
|
190
|
-
/** @param {boolean|string|string[]} attributionsrc */
|
|
191
|
-
set attributionsrc(attributionsrc) {
|
|
192
|
-
if (attributionsrc === true) {
|
|
193
|
-
this.addProp('attributionsrc');
|
|
194
|
-
} else if (typeof attributionsrc === 'string') {
|
|
195
|
-
this.setAttr('attributionsrc', attributionsrc);
|
|
196
|
-
} else if (
|
|
197
|
-
Array.isArray(attributionsrc) &&
|
|
198
|
-
attributionsrc.every((v) => typeof v === 'string')
|
|
199
|
-
) {
|
|
200
|
-
this.setAttr('attributionsrc', attributionsrc.join(' '));
|
|
201
|
-
} else {
|
|
202
|
-
throw new TypeError('TinyHtmlScript: "attributionsrc" must be boolean, string, or string[].');
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
/** @returns {boolean|string[]|null} */
|
|
206
|
-
get attributionsrc() {
|
|
207
|
-
if (this.hasProp('attributionsrc')) return true;
|
|
208
|
-
const val = this.attrString('attributionsrc');
|
|
209
|
-
return val ? val.split(/\s+/) : null;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
186
|
/** @param {string} code */
|
|
213
187
|
set content(code) {
|
|
214
188
|
if (typeof code !== 'string')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
|
|
2
2
|
/**
|
|
3
3
|
* TinyHtmlScript is a helper class for creating and managing <script> elements.
|
|
4
4
|
* Supports both inline and external scripts, with attributes for async, defer, modules, etc.
|
|
@@ -16,31 +16,29 @@ declare class TinyHtmlScript extends TinyHtmlTemplate<HTMLScriptElement> {
|
|
|
16
16
|
* @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes.
|
|
17
17
|
* @param {string} [config.mainClass=""] - Main CSS class.
|
|
18
18
|
* @param {string} [config.content=""] - Inline script content (ignored if src is provided).
|
|
19
|
-
* @param {string
|
|
19
|
+
* @param {string[]} [config.blocking] - Space-separated list of blocking tokens (currently only "render").
|
|
20
20
|
* @param {"anonymous" | "use-credentials"} [config.crossorigin] - CORS setting ("anonymous" or "use-credentials").
|
|
21
21
|
* @param {"auto"|"high"|"low"} [config.fetchpriority="auto"] - Fetch priority.
|
|
22
22
|
* @param {string} [config.integrity] - Subresource integrity hash (only valid with src).
|
|
23
23
|
* @param {boolean} [config.nomodule=false] - Whether to prevent execution in browsers supporting modules.
|
|
24
24
|
* @param {string} [config.nonce] - Cryptographic nonce for CSP.
|
|
25
25
|
* @param {string} [config.referrerpolicy] - Referrer policy.
|
|
26
|
-
* @param {boolean|string|string[]} [config.attributionsrc] - Boolean or list of URLs for attribution reporting.
|
|
27
26
|
*/
|
|
28
|
-
constructor({ src, type, async, defer, tags, mainClass, content, blocking, crossorigin, fetchpriority, integrity, nomodule, nonce, referrerpolicy,
|
|
29
|
-
src?: string
|
|
30
|
-
type?: string
|
|
31
|
-
async?: boolean
|
|
32
|
-
defer?: boolean
|
|
33
|
-
tags?: string | string[] | Set<string
|
|
34
|
-
mainClass?: string
|
|
35
|
-
content?: string
|
|
36
|
-
blocking?: string
|
|
37
|
-
crossorigin?: "anonymous" | "use-credentials"
|
|
38
|
-
fetchpriority?: "auto" | "high" | "low"
|
|
39
|
-
integrity?: string
|
|
40
|
-
nomodule?: boolean
|
|
41
|
-
nonce?: string
|
|
42
|
-
referrerpolicy?: string
|
|
43
|
-
attributionsrc?: string | boolean | string[] | undefined;
|
|
27
|
+
constructor({ src, type, async, defer, tags, mainClass, content, blocking, crossorigin, fetchpriority, integrity, nomodule, nonce, referrerpolicy, }?: {
|
|
28
|
+
src?: string;
|
|
29
|
+
type?: string;
|
|
30
|
+
async?: boolean;
|
|
31
|
+
defer?: boolean;
|
|
32
|
+
tags?: string | string[] | Set<string>;
|
|
33
|
+
mainClass?: string;
|
|
34
|
+
content?: string;
|
|
35
|
+
blocking?: string[];
|
|
36
|
+
crossorigin?: "anonymous" | "use-credentials";
|
|
37
|
+
fetchpriority?: "auto" | "high" | "low";
|
|
38
|
+
integrity?: string;
|
|
39
|
+
nomodule?: boolean;
|
|
40
|
+
nonce?: string;
|
|
41
|
+
referrerpolicy?: string;
|
|
44
42
|
});
|
|
45
43
|
/** @param {string} src */
|
|
46
44
|
set src(src: string);
|
|
@@ -58,8 +56,8 @@ declare class TinyHtmlScript extends TinyHtmlTemplate<HTMLScriptElement> {
|
|
|
58
56
|
set defer(defer: boolean);
|
|
59
57
|
/** @returns {boolean} */
|
|
60
58
|
get defer(): boolean;
|
|
61
|
-
/** @param {string
|
|
62
|
-
set blocking(blocking: string
|
|
59
|
+
/** @param {string[]} blocking */
|
|
60
|
+
set blocking(blocking: string[]);
|
|
63
61
|
/** @returns {string[]|null} */
|
|
64
62
|
get blocking(): string[] | null;
|
|
65
63
|
/** @param {"anonymous"|"use-credentials"} crossorigin */
|
|
@@ -86,14 +84,10 @@ declare class TinyHtmlScript extends TinyHtmlTemplate<HTMLScriptElement> {
|
|
|
86
84
|
set referrerpolicy(referrerpolicy: string);
|
|
87
85
|
/** @returns {string|null} */
|
|
88
86
|
get referrerpolicy(): string | null;
|
|
89
|
-
/** @param {boolean|string|string[]} attributionsrc */
|
|
90
|
-
set attributionsrc(attributionsrc: boolean | string | string[]);
|
|
91
|
-
/** @returns {boolean|string[]|null} */
|
|
92
|
-
get attributionsrc(): boolean | string[] | null;
|
|
93
87
|
/** @param {string} code */
|
|
94
88
|
set content(code: string);
|
|
95
89
|
/** @returns {string|null} */
|
|
96
90
|
get content(): string | null;
|
|
97
91
|
}
|
|
98
|
-
|
|
92
|
+
export default TinyHtmlScript;
|
|
99
93
|
//# sourceMappingURL=TinyHtmlScript.d.mts.map
|
|
@@ -16,16 +16,15 @@ class TinyHtmlScript extends TinyHtmlTemplate {
|
|
|
16
16
|
* @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes.
|
|
17
17
|
* @param {string} [config.mainClass=""] - Main CSS class.
|
|
18
18
|
* @param {string} [config.content=""] - Inline script content (ignored if src is provided).
|
|
19
|
-
* @param {string
|
|
19
|
+
* @param {string[]} [config.blocking] - Space-separated list of blocking tokens (currently only "render").
|
|
20
20
|
* @param {"anonymous" | "use-credentials"} [config.crossorigin] - CORS setting ("anonymous" or "use-credentials").
|
|
21
21
|
* @param {"auto"|"high"|"low"} [config.fetchpriority="auto"] - Fetch priority.
|
|
22
22
|
* @param {string} [config.integrity] - Subresource integrity hash (only valid with src).
|
|
23
23
|
* @param {boolean} [config.nomodule=false] - Whether to prevent execution in browsers supporting modules.
|
|
24
24
|
* @param {string} [config.nonce] - Cryptographic nonce for CSP.
|
|
25
25
|
* @param {string} [config.referrerpolicy] - Referrer policy.
|
|
26
|
-
* @param {boolean|string|string[]} [config.attributionsrc] - Boolean or list of URLs for attribution reporting.
|
|
27
26
|
*/
|
|
28
|
-
constructor({ src, type, async = false, defer = false, tags = [], mainClass = '', content = '', blocking, crossorigin, fetchpriority = 'auto', integrity, nomodule = false, nonce, referrerpolicy,
|
|
27
|
+
constructor({ src, type, async = false, defer = false, tags = [], mainClass = '', content = '', blocking, crossorigin, fetchpriority = 'auto', integrity, nomodule = false, nonce, referrerpolicy, } = {}) {
|
|
29
28
|
super(document.createElement('script'), tags, mainClass);
|
|
30
29
|
if (src !== undefined)
|
|
31
30
|
this.src = src;
|
|
@@ -45,8 +44,6 @@ class TinyHtmlScript extends TinyHtmlTemplate {
|
|
|
45
44
|
this.nonce = nonce;
|
|
46
45
|
if (referrerpolicy !== undefined)
|
|
47
46
|
this.referrerpolicy = referrerpolicy;
|
|
48
|
-
if (attributionsrc !== undefined)
|
|
49
|
-
this.attributionsrc = attributionsrc;
|
|
50
47
|
if (!src && content)
|
|
51
48
|
this.content = content;
|
|
52
49
|
}
|
|
@@ -94,14 +91,13 @@ class TinyHtmlScript extends TinyHtmlTemplate {
|
|
|
94
91
|
get defer() {
|
|
95
92
|
return this.hasProp('defer');
|
|
96
93
|
}
|
|
97
|
-
/** @param {string
|
|
94
|
+
/** @param {string[]} blocking */
|
|
98
95
|
set blocking(blocking) {
|
|
99
|
-
const
|
|
100
|
-
for (const v of values) {
|
|
96
|
+
for (const v of blocking) {
|
|
101
97
|
if (v !== 'render')
|
|
102
98
|
throw new Error(`TinyHtmlScript: invalid blocking token "${v}".`);
|
|
103
99
|
}
|
|
104
|
-
this.setAttr('blocking',
|
|
100
|
+
this.setAttr('blocking', blocking.join(' '));
|
|
105
101
|
}
|
|
106
102
|
/** @returns {string[]|null} */
|
|
107
103
|
get blocking() {
|
|
@@ -170,29 +166,6 @@ class TinyHtmlScript extends TinyHtmlTemplate {
|
|
|
170
166
|
get referrerpolicy() {
|
|
171
167
|
return this.attrString('referrerpolicy');
|
|
172
168
|
}
|
|
173
|
-
/** @param {boolean|string|string[]} attributionsrc */
|
|
174
|
-
set attributionsrc(attributionsrc) {
|
|
175
|
-
if (attributionsrc === true) {
|
|
176
|
-
this.addProp('attributionsrc');
|
|
177
|
-
}
|
|
178
|
-
else if (typeof attributionsrc === 'string') {
|
|
179
|
-
this.setAttr('attributionsrc', attributionsrc);
|
|
180
|
-
}
|
|
181
|
-
else if (Array.isArray(attributionsrc) &&
|
|
182
|
-
attributionsrc.every((v) => typeof v === 'string')) {
|
|
183
|
-
this.setAttr('attributionsrc', attributionsrc.join(' '));
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
throw new TypeError('TinyHtmlScript: "attributionsrc" must be boolean, string, or string[].');
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
/** @returns {boolean|string[]|null} */
|
|
190
|
-
get attributionsrc() {
|
|
191
|
-
if (this.hasProp('attributionsrc'))
|
|
192
|
-
return true;
|
|
193
|
-
const val = this.attrString('attributionsrc');
|
|
194
|
-
return val ? val.split(/\s+/) : null;
|
|
195
|
-
}
|
|
196
169
|
/** @param {string} code */
|
|
197
170
|
set content(code) {
|
|
198
171
|
if (typeof code !== 'string')
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import TinyHtml from '../TinyHtml.mjs';
|
|
2
|
+
import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
|
|
2
3
|
/**
|
|
3
4
|
* TinyHtmlSelect is a helper class for managing <select> elements.
|
|
4
5
|
* It supports all standard attributes (multiple, autocomplete, autofocus, disabled, etc.)
|
|
@@ -66,22 +67,22 @@ declare class TinyHtmlSelect extends TinyHtmlTemplate<HTMLSelectElement> {
|
|
|
66
67
|
* A primary CSS class name to be applied to the select element.
|
|
67
68
|
*/
|
|
68
69
|
constructor({ options, multiple, autocomplete, autofocus, disabled, form, name, required, size, tags, mainClass, }?: {
|
|
69
|
-
options?: {
|
|
70
|
+
options?: Array<{
|
|
70
71
|
value: string;
|
|
71
72
|
label: string | Element | TinyHtml<any>;
|
|
72
73
|
selected?: boolean;
|
|
73
74
|
allowHtml?: boolean;
|
|
74
|
-
}
|
|
75
|
-
multiple?: boolean
|
|
76
|
-
autocomplete?: string
|
|
77
|
-
autofocus?: boolean
|
|
78
|
-
disabled?: boolean
|
|
79
|
-
form?: string
|
|
80
|
-
name?: string
|
|
81
|
-
required?: boolean
|
|
82
|
-
size?: number
|
|
83
|
-
tags?: string | string[] | Set<string
|
|
84
|
-
mainClass?: string
|
|
75
|
+
}>;
|
|
76
|
+
multiple?: boolean;
|
|
77
|
+
autocomplete?: string;
|
|
78
|
+
autofocus?: boolean;
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
form?: string;
|
|
81
|
+
name?: string;
|
|
82
|
+
required?: boolean;
|
|
83
|
+
size?: number;
|
|
84
|
+
tags?: string | string[] | Set<string>;
|
|
85
|
+
mainClass?: string;
|
|
85
86
|
});
|
|
86
87
|
/** @param {boolean} multiple */
|
|
87
88
|
set multiple(multiple: boolean);
|
|
@@ -126,14 +127,14 @@ declare class TinyHtmlSelect extends TinyHtmlTemplate<HTMLSelectElement> {
|
|
|
126
127
|
selected?: boolean;
|
|
127
128
|
allowHtml?: boolean;
|
|
128
129
|
}): this;
|
|
129
|
-
/** @param {string} val */
|
|
130
|
-
set value(val: string);
|
|
131
130
|
/** @returns {string} */
|
|
132
131
|
get value(): string;
|
|
133
|
-
/** @param {string
|
|
134
|
-
set
|
|
132
|
+
/** @param {string} val */
|
|
133
|
+
set value(val: string);
|
|
135
134
|
/** @returns {string[]} */
|
|
136
135
|
get values(): string[];
|
|
136
|
+
/** @param {string[]} vals */
|
|
137
|
+
set values(vals: string[]);
|
|
137
138
|
/**
|
|
138
139
|
* Internal: apply selection to options.
|
|
139
140
|
* @param {string|string[]} value
|
|
@@ -141,6 +142,5 @@ declare class TinyHtmlSelect extends TinyHtmlTemplate<HTMLSelectElement> {
|
|
|
141
142
|
*/
|
|
142
143
|
setValue(value: string | string[]): this;
|
|
143
144
|
}
|
|
144
|
-
|
|
145
|
-
import TinyHtml from '../TinyHtml.mjs';
|
|
145
|
+
export default TinyHtmlSelect;
|
|
146
146
|
//# sourceMappingURL=TinyHtmlSelect.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
|
|
2
2
|
/**
|
|
3
3
|
* TinyHtmlStyle is a lightweight helper class for managing <style> elements.
|
|
4
4
|
* It provides a simple API to configure attributes like `media`, `nonce`,
|
|
@@ -25,12 +25,12 @@ declare class TinyHtmlStyle extends TinyHtmlTemplate<HTMLStyleElement> {
|
|
|
25
25
|
* @param {string} [config.mainClass=""] - Main CSS class to apply.
|
|
26
26
|
*/
|
|
27
27
|
constructor({ blocking, media, nonce, title, tags, mainClass }?: {
|
|
28
|
-
blocking?: string
|
|
29
|
-
media?: string
|
|
30
|
-
nonce?: string
|
|
31
|
-
title?: string
|
|
32
|
-
tags?: string | string[] | Set<string
|
|
33
|
-
mainClass?: string
|
|
28
|
+
blocking?: string;
|
|
29
|
+
media?: string;
|
|
30
|
+
nonce?: string;
|
|
31
|
+
title?: string;
|
|
32
|
+
tags?: string | string[] | Set<string>;
|
|
33
|
+
mainClass?: string;
|
|
34
34
|
});
|
|
35
35
|
/** @param {string} blocking */
|
|
36
36
|
set blocking(blocking: string);
|
|
@@ -53,5 +53,5 @@ declare class TinyHtmlStyle extends TinyHtmlTemplate<HTMLStyleElement> {
|
|
|
53
53
|
/** @returns {string} */
|
|
54
54
|
get content(): string;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
export default TinyHtmlStyle;
|
|
57
57
|
//# sourceMappingURL=TinyHtmlStyle.d.mts.map
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Represents a set of CSS classes that can be applied to an element.
|
|
4
|
-
* - Can be a single class name string.
|
|
5
|
-
* - Can be an array of class name strings.
|
|
6
|
-
* - Can be a Set of class name strings.
|
|
7
|
-
*/
|
|
1
|
+
import TinyHtml from '../TinyHtml.mjs';
|
|
8
2
|
export type ClassSetter = string | string[] | Set<string>;
|
|
9
3
|
/**
|
|
10
4
|
* @typedef {string|string[]|Set<string>} ClassSetter
|
|
@@ -29,19 +23,7 @@ export type ClassSetter = string | string[] | Set<string>;
|
|
|
29
23
|
* @extends TinyHtml<TinyHtmlT>
|
|
30
24
|
*/
|
|
31
25
|
declare class TinyHtmlTemplate<TinyHtmlT extends Element> extends TinyHtml<TinyHtmlT> {
|
|
32
|
-
|
|
33
|
-
* Ensures a given value is a valid ClassSetter.
|
|
34
|
-
* @param {ClassSetter} value
|
|
35
|
-
* @returns {Set<string>}
|
|
36
|
-
*/
|
|
37
|
-
static #normalizeClasses(value: ClassSetter): Set<string>;
|
|
38
|
-
/**
|
|
39
|
-
* Creates a new TinyHtmlTemplate instance.
|
|
40
|
-
* @param {TinyHtmlT} tag - The HTML tag name to create (e.g., 'div', 'span').
|
|
41
|
-
* @param {ClassSetter} [tags=[]] - Initial CSS classes to apply.
|
|
42
|
-
* @param {ClassSetter} [mainClass=[]] - Main CSS classes to apply.
|
|
43
|
-
*/
|
|
44
|
-
constructor(tag: TinyHtmlT, tags?: ClassSetter, mainClass?: ClassSetter);
|
|
26
|
+
#private;
|
|
45
27
|
/** @returns {TinyHtmlT} */
|
|
46
28
|
get el(): TinyHtmlT;
|
|
47
29
|
/**
|
|
@@ -49,6 +31,11 @@ declare class TinyHtmlTemplate<TinyHtmlT extends Element> extends TinyHtml<TinyH
|
|
|
49
31
|
* @returns {string[]}
|
|
50
32
|
*/
|
|
51
33
|
get fullClass(): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Gets the current list of CSS classes applied to this element.
|
|
36
|
+
* @returns {string[]}
|
|
37
|
+
*/
|
|
38
|
+
get classes(): string[];
|
|
52
39
|
/**
|
|
53
40
|
* Sets the list of CSS classes applied to this element.
|
|
54
41
|
* Automatically updates the element's `className` attribute.
|
|
@@ -56,10 +43,11 @@ declare class TinyHtmlTemplate<TinyHtmlT extends Element> extends TinyHtml<TinyH
|
|
|
56
43
|
*/
|
|
57
44
|
set classes(value: ClassSetter);
|
|
58
45
|
/**
|
|
59
|
-
* Gets the
|
|
46
|
+
* Gets the main CSS class applied to this element.
|
|
47
|
+
* This class is always present in addition to the regular classes.
|
|
60
48
|
* @returns {string[]}
|
|
61
49
|
*/
|
|
62
|
-
get
|
|
50
|
+
get mainClass(): string[];
|
|
63
51
|
/**
|
|
64
52
|
* Sets the main CSS class applied to this element.
|
|
65
53
|
* Automatically updates the element's `className` attribute.
|
|
@@ -67,11 +55,12 @@ declare class TinyHtmlTemplate<TinyHtmlT extends Element> extends TinyHtml<TinyH
|
|
|
67
55
|
*/
|
|
68
56
|
set mainClass(value: ClassSetter);
|
|
69
57
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* @
|
|
58
|
+
* Creates a new TinyHtmlTemplate instance.
|
|
59
|
+
* @param {TinyHtmlT} tag - The HTML tag name to create (e.g., 'div', 'span').
|
|
60
|
+
* @param {ClassSetter} [tags=[]] - Initial CSS classes to apply.
|
|
61
|
+
* @param {ClassSetter} [mainClass=[]] - Main CSS classes to apply.
|
|
73
62
|
*/
|
|
74
|
-
|
|
63
|
+
constructor(tag: TinyHtmlT, tags?: ClassSetter, mainClass?: ClassSetter);
|
|
75
64
|
/**
|
|
76
65
|
* Add one or more CSS classes to the element.
|
|
77
66
|
* @param {...string|string[]} tags
|
|
@@ -90,12 +79,21 @@ declare class TinyHtmlTemplate<TinyHtmlT extends Element> extends TinyHtml<TinyH
|
|
|
90
79
|
* @returns {this}
|
|
91
80
|
*/
|
|
92
81
|
toggleClass(tag: string): this;
|
|
82
|
+
/**
|
|
83
|
+
* Replaces an existing CSS class with a new one.
|
|
84
|
+
* Behaves like DOMTokenList.replace:
|
|
85
|
+
* - Only replaces if oldClass exists.
|
|
86
|
+
* - Returns true if replacement occurred, false otherwise.
|
|
87
|
+
* @param {string} oldClass - The class to replace.
|
|
88
|
+
* @param {string} newClass - The new class to add.
|
|
89
|
+
* @returns {boolean} True if the replacement occurred, false otherwise.
|
|
90
|
+
*/
|
|
91
|
+
replaceClass(oldClass: string, newClass: string): boolean;
|
|
93
92
|
/**
|
|
94
93
|
* Clears all CSS classes from the element.
|
|
95
94
|
* @returns {this}
|
|
96
95
|
*/
|
|
97
96
|
resetClasses(): this;
|
|
98
|
-
#private;
|
|
99
97
|
}
|
|
100
|
-
|
|
98
|
+
export default TinyHtmlTemplate;
|
|
101
99
|
//# sourceMappingURL=TinyHtmlTemplate.d.mts.map
|
|
@@ -27,7 +27,7 @@ class TinyHtmlTextarea extends TinyHtmlTemplate {
|
|
|
27
27
|
* @param {string} [config.placeholder] - Placeholder text.
|
|
28
28
|
* @param {'none'|'sentences'|'words'|'characters'|'on'|'off'} [config.autocapitalize] - Controls automatic capitalization.
|
|
29
29
|
* @param {string} [config.autocomplete] - Autocomplete behavior ("on", "off", or token list).
|
|
30
|
-
* @param {
|
|
30
|
+
* @param {boolean} [config.autocorrect] - Autocorrect behavior ("on" or "off").
|
|
31
31
|
* @param {boolean} [config.autofocus=false] - Whether the textarea should autofocus on load.
|
|
32
32
|
* @param {string} [config.dirname] - Directionality of submitted text.
|
|
33
33
|
* @param {boolean} [config.disabled=false] - Whether the textarea is disabled.
|
|
@@ -37,7 +37,7 @@ class TinyHtmlTextarea extends TinyHtmlTemplate {
|
|
|
37
37
|
* @param {string} [config.name] - The name of the control.
|
|
38
38
|
* @param {boolean} [config.readonly=false] - Whether the textarea is read-only.
|
|
39
39
|
* @param {boolean} [config.required=false] - Whether the textarea is required.
|
|
40
|
-
* @param {
|
|
40
|
+
* @param {boolean|"default"} [config.spellcheck] - Spellcheck behavior.
|
|
41
41
|
* @param {"hard"|"soft"|"off"} [config.wrap] - Wrapping behavior.
|
|
42
42
|
* @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes.
|
|
43
43
|
* @param {string} [config.mainClass=''] - Main CSS class.
|
|
@@ -177,15 +177,12 @@ class TinyHtmlTextarea extends TinyHtmlTemplate {
|
|
|
177
177
|
return this.attrString('autocomplete');
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
/** @param {
|
|
180
|
+
/** @param {boolean} autocorrect */
|
|
181
181
|
set autocorrect(autocorrect) {
|
|
182
|
-
if (typeof autocorrect
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (!['on', 'off'].includes(autocorrect))
|
|
187
|
-
throw new TypeError('TinyTextarea: "autocorrect" must be "on" or "off".');
|
|
188
|
-
this.setAttr('autocorrect', autocorrect);
|
|
182
|
+
if (typeof autocorrect !== 'boolean')
|
|
183
|
+
throw new TypeError('TinyTextarea: "autocorrect" must be "true" or "false".');
|
|
184
|
+
this.setAttr('autocorrect', autocorrect ? 'on' : 'off');
|
|
185
|
+
return;
|
|
189
186
|
}
|
|
190
187
|
|
|
191
188
|
/** @returns {boolean|null} */
|
|
@@ -302,16 +299,18 @@ class TinyHtmlTextarea extends TinyHtmlTemplate {
|
|
|
302
299
|
return this.hasProp('required');
|
|
303
300
|
}
|
|
304
301
|
|
|
305
|
-
/** @param {
|
|
302
|
+
/** @param {boolean|'default'} spellcheck */
|
|
306
303
|
set spellcheck(spellcheck) {
|
|
307
|
-
if (![true, false, '
|
|
304
|
+
if (![true, false, 'default'].includes(spellcheck))
|
|
308
305
|
throw new TypeError('TinyTextarea: "spellcheck" must be "true", "false" or "default".');
|
|
309
|
-
this.setAttr('spellcheck', spellcheck);
|
|
306
|
+
this.setAttr('spellcheck', typeof spellcheck === 'boolean' ? String(spellcheck) : spellcheck);
|
|
310
307
|
}
|
|
311
308
|
|
|
312
|
-
/** @returns {
|
|
309
|
+
/** @returns {boolean|'default'|null} */
|
|
313
310
|
get spellcheck() {
|
|
314
|
-
|
|
311
|
+
const value = this.attrString('spellcheck');
|
|
312
|
+
if (typeof value === 'boolean' || value === 'default') return value;
|
|
313
|
+
return null;
|
|
315
314
|
}
|
|
316
315
|
|
|
317
316
|
/** @param {'hard'|'soft'|'off'} wrap */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import TinyHtmlTemplate from './TinyHtmlTemplate.mjs';
|
|
2
2
|
/**
|
|
3
3
|
* TinyTextarea is a helper class for managing <textarea> elements.
|
|
4
4
|
* It allows configuring all standard attributes such as rows, cols, placeholder,
|
|
@@ -24,7 +24,7 @@ declare class TinyHtmlTextarea extends TinyHtmlTemplate<HTMLTextAreaElement> {
|
|
|
24
24
|
* @param {string} [config.placeholder] - Placeholder text.
|
|
25
25
|
* @param {'none'|'sentences'|'words'|'characters'|'on'|'off'} [config.autocapitalize] - Controls automatic capitalization.
|
|
26
26
|
* @param {string} [config.autocomplete] - Autocomplete behavior ("on", "off", or token list).
|
|
27
|
-
* @param {
|
|
27
|
+
* @param {boolean} [config.autocorrect] - Autocorrect behavior ("on" or "off").
|
|
28
28
|
* @param {boolean} [config.autofocus=false] - Whether the textarea should autofocus on load.
|
|
29
29
|
* @param {string} [config.dirname] - Directionality of submitted text.
|
|
30
30
|
* @param {boolean} [config.disabled=false] - Whether the textarea is disabled.
|
|
@@ -34,33 +34,33 @@ declare class TinyHtmlTextarea extends TinyHtmlTemplate<HTMLTextAreaElement> {
|
|
|
34
34
|
* @param {string} [config.name] - The name of the control.
|
|
35
35
|
* @param {boolean} [config.readonly=false] - Whether the textarea is read-only.
|
|
36
36
|
* @param {boolean} [config.required=false] - Whether the textarea is required.
|
|
37
|
-
* @param {
|
|
37
|
+
* @param {boolean|"default"} [config.spellcheck] - Spellcheck behavior.
|
|
38
38
|
* @param {"hard"|"soft"|"off"} [config.wrap] - Wrapping behavior.
|
|
39
39
|
* @param {string|string[]|Set<string>} [config.tags=[]] - Initial CSS classes.
|
|
40
40
|
* @param {string} [config.mainClass=''] - Main CSS class.
|
|
41
41
|
* @throws {TypeError} If any attribute is of the wrong type.
|
|
42
42
|
*/
|
|
43
43
|
constructor({ value, rows, cols, placeholder, autocapitalize, autocomplete, autocorrect, autofocus, dirname, disabled, form, maxlength, minlength, name, readonly, required, spellcheck, wrap, tags, mainClass, }?: {
|
|
44
|
-
value?: string
|
|
45
|
-
rows?: number
|
|
46
|
-
cols?: number
|
|
47
|
-
placeholder?: string
|
|
48
|
-
autocapitalize?:
|
|
49
|
-
autocomplete?: string
|
|
50
|
-
autocorrect?: boolean
|
|
51
|
-
autofocus?: boolean
|
|
52
|
-
dirname?: string
|
|
53
|
-
disabled?: boolean
|
|
54
|
-
form?: string
|
|
55
|
-
maxlength?: number
|
|
56
|
-
minlength?: number
|
|
57
|
-
name?: string
|
|
58
|
-
readonly?: boolean
|
|
59
|
-
required?: boolean
|
|
60
|
-
spellcheck?: boolean | "
|
|
61
|
-
wrap?: "
|
|
62
|
-
tags?: string | string[] | Set<string
|
|
63
|
-
mainClass?: string
|
|
44
|
+
value?: string;
|
|
45
|
+
rows?: number;
|
|
46
|
+
cols?: number;
|
|
47
|
+
placeholder?: string;
|
|
48
|
+
autocapitalize?: 'none' | 'sentences' | 'words' | 'characters' | 'on' | 'off';
|
|
49
|
+
autocomplete?: string;
|
|
50
|
+
autocorrect?: boolean;
|
|
51
|
+
autofocus?: boolean;
|
|
52
|
+
dirname?: string;
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
form?: string;
|
|
55
|
+
maxlength?: number;
|
|
56
|
+
minlength?: number;
|
|
57
|
+
name?: string;
|
|
58
|
+
readonly?: boolean;
|
|
59
|
+
required?: boolean;
|
|
60
|
+
spellcheck?: boolean | "default";
|
|
61
|
+
wrap?: "hard" | "soft" | "off";
|
|
62
|
+
tags?: string | string[] | Set<string>;
|
|
63
|
+
mainClass?: string;
|
|
64
64
|
});
|
|
65
65
|
/** @param {string} value */
|
|
66
66
|
set value(value: string);
|
|
@@ -79,15 +79,15 @@ declare class TinyHtmlTextarea extends TinyHtmlTemplate<HTMLTextAreaElement> {
|
|
|
79
79
|
/** @returns {string|null} */
|
|
80
80
|
get placeholder(): string | null;
|
|
81
81
|
/** @param {'none'|'sentences'|'words'|'characters'|'on'|'off'} autocapitalize */
|
|
82
|
-
set autocapitalize(autocapitalize:
|
|
82
|
+
set autocapitalize(autocapitalize: 'none' | 'sentences' | 'words' | 'characters' | 'on' | 'off');
|
|
83
83
|
/** @returns {string|null} */
|
|
84
84
|
get autocapitalize(): string | null;
|
|
85
85
|
/** @param {string} autocomplete */
|
|
86
86
|
set autocomplete(autocomplete: string);
|
|
87
87
|
/** @returns {string|null} */
|
|
88
88
|
get autocomplete(): string | null;
|
|
89
|
-
/** @param {
|
|
90
|
-
set autocorrect(autocorrect:
|
|
89
|
+
/** @param {boolean} autocorrect */
|
|
90
|
+
set autocorrect(autocorrect: boolean);
|
|
91
91
|
/** @returns {boolean|null} */
|
|
92
92
|
get autocorrect(): boolean | null;
|
|
93
93
|
/** @param {boolean} autofocus */
|
|
@@ -126,14 +126,14 @@ declare class TinyHtmlTextarea extends TinyHtmlTemplate<HTMLTextAreaElement> {
|
|
|
126
126
|
set required(required: boolean);
|
|
127
127
|
/** @returns {boolean} */
|
|
128
128
|
get required(): boolean;
|
|
129
|
-
/** @param {
|
|
130
|
-
set spellcheck(spellcheck:
|
|
131
|
-
/** @returns {
|
|
132
|
-
get spellcheck():
|
|
129
|
+
/** @param {boolean|'default'} spellcheck */
|
|
130
|
+
set spellcheck(spellcheck: boolean | 'default');
|
|
131
|
+
/** @returns {boolean|'default'|null} */
|
|
132
|
+
get spellcheck(): boolean | 'default' | null;
|
|
133
133
|
/** @param {'hard'|'soft'|'off'} wrap */
|
|
134
|
-
set wrap(wrap:
|
|
134
|
+
set wrap(wrap: 'hard' | 'soft' | 'off');
|
|
135
135
|
/** @returns {string|null} */
|
|
136
136
|
get wrap(): string | null;
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
export default TinyHtmlTextarea;
|
|
139
139
|
//# sourceMappingURL=TinyHtmlTextarea.d.mts.map
|