native-document 1.0.206 → 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
|
@@ -19,6 +19,9 @@ export default function NativeFetch($baseUrl) {
|
|
|
19
19
|
if(options.formData) {
|
|
20
20
|
const formData = new FormData();
|
|
21
21
|
for(const key in params) {
|
|
22
|
+
if(params[key] == null) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
22
25
|
formData.append(key, params[key]);
|
|
23
26
|
}
|
|
24
27
|
params = formData;
|
|
@@ -96,7 +99,7 @@ export default function NativeFetch($baseUrl) {
|
|
|
96
99
|
|
|
97
100
|
export const resolveData = (data) => {
|
|
98
101
|
if(data?.__$Observable) {
|
|
99
|
-
return data.
|
|
102
|
+
return data.val();
|
|
100
103
|
}
|
|
101
104
|
for(const key in data) {
|
|
102
105
|
const value = data[key];
|
|
@@ -104,7 +107,7 @@ export const resolveData = (data) => {
|
|
|
104
107
|
continue;
|
|
105
108
|
}
|
|
106
109
|
if(value.__$Observable) {
|
|
107
|
-
data[key] = value.
|
|
110
|
+
data[key] = value.val();
|
|
108
111
|
continue;
|
|
109
112
|
}
|
|
110
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
|