native-document 1.0.222 → 1.0.224
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-document",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.224",
|
|
4
4
|
"description": "A reactive JavaScript framework that preserves native DOM simplicity without sacrificing modern features",
|
|
5
5
|
"author": "AfroCodeur <https://github.com/afrocodeur>",
|
|
6
6
|
"license": "MIT",
|
package/src/core/data/Store.js
CHANGED
|
@@ -3,7 +3,6 @@ import NativeDocumentError from '../errors/NativeDocumentError';
|
|
|
3
3
|
import DebugManager from '../utils/debug-manager';
|
|
4
4
|
import {$getFromStorage, $saveToStorage, LocalStorage} from '../utils/localstorage';
|
|
5
5
|
import {mutationMethods} from './ObservableArray';
|
|
6
|
-
import {method} from 'happy-dom/lib/PropertySymbol';
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
const WRITE_METHODS = [
|
|
@@ -46,8 +45,8 @@ export const StoreFactory = function() {
|
|
|
46
45
|
};
|
|
47
46
|
|
|
48
47
|
const $synchroProtectedFollower = (from, follower, name, context) => {
|
|
48
|
+
const originalSet = follower.set.bind(follower);
|
|
49
49
|
if(!from.__$isObservableArray) {
|
|
50
|
-
const originalSet = follower.set.bind(follower);
|
|
51
50
|
from.subscribe(originalSet);
|
|
52
51
|
$applyReadOnly(follower, name, 'follow');
|
|
53
52
|
return originalSet;
|
|
@@ -68,9 +67,13 @@ export const StoreFactory = function() {
|
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
from.subscribe((data, _, operations) => {
|
|
71
|
-
methods[operations.action]
|
|
70
|
+
const callback = methods[operations.action];
|
|
71
|
+
if(!callback) {
|
|
72
|
+
originalSet(data);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
callback(...(operations.args||[]));
|
|
72
76
|
});
|
|
73
|
-
|
|
74
77
|
};
|
|
75
78
|
|
|
76
79
|
const $createObservable = (value, options = {}) => {
|
|
@@ -16,11 +16,6 @@ export default function ListItemRender($desc, instance) {
|
|
|
16
16
|
// [a11y] aria-disabled
|
|
17
17
|
props['aria-disabled'] = $desc.disabled;
|
|
18
18
|
}
|
|
19
|
-
if ($desc.selected) {
|
|
20
|
-
props.class.add('is-selected', $desc.selected);
|
|
21
|
-
// [a11y] aria-selected
|
|
22
|
-
props['aria-selected'] = $desc.selected;
|
|
23
|
-
}
|
|
24
19
|
if ($desc.visibility) {
|
|
25
20
|
props.class.add('is-hidden', $desc.visibility.isFalsy());
|
|
26
21
|
}
|
|
@@ -31,11 +26,17 @@ export default function ListItemRender($desc, instance) {
|
|
|
31
26
|
const $list = instance.$parent;
|
|
32
27
|
|
|
33
28
|
// Checkbox — réactif via ShowIf
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
const selectedValues = $list.$description.selectedValues;
|
|
30
|
+
const value = $desc.value ?? instance;
|
|
31
|
+
const isChecked = selectedValues ? selectedValues.isIncludes(value) : null;
|
|
32
|
+
|
|
33
|
+
if($list.$description?.selectable || $desc.selected) {
|
|
34
|
+
const selectedSource = $desc.selected ?? isChecked;
|
|
35
|
+
props.class.add('is-selected', selectedSource);
|
|
36
|
+
props['aria-selected'] = selectedSource;
|
|
37
|
+
}
|
|
38
38
|
|
|
39
|
+
if ($list?.$description?.selectByCheckbox) {
|
|
39
40
|
const cls = isChecked
|
|
40
41
|
? isChecked.transform((c) => 'list-item-checkbox' + (c ? ' is-checked' : ''))
|
|
41
42
|
: 'list-item-checkbox';
|