native-document 1.0.207 → 1.0.208
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.208",
|
|
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",
|
|
@@ -118,8 +118,6 @@ FormControl.prototype.fields = function(fieldBuilder) {
|
|
|
118
118
|
dirties.push(field.$description.isDirty);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
console.log(dirties);
|
|
122
|
-
|
|
123
121
|
$.computed(() => {
|
|
124
122
|
const isDirty = dirties.some((item) => item.val());
|
|
125
123
|
this.$description.isDirty.set(isDirty);
|
|
@@ -104,8 +104,9 @@ export const bindBooleanAttribute = (element, attributeName, value) => {
|
|
|
104
104
|
const defaultValue = isObservable? value.val() : value;
|
|
105
105
|
|
|
106
106
|
const attributeRealName = BOOL_ATTRIBUTES_NAME[attributeName] || attributeName;
|
|
107
|
+
const isBooleanHandling = typeof defaultValue === 'boolean' || defaultValue == null;
|
|
107
108
|
|
|
108
|
-
if(
|
|
109
|
+
if(isBooleanHandling) {
|
|
109
110
|
element[attributeRealName] = defaultValue;
|
|
110
111
|
}
|
|
111
112
|
else {
|
|
@@ -113,7 +114,7 @@ export const bindBooleanAttribute = (element, attributeName, value) => {
|
|
|
113
114
|
}
|
|
114
115
|
if(isObservable) {
|
|
115
116
|
if(attributeName === 'checked') {
|
|
116
|
-
if(
|
|
117
|
+
if(isBooleanHandling) {
|
|
117
118
|
element.addEventListener('input', () => value.set(element[attributeRealName]));
|
|
118
119
|
}
|
|
119
120
|
else {
|
package/src/fetch/NativeFetch.js
CHANGED
|
@@ -99,7 +99,7 @@ export default function NativeFetch($baseUrl) {
|
|
|
99
99
|
|
|
100
100
|
export const resolveData = (data) => {
|
|
101
101
|
if(data?.__$Observable) {
|
|
102
|
-
return data.
|
|
102
|
+
return data.val();
|
|
103
103
|
}
|
|
104
104
|
for(const key in data) {
|
|
105
105
|
const value = data[key];
|
|
@@ -107,7 +107,7 @@ export const resolveData = (data) => {
|
|
|
107
107
|
continue;
|
|
108
108
|
}
|
|
109
109
|
if(value.__$Observable) {
|
|
110
|
-
data[key] = value.
|
|
110
|
+
data[key] = value.val();
|
|
111
111
|
continue;
|
|
112
112
|
}
|
|
113
113
|
if(typeof value === 'object') {
|
package/types/nd-element.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface NDElement {
|
|
|
22
22
|
ref(target: RefItem | Record<string, unknown>, name: string): this;
|
|
23
23
|
refSelf(target: RefItem | Record<string, unknown>, name: string): this;
|
|
24
24
|
with<T extends MethodsObject>(methods: T): this & ExtractMethods<T>;
|
|
25
|
+
expose<T extends MethodsObject>(methods: T): this & ExtractMethods<T>;
|
|
25
26
|
extend(methods: MethodsObject): NDElement;
|
|
26
27
|
extend<T extends MethodsObject>(
|
|
27
28
|
methods: T
|