tiny-essentials 1.21.3 → 1.21.5
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/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyHtml.min.js +1 -1
- package/dist/v1/TinySmartScroller.min.js +1 -1
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/libs/TinyHtml.cjs +314 -82
- package/dist/v1/libs/TinyHtml.d.mts +130 -20
- package/dist/v1/libs/TinyHtml.mjs +292 -82
- package/docs/v1/libs/TinyHtml.md +108 -0
- package/package.json +1 -1
|
@@ -1171,6 +1171,13 @@ declare class TinyHtml {
|
|
|
1171
1171
|
* @returns {TinyHtmlElement}
|
|
1172
1172
|
*/
|
|
1173
1173
|
static blur(el: TinyHtmlElement): TinyHtmlElement;
|
|
1174
|
+
/**
|
|
1175
|
+
* Select the text content of an input or textarea element.
|
|
1176
|
+
*
|
|
1177
|
+
* @param {TinyHtml|HTMLInputElement|HTMLTextAreaElement} el - The element or a selector string.
|
|
1178
|
+
* @returns {TinyHtml|HTMLInputElement|HTMLTextAreaElement}
|
|
1179
|
+
*/
|
|
1180
|
+
static select(el: TinyHtml | HTMLInputElement | HTMLTextAreaElement): TinyHtml | HTMLInputElement | HTMLTextAreaElement;
|
|
1174
1181
|
/**
|
|
1175
1182
|
* Interprets a value as a boolean `true` if it matches a common truthy representation.
|
|
1176
1183
|
*
|
|
@@ -1474,6 +1481,59 @@ declare class TinyHtml {
|
|
|
1474
1481
|
* @returns {string} The element's ID.
|
|
1475
1482
|
*/
|
|
1476
1483
|
static id(el: TinyElement): string;
|
|
1484
|
+
/**
|
|
1485
|
+
* Returns the BigInt content of the element.
|
|
1486
|
+
* @param {TinyElement} el - Target element.
|
|
1487
|
+
* @returns {bigint|null} The BigInt content or null if none.
|
|
1488
|
+
*/
|
|
1489
|
+
static toBigInt(el: TinyElement): bigint | null;
|
|
1490
|
+
/**
|
|
1491
|
+
* Set BigInt content of elements.
|
|
1492
|
+
* @param {TinyElement|TinyElement[]} el
|
|
1493
|
+
* @param {bigint} value
|
|
1494
|
+
* @returns {TinyElement|TinyElement[]}
|
|
1495
|
+
*/
|
|
1496
|
+
static setBigInt(el: TinyElement | TinyElement[], value: bigint): TinyElement | TinyElement[];
|
|
1497
|
+
/**
|
|
1498
|
+
* Returns the Date content of the element.
|
|
1499
|
+
* @param {TinyElement} el - Target element.
|
|
1500
|
+
* @returns {Date|null} The Date content or null if invalid.
|
|
1501
|
+
*/
|
|
1502
|
+
static toDate(el: TinyElement): Date | null;
|
|
1503
|
+
/**
|
|
1504
|
+
* Set Date content of elements.
|
|
1505
|
+
* @param {TinyElement|TinyElement[]} el
|
|
1506
|
+
* @param {Date} value
|
|
1507
|
+
* @returns {TinyElement|TinyElement[]}
|
|
1508
|
+
*/
|
|
1509
|
+
static setDate(el: TinyElement | TinyElement[], value: Date): TinyElement | TinyElement[];
|
|
1510
|
+
/**
|
|
1511
|
+
* Returns the JSON content of the element.
|
|
1512
|
+
* @param {TinyElement} el - Target element.
|
|
1513
|
+
* @returns {any|null} The parsed JSON content or null if invalid.
|
|
1514
|
+
*/
|
|
1515
|
+
static toJson(el: TinyElement): any | null;
|
|
1516
|
+
/**
|
|
1517
|
+
* Set JSON content of elements.
|
|
1518
|
+
* @param {TinyElement|TinyElement[]} el
|
|
1519
|
+
* @param {any} value
|
|
1520
|
+
* @param {number|string} [space] - Indentation level or string for formatting.
|
|
1521
|
+
* @returns {TinyElement|TinyElement[]}
|
|
1522
|
+
*/
|
|
1523
|
+
static setJson(el: TinyElement | TinyElement[], value: any, space?: number | string): TinyElement | TinyElement[];
|
|
1524
|
+
/**
|
|
1525
|
+
* Returns the number content of the element.
|
|
1526
|
+
* @param {TinyElement} el - Target element.
|
|
1527
|
+
* @returns {number|null} The text content or null if none.
|
|
1528
|
+
*/
|
|
1529
|
+
static toNumber(el: TinyElement): number | null;
|
|
1530
|
+
/**
|
|
1531
|
+
* Set number content of elements.
|
|
1532
|
+
* @param {TinyElement|TinyElement[]} el
|
|
1533
|
+
* @param {number} value
|
|
1534
|
+
* @returns {TinyElement|TinyElement[]}
|
|
1535
|
+
*/
|
|
1536
|
+
static setNumber(el: TinyElement | TinyElement[], value: number): TinyElement | TinyElement[];
|
|
1477
1537
|
/**
|
|
1478
1538
|
* Returns the text content of the element.
|
|
1479
1539
|
* @param {TinyElement} el - Target element.
|
|
@@ -1710,40 +1770,40 @@ declare class TinyHtml {
|
|
|
1710
1770
|
* Registers an event listener on the specified element.
|
|
1711
1771
|
*
|
|
1712
1772
|
* @param {TinyEventTarget|TinyEventTarget[]} el - The target to listen on.
|
|
1713
|
-
* @param {string}
|
|
1773
|
+
* @param {string|string[]} events - The event type (e.g. 'click', 'keydown').
|
|
1714
1774
|
* @param {EventListenerOrEventListenerObject|null} handler - The callback function to run on event.
|
|
1715
1775
|
* @param {EventRegistryOptions} [options] - Optional event listener options.
|
|
1716
1776
|
* @returns {TinyEventTarget|TinyEventTarget[]}
|
|
1717
1777
|
*/
|
|
1718
|
-
static on(el: TinyEventTarget | TinyEventTarget[],
|
|
1778
|
+
static on(el: TinyEventTarget | TinyEventTarget[], events: string | string[], handler: EventListenerOrEventListenerObject | null, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
|
|
1719
1779
|
/**
|
|
1720
1780
|
* Registers an event listener that runs only once, then is removed.
|
|
1721
1781
|
*
|
|
1722
1782
|
* @param {TinyEventTarget|TinyEventTarget[]} el - The target to listen on.
|
|
1723
|
-
* @param {string}
|
|
1783
|
+
* @param {string|string[]} events - The event type (e.g. 'click', 'keydown').
|
|
1724
1784
|
* @param {EventListenerOrEventListenerObject} handler - The callback function to run on event.
|
|
1725
1785
|
* @param {EventRegistryOptions} [options={}] - Optional event listener options.
|
|
1726
1786
|
* @returns {TinyEventTarget|TinyEventTarget[]}
|
|
1727
1787
|
*/
|
|
1728
|
-
static once(el: TinyEventTarget | TinyEventTarget[],
|
|
1788
|
+
static once(el: TinyEventTarget | TinyEventTarget[], events: string | string[], handler: EventListenerOrEventListenerObject, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
|
|
1729
1789
|
/**
|
|
1730
1790
|
* Removes a specific event listener from an element.
|
|
1731
1791
|
*
|
|
1732
1792
|
* @param {TinyEventTarget|TinyEventTarget[]} el - The target element.
|
|
1733
|
-
* @param {string}
|
|
1793
|
+
* @param {string|string[]} events - The event type.
|
|
1734
1794
|
* @param {EventListenerOrEventListenerObject|null} handler - The function originally bound to the event.
|
|
1735
1795
|
* @param {boolean|EventListenerOptions} [options] - Optional listener options.
|
|
1736
1796
|
* @returns {TinyEventTarget|TinyEventTarget[]}
|
|
1737
1797
|
*/
|
|
1738
|
-
static off(el: TinyEventTarget | TinyEventTarget[],
|
|
1798
|
+
static off(el: TinyEventTarget | TinyEventTarget[], events: string | string[], handler: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): TinyEventTarget | TinyEventTarget[];
|
|
1739
1799
|
/**
|
|
1740
1800
|
* Removes all event listeners of a specific type from the element.
|
|
1741
1801
|
*
|
|
1742
1802
|
* @param {TinyEventTarget|TinyEventTarget[]} el - The target element.
|
|
1743
|
-
* @param {string}
|
|
1803
|
+
* @param {string|string[]} events - The event type to remove (e.g. 'click').
|
|
1744
1804
|
* @returns {TinyEventTarget|TinyEventTarget[]}
|
|
1745
1805
|
*/
|
|
1746
|
-
static offAll(el: TinyEventTarget | TinyEventTarget[],
|
|
1806
|
+
static offAll(el: TinyEventTarget | TinyEventTarget[], events: string | string[]): TinyEventTarget | TinyEventTarget[];
|
|
1747
1807
|
/**
|
|
1748
1808
|
* Removes all event listeners of all types from the element.
|
|
1749
1809
|
*
|
|
@@ -1757,11 +1817,11 @@ declare class TinyHtml {
|
|
|
1757
1817
|
* Triggers all handlers associated with a specific event on the given element.
|
|
1758
1818
|
*
|
|
1759
1819
|
* @param {TinyEventTarget|TinyEventTarget[]} el - Target element where the event should be triggered.
|
|
1760
|
-
* @param {string}
|
|
1820
|
+
* @param {string|string[]} events - Name of the event to trigger.
|
|
1761
1821
|
* @param {Event|CustomEvent|CustomEventInit} [payload] - Optional event object or data to pass.
|
|
1762
1822
|
* @returns {TinyEventTarget|TinyEventTarget[]}
|
|
1763
1823
|
*/
|
|
1764
|
-
static trigger(el: TinyEventTarget | TinyEventTarget[],
|
|
1824
|
+
static trigger(el: TinyEventTarget | TinyEventTarget[], events: string | string[], payload?: Event | CustomEvent | CustomEventInit): TinyEventTarget | TinyEventTarget[];
|
|
1765
1825
|
/**
|
|
1766
1826
|
* Internal property name normalization map (similar to jQuery's `propFix`).
|
|
1767
1827
|
* Maps attribute-like names to their JavaScript DOM property equivalents.
|
|
@@ -2417,6 +2477,11 @@ declare class TinyHtml {
|
|
|
2417
2477
|
* @returns {TinyHtmlElement}
|
|
2418
2478
|
*/
|
|
2419
2479
|
blur(): TinyHtmlElement;
|
|
2480
|
+
/**
|
|
2481
|
+
* Select the text content of an input or textarea element.
|
|
2482
|
+
* @returns {TinyHtml|HTMLInputElement|HTMLTextAreaElement}
|
|
2483
|
+
*/
|
|
2484
|
+
select(): TinyHtml | HTMLInputElement | HTMLTextAreaElement;
|
|
2420
2485
|
/**
|
|
2421
2486
|
* Gets the width or height of an element based on the box model.
|
|
2422
2487
|
* @param {"width"|"height"} type - Dimension type.
|
|
@@ -2617,6 +2682,51 @@ declare class TinyHtml {
|
|
|
2617
2682
|
* @returns {string} The element's ID.
|
|
2618
2683
|
*/
|
|
2619
2684
|
id(): string;
|
|
2685
|
+
/**
|
|
2686
|
+
* Returns the BigInt content of the element.
|
|
2687
|
+
* @returns {bigint|null}
|
|
2688
|
+
*/
|
|
2689
|
+
toBigInt(): bigint | null;
|
|
2690
|
+
/**
|
|
2691
|
+
* Set BigInt content of the element.
|
|
2692
|
+
* @param {bigint} value
|
|
2693
|
+
* @returns {TinyElement|TinyElement[]}
|
|
2694
|
+
*/
|
|
2695
|
+
setBigInt(value: bigint): TinyElement | TinyElement[];
|
|
2696
|
+
/**
|
|
2697
|
+
* Returns the Date content of the element.
|
|
2698
|
+
* @returns {Date|null}
|
|
2699
|
+
*/
|
|
2700
|
+
toDate(): Date | null;
|
|
2701
|
+
/**
|
|
2702
|
+
* Set Date content of the element.
|
|
2703
|
+
* @param {Date} value
|
|
2704
|
+
* @returns {TinyElement|TinyElement[]}
|
|
2705
|
+
*/
|
|
2706
|
+
setDate(value: Date): TinyElement | TinyElement[];
|
|
2707
|
+
/**
|
|
2708
|
+
* Returns the JSON content of the element.
|
|
2709
|
+
* @returns {any|null}
|
|
2710
|
+
*/
|
|
2711
|
+
toJson(): any | null;
|
|
2712
|
+
/**
|
|
2713
|
+
* Set JSON content of the element.
|
|
2714
|
+
* @param {any} value
|
|
2715
|
+
* @param {number|string} [space] - Indentation level or string for formatting.
|
|
2716
|
+
* @returns {TinyElement|TinyElement[]}
|
|
2717
|
+
*/
|
|
2718
|
+
setJson(value: any, space?: number | string): TinyElement | TinyElement[];
|
|
2719
|
+
/**
|
|
2720
|
+
* Returns the number content of the element.
|
|
2721
|
+
* @returns {number|null} The text content or null if none.
|
|
2722
|
+
*/
|
|
2723
|
+
toNumber(): number | null;
|
|
2724
|
+
/**
|
|
2725
|
+
* Set number content of the element.
|
|
2726
|
+
* @param {number} value
|
|
2727
|
+
* @returns {TinyElement|TinyElement[]}
|
|
2728
|
+
*/
|
|
2729
|
+
setNumber(value: number): TinyElement | TinyElement[];
|
|
2620
2730
|
/**
|
|
2621
2731
|
* Returns the text content of the element.
|
|
2622
2732
|
* @returns {string|null} The text content or null if none.
|
|
@@ -2748,37 +2858,37 @@ declare class TinyHtml {
|
|
|
2748
2858
|
/**
|
|
2749
2859
|
* Registers an event listener on the specified element.
|
|
2750
2860
|
*
|
|
2751
|
-
* @param {string}
|
|
2861
|
+
* @param {string|string[]} events - The event type (e.g. 'click', 'keydown').
|
|
2752
2862
|
* @param {EventListenerOrEventListenerObject|null} handler - The callback function to run on event.
|
|
2753
2863
|
* @param {EventRegistryOptions} [options] - Optional event listener options.
|
|
2754
2864
|
* @returns {TinyEventTarget|TinyEventTarget[]}
|
|
2755
2865
|
*/
|
|
2756
|
-
on(
|
|
2866
|
+
on(events: string | string[], handler: EventListenerOrEventListenerObject | null, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
|
|
2757
2867
|
/**
|
|
2758
2868
|
* Registers an event listener that runs only once, then is removed.
|
|
2759
2869
|
*
|
|
2760
|
-
* @param {string}
|
|
2870
|
+
* @param {string|string[]} events - The event type (e.g. 'click', 'keydown').
|
|
2761
2871
|
* @param {EventListenerOrEventListenerObject} handler - The callback function to run on event.
|
|
2762
2872
|
* @param {EventRegistryOptions} [options={}] - Optional event listener options.
|
|
2763
2873
|
* @returns {TinyEventTarget|TinyEventTarget[]}
|
|
2764
2874
|
*/
|
|
2765
|
-
once(
|
|
2875
|
+
once(events: string | string[], handler: EventListenerOrEventListenerObject, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
|
|
2766
2876
|
/**
|
|
2767
2877
|
* Removes a specific event listener from an element.
|
|
2768
2878
|
*
|
|
2769
|
-
* @param {string}
|
|
2879
|
+
* @param {string|string[]} events - The event type.
|
|
2770
2880
|
* @param {EventListenerOrEventListenerObject|null} handler - The function originally bound to the event.
|
|
2771
2881
|
* @param {boolean|EventListenerOptions} [options] - Optional listener options.
|
|
2772
2882
|
* @returns {TinyEventTarget|TinyEventTarget[]}
|
|
2773
2883
|
*/
|
|
2774
|
-
off(
|
|
2884
|
+
off(events: string | string[], handler: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): TinyEventTarget | TinyEventTarget[];
|
|
2775
2885
|
/**
|
|
2776
2886
|
* Removes all event listeners of a specific type from the element.
|
|
2777
2887
|
*
|
|
2778
|
-
* @param {string}
|
|
2888
|
+
* @param {string|string[]} events - The event type to remove (e.g. 'click').
|
|
2779
2889
|
* @returns {TinyEventTarget|TinyEventTarget[]}
|
|
2780
2890
|
*/
|
|
2781
|
-
offAll(
|
|
2891
|
+
offAll(events: string | string[]): TinyEventTarget | TinyEventTarget[];
|
|
2782
2892
|
/**
|
|
2783
2893
|
* Removes all event listeners of all types from the element.
|
|
2784
2894
|
*
|
|
@@ -2790,11 +2900,11 @@ declare class TinyHtml {
|
|
|
2790
2900
|
/**
|
|
2791
2901
|
* Triggers all handlers associated with a specific event on the given element.
|
|
2792
2902
|
*
|
|
2793
|
-
* @param {string}
|
|
2903
|
+
* @param {string|string[]} events - Name of the event to trigger.
|
|
2794
2904
|
* @param {Event|CustomEvent|CustomEventInit} [payload] - Optional event object or data to pass.
|
|
2795
2905
|
* @returns {TinyEventTarget|TinyEventTarget[]}
|
|
2796
2906
|
*/
|
|
2797
|
-
trigger(
|
|
2907
|
+
trigger(events: string | string[], payload?: Event | CustomEvent | CustomEventInit): TinyEventTarget | TinyEventTarget[];
|
|
2798
2908
|
/**
|
|
2799
2909
|
* Get an attribute on an element.
|
|
2800
2910
|
* @param {string} name
|