native-document 1.0.77 → 1.0.79
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 +146 -120
- package/dist/native-document.dev.js +171 -125
- 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/rollup.config.js +0 -16
- package/src/components/$traits/HasItems.js +1 -1
- package/src/components/accordion/Accordion.js +2 -2
- package/src/components/accordion/AccordionItem.js +2 -2
- package/src/components/alert/Alert.js +2 -2
- package/src/components/avatar/Avatar.js +2 -2
- package/src/components/badge/Badge.js +2 -2
- package/src/components/breadcrumb/BreadCrumb.js +2 -2
- package/src/components/button/Button.js +2 -2
- package/src/components/card/Card.js +1 -1
- package/src/components/context-menu/ContextMenu.js +2 -2
- package/src/components/context-menu/ContextMenuGroup.js +1 -1
- package/src/components/context-menu/ContextMenuItem.js +1 -1
- package/src/components/divider/Divider.js +1 -1
- package/src/components/dropdown/Dropdown.js +2 -2
- package/src/components/dropdown/DropdownDivider.js +1 -1
- package/src/components/dropdown/DropdownGroup.js +1 -1
- package/src/components/dropdown/DropdownItem.js +1 -1
- package/src/components/dropdown/DropdownTrigger.js +1 -1
- package/src/components/form/FormControl.js +5 -5
- package/src/components/form/field/DefaultRender.js +2 -2
- package/src/components/form/field/Field.js +4 -4
- package/src/components/form/field/FieldCollection.js +5 -5
- package/src/components/form/field/types/CheckboxField.js +1 -1
- package/src/components/form/field/types/ColorField.js +1 -1
- package/src/components/form/field/types/DateField.js +1 -1
- package/src/components/form/field/types/EmailField.js +1 -1
- package/src/components/form/field/types/FileField.js +1 -1
- package/src/components/form/field/types/ImageField.js +1 -1
- package/src/components/form/field/types/NumberField.js +1 -1
- package/src/components/form/field/types/PasswordField.js +1 -1
- package/src/components/form/field/types/RadioField.js +1 -1
- package/src/components/form/field/types/StringField.js +1 -1
- package/src/components/form/field/types/TelField.js +1 -1
- package/src/components/form/field/types/TimeField.js +1 -1
- package/src/components/form/field/types/UrlField.js +1 -1
- package/src/components/form/validation/Validation.js +1 -1
- package/src/components/list/List.js +4 -4
- package/src/components/list/ListGroup.js +2 -2
- package/src/components/list/ListItem.js +2 -2
- package/src/components/menu/Menu.js +3 -3
- package/src/components/menu/MenuDivider.js +1 -1
- package/src/components/menu/MenuGroup.js +2 -2
- package/src/components/menu/MenuItem.js +2 -2
- package/src/components/modal/Modal.js +2 -2
- package/src/components/pagination/Pagination.js +2 -2
- package/src/components/popover/Popover.js +2 -2
- package/src/components/popover/PopoverFooter.js +1 -1
- package/src/components/popover/PopoverHeader.js +1 -1
- package/src/components/progress/Progress.js +3 -3
- package/src/components/slider/Slider.js +2 -2
- package/src/components/splitter/Splitter.js +3 -4
- package/src/components/splitter/SplitterPanel.js +1 -1
- package/src/components/stepper/Stepper.js +3 -3
- package/src/components/stepper/StepperStep.js +2 -2
- package/src/components/switch/Switch.js +2 -2
- package/src/components/table/ColumnGroup.js +1 -1
- package/src/components/table/DataTable.js +1 -1
- package/src/components/table/SimpleTable.js +1 -1
- package/src/components/tabs/Tabs.js +2 -2
- package/src/components/toast/Toast.js +2 -2
- package/src/components/tooltip/prototypes.js +1 -1
- package/src/core/data/MemoryManager.js +1 -2
- package/src/core/data/Observable.js +1 -1
- package/src/core/data/ObservableArray.js +4 -4
- package/src/core/data/ObservableItem.js +5 -5
- package/src/core/data/observable-helpers/array.js +2 -2
- package/src/core/data/observable-helpers/batch.js +2 -2
- package/src/core/data/observable-helpers/computed.js +6 -6
- package/src/core/data/observable-helpers/object.js +2 -2
- package/src/core/elements/anchor.js +3 -3
- package/src/core/elements/content-formatter.js +1 -1
- package/src/core/elements/control/for-each-array.js +5 -6
- package/src/core/elements/control/for-each.js +7 -7
- package/src/core/elements/control/show-if.js +5 -5
- package/src/core/elements/control/show-when.js +2 -2
- package/src/core/elements/control/switch.js +4 -4
- package/src/core/elements/description-list.js +1 -1
- package/src/core/elements/form.js +1 -1
- package/src/core/elements/html5-semantics.js +1 -1
- package/src/core/elements/img.js +3 -3
- package/src/core/elements/index.js +1 -1
- package/src/core/elements/interactive.js +1 -1
- package/src/core/elements/list.js +1 -1
- package/src/core/elements/medias.js +1 -1
- package/src/core/elements/meta-data.js +1 -1
- package/src/core/elements/table.js +1 -1
- package/src/core/utils/EventEmitter.js +1 -1
- package/src/core/utils/args-types.js +2 -2
- package/src/core/utils/filters/standard.js +1 -1
- package/src/core/utils/filters/utils.js +1 -1
- package/src/core/utils/prototypes.js +2 -2
- package/src/core/utils/validator.js +5 -5
- package/src/core/wrappers/AttributesWrapper.js +3 -3
- package/src/core/wrappers/DocumentObserver.js +0 -1
- package/src/core/wrappers/ElementCreator.js +3 -3
- package/src/core/wrappers/HtmlElementWrapper.js +2 -2
- package/src/core/wrappers/NDElement.js +3 -3
- package/src/core/wrappers/NdPrototype.js +1 -1
- package/src/core/wrappers/SingletonView.js +1 -1
- package/src/core/wrappers/TemplateCloner.js +1 -2
- package/src/core/wrappers/prototypes/attributes-extensions.js +4 -4
- package/src/core/wrappers/prototypes/bind-class-extensions.js +4 -4
- package/src/core/wrappers/prototypes/nd-element-extensions.js +6 -6
- package/src/devtools/app/App.js +2 -2
- package/src/devtools/hrm/ComponentRegistry.js +2 -2
- package/src/devtools/plugin.js +1 -1
- package/src/devtools/widget/DevToolsWidget.js +2 -2
- package/src/router/Route.js +1 -1
- package/src/router/RouteGroupHelper.js +1 -1
- package/src/router/Router.js +4 -4
- package/src/router/RouterComponent.js +1 -1
- package/src/router/link.js +4 -4
- package/src/router/modes/HistoryRouter.js +1 -1
- package/types/control-flow.d.ts +0 -1
- package/types/filters/dates.d.ts +1 -1
- package/types/filters/types.d.ts +1 -1
- package/utils.js +3 -3
- package/jsconfig.json +0 -15
- /package/src/{core → router}/errors/RouterError.js +0 -0
|
@@ -1404,7 +1404,38 @@ var NativeComponents = (function (exports) {
|
|
|
1404
1404
|
return anchorFragment;
|
|
1405
1405
|
}
|
|
1406
1406
|
|
|
1407
|
-
const BOOLEAN_ATTRIBUTES = [
|
|
1407
|
+
const BOOLEAN_ATTRIBUTES = new Set([
|
|
1408
|
+
'checked',
|
|
1409
|
+
'selected',
|
|
1410
|
+
'disabled',
|
|
1411
|
+
'readonly',
|
|
1412
|
+
'required',
|
|
1413
|
+
'autofocus',
|
|
1414
|
+
'multiple',
|
|
1415
|
+
'autocomplete',
|
|
1416
|
+
'hidden',
|
|
1417
|
+
'contenteditable',
|
|
1418
|
+
'spellcheck',
|
|
1419
|
+
'translate',
|
|
1420
|
+
'draggable',
|
|
1421
|
+
'async',
|
|
1422
|
+
'defer',
|
|
1423
|
+
'autoplay',
|
|
1424
|
+
'controls',
|
|
1425
|
+
'loop',
|
|
1426
|
+
'muted',
|
|
1427
|
+
'download',
|
|
1428
|
+
'reversed',
|
|
1429
|
+
'open',
|
|
1430
|
+
'default',
|
|
1431
|
+
'formnovalidate',
|
|
1432
|
+
'novalidate',
|
|
1433
|
+
'scoped',
|
|
1434
|
+
'itemscope',
|
|
1435
|
+
'allowfullscreen',
|
|
1436
|
+
'allowpaymentrequest',
|
|
1437
|
+
'playsinline'
|
|
1438
|
+
]);
|
|
1408
1439
|
|
|
1409
1440
|
/**
|
|
1410
1441
|
*
|
|
@@ -1592,6 +1623,12 @@ var NativeComponents = (function (exports) {
|
|
|
1592
1623
|
}
|
|
1593
1624
|
}
|
|
1594
1625
|
|
|
1626
|
+
const NdBindings = {
|
|
1627
|
+
class: (element, value) => bindClassAttribute(element, value),
|
|
1628
|
+
style: (element, value) => bindStyleAttribute(element, value),
|
|
1629
|
+
};
|
|
1630
|
+
|
|
1631
|
+
|
|
1595
1632
|
/**
|
|
1596
1633
|
*
|
|
1597
1634
|
* @param {HTMLElement} element
|
|
@@ -1605,41 +1642,27 @@ var NativeComponents = (function (exports) {
|
|
|
1605
1642
|
|
|
1606
1643
|
for(let key in attributes) {
|
|
1607
1644
|
const attributeName = key.toLowerCase();
|
|
1608
|
-
let value = attributes[
|
|
1609
|
-
if(value
|
|
1645
|
+
let value = attributes[key];
|
|
1646
|
+
if(value == null) {
|
|
1610
1647
|
continue;
|
|
1611
1648
|
}
|
|
1612
1649
|
if(value.handleNdAttribute) {
|
|
1613
1650
|
value.handleNdAttribute(element, attributeName, value);
|
|
1614
1651
|
continue;
|
|
1615
1652
|
}
|
|
1616
|
-
if(
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
continue;
|
|
1623
|
-
}
|
|
1624
|
-
if(attributeName === 'style' && Validator.isObject(value)) {
|
|
1625
|
-
bindStyleAttribute(element, value);
|
|
1626
|
-
continue;
|
|
1653
|
+
if(typeof value === 'object') {
|
|
1654
|
+
const binding = NdBindings[attributeName];
|
|
1655
|
+
if(binding) {
|
|
1656
|
+
binding(element, value);
|
|
1657
|
+
continue;
|
|
1658
|
+
}
|
|
1627
1659
|
}
|
|
1628
|
-
if(BOOLEAN_ATTRIBUTES.
|
|
1660
|
+
if(BOOLEAN_ATTRIBUTES.has(attributeName)) {
|
|
1629
1661
|
bindBooleanAttribute(element, attributeName, value);
|
|
1630
1662
|
continue;
|
|
1631
1663
|
}
|
|
1632
|
-
if(Validator.isObservable(value)) {
|
|
1633
|
-
bindAttributeWithObservable(element, attributeName, value);
|
|
1634
|
-
continue;
|
|
1635
|
-
}
|
|
1636
|
-
if(value.$hydrate) {
|
|
1637
|
-
value.$hydrate(element, attributeName);
|
|
1638
|
-
continue;
|
|
1639
|
-
}
|
|
1640
1664
|
|
|
1641
1665
|
element.setAttribute(attributeName, value);
|
|
1642
|
-
|
|
1643
1666
|
}
|
|
1644
1667
|
return element;
|
|
1645
1668
|
}
|
|
@@ -1700,8 +1723,16 @@ var NativeComponents = (function (exports) {
|
|
|
1700
1723
|
element.setAttribute(attributeName, this);
|
|
1701
1724
|
};
|
|
1702
1725
|
|
|
1726
|
+
Number.prototype.handleNdAttribute = function(element, attributeName) {
|
|
1727
|
+
element.setAttribute(attributeName, this);
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1730
|
+
Boolean.prototype.handleNdAttribute = function(element, attrName) {
|
|
1731
|
+
bindBooleanAttribute(element, attrName, this);
|
|
1732
|
+
};
|
|
1733
|
+
|
|
1703
1734
|
ObservableItem.prototype.handleNdAttribute = function(element, attributeName) {
|
|
1704
|
-
if(BOOLEAN_ATTRIBUTES.
|
|
1735
|
+
if(BOOLEAN_ATTRIBUTES.has(attributeName)) {
|
|
1705
1736
|
bindBooleanAttribute(element, attributeName, this);
|
|
1706
1737
|
return;
|
|
1707
1738
|
}
|
|
@@ -1791,22 +1822,14 @@ var NativeComponents = (function (exports) {
|
|
|
1791
1822
|
PluginsManager.emit('AfterProcessChildren', parent);
|
|
1792
1823
|
},
|
|
1793
1824
|
getChild(child) {
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
child = child.toNdElement();
|
|
1800
|
-
if(Validator.isElement(child)) {
|
|
1801
|
-
return child;
|
|
1802
|
-
}
|
|
1803
|
-
if(child == null) {
|
|
1804
|
-
return null;
|
|
1805
|
-
}
|
|
1806
|
-
} while (child.toNdElement);
|
|
1825
|
+
while (child?.toNdElement) {
|
|
1826
|
+
child = child.toNdElement();
|
|
1827
|
+
|
|
1828
|
+
if (Validator.isElement(child)) return child;
|
|
1829
|
+
if (!child) return null;
|
|
1807
1830
|
}
|
|
1808
1831
|
|
|
1809
|
-
return ElementCreator.createStaticTextNode(null, child);
|
|
1832
|
+
return child ? ElementCreator.createStaticTextNode(null, child) : null;
|
|
1810
1833
|
},
|
|
1811
1834
|
/**
|
|
1812
1835
|
*
|
|
@@ -2284,6 +2307,9 @@ var NativeComponents = (function (exports) {
|
|
|
2284
2307
|
});
|
|
2285
2308
|
|
|
2286
2309
|
ObservableArray.prototype.clear = function() {
|
|
2310
|
+
if(this.$currentValue.length === 0) {
|
|
2311
|
+
return;
|
|
2312
|
+
}
|
|
2287
2313
|
this.$currentValue.length = 0;
|
|
2288
2314
|
this.trigger({ action: 'clear' });
|
|
2289
2315
|
return true;
|
|
@@ -8647,87 +8673,6 @@ var NativeComponents = (function (exports) {
|
|
|
8647
8673
|
Spinner.prototype.$build = function() {};
|
|
8648
8674
|
Spinner.prototype.toNdElement = function() {};
|
|
8649
8675
|
|
|
8650
|
-
function SplitterPanel(content, config = {}) {
|
|
8651
|
-
if(!(this instanceof SplitterPanel)) {
|
|
8652
|
-
return new SplitterPanel(content, config);
|
|
8653
|
-
}
|
|
8654
|
-
|
|
8655
|
-
if (typeof content === 'object' && !content.tagName) {
|
|
8656
|
-
config = content;
|
|
8657
|
-
content = config.content || null;
|
|
8658
|
-
}
|
|
8659
|
-
|
|
8660
|
-
this.$description = {
|
|
8661
|
-
content: content || null,
|
|
8662
|
-
size: null,
|
|
8663
|
-
minSize: null,
|
|
8664
|
-
maxSize: null,
|
|
8665
|
-
collapsible: false,
|
|
8666
|
-
collapsed: false,
|
|
8667
|
-
resizable: true,
|
|
8668
|
-
data: null,
|
|
8669
|
-
render: null,
|
|
8670
|
-
...config
|
|
8671
|
-
};
|
|
8672
|
-
}
|
|
8673
|
-
|
|
8674
|
-
BaseComponent.extends(SplitterPanel, BaseComponent);
|
|
8675
|
-
|
|
8676
|
-
SplitterPanel.defaultTemplate = null;
|
|
8677
|
-
|
|
8678
|
-
SplitterPanel.use = function(template) {
|
|
8679
|
-
SplitterPanel.defaultTemplate = template.splitterPanel;
|
|
8680
|
-
};
|
|
8681
|
-
|
|
8682
|
-
SplitterPanel.prototype.content = function(content) {
|
|
8683
|
-
this.$description.content = content;
|
|
8684
|
-
return this;
|
|
8685
|
-
};
|
|
8686
|
-
|
|
8687
|
-
SplitterPanel.prototype.size = function(size) {
|
|
8688
|
-
this.$description.size = size;
|
|
8689
|
-
return this;
|
|
8690
|
-
};
|
|
8691
|
-
|
|
8692
|
-
SplitterPanel.prototype.minSize = function(size) {
|
|
8693
|
-
this.$description.minSize = size;
|
|
8694
|
-
return this;
|
|
8695
|
-
};
|
|
8696
|
-
|
|
8697
|
-
SplitterPanel.prototype.maxSize = function(size) {
|
|
8698
|
-
this.$description.maxSize = size;
|
|
8699
|
-
return this;
|
|
8700
|
-
};
|
|
8701
|
-
|
|
8702
|
-
SplitterPanel.prototype.collapsible = function(collapsible = true) {
|
|
8703
|
-
this.$description.collapsible = collapsible;
|
|
8704
|
-
return this;
|
|
8705
|
-
};
|
|
8706
|
-
|
|
8707
|
-
SplitterPanel.prototype.collapsed = function(collapsed = true) {
|
|
8708
|
-
this.$description.collapsed = collapsed;
|
|
8709
|
-
return this;
|
|
8710
|
-
};
|
|
8711
|
-
|
|
8712
|
-
SplitterPanel.prototype.resizable = function(resizable = true) {
|
|
8713
|
-
this.$description.resizable = resizable;
|
|
8714
|
-
return this;
|
|
8715
|
-
};
|
|
8716
|
-
|
|
8717
|
-
SplitterPanel.prototype.fixed = function() {
|
|
8718
|
-
return this.resizable(false);
|
|
8719
|
-
};
|
|
8720
|
-
|
|
8721
|
-
SplitterPanel.prototype.data = function(data) {
|
|
8722
|
-
this.$description.data = data;
|
|
8723
|
-
return this;
|
|
8724
|
-
};
|
|
8725
|
-
|
|
8726
|
-
SplitterPanel.prototype.render = function(renderFn) {
|
|
8727
|
-
this.$description.render = renderFn;
|
|
8728
|
-
return this;
|
|
8729
|
-
};
|
|
8730
|
-
|
|
8731
8676
|
function Splitter(config = {}) {
|
|
8732
8677
|
if(!(this instanceof Splitter)) {
|
|
8733
8678
|
return new Splitter(config);
|
|
@@ -8819,6 +8764,87 @@ var NativeComponents = (function (exports) {
|
|
|
8819
8764
|
return this;
|
|
8820
8765
|
};
|
|
8821
8766
|
|
|
8767
|
+
function SplitterPanel(content, config = {}) {
|
|
8768
|
+
if(!(this instanceof SplitterPanel)) {
|
|
8769
|
+
return new SplitterPanel(content, config);
|
|
8770
|
+
}
|
|
8771
|
+
|
|
8772
|
+
if (typeof content === 'object' && !content.tagName) {
|
|
8773
|
+
config = content;
|
|
8774
|
+
content = config.content || null;
|
|
8775
|
+
}
|
|
8776
|
+
|
|
8777
|
+
this.$description = {
|
|
8778
|
+
content: content || null,
|
|
8779
|
+
size: null,
|
|
8780
|
+
minSize: null,
|
|
8781
|
+
maxSize: null,
|
|
8782
|
+
collapsible: false,
|
|
8783
|
+
collapsed: false,
|
|
8784
|
+
resizable: true,
|
|
8785
|
+
data: null,
|
|
8786
|
+
render: null,
|
|
8787
|
+
...config
|
|
8788
|
+
};
|
|
8789
|
+
}
|
|
8790
|
+
|
|
8791
|
+
BaseComponent.extends(SplitterPanel, BaseComponent);
|
|
8792
|
+
|
|
8793
|
+
SplitterPanel.defaultTemplate = null;
|
|
8794
|
+
|
|
8795
|
+
SplitterPanel.use = function(template) {
|
|
8796
|
+
SplitterPanel.defaultTemplate = template.splitterPanel;
|
|
8797
|
+
};
|
|
8798
|
+
|
|
8799
|
+
SplitterPanel.prototype.content = function(content) {
|
|
8800
|
+
this.$description.content = content;
|
|
8801
|
+
return this;
|
|
8802
|
+
};
|
|
8803
|
+
|
|
8804
|
+
SplitterPanel.prototype.size = function(size) {
|
|
8805
|
+
this.$description.size = size;
|
|
8806
|
+
return this;
|
|
8807
|
+
};
|
|
8808
|
+
|
|
8809
|
+
SplitterPanel.prototype.minSize = function(size) {
|
|
8810
|
+
this.$description.minSize = size;
|
|
8811
|
+
return this;
|
|
8812
|
+
};
|
|
8813
|
+
|
|
8814
|
+
SplitterPanel.prototype.maxSize = function(size) {
|
|
8815
|
+
this.$description.maxSize = size;
|
|
8816
|
+
return this;
|
|
8817
|
+
};
|
|
8818
|
+
|
|
8819
|
+
SplitterPanel.prototype.collapsible = function(collapsible = true) {
|
|
8820
|
+
this.$description.collapsible = collapsible;
|
|
8821
|
+
return this;
|
|
8822
|
+
};
|
|
8823
|
+
|
|
8824
|
+
SplitterPanel.prototype.collapsed = function(collapsed = true) {
|
|
8825
|
+
this.$description.collapsed = collapsed;
|
|
8826
|
+
return this;
|
|
8827
|
+
};
|
|
8828
|
+
|
|
8829
|
+
SplitterPanel.prototype.resizable = function(resizable = true) {
|
|
8830
|
+
this.$description.resizable = resizable;
|
|
8831
|
+
return this;
|
|
8832
|
+
};
|
|
8833
|
+
|
|
8834
|
+
SplitterPanel.prototype.fixed = function() {
|
|
8835
|
+
return this.resizable(false);
|
|
8836
|
+
};
|
|
8837
|
+
|
|
8838
|
+
SplitterPanel.prototype.data = function(data) {
|
|
8839
|
+
this.$description.data = data;
|
|
8840
|
+
return this;
|
|
8841
|
+
};
|
|
8842
|
+
|
|
8843
|
+
SplitterPanel.prototype.render = function(renderFn) {
|
|
8844
|
+
this.$description.render = renderFn;
|
|
8845
|
+
return this;
|
|
8846
|
+
};
|
|
8847
|
+
|
|
8822
8848
|
function Stepper(config = {}) {
|
|
8823
8849
|
if(!(this instanceof Stepper)) {
|
|
8824
8850
|
return new Stepper(config);
|