native-document 1.0.75 → 1.0.76
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 +22 -35
- package/dist/native-document.dev.js +18 -28
- 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/package.json +1 -1
- package/src/components/table/DataTable.js +4 -7
- package/src/core/wrappers/AttributesWrapper.js +17 -1
- package/src/core/wrappers/prototypes/attributes-extensions.js +3 -35
|
@@ -1363,14 +1363,30 @@ var NativeComponents = (function (exports) {
|
|
|
1363
1363
|
value.handleNdAttribute(element, attributeName, value);
|
|
1364
1364
|
continue;
|
|
1365
1365
|
}
|
|
1366
|
+
if(Validator.isString(value)) {
|
|
1367
|
+
element.setAttribute(attributeName, value);
|
|
1368
|
+
return;
|
|
1369
|
+
}
|
|
1370
|
+
if(attributeName === 'class' && Validator.isObject(value)) {
|
|
1371
|
+
bindClassAttribute(element, value);
|
|
1372
|
+
continue;
|
|
1373
|
+
}
|
|
1374
|
+
if(attributeName === 'style' && Validator.isObject(value)) {
|
|
1375
|
+
bindStyleAttribute(element, value);
|
|
1376
|
+
continue;
|
|
1377
|
+
}
|
|
1366
1378
|
if(BOOLEAN_ATTRIBUTES.includes(attributeName)) {
|
|
1367
1379
|
bindBooleanAttribute(element, attributeName, value);
|
|
1368
|
-
|
|
1380
|
+
continue;
|
|
1369
1381
|
}
|
|
1370
1382
|
if(Validator.isObservable(value)) {
|
|
1371
1383
|
bindAttributeWithObservable(element, attributeName, value);
|
|
1372
1384
|
continue;
|
|
1373
1385
|
}
|
|
1386
|
+
if(value.$hydrate) {
|
|
1387
|
+
value.$hydrate(element, attributeName);
|
|
1388
|
+
continue;
|
|
1389
|
+
}
|
|
1374
1390
|
|
|
1375
1391
|
element.setAttribute(attributeName, value);
|
|
1376
1392
|
|
|
@@ -1430,34 +1446,8 @@ var NativeComponents = (function (exports) {
|
|
|
1430
1446
|
return ElementCreator.createHydratableNode(null, this);
|
|
1431
1447
|
};
|
|
1432
1448
|
|
|
1433
|
-
Object.prototype.handleNdAttribute = function(element, attributeName) {
|
|
1434
|
-
if(attributeName === 'class') {
|
|
1435
|
-
bindClassAttribute(element, this);
|
|
1436
|
-
return;
|
|
1437
|
-
}
|
|
1438
|
-
if(attributeName === 'style') {
|
|
1439
|
-
bindStyleAttribute(element, this);
|
|
1440
|
-
|
|
1441
|
-
}
|
|
1442
|
-
};
|
|
1443
|
-
|
|
1444
1449
|
String.prototype.handleNdAttribute = function(element, attributeName) {
|
|
1445
|
-
|
|
1446
|
-
if(Validator.isString(value)) {
|
|
1447
|
-
element.setAttribute(attributeName, value);
|
|
1448
|
-
return;
|
|
1449
|
-
}
|
|
1450
|
-
const observables = value.filter(item => Validator.isObservable(item));
|
|
1451
|
-
value = Observable.computed(() => {
|
|
1452
|
-
return value.map(item => Validator.isObservable(item) ? item.val() : item).join(' ') || ' ';
|
|
1453
|
-
}, observables);
|
|
1454
|
-
|
|
1455
|
-
if(BOOLEAN_ATTRIBUTES.includes(attributeName)) {
|
|
1456
|
-
bindBooleanAttribute(element, attributeName, value);
|
|
1457
|
-
return;
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
bindAttributeWithObservable(element, attributeName, value);
|
|
1450
|
+
element.setAttribute(attributeName, this);
|
|
1461
1451
|
};
|
|
1462
1452
|
|
|
1463
1453
|
ObservableItem.prototype.handleNdAttribute = function(element, attributeName) {
|
|
@@ -5284,9 +5274,9 @@ var NativeComponents = (function (exports) {
|
|
|
5284
5274
|
...configs
|
|
5285
5275
|
});
|
|
5286
5276
|
|
|
5287
|
-
this.$currentPage =
|
|
5288
|
-
this.$selectedRows =
|
|
5289
|
-
this.$expandedRows =
|
|
5277
|
+
this.$currentPage = Observable(1);
|
|
5278
|
+
this.$selectedRows = Observable.array();
|
|
5279
|
+
this.$expandedRows = Observable.array();
|
|
5290
5280
|
}
|
|
5291
5281
|
|
|
5292
5282
|
DataTable.defaultToolbarTemplate = null;
|
|
@@ -5305,9 +5295,6 @@ var NativeComponents = (function (exports) {
|
|
|
5305
5295
|
|
|
5306
5296
|
DataTable.prototype.paginate = function(size) {
|
|
5307
5297
|
this.$description.pageSize = size;
|
|
5308
|
-
if(size > 0) {
|
|
5309
|
-
this.$currentPage = Observable(1);
|
|
5310
|
-
}
|
|
5311
5298
|
return this;
|
|
5312
5299
|
};
|
|
5313
5300
|
|
|
@@ -5377,7 +5364,7 @@ var NativeComponents = (function (exports) {
|
|
|
5377
5364
|
return this;
|
|
5378
5365
|
};
|
|
5379
5366
|
|
|
5380
|
-
DataTable.prototype.
|
|
5367
|
+
DataTable.prototype.goToFirstPage = function(page) {
|
|
5381
5368
|
// TODO: implement this action
|
|
5382
5369
|
return this;
|
|
5383
5370
|
};
|
|
@@ -1423,14 +1423,30 @@ var NativeDocument = (function (exports) {
|
|
|
1423
1423
|
value.handleNdAttribute(element, attributeName, value);
|
|
1424
1424
|
continue;
|
|
1425
1425
|
}
|
|
1426
|
+
if(Validator.isString(value)) {
|
|
1427
|
+
element.setAttribute(attributeName, value);
|
|
1428
|
+
return;
|
|
1429
|
+
}
|
|
1430
|
+
if(attributeName === 'class' && Validator.isObject(value)) {
|
|
1431
|
+
bindClassAttribute(element, value);
|
|
1432
|
+
continue;
|
|
1433
|
+
}
|
|
1434
|
+
if(attributeName === 'style' && Validator.isObject(value)) {
|
|
1435
|
+
bindStyleAttribute(element, value);
|
|
1436
|
+
continue;
|
|
1437
|
+
}
|
|
1426
1438
|
if(BOOLEAN_ATTRIBUTES.includes(attributeName)) {
|
|
1427
1439
|
bindBooleanAttribute(element, attributeName, value);
|
|
1428
|
-
|
|
1440
|
+
continue;
|
|
1429
1441
|
}
|
|
1430
1442
|
if(Validator.isObservable(value)) {
|
|
1431
1443
|
bindAttributeWithObservable(element, attributeName, value);
|
|
1432
1444
|
continue;
|
|
1433
1445
|
}
|
|
1446
|
+
if(value.$hydrate) {
|
|
1447
|
+
value.$hydrate(element, attributeName);
|
|
1448
|
+
continue;
|
|
1449
|
+
}
|
|
1434
1450
|
|
|
1435
1451
|
element.setAttribute(attributeName, value);
|
|
1436
1452
|
|
|
@@ -1490,34 +1506,8 @@ var NativeDocument = (function (exports) {
|
|
|
1490
1506
|
return ElementCreator.createHydratableNode(null, this);
|
|
1491
1507
|
};
|
|
1492
1508
|
|
|
1493
|
-
Object.prototype.handleNdAttribute = function(element, attributeName) {
|
|
1494
|
-
if(attributeName === 'class') {
|
|
1495
|
-
bindClassAttribute(element, this);
|
|
1496
|
-
return;
|
|
1497
|
-
}
|
|
1498
|
-
if(attributeName === 'style') {
|
|
1499
|
-
bindStyleAttribute(element, this);
|
|
1500
|
-
|
|
1501
|
-
}
|
|
1502
|
-
};
|
|
1503
|
-
|
|
1504
1509
|
String.prototype.handleNdAttribute = function(element, attributeName) {
|
|
1505
|
-
|
|
1506
|
-
if(Validator.isString(value)) {
|
|
1507
|
-
element.setAttribute(attributeName, value);
|
|
1508
|
-
return;
|
|
1509
|
-
}
|
|
1510
|
-
const observables = value.filter(item => Validator.isObservable(item));
|
|
1511
|
-
value = Observable.computed(() => {
|
|
1512
|
-
return value.map(item => Validator.isObservable(item) ? item.val() : item).join(' ') || ' ';
|
|
1513
|
-
}, observables);
|
|
1514
|
-
|
|
1515
|
-
if(BOOLEAN_ATTRIBUTES.includes(attributeName)) {
|
|
1516
|
-
bindBooleanAttribute(element, attributeName, value);
|
|
1517
|
-
return;
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1520
|
-
bindAttributeWithObservable(element, attributeName, value);
|
|
1510
|
+
element.setAttribute(attributeName, this);
|
|
1521
1511
|
};
|
|
1522
1512
|
|
|
1523
1513
|
ObservableItem.prototype.handleNdAttribute = function(element, attributeName) {
|