native-document 1.0.39 → 1.0.40
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.dev.js +10 -9
- 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/index.js +1 -1
- package/package.json +1 -1
- package/src/data/observable-helpers/object.js +2 -9
- package/src/wrappers/AttributesWrapper.js +3 -0
|
@@ -973,6 +973,11 @@ var NativeDocument = (function (exports) {
|
|
|
973
973
|
};
|
|
974
974
|
}
|
|
975
975
|
|
|
976
|
+
var validator = /*#__PURE__*/Object.freeze({
|
|
977
|
+
__proto__: null,
|
|
978
|
+
default: Validator
|
|
979
|
+
});
|
|
980
|
+
|
|
976
981
|
function Anchor(name, isUniqueChild = false) {
|
|
977
982
|
const element = document.createDocumentFragment();
|
|
978
983
|
|
|
@@ -1281,6 +1286,9 @@ var NativeDocument = (function (exports) {
|
|
|
1281
1286
|
for(let key in attributes) {
|
|
1282
1287
|
const attributeName = key.toLowerCase();
|
|
1283
1288
|
let value = attributes[attributeName];
|
|
1289
|
+
if(value === null || value === undefined) {
|
|
1290
|
+
continue;
|
|
1291
|
+
}
|
|
1284
1292
|
if(Validator.isString(value)) {
|
|
1285
1293
|
value = value.resolveObservableTemplate ? value.resolveObservableTemplate() : value;
|
|
1286
1294
|
if(Validator.isString(value)) {
|
|
@@ -2052,14 +2060,6 @@ var NativeDocument = (function (exports) {
|
|
|
2052
2060
|
const data = {};
|
|
2053
2061
|
for(const key in initialValue) {
|
|
2054
2062
|
const itemValue = initialValue[key];
|
|
2055
|
-
if(Validator.isJson(itemValue)) {
|
|
2056
|
-
data[key] = Observable.init(itemValue);
|
|
2057
|
-
continue;
|
|
2058
|
-
}
|
|
2059
|
-
else if(Validator.isArray(itemValue)) {
|
|
2060
|
-
data[key] = Observable.array(itemValue);
|
|
2061
|
-
continue;
|
|
2062
|
-
}
|
|
2063
2063
|
data[key] = Observable(itemValue);
|
|
2064
2064
|
}
|
|
2065
2065
|
|
|
@@ -2078,7 +2078,7 @@ var NativeDocument = (function (exports) {
|
|
|
2078
2078
|
return result;
|
|
2079
2079
|
};
|
|
2080
2080
|
const $clone = function() {
|
|
2081
|
-
|
|
2081
|
+
return Observable.init($val());
|
|
2082
2082
|
};
|
|
2083
2083
|
const $updateWith = function(values) {
|
|
2084
2084
|
Observable.update(proxy, values);
|
|
@@ -3892,6 +3892,7 @@ var NativeDocument = (function (exports) {
|
|
|
3892
3892
|
exports.PluginsManager = PluginsManager;
|
|
3893
3893
|
exports.Store = Store;
|
|
3894
3894
|
exports.TemplateCloner = TemplateCloner;
|
|
3895
|
+
exports.Validator = validator;
|
|
3895
3896
|
exports.classPropertyAccumulator = classPropertyAccumulator;
|
|
3896
3897
|
exports.createTextNode = createTextNode;
|
|
3897
3898
|
exports.cssPropertyAccumulator = cssPropertyAccumulator;
|