|
1 | 1 |
|
2 | | -/* Smart UI v8.0.0 (2020-Sep) |
| 2 | +/* Smart UI v8.1.1 (2020-Nov) |
3 | 3 | Copyright (c) 2011-2020 jQWidgets. |
4 | 4 | License: https://htmlelements.com/license/ */ // |
5 | 5 |
|
6 | 6 | (function () { |
7 | 7 |
|
8 | 8 |
|
9 | | - const Version = '7.7.1'; |
| 9 | + const Version = '8.0.1'; |
10 | 10 | const templates = []; |
11 | 11 |
|
12 | 12 | let namespace = 'Smart'; |
@@ -943,9 +943,29 @@ License: https://htmlelements.com/license/ */ // |
943 | 943 | listen(eventType) { |
944 | 944 | const that = this; |
945 | 945 |
|
946 | | - if (eventType === 'resize') { |
947 | | - if (!that.target.resizeTrigger && that.target !== document && that.target !== window && that.target.hasResizeObserver !== false) { |
| 946 | + if (eventType === 'resize' && that.target !== document && that.target !== window && that.target.hasResizeObserver !== false) { |
| 947 | + if (Smart.Utilities.Core.Browser.Firefox) { |
| 948 | + if (!that.target.resizeObserver) { |
| 949 | + let firstCallPassed = false; |
| 950 | + const resizeObserver = new ResizeObserver(() => { |
| 951 | + if (!firstCallPassed) { |
| 952 | + firstCallPassed = true; |
| 953 | + return; |
| 954 | + } |
| 955 | + |
| 956 | + const resizeEvent = new CustomEvent('resize', { |
| 957 | + bubbles: false, |
| 958 | + cancelable: true |
| 959 | + }); |
| 960 | + |
| 961 | + that.resize(resizeEvent); |
| 962 | + }); |
948 | 963 |
|
| 964 | + resizeObserver.observe(that.target); |
| 965 | + that.target.resizeObserver = resizeObserver; |
| 966 | + } |
| 967 | + } |
| 968 | + else if (!that.target.resizeTrigger) { |
949 | 969 | const container = document.createElement('div'); |
950 | 970 | container.className = 'smart-resize-trigger-container'; |
951 | 971 | container.innerHTML = |
@@ -1104,18 +1124,26 @@ License: https://htmlelements.com/license/ */ // |
1104 | 1124 | delete that.target._handleDocumentUpId; |
1105 | 1125 | } |
1106 | 1126 |
|
1107 | | - if (eventType === 'resize' && that.target.resizeTrigger) { |
1108 | | - const container = that.target.resizeTrigger; |
1109 | | - const expand = container.childNodes[0]; |
1110 | | - const shrink = container.childNodes[1]; |
| 1127 | + if (eventType === 'resize') { |
| 1128 | + if (Smart.Utilities.Core.Browser.Firefox) { |
| 1129 | + if (that.target.resizeObserver) { |
| 1130 | + that.target.resizeObserver.unobserve(that.target); |
| 1131 | + delete that.target.resizeObserver; |
| 1132 | + } |
| 1133 | + } |
| 1134 | + else if (that.target.resizeTrigger) { |
| 1135 | + const container = that.target.resizeTrigger; |
| 1136 | + const expand = container.childNodes[0]; |
| 1137 | + const shrink = container.childNodes[1]; |
1111 | 1138 |
|
1112 | | - expand.removeEventListener('scroll', that.target.resizeHandler); |
1113 | | - shrink.removeEventListener('scroll', that.target.resizeHandler); |
| 1139 | + expand.removeEventListener('scroll', that.target.resizeHandler); |
| 1140 | + shrink.removeEventListener('scroll', that.target.resizeHandler); |
1114 | 1141 |
|
1115 | | - that.target.resizeHandler = null; |
1116 | | - container.parentNode.removeChild(container); |
| 1142 | + that.target.resizeHandler = null; |
| 1143 | + container.parentNode.removeChild(container); |
1117 | 1144 |
|
1118 | | - delete that.target.resizeTrigger; |
| 1145 | + delete that.target.resizeTrigger; |
| 1146 | + } |
1119 | 1147 | } |
1120 | 1148 | } |
1121 | 1149 |
|
@@ -3567,7 +3595,7 @@ License: https://htmlelements.com/license/ */ // |
3567 | 3595 | if (rootNode.host) { |
3568 | 3596 | const getNodeParents = (node) => { |
3569 | 3597 | let matched = [node], |
3570 | | - current = node.parentNode; |
| 3598 | + current = node.parentNode; |
3571 | 3599 |
|
3572 | 3600 | while (current && current.nodeType !== 9) { |
3573 | 3601 | if (current instanceof HTMLElement === true) { |
@@ -4566,6 +4594,10 @@ License: https://htmlelements.com/license/ */ // |
4566 | 4594 | that.attributeChanged(name, oldValue, newValue); |
4567 | 4595 | } |
4568 | 4596 |
|
| 4597 | + if (that.onAttributeChanged) { |
| 4598 | + that.onAttributeChanged(name, oldValue, newValue); |
| 4599 | + } |
| 4600 | + |
4569 | 4601 | if (!property || (property && property.isUpdating)) { |
4570 | 4602 | return; |
4571 | 4603 | } |
@@ -6045,8 +6077,9 @@ License: https://htmlelements.com/license/ */ // |
6045 | 6077 |
|
6046 | 6078 | get isInShadowDOM() { |
6047 | 6079 | const that = this; |
| 6080 | + const rootNode = that.getRootNode(); |
6048 | 6081 |
|
6049 | | - return that.getRootNode() !== document; |
| 6082 | + return rootNode !== document && rootNode !== that; |
6050 | 6083 | } |
6051 | 6084 |
|
6052 | 6085 | getShadowRootOrBody() { |
@@ -6455,6 +6488,25 @@ License: https://htmlelements.com/license/ */ // |
6455 | 6488 | that.classList.remove('smart-element-init'); |
6456 | 6489 | } |
6457 | 6490 |
|
| 6491 | + if (document.readyState === 'complete') { |
| 6492 | + if (window[namespace].isAngular === undefined) { |
| 6493 | + window[namespace].isAngular = document.body.querySelector('[ng-version]') !== null; |
| 6494 | + } |
| 6495 | + |
| 6496 | + if (window[namespace].isAngular) { |
| 6497 | + for (let i = 0; i < that.parents.length; i++) { |
| 6498 | + if (that.parents[i].nodeName.toLowerCase().startsWith(namespace.toLowerCase() + '-')) { |
| 6499 | + break; |
| 6500 | + } |
| 6501 | + |
| 6502 | + if (that.parents[i].hasAttribute('ng-version')) { |
| 6503 | + window[namespace].RenderMode = 'manual'; |
| 6504 | + break; |
| 6505 | + } |
| 6506 | + } |
| 6507 | + } |
| 6508 | + } |
| 6509 | + |
6458 | 6510 | if (document.readyState === 'complete' && window[namespace].RenderMode !== 'manual' /*&& !ElementRegistry.isRegistering */) { |
6459 | 6511 | const parents = that.parents; |
6460 | 6512 |
|
@@ -6992,6 +7044,7 @@ License: https://htmlelements.com/license/ */ // |
6992 | 7044 | const itemProxy = new Proxy(item, { |
6993 | 7045 | deleteProperty: function (target, property) { |
6994 | 7046 | delete target[property]; |
| 7047 | + return true; |
6995 | 7048 | }, |
6996 | 7049 | set: function (target, property, value/*, receiver*/) { |
6997 | 7050 | const oldValue = target[property]; |
@@ -7655,6 +7708,7 @@ License: https://htmlelements.com/license/ */ // |
7655 | 7708 | Version: Version, |
7656 | 7709 | RenderMode: userDefinedSettings.RenderMode || 'auto', |
7657 | 7710 | Render: render, |
| 7711 | + Data: data, |
7658 | 7712 | License: 'Evaluation' |
7659 | 7713 | }); |
7660 | 7714 |
|
@@ -7843,8 +7897,8 @@ License: https://htmlelements.com/license/ */ // |
7843 | 7897 | <content></content> |
7844 | 7898 | </div> |
7845 | 7899 | </div> |
7846 | | - <smart-scroll-bar id="verticalScrollBar" animation="[[animation]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]" orientation="vertical"></smart-scroll-bar> |
7847 | | - <smart-scroll-bar id="horizontalScrollBar" animation="[[animation]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]"></smart-scroll-bar> |
| 7900 | + <smart-scroll-bar id="verticalScrollBar" theme="[[theme]]" animation="[[animation]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]" orientation="vertical"></smart-scroll-bar> |
| 7901 | + <smart-scroll-bar id="horizontalScrollBar" theme="[[theme]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]"></smart-scroll-bar> |
7848 | 7902 | </div>`; |
7849 | 7903 | } |
7850 | 7904 |
|
@@ -8615,7 +8669,7 @@ License: https://htmlelements.com/license/ */ // |
8615 | 8669 | that._dropDownParent = that.getRootNode().host.shadowRoot; |
8616 | 8670 | } |
8617 | 8671 | else { |
8618 | | - that._dropDownParent = document.body; |
| 8672 | + that._dropDownParent = document.body; |
8619 | 8673 | } |
8620 | 8674 | } |
8621 | 8675 | else if (dropDownAppendTo instanceof HTMLElement) { |
|
0 commit comments