native-document 1.0.92 → 1.0.94
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/native-document.components.min.js +1088 -65
- package/dist/native-document.dev.js +695 -142
- package/dist/native-document.dev.js.map +1 -1
- package/dist/native-document.devtools.min.js +1 -1
- package/dist/native-document.min.js +1 -1
- package/docs/advanced-components.md +814 -0
- package/docs/anchor.md +71 -11
- package/docs/cache.md +888 -0
- package/docs/conditional-rendering.md +91 -1
- package/docs/core-concepts.md +9 -2
- package/docs/elements.md +127 -2
- package/docs/extending-native-document-element.md +7 -1
- package/docs/filters.md +1216 -0
- package/docs/getting-started.md +12 -3
- package/docs/lifecycle-events.md +10 -2
- package/docs/list-rendering.md +453 -54
- package/docs/memory-management.md +9 -7
- package/docs/native-document-element.md +30 -9
- package/docs/native-fetch.md +744 -0
- package/docs/observables.md +135 -6
- package/docs/routing.md +7 -1
- package/docs/state-management.md +7 -1
- package/docs/validation.md +8 -1
- package/elements.js +1 -0
- package/eslint.config.js +3 -3
- package/index.def.js +350 -0
- package/package.json +3 -2
- package/readme.md +53 -14
- package/src/components/$traits/HasItems.js +42 -1
- package/src/components/BaseComponent.js +4 -1
- package/src/components/accordion/Accordion.js +112 -8
- package/src/components/accordion/AccordionItem.js +93 -4
- package/src/components/alert/Alert.js +164 -4
- package/src/components/avatar/Avatar.js +236 -22
- package/src/components/menu/index.js +1 -2
- package/src/core/data/ObservableArray.js +120 -2
- package/src/core/data/ObservableChecker.js +50 -0
- package/src/core/data/ObservableItem.js +124 -4
- package/src/core/data/ObservableWhen.js +36 -6
- package/src/core/data/observable-helpers/array.js +12 -3
- package/src/core/data/observable-helpers/computed.js +17 -4
- package/src/core/data/observable-helpers/object.js +19 -3
- package/src/core/elements/content-formatter.js +138 -1
- package/src/core/elements/control/for-each-array.js +20 -2
- package/src/core/elements/control/for-each.js +17 -5
- package/src/core/elements/control/show-if.js +31 -15
- package/src/core/elements/control/show-when.js +23 -0
- package/src/core/elements/control/switch.js +40 -10
- package/src/core/elements/description-list.js +14 -0
- package/src/core/elements/form.js +188 -4
- package/src/core/elements/html5-semantics.js +44 -1
- package/src/core/elements/img.js +22 -10
- package/src/core/elements/index.js +5 -0
- package/src/core/elements/interactive.js +19 -1
- package/src/core/elements/list.js +28 -1
- package/src/core/elements/medias.js +29 -0
- package/src/core/elements/meta-data.js +34 -0
- package/src/core/elements/table.js +59 -0
- package/src/core/utils/cache.js +5 -0
- package/src/core/utils/helpers.js +7 -2
- package/src/core/utils/memoize.js +25 -16
- package/src/core/utils/prototypes.js +3 -2
- package/src/core/wrappers/AttributesWrapper.js +1 -1
- package/src/core/wrappers/HtmlElementWrapper.js +2 -2
- package/src/core/wrappers/NDElement.js +42 -2
- package/src/core/wrappers/NdPrototype.js +4 -0
- package/src/core/wrappers/TemplateCloner.js +14 -11
- package/src/core/wrappers/prototypes/bind-class-extensions.js +1 -1
- package/src/core/wrappers/prototypes/nd-element-extensions.js +3 -0
- package/src/router/Route.js +9 -4
- package/src/router/Router.js +28 -9
- package/src/router/errors/RouterError.js +0 -1
- package/types/control-flow.d.ts +9 -6
- package/types/elements.d.ts +496 -111
- package/types/filters/index.d.ts +4 -0
- package/types/forms.d.ts +85 -48
- package/types/images.d.ts +16 -9
- package/types/nd-element.d.ts +5 -238
- package/types/observable.d.ts +9 -3
- package/types/router.d.ts +5 -1
- package/types/template-cloner.ts +1 -0
- package/types/validator.ts +11 -1
- package/utils.d.ts +2 -1
- package/utils.js +4 -4
- package/src/core/utils/service.js +0 -6
package/docs/observables.md
CHANGED
|
@@ -615,10 +615,12 @@ console.log(isAdult.val()); // true
|
|
|
615
615
|
const data = Observable("test");
|
|
616
616
|
|
|
617
617
|
// Create a subscription
|
|
618
|
-
const
|
|
618
|
+
const handler = value => console.log(value);
|
|
619
|
+
data.subscribe(handler);
|
|
620
|
+
|
|
619
621
|
|
|
620
622
|
// Clean up manually if needed
|
|
621
|
-
unsubscribe();
|
|
623
|
+
data.unsubscribe('test', handler);
|
|
622
624
|
|
|
623
625
|
// Complete observable cleanup
|
|
624
626
|
data.cleanup(); // Removes all listeners and prevents new subscriptions
|
|
@@ -626,9 +628,6 @@ data.cleanup(); // Removes all listeners and prevents new subscriptions
|
|
|
626
628
|
// Manual trigger (useful for forcing updates)
|
|
627
629
|
data.trigger(); // Notifies all subscribers without changing the value
|
|
628
630
|
|
|
629
|
-
// Get original value (useful for reset functionality)
|
|
630
|
-
console.log(data.originalValue()); // Returns the initial value
|
|
631
|
-
|
|
632
631
|
// Extract values from any observable structure
|
|
633
632
|
const complexData = Observable.object({
|
|
634
633
|
user: "John",
|
|
@@ -637,6 +636,130 @@ const complexData = Observable.object({
|
|
|
637
636
|
console.log(Observable.value(complexData)); // Plain object with extracted values
|
|
638
637
|
```
|
|
639
638
|
|
|
639
|
+
## Utility Methods
|
|
640
|
+
|
|
641
|
+
### `off(value, callback?)` - Remove Watchers
|
|
642
|
+
|
|
643
|
+
Remove specific value watchers created with `.on()`:
|
|
644
|
+
```javascript
|
|
645
|
+
const status = Observable("idle");
|
|
646
|
+
|
|
647
|
+
const loadingHandler = (isActive) => console.log("Loading:", isActive);
|
|
648
|
+
status.on("loading", loadingHandler);
|
|
649
|
+
|
|
650
|
+
// Remove specific callback
|
|
651
|
+
status.off("loading", loadingHandler);
|
|
652
|
+
|
|
653
|
+
// Remove all watchers for a value
|
|
654
|
+
status.off("loading");
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
### `once(predicate, callback)` - Single-Time Listener
|
|
658
|
+
|
|
659
|
+
Execute callback only once when condition is met:
|
|
660
|
+
```javascript
|
|
661
|
+
const count = Observable(0);
|
|
662
|
+
|
|
663
|
+
// Wait for specific value
|
|
664
|
+
count.once(5, (value) => {
|
|
665
|
+
console.log("Reached 5!"); // Only called once
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
// With predicate function
|
|
669
|
+
count.once(val => val > 10, (value) => {
|
|
670
|
+
console.log("Greater than 10!"); // Only called once
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
count.set(5); // Callback fires and unsubscribes
|
|
674
|
+
count.set(5); // Callback doesn't fire again
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
### `toggle()` - Boolean Toggle
|
|
678
|
+
|
|
679
|
+
Toggle boolean observables:
|
|
680
|
+
```javascript
|
|
681
|
+
const isVisible = Observable(false);
|
|
682
|
+
|
|
683
|
+
isVisible.toggle(); // true
|
|
684
|
+
isVisible.toggle(); // false
|
|
685
|
+
isVisible.toggle(); // true
|
|
686
|
+
|
|
687
|
+
// Useful with buttons
|
|
688
|
+
Button("Toggle").nd.onClick(() => isVisible.toggle());
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
### `reset()` - Reset to Initial Value
|
|
692
|
+
|
|
693
|
+
Reset observable to its initial value (requires `reset: true` config):
|
|
694
|
+
```javascript
|
|
695
|
+
const name = Observable("Alice", { reset: true });
|
|
696
|
+
|
|
697
|
+
name.set("Bob");
|
|
698
|
+
console.log(name.val()); // "Bob"
|
|
699
|
+
|
|
700
|
+
name.reset();
|
|
701
|
+
console.log(name.val()); // "Alice" (initial value)
|
|
702
|
+
|
|
703
|
+
// With objects
|
|
704
|
+
const user = Observable({ name: "Alice", age: 25 }, { reset: true });
|
|
705
|
+
user.set({ name: "Bob", age: 30 });
|
|
706
|
+
user.reset(); // Back to { name: "Alice", age: 25 }
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
### `equals(other)` - Value Comparison
|
|
710
|
+
|
|
711
|
+
Compare observable values:
|
|
712
|
+
```javascript
|
|
713
|
+
const num1 = Observable(5);
|
|
714
|
+
const num2 = Observable(5);
|
|
715
|
+
const num3 = Observable(10);
|
|
716
|
+
|
|
717
|
+
console.log(num1.equals(num2)); // true (same value)
|
|
718
|
+
console.log(num1.equals(5)); // true (compare with raw value)
|
|
719
|
+
console.log(num1.equals(num3)); // false
|
|
720
|
+
```
|
|
721
|
+
|
|
722
|
+
### `toBool()` - Boolean Conversion
|
|
723
|
+
|
|
724
|
+
Convert observable value to boolean:
|
|
725
|
+
```javascript
|
|
726
|
+
const text = Observable("");
|
|
727
|
+
console.log(text.toBool()); // false
|
|
728
|
+
|
|
729
|
+
text.set("Hello");
|
|
730
|
+
console.log(text.toBool()); // true
|
|
731
|
+
|
|
732
|
+
// Useful for conditions
|
|
733
|
+
const hasContent = text.toBool();
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
### `intercept(callback)` - Value Interception
|
|
737
|
+
|
|
738
|
+
Intercept and modify values before they're set:
|
|
739
|
+
```javascript
|
|
740
|
+
const age = Observable(0);
|
|
741
|
+
|
|
742
|
+
// Intercept sets to enforce constraints
|
|
743
|
+
age.intercept((newValue, oldValue) => {
|
|
744
|
+
if (newValue < 0) return 0;
|
|
745
|
+
if (newValue > 120) return 120;
|
|
746
|
+
return newValue;
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
age.set(-5); // Actually sets 0
|
|
750
|
+
age.set(150); // Actually sets 120
|
|
751
|
+
age.set(25); // Sets 25
|
|
752
|
+
|
|
753
|
+
// Practical example: sanitize input
|
|
754
|
+
const username = Observable("");
|
|
755
|
+
username.intercept((value) => {
|
|
756
|
+
return value.toLowerCase().trim();
|
|
757
|
+
});
|
|
758
|
+
|
|
759
|
+
username.set(" JohnDoe ");
|
|
760
|
+
console.log(username.val()); // "johndoe"
|
|
761
|
+
```
|
|
762
|
+
|
|
640
763
|
## Best Practices
|
|
641
764
|
|
|
642
765
|
1. **Use descriptive names** for your observables
|
|
@@ -663,4 +786,10 @@ Now that you understand NativeDocument's observable, explore these advanced topi
|
|
|
663
786
|
- **[Extending NDElement](extending-native-document-element.md)** - Custom Methods Guide
|
|
664
787
|
- **[Args Validation](validation.md)** - Function Argument Validation
|
|
665
788
|
- **[Memory Management](memory-management.md)** - Memory management
|
|
666
|
-
- **[Anchor](anchor.md)** - Anchor
|
|
789
|
+
- **[Anchor](anchor.md)** - Anchor
|
|
790
|
+
|
|
791
|
+
## Utilities
|
|
792
|
+
|
|
793
|
+
- **[Cache](docs/utils/cache.md)** - Lazy initialization and singleton patterns
|
|
794
|
+
- **[NativeFetch](docs/utils/native-fetch.md)** - HTTP client with interceptors
|
|
795
|
+
- **[Filters](docs/utils/filters.md)** - Data filtering helpers
|
package/docs/routing.md
CHANGED
|
@@ -817,4 +817,10 @@ Explore these related topics to build complete applications:
|
|
|
817
817
|
- **[Extending NDElement](extending-native-document-element.md)** - Custom Methods Guide
|
|
818
818
|
- **[Args Validation](validation.md)** - Function Argument Validation
|
|
819
819
|
- **[Memory Management](memory-management.md)** - Memory management
|
|
820
|
-
- **[Anchor](anchor.md)** - Anchor
|
|
820
|
+
- **[Anchor](anchor.md)** - Anchor
|
|
821
|
+
|
|
822
|
+
## Utilities
|
|
823
|
+
|
|
824
|
+
- **[Cache](docs/utils/cache.md)** - Lazy initialization and singleton patterns
|
|
825
|
+
- **[NativeFetch](docs/utils/native-fetch.md)** - HTTP client with interceptors
|
|
826
|
+
- **[Filters](docs/utils/filters.md)** - Data filtering helpers
|
package/docs/state-management.md
CHANGED
|
@@ -423,4 +423,10 @@ Now that you understand state management, explore these related topics:
|
|
|
423
423
|
- **[Extending NDElement](extending-native-document-element.md)** - Custom Methods Guide
|
|
424
424
|
- **[Args Validation](validation.md)** - Function Argument Validation
|
|
425
425
|
- **[Memory Management](memory-management.md)** - Memory management
|
|
426
|
-
- **[Anchor](anchor.md)** - Anchor
|
|
426
|
+
- **[Anchor](anchor.md)** - Anchor
|
|
427
|
+
|
|
428
|
+
## Utilities
|
|
429
|
+
|
|
430
|
+
- **[Cache](docs/utils/cache.md)** - Lazy initialization and singleton patterns
|
|
431
|
+
- **[NativeFetch](docs/utils/native-fetch.md)** - HTTP client with interceptors
|
|
432
|
+
- **[Filters](docs/utils/filters.md)** - Data filtering helpers
|
package/docs/validation.md
CHANGED
|
@@ -190,4 +190,11 @@ registerUser.args(
|
|
|
190
190
|
- **[Lifecycle Events](lifecycle-events.md)** - Validate lifecycle callback arguments
|
|
191
191
|
- **[NDElement](native-document-element.md)** - Native Document Element
|
|
192
192
|
- **[Extending NDElement](extending-native-document-element.md)** - Custom Methods Guide
|
|
193
|
-
- **[
|
|
193
|
+
- **[Advanced Components](advanced-components.md)** - Template caching and singleton views
|
|
194
|
+
- **[Memory Management](memory-management.md)** - Debugging memory issues with validation
|
|
195
|
+
|
|
196
|
+
## Utilities
|
|
197
|
+
|
|
198
|
+
- **[Cache](docs/utils/cache.md)** - Lazy initialization and singleton patterns
|
|
199
|
+
- **[NativeFetch](docs/utils/native-fetch.md)** - HTTP client with interceptors
|
|
200
|
+
- **[Filters](docs/utils/filters.md)** - Data filtering helpers
|
package/elements.js
CHANGED
package/eslint.config.js
CHANGED
|
@@ -3,18 +3,18 @@ import globals from 'globals'
|
|
|
3
3
|
|
|
4
4
|
export default [
|
|
5
5
|
{ ignores: ['dist'] },
|
|
6
|
+
js.configs.recommended,
|
|
6
7
|
{
|
|
7
8
|
files: ['**/*.{js}'],
|
|
8
9
|
languageOptions: {
|
|
9
|
-
ecmaVersion:
|
|
10
|
+
ecmaVersion: 'latest',
|
|
10
11
|
globals: globals.browser,
|
|
11
12
|
parserOptions: {
|
|
12
13
|
ecmaVersion: 'latest',
|
|
13
14
|
sourceType: 'module',
|
|
14
15
|
},
|
|
15
16
|
},
|
|
16
|
-
plugins: {
|
|
17
|
-
},
|
|
17
|
+
plugins: {},
|
|
18
18
|
rules: {
|
|
19
19
|
...js.configs.recommended.rules,
|
|
20
20
|
},
|
package/index.def.js
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview JSDoc type definitions for NativeDocument HTML elements.
|
|
3
|
+
* Provides IDE autocomplete for element attributes.
|
|
4
|
+
* Compound attribute names are listed in both their original (lowercase)
|
|
5
|
+
* and camelCase forms so both conventions trigger autocomplete.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// ─────────────────────────────────────────────
|
|
9
|
+
// Base types
|
|
10
|
+
// ─────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* An ObservableItem or a raw value.
|
|
14
|
+
* @template T
|
|
15
|
+
* @typedef {import('./native-document.dev').ObservableItem | T} Observable
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A valid child — string, number, boolean, HTMLElement, DocumentFragment,
|
|
20
|
+
* ObservableItem, NDElement, or an array of those.
|
|
21
|
+
* @typedef {string|number|boolean|HTMLElement|DocumentFragment|ObservableItem|NDElement|Array} NdChild
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Reactive class binding — maps class names to observable or plain booleans.
|
|
26
|
+
* @typedef {Object.<string, Observable<boolean>|boolean>} NdClassMap
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Reactive style binding — maps CSS property names to observable or plain strings.
|
|
31
|
+
* @typedef {Object.<string, Observable<string>|string>} NdStyleMap
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
// ─────────────────────────────────────────────
|
|
35
|
+
// Shared attribute sets
|
|
36
|
+
// ─────────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Global HTML attributes shared by all elements.
|
|
40
|
+
* @typedef {Object} GlobalAttributes
|
|
41
|
+
* @property {Observable<string>|string} [id] - Unique identifier
|
|
42
|
+
* @property {Observable<string>|NdClassMap|string} [class] - CSS classes (string or reactive map)
|
|
43
|
+
* @property {Observable<NdStyleMap>|NdStyleMap} [style] - Inline styles
|
|
44
|
+
* @property {string} [title] - Tooltip text
|
|
45
|
+
* @property {string} [lang] - Language code
|
|
46
|
+
* @property {string} [dir] - Text direction: 'ltr'|'rtl'|'auto'
|
|
47
|
+
* @property {Observable<boolean>|boolean} [hidden] - Hide element
|
|
48
|
+
* @property {Observable<boolean>|boolean} [draggable] - Make element draggable
|
|
49
|
+
* @property {Observable<boolean>|boolean} [contenteditable] - Make content editable
|
|
50
|
+
* @property {Observable<boolean>|boolean} [contentEditable] - Make content editable (camelCase)
|
|
51
|
+
* @property {string} [tabindex] - Tab order
|
|
52
|
+
* @property {string} [tabIndex] - Tab order (camelCase)
|
|
53
|
+
* @property {string} [accesskey] - Keyboard shortcut
|
|
54
|
+
* @property {string} [accessKey] - Keyboard shortcut (camelCase)
|
|
55
|
+
* @property {Observable<boolean>|boolean} [spellcheck] - Enable spellcheck
|
|
56
|
+
* @property {Observable<boolean>|boolean} [spellCheck] - Enable spellcheck (camelCase)
|
|
57
|
+
* @property {string} [data-*] - Custom data attributes
|
|
58
|
+
* @property {string} [aria-*] - ARIA accessibility attributes
|
|
59
|
+
* @property {string} [role] - ARIA role
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Attributes shared by form-related elements.
|
|
64
|
+
* @typedef {Object} SharedFormAttributes
|
|
65
|
+
* @property {string} [name] - Field name
|
|
66
|
+
* @property {Observable<boolean>|boolean} [disabled] - Disable the field
|
|
67
|
+
* @property {Observable<boolean>|boolean} [required] - Mark as required
|
|
68
|
+
* @property {Observable<boolean>|boolean} [autofocus] - Auto-focus on page load
|
|
69
|
+
* @property {Observable<boolean>|boolean} [autoFocus] - Auto-focus on page load (camelCase)
|
|
70
|
+
* @property {string} [form] - Associated form id
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
// ─────────────────────────────────────────────
|
|
74
|
+
// Element-specific attribute types
|
|
75
|
+
// ─────────────────────────────────────────────
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @typedef {GlobalAttributes & {
|
|
79
|
+
* src: Observable<string>|string,
|
|
80
|
+
* alt: Observable<string>|string,
|
|
81
|
+
* width: Observable<string>|string|number,
|
|
82
|
+
* height: Observable<string>|string|number,
|
|
83
|
+
* loading: 'lazy'|'eager'|'auto',
|
|
84
|
+
* decoding: 'async'|'sync'|'auto',
|
|
85
|
+
* srcset: string,
|
|
86
|
+
* srcSet: string,
|
|
87
|
+
* sizes: string,
|
|
88
|
+
* crossorigin: 'anonymous'|'use-credentials',
|
|
89
|
+
* crossOrigin: 'anonymous'|'use-credentials',
|
|
90
|
+
* referrerpolicy: string,
|
|
91
|
+
* referrerPolicy: string,
|
|
92
|
+
* fetchpriority: 'high'|'low'|'auto',
|
|
93
|
+
* fetchPriority: 'high'|'low'|'auto',
|
|
94
|
+
* }} ImgAttributes
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @typedef {GlobalAttributes & {
|
|
99
|
+
* href: Observable<string>|string,
|
|
100
|
+
* target: '_blank'|'_self'|'_parent'|'_top'|string,
|
|
101
|
+
* rel: string,
|
|
102
|
+
* download: Observable<boolean>|boolean|string,
|
|
103
|
+
* hreflang: string,
|
|
104
|
+
* hrefLang: string,
|
|
105
|
+
* type: string,
|
|
106
|
+
* referrerpolicy: string,
|
|
107
|
+
* referrerPolicy: string,
|
|
108
|
+
* }} AnchorAttributes
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @typedef {GlobalAttributes & SharedFormAttributes & {
|
|
113
|
+
* type: 'button'|'submit'|'reset',
|
|
114
|
+
* value: Observable<string>|string,
|
|
115
|
+
* }} ButtonAttributes
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @typedef {GlobalAttributes & SharedFormAttributes & {
|
|
120
|
+
* type: 'text'|'email'|'password'|'number'|'tel'|'url'|'search'|
|
|
121
|
+
* 'date'|'time'|'datetime-local'|'week'|'month'|
|
|
122
|
+
* 'checkbox'|'radio'|'range'|'color'|'file'|'hidden',
|
|
123
|
+
* value: Observable<string>|string,
|
|
124
|
+
* placeholder: Observable<string>|string,
|
|
125
|
+
* checked: Observable<boolean>|boolean,
|
|
126
|
+
* readonly: Observable<boolean>|boolean,
|
|
127
|
+
* readOnly: Observable<boolean>|boolean,
|
|
128
|
+
* multiple: Observable<boolean>|boolean,
|
|
129
|
+
* min: Observable<string>|string|number,
|
|
130
|
+
* max: Observable<string>|string|number,
|
|
131
|
+
* step: Observable<string>|string|number,
|
|
132
|
+
* minlength: number,
|
|
133
|
+
* minLength: number,
|
|
134
|
+
* maxlength: number,
|
|
135
|
+
* maxLength: number,
|
|
136
|
+
* pattern: string,
|
|
137
|
+
* accept: string,
|
|
138
|
+
* autocomplete: 'on'|'off'|string,
|
|
139
|
+
* autoComplete: 'on'|'off'|string,
|
|
140
|
+
* list: string,
|
|
141
|
+
* }} InputAttributes
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @typedef {GlobalAttributes & SharedFormAttributes & {
|
|
146
|
+
* value: Observable<string>|string,
|
|
147
|
+
* placeholder: Observable<string>|string,
|
|
148
|
+
* readonly: Observable<boolean>|boolean,
|
|
149
|
+
* readOnly: Observable<boolean>|boolean,
|
|
150
|
+
* rows: number,
|
|
151
|
+
* cols: number,
|
|
152
|
+
* minlength: number,
|
|
153
|
+
* minLength: number,
|
|
154
|
+
* maxlength: number,
|
|
155
|
+
* maxLength: number,
|
|
156
|
+
* wrap: 'hard'|'soft'|'off',
|
|
157
|
+
* autocomplete: 'on'|'off'|string,
|
|
158
|
+
* autoComplete: 'on'|'off'|string,
|
|
159
|
+
* spellcheck: Observable<boolean>|boolean,
|
|
160
|
+
* spellCheck: Observable<boolean>|boolean,
|
|
161
|
+
* }} TextAreaAttributes
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @typedef {GlobalAttributes & SharedFormAttributes & {
|
|
166
|
+
* value: Observable<string>|string,
|
|
167
|
+
* multiple: Observable<boolean>|boolean,
|
|
168
|
+
* size: number,
|
|
169
|
+
* }} SelectAttributes
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @typedef {GlobalAttributes & {
|
|
174
|
+
* value: Observable<string>|string,
|
|
175
|
+
* selected: Observable<boolean>|boolean,
|
|
176
|
+
* disabled: Observable<boolean>|boolean,
|
|
177
|
+
* }} OptionAttributes
|
|
178
|
+
*/
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @typedef {GlobalAttributes & SharedFormAttributes & {
|
|
182
|
+
* action: string,
|
|
183
|
+
* method: 'get'|'post',
|
|
184
|
+
* enctype: 'application/x-www-form-urlencoded'|'multipart/form-data'|'text/plain',
|
|
185
|
+
* encType: 'application/x-www-form-urlencoded'|'multipart/form-data'|'text/plain',
|
|
186
|
+
* novalidate: Observable<boolean>|boolean,
|
|
187
|
+
* noValidate: Observable<boolean>|boolean,
|
|
188
|
+
* target: '_blank'|'_self'|'_parent'|'_top'|string,
|
|
189
|
+
* autocomplete: 'on'|'off',
|
|
190
|
+
* autoComplete: 'on'|'off',
|
|
191
|
+
* }} FormAttributes
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @typedef {GlobalAttributes & {
|
|
196
|
+
* src: Observable<string>|string,
|
|
197
|
+
* autoplay: Observable<boolean>|boolean,
|
|
198
|
+
* autoPlay: Observable<boolean>|boolean,
|
|
199
|
+
* controls: Observable<boolean>|boolean,
|
|
200
|
+
* loop: Observable<boolean>|boolean,
|
|
201
|
+
* muted: Observable<boolean>|boolean,
|
|
202
|
+
* preload: 'auto'|'metadata'|'none',
|
|
203
|
+
* width: Observable<string>|string|number,
|
|
204
|
+
* height: Observable<string>|string|number,
|
|
205
|
+
* poster: string,
|
|
206
|
+
* playsinline: Observable<boolean>|boolean,
|
|
207
|
+
* playsInline: Observable<boolean>|boolean,
|
|
208
|
+
* crossorigin: 'anonymous'|'use-credentials',
|
|
209
|
+
* crossOrigin: 'anonymous'|'use-credentials',
|
|
210
|
+
* }} VideoAttributes
|
|
211
|
+
*/
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* @typedef {GlobalAttributes & {
|
|
215
|
+
* src: Observable<string>|string,
|
|
216
|
+
* autoplay: Observable<boolean>|boolean,
|
|
217
|
+
* autoPlay: Observable<boolean>|boolean,
|
|
218
|
+
* controls: Observable<boolean>|boolean,
|
|
219
|
+
* loop: Observable<boolean>|boolean,
|
|
220
|
+
* muted: Observable<boolean>|boolean,
|
|
221
|
+
* preload: 'auto'|'metadata'|'none',
|
|
222
|
+
* crossorigin: 'anonymous'|'use-credentials',
|
|
223
|
+
* crossOrigin: 'anonymous'|'use-credentials',
|
|
224
|
+
* }} AudioAttributes
|
|
225
|
+
*/
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* @typedef {GlobalAttributes & {
|
|
229
|
+
* width: Observable<string>|string|number,
|
|
230
|
+
* height: Observable<string>|string|number,
|
|
231
|
+
* }} CanvasAttributes
|
|
232
|
+
*/
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @typedef {GlobalAttributes & {
|
|
236
|
+
* open: Observable<boolean>|boolean,
|
|
237
|
+
* }} DetailsAttributes
|
|
238
|
+
*/
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* @typedef {GlobalAttributes & {
|
|
242
|
+
* open: Observable<boolean>|boolean,
|
|
243
|
+
* }} DialogAttributes
|
|
244
|
+
*/
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @typedef {GlobalAttributes & {
|
|
248
|
+
* value: Observable<string>|string|number,
|
|
249
|
+
* max: number,
|
|
250
|
+
* }} ProgressAttributes
|
|
251
|
+
*/
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @typedef {GlobalAttributes & {
|
|
255
|
+
* value: Observable<string>|string|number,
|
|
256
|
+
* min: number,
|
|
257
|
+
* max: number,
|
|
258
|
+
* low: number,
|
|
259
|
+
* high: number,
|
|
260
|
+
* optimum: number,
|
|
261
|
+
* }} MeterAttributes
|
|
262
|
+
*/
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @typedef {GlobalAttributes & {
|
|
266
|
+
* src: string,
|
|
267
|
+
* type: string,
|
|
268
|
+
* media: string,
|
|
269
|
+
* }} SourceAttributes
|
|
270
|
+
*/
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* @typedef {GlobalAttributes & {
|
|
274
|
+
* colspan: number,
|
|
275
|
+
* colSpan: number,
|
|
276
|
+
* rowspan: number,
|
|
277
|
+
* rowSpan: number,
|
|
278
|
+
* headers: string,
|
|
279
|
+
* scope: 'row'|'col'|'rowgroup'|'colgroup',
|
|
280
|
+
* }} ThAttributes
|
|
281
|
+
*/
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* @typedef {GlobalAttributes & {
|
|
285
|
+
* colspan: number,
|
|
286
|
+
* colSpan: number,
|
|
287
|
+
* rowspan: number,
|
|
288
|
+
* rowSpan: number,
|
|
289
|
+
* headers: string,
|
|
290
|
+
* }} TdAttributes
|
|
291
|
+
*/
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* @typedef {GlobalAttributes & {
|
|
295
|
+
* for: string,
|
|
296
|
+
* htmlFor: string,
|
|
297
|
+
* }} LabelAttributes
|
|
298
|
+
*/
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* @typedef {GlobalAttributes & {
|
|
302
|
+
* for: string,
|
|
303
|
+
* form: string,
|
|
304
|
+
* name: string,
|
|
305
|
+
* }} OutputAttributes
|
|
306
|
+
*/
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* @typedef {GlobalAttributes & {
|
|
310
|
+
* datetime: string,
|
|
311
|
+
* dateTime: string,
|
|
312
|
+
* }} TimeAttributes
|
|
313
|
+
*/
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @typedef {GlobalAttributes & {
|
|
317
|
+
* cite: string,
|
|
318
|
+
* datetime: string,
|
|
319
|
+
* dateTime: string,
|
|
320
|
+
* }} ModAttributes
|
|
321
|
+
*/
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* @typedef {GlobalAttributes & {
|
|
325
|
+
* reversed: Observable<boolean>|boolean,
|
|
326
|
+
* start: number,
|
|
327
|
+
* type: '1'|'a'|'A'|'i'|'I',
|
|
328
|
+
* }} OlAttributes
|
|
329
|
+
*/
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* @typedef {GlobalAttributes & {
|
|
333
|
+
* viewBox: string,
|
|
334
|
+
* viewbox: string,
|
|
335
|
+
* xmlns: string,
|
|
336
|
+
* width: Observable<string>|string|number,
|
|
337
|
+
* height: Observable<string>|string|number,
|
|
338
|
+
* }} SvgAttributes
|
|
339
|
+
*/
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* @typedef {GlobalAttributes & {
|
|
343
|
+
* src: string,
|
|
344
|
+
* kind: 'subtitles'|'captions'|'descriptions'|'chapters'|'metadata',
|
|
345
|
+
* srclang: string,
|
|
346
|
+
* srcLang: string,
|
|
347
|
+
* label: string,
|
|
348
|
+
* default: Observable<boolean>|boolean,
|
|
349
|
+
* }} TrackAttributes
|
|
350
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-document",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.94",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "rollup --config rollup.config.js --watch",
|
|
8
|
-
"lint": "eslint
|
|
8
|
+
"lint": "eslint ./src"
|
|
9
9
|
},
|
|
10
10
|
"keywords": [],
|
|
11
11
|
"author": "",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"@rollup/plugin-replace": "^6.0.2",
|
|
19
19
|
"@rollup/plugin-terser": "^0.4.4",
|
|
20
20
|
"eslint": "^9.33.0",
|
|
21
|
+
"eslint-plugin-jsdoc": "^62.5.4",
|
|
21
22
|
"magic-string": "^0.30.21",
|
|
22
23
|
"rollup": "^4.53.3"
|
|
23
24
|
},
|