@grapecity/wijmo.angular2legacy.directivebase 5.20261.50 → 5.20262.60
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/es2015-commonjs.js +2 -2
- package/es2015-esm.js +2 -2
- package/es2022-fesm.mjs +14 -0
- package/es5-esm.js +2 -2
- package/index.d.ts +119 -99
- package/index.js +2 -2
- package/package.json +7 -7
- package/index.metadata.json +0 -1
package/es2015-commonjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.
|
|
3
|
+
* Wijmo Library 5.20262.60
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
"use strict";var __importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.hasOwnProperty.call(e,i)&&(t[i]=e[i]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});const core_1=require("@angular/core"),wijmo=__importStar(require("@grapecity/wijmo"));class WjOptions{}WjOptions.asyncBindings=!0;exports.WjOptions=WjOptions;class WjComponentResolvedMetadata{constructor(e){this.changeEventMap=[];this.allImplEvents=[];this.resolveChangeEventMap(e)}resolveChangeEventMap(e){const t=this.changeEventMap,i=e.outputs,n=e.changeEvents||{};t.splice(0,t.length);this.allImplEvents=[];if(!i||!i.length)return;const r=i.map(e=>e.split(":")).map(e=>({implName:e[0].trim(),exposeName:e[1]&&e[1].trim()}));this.allImplEvents=r.map(e=>e.implName);const s=r.filter(e=>e.implName&&e.exposeName);for(const e of s){if(Ng2Utils.getWjEventName(e.implName)){const i={eventImpl:e.implName,event:e.exposeName},r=n[e.exposeName];r&&r.length&&(i.props=r.map(e=>({prop:e,evExposed:Ng2Utils.getChangeEventNameExposed(e),evImpl:Ng2Utils.getChangeEventNameImplemented(e)})));t.push(i)}}for(const e in n)if(e.indexOf(".")>-1){const i={eventImpl:null,event:e,props:n[e].map(e=>({prop:e,evExposed:Ng2Utils.getChangeEventNameExposed(e),evImpl:Ng2Utils.getChangeEventNameImplemented(e)}))};t.push(i)}}}exports.WjComponentResolvedMetadata=WjComponentResolvedMetadata;class WjDirectiveBehavior{constructor(e,t,i,n){this._pendingEvents=[];this.isInitialized=!1;this.isDestroyed=!1;this.nzRun=e=>e();this.directive=e;this.elementRef=t;this.injector=i;this._overrideDirectiveMethods();this.nz=i.get(core_1.NgZone);const r=this.nz;r&&(this.nzRun=r.run.bind(r));this.injectedParent=n;this.typeData=e.constructor[WjDirectiveBehavior.directiveTypeDataProp];const s=this.typeData;null==s.siblingId&&(s.siblingId=""+ ++WjDirectiveBehavior.siblingDirId);let o=e.constructor[WjDirectiveBehavior.directiveResolvedTypeDataProp];o?this.resolvedTypeData=o:e.constructor[WjDirectiveBehavior.directiveResolvedTypeDataProp]=o=this.resolvedTypeData=new WjComponentResolvedMetadata(s);e[WjDirectiveBehavior.BehaviourRefProp]=this;i[WjDirectiveBehavior.BehaviourRefProp]=this;e[WjDirectiveBehavior.isInitializedPropAttr]=!1;this._createEvents();this._setupAsChild();this._isHostElement()&&t.nativeElement.setAttribute(WjDirectiveBehavior.siblingDirIdAttr,s.siblingId);this.subscribeToEvents(!1);this.directive instanceof wijmo.Control&&(this.directive.workingAs="Angular2")}static getHostElement(e,t){WjDirectiveBehavior.ngZone=t.get(core_1.NgZone);return e.nativeElement}static attach(e,t,i,n){return new WjDirectiveBehavior(e,t,i,n)}static getZone(e){const t=WjDirectiveBehavior.getBehavior(e);return t&&t.nz||WjDirectiveBehavior.ngZone}ngOnInit(){this.isInitialized=!0;this._initParent();this.subscribeToEvents(!0)}ngAfterViewInit(){this.directive[WjDirectiveBehavior.isInitializedPropAttr]=!0;setTimeout(()=>{this.isDestroyed||this.directive[WjDirectiveBehavior.initializedEventAttr].emit(void 0)})}ngOnDestroy(){if(!this.isDestroyed){this.isDestroyed=!0;var e=this.directive;this._siblingInsertedMO&&this._siblingInsertedMO.disconnect();if(this._isChild()&&this.parentBehavior){const t=this.parentBehavior.directive,i=this._getParentProp();if(!this.parentBehavior.isDestroyed&&t&&i&&e){const n=t[i];if(wijmo.isArray(n)&&n){const t=n.indexOf(e);t>=0&&n.splice(t,1)}}}if(e instanceof wijmo.Control&&e.hostElement){const t=this.elementRef.nativeElement,i=t&&t.parentNode,n=i?Array.prototype.indexOf.call(i.childNodes,t):-1;e.dispose();if(n>-1&&Array.prototype.indexOf.call(i.childNodes,t)<0){t.textContent="";n<i.childNodes.length&&i.replaceChild(t,i.childNodes[n])}}this.injector[WjDirectiveBehavior.BehaviourRefProp]=null}}static instantiateTemplate(e,t,i,n=!1,r={}){var s,o=t.createEmbeddedView(i,r,t.length),a=o.rootNodes;if(n&&1===a.length)s=a[0];else{s=document.createElement("div");for(const e of a)s.appendChild(e)}e&&e.appendChild(s);return{viewRef:o,rootElement:s}}getPropChangeEvent(e){const t=this.typeData.changeEvents;if(t)for(const i in t)if(t[i].indexOf(e)>-1)return i;return null}_createEvents(){const e=this.resolvedTypeData.allImplEvents;for(const t of e)this.directive[t]=new core_1.EventEmitter(!1)}_overrideDirectiveMethods(){const e=this.directive;if(e instanceof wijmo.Control){const t=e._resizeObserverCallback.bind(e);e._resizeObserverCallback=function(e){core_1.NgZone.isInAngularZone()?t(e):WjDirectiveBehavior.getZone(this).run(()=>{t(e)})}.bind(e)}}subscribeToEvents(e){var t=this.resolvedTypeData.changeEventMap;e=!!e;for(const i of t)e!==i.event.indexOf(".")<0&&this.addHandlers(i);if(e)for(const e of t)this.triggerPropChangeEvents(e,!0)}addHandlers(e){const t=this.directive;WjDirectiveBehavior.evaluatePath(t,e.event).addHandler((i,n)=>{this.nzRun(()=>{this.isInitialized&&this.triggerPropChangeEvents(e);e.eventImpl&&this._triggerEvent(t[e.eventImpl],n,e.props&&e.props.length>0)})})}triggerPropChangeEvents(e,t=!0){const i=this.directive;if(e.props&&e.props.length)for(const n of e.props)this._triggerEvent(i[n.evImpl],i[n.prop],t)}_setupAsChild(){if(this._isChild()){this._isHostElement()&&(this.elementRef.nativeElement.style.display="none");this.parentBehavior=WjDirectiveBehavior.getBehavior(this.injectedParent)}}_isAsyncBinding(){const e=this.directive[WjDirectiveBehavior.asyncBindingUpdatePropAttr];return null==e?WjOptions.asyncBindings:e}_isChild(){return this._isParentInitializer()||this._isParentReferencer()}_isParentInitializer(){return null!=this.directive[WjDirectiveBehavior.parPropAttr]}_isParentReferencer(){return!!this.typeData.parentRefProperty}_getParentProp(){return this.directive[WjDirectiveBehavior.parPropAttr]}_getParentReferenceProperty(){return this.typeData.parentRefProperty}_useParentObj(){return!1}_parentInCtor(){return this._isParentReferencer()&&""==this._getParentReferenceProperty()}_initParent(){if(this.parentBehavior&&!this._useParentObj()){var e=this.parentBehavior.directive,t=this._getParentProp(),i=this.directive;if(this._isParentInitializer()){const n=e[t];if(wijmo.isArray(n)){let e=this._isHostElement(),t=e?this._getSiblingIndex():-1;(t<0||t>=n.length)&&(t=n.length);n.splice(t,0,i);if(e){const e=this.elementRef.nativeElement;this._siblingInsertedMO=new MutationObserver(this._siblingInserted.bind(this));this._siblingInsertedMO.observe(e,{childList:!0})}}else e[t]=i}this._isParentReferencer()&&!this._parentInCtor()&&(i[this._getParentReferenceProperty()]=e)}}_getSiblingIndex(){var e=this.elementRef.nativeElement,t=e.parentElement;if(!t)return-1;const i=t.childNodes;let n=-1;const r=this.typeData.siblingId;for(let t=0;t<i.length;t++){const s=i[t];if(1==s.nodeType&&s.getAttribute(WjDirectiveBehavior.siblingDirIdAttr)==r){++n;if(s===e)return n}}return-1}_siblingInserted(e){for(const t of e)if("childList"===t.type&&t.addedNodes.length>0){if(Array.from(t.addedNodes).some(e=>e===this.elementRef.nativeElement)){const e=this._getSiblingIndex(),t=this.parentBehavior.directive[this._getParentProp()],i=this.directive,n=t.indexOf(i);if(e>=0&&n>=0&&e!==n){t.splice(n,1);const r=Math.min(e,t.length);t.splice(r,0,i)}}}}_isHostElement(){return this.elementRef.nativeElement.nodeType===Node.ELEMENT_NODE}_triggerEvent(e,t,i){if(i&&this._isAsyncBinding()){const i={event:e,args:t};this._pendingEvents.push(i);null==this._pendingEventsTO&&(this._pendingEventsTO=setTimeout(()=>{this._triggerPendingEvents(!1)},0))}else e.emit(t)}_triggerPendingEvents(e){if(null!=this._pendingEventsTO){clearTimeout(this._pendingEventsTO);this._pendingEventsTO=null}if(this.isDestroyed)return;const t=[].concat(this._pendingEvents);this._pendingEvents.splice(0,this._pendingEvents.length);for(const e of t)e.event.emit(e.args);e&&this._pendingEvents.length&&this._triggerPendingEvents(!0)}flushPendingEvents(){this._triggerPendingEvents(!0)}static evaluatePath(e,t){WjDirectiveBehavior._pathBinding.path=t;return WjDirectiveBehavior._pathBinding.getValue(e)}static getBehavior(e){return e?e[WjDirectiveBehavior.BehaviourRefProp]:null}}WjDirectiveBehavior.directiveTypeDataProp="meta";WjDirectiveBehavior.directiveResolvedTypeDataProp="_wjResolvedMeta";WjDirectiveBehavior.BehaviourRefProp="_wjBehaviour";WjDirectiveBehavior.parPropAttr="wjProperty";WjDirectiveBehavior.wjModelPropAttr="wjModelProperty";WjDirectiveBehavior.initializedEventAttr="initialized";WjDirectiveBehavior.isInitializedPropAttr="isInitialized";WjDirectiveBehavior.siblingDirIdAttr="wj-directive-id";WjDirectiveBehavior.asyncBindingUpdatePropAttr="asyncBindings";WjDirectiveBehavior.siblingDirId=0;WjDirectiveBehavior.wijmoComponentProviderId="WjComponent";WjDirectiveBehavior.outsideZoneEvents={pointermove:!0,pointerover:!0,mousemove:!0,wheel:!0,touchmove:!0,pointerenter:!0,pointerleave:!0,pointerout:!0,mouseover:!0,mouseenter:!0,mouseleave:!0,mouseout:!0};WjDirectiveBehavior._pathBinding=new wijmo.Binding("");exports.WjDirectiveBehavior=WjDirectiveBehavior;class Ng2Utils{static initEvents(e,t){var i=[];for(const e of t){const t=e.props;e.event&&e.eventImpl&&i.push(`${e.eventImpl}:${e.event}`);if(t&&t.length)for(const e of t)i.push(`${e.evImpl}:${e.evExposed}`)}return i}static getChangeEventNameImplemented(e){return Ng2Utils.getChangeEventNameExposed(e)+Ng2Utils.changeEventImplementSuffix}static getChangeEventNameExposed(e){return e+"Change"}static getWjEventName(e){if(e){const t=Ng2Utils.wjEventImplementSuffix,i=e.length-t.length;if(i>0&&e.substr(i)===t)return e.substr(0,i)}return null}static getBaseType(e){if(!e)return null;const t=Object.getPrototypeOf(e.prototype);return t&&t.constructor}static getAnnotations(e){return Reflect.getMetadata("annotations",e)}static getAnnotation(e,t){if(t&&e)for(const i of e)if(i instanceof t)return i;return null}static getTypeAnnotation(e,t,i){for(let n=e;n;n=i?null:Ng2Utils.getBaseType(n)){const e=Ng2Utils.getAnnotation(Ng2Utils.getAnnotations(n),t);if(e)return e}return null}static equals(e,t){return e!=e&&t!=t||wijmo.DateTime.equals(e,t)||e===t}static _copy(e,t,i,n,r){if(e&&t)for(const s in t)if(n||"_"!==s[0]){const n=t[s];if(!r||r(s,n)){const t=e[s];wijmo.isArray(n)?e[s]=(!wijmo.isArray(t)||i?[]:t).concat(n):void 0!==n&&(e[s]=n)}}}}Ng2Utils.changeEventImplementSuffix="PC";Ng2Utils.wjEventImplementSuffix="Ng";exports.Ng2Utils=Ng2Utils;class WjValueAccessor{constructor(e){this._writeQnt=0;this._isSubscribed=!1;this._dirUpdateQnt=0;this._onChange=e=>{};this._onTouched=()=>{};this._directive=e;this._behavior=WjDirectiveBehavior.getBehavior(e)}writeValue(e){this._modelValue=e;++this._writeQnt;if(this._directive.isInitialized){this._ensureInitEhUnsubscribed();this._updateDirective()}else if(!this._dirInitEh){const e=this._directive.initialized;this._dirInitEh=e.subscribe(()=>{this._updateDirective();this._ensureInitEhUnsubscribed()})}}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){const t=this._directive;t instanceof wijmo.Control&&(t.isDisabled=e)}_updateDirective(){if(!this._isFirstChange()||null!=this._modelValue){this._ensureNgModelProp();if(this._directive&&this._ngModelProp){let e=this._modelValue;""===e&&(e=null);this._dirUpdateQnt++;try{this._directive[this._ngModelProp]=e}finally{this._dirUpdateQnt--}}this._ensureSubscribed()}}_ensureSubscribed(){if(this._isSubscribed)return;const e=this._directive;if(e){this._ensureNgModelProp();this._ngModelProp=e[WjDirectiveBehavior.wjModelPropAttr];const t=this._ngModelProp;if(t){const i=this._behavior.getPropChangeEvent(t);i&&e[i].addHandler(this._dirValChgEh,this)}e instanceof wijmo.Control&&e.lostFocus.addHandler(this._dirLostFocusEh,this);this._isSubscribed=!0}}_ensureNgModelProp(){!this._ngModelProp&&this._directive&&(this._ngModelProp=this._directive[WjDirectiveBehavior.wjModelPropAttr])}_ensureInitEhUnsubscribed(){if(this._dirInitEh){this._dirInitEh.unsubscribe();this._dirInitEh=null}}_isFirstChange(){return this._writeQnt<2}_dirValChgEh(e,t){if(this._onChange&&this._directive&&this._ngModelProp){let e=this._directive[this._ngModelProp],t=this._modelValue;""===t&&(t=null);if(!(this._dirUpdateQnt>0&&_isNullOrEmpty(t)&&_isNullOrEmpty(e)||Ng2Utils.equals(t,e))||wijmo.isArray(e)){this._modelValue=e;this._onChange(e)}}}_dirLostFocusEh(e,t){this._onTouched&&this._onTouched()}}exports.WjValueAccessor=WjValueAccessor;function WjValueAccessorFactory(e){return new WjValueAccessor(e)}exports.WjValueAccessorFactory=WjValueAccessorFactory;function _isNullOrEmpty(e){return null==e||""===e}
|
|
14
|
+
"use strict";var _a,_b,_c,_d,_e;Object.defineProperty(exports,"__esModule",{value:!0});exports.WjValueAccessor=exports.WjOptions=exports.WjDirectiveBehavior=exports.WjComponentResolvedMetadata=exports.Ng2Utils=void 0;exports.WjValueAccessorFactory=WjValueAccessorFactory;exports.isNoopNgZoneLike=isNoopNgZoneLike;const i0=require("@angular/core"),core_1=require("@angular/core"),wijmo=require("@grapecity/wijmo");class WjOptions{}exports.WjOptions=WjOptions;(_a=WjOptions).asyncBindings=!0;_a.zonelessMode="auto";function isNoopNgZoneLike(e){return!e||!e._inner&&!e._outer&&("function"==typeof e.run&&"function"==typeof e.runGuarded&&"function"==typeof e.runOutsideAngular&&"function"==typeof e.runTask)}class WjComponentResolvedMetadata{constructor(e){this.changeEventMap=[];this.allImplEvents=[];this.resolveChangeEventMap(e)}resolveChangeEventMap(e){var t;const i=e.outputs||[],n=e.changeEvents||{};this.changeEventMap.splice(0,this.changeEventMap.length);this.allImplEvents=[];if(!i.length)return;const r=i.map(e=>e.split(":")).map(e=>{var t,i;return{implName:null===(t=e[0])||void 0===t?void 0:t.trim(),exposeName:null===(i=e[1])||void 0===i?void 0:i.trim()}});this.allImplEvents=r.filter(e=>!!e.implName).map(e=>e.implName);const s=r.filter(e=>e.implName&&e.exposeName);for(const e of s){const i=ResolvedMetadataUtils.getWjEventName(e.implName);if(!i)continue;const r={eventImpl:e.implName,event:e.exposeName},s=null!==(t=n[i])&&void 0!==t?t:n[e.exposeName];(null==s?void 0:s.length)&&(r.props=s.map(e=>({prop:e,evExposed:ResolvedMetadataUtils.getChangeEventNameExposed(e),evImpl:ResolvedMetadataUtils.getChangeEventNameImplemented(e)})));this.changeEventMap.push(r)}for(const e of Object.keys(n)){if(e.indexOf(".")<0)continue;const t={eventImpl:null,event:e,props:n[e].map(e=>({prop:e,evExposed:ResolvedMetadataUtils.getChangeEventNameExposed(e),evImpl:ResolvedMetadataUtils.getChangeEventNameImplemented(e)}))};this.changeEventMap.push(t)}}}exports.WjComponentResolvedMetadata=WjComponentResolvedMetadata;class ResolvedMetadataUtils{static getChangeEventNameImplemented(e){return`${_b.getChangeEventNameExposed(e)}${_b.changeEventImplementSuffix}`}static getChangeEventNameExposed(e){return e+"Change"}static getWjEventName(e){if(!e)return null;const t=_b.wijmoEventImplementSuffix,i=e.length-t.length;return i>0&&e.slice(i)===t?e.slice(0,i):null}}(_b=ResolvedMetadataUtils).changeEventImplementSuffix="PC";_b.wijmoEventImplementSuffix="Ng";class WjDirectiveBehavior{static getHostElement(e,t){_c.ngZone=t?t.get(core_1.NgZone,null):null;return e.nativeElement}static attach(e,t,i,n){return new _c(e,t,i,n)}static getBehavior(e){var t;return e&&null!==(t=e[_c.behaviorRefProp])&&void 0!==t?t:null}static getZone(e){var t;const i=_c.getBehavior(e);return null!==(t=null==i?void 0:i.nz)&&void 0!==t?t:_c.ngZone}static instantiateTemplate(e,t,i,n=!1,r={}){if(!i)throw new Error("A templateRef is required to instantiate a Wijmo Angular template.");const s=t.createEmbeddedView(i,r,t.length),o=s.rootNodes;let l;if(n&&1===o.length)l=o[0];else{const e=document.createElement("div");for(const t of o)e.appendChild(t);l=e}e&&e.appendChild(l);return{viewRef:s,rootElement:l}}constructor(e,t,i,n){this.parentBehavior=null;this.isInitialized=!1;this.isDestroyed=!1;this.nzRun=e=>e();this.siblingInsertedObserver=null;this.pendingEvents=[];this.pendingEventsTimeout=null;this.pendingCheck=!1;this.directive=e;this.elementRef=t;this.injector=i;this.injectedParent=n;this.nz=i.get(core_1.NgZone,null);this.cdRef=i.get(core_1.ChangeDetectorRef,null);this.appRef=i.get(core_1.ApplicationRef,null);this.isZoneless=this.detectZonelessMode();this.nz&&!this.isZoneless&&(this.nzRun=this.nz.run.bind(this.nz));this.overrideDirectiveMethods();this.typeData=e.constructor[_c.directiveTypeDataProp]||{};null!==this.typeData.siblingId&&void 0!==this.typeData.siblingId||(this.typeData.siblingId=""+ ++_c.siblingDirId);const r=e.constructor[_c.directiveResolvedTypeDataProp]||new WjComponentResolvedMetadata(this.typeData);e.constructor[_c.directiveResolvedTypeDataProp]=r;this.resolvedTypeData=r;e[_c.behaviorRefProp]=this;i[_c.behaviorRefProp]=this;e[_c.isInitializedPropAttr]=!1;this.createEvents();this.setupAsChild();this.isHostElement()&&this.elementRef.nativeElement.setAttribute(_c.siblingDirIdAttr,this.typeData.siblingId);this.subscribeToEvents(!1);e instanceof wijmo.Control&&(e.workingAs="Angular2")}ngOnInit(){this.isInitialized=!0;this.initParent();this.subscribeToEvents(!0)}ngAfterViewInit(){this.directive[_c.isInitializedPropAttr]=!0;setTimeout(()=>{if(!this.isDestroyed){this.directive[_c.initializedEventAttr].emit(void 0);this.requestCheck()}})}ngOnDestroy(){if(!this.isDestroyed){this.isDestroyed=!0;if(this.siblingInsertedObserver){this.siblingInsertedObserver.disconnect();this.siblingInsertedObserver=null}if(this.isChild()&&this.parentBehavior){const e=this.parentBehavior.directive,t=this.getParentProp(),i=this.directive;if(!this.parentBehavior.isDestroyed&&e&&t&&i){const n=e[t];this.removeFromParentCollection(n,i)}}if(this.directive instanceof wijmo.Control&&this.directive.hostElement){const e=this.elementRef.nativeElement,t=null==e?void 0:e.parentNode,i=t?Array.prototype.indexOf.call(t.childNodes,e):-1;this.directive.dispose();if(t&&i>-1&&Array.prototype.indexOf.call(t.childNodes,e)<0){e.textContent="";i<t.childNodes.length&&t.replaceChild(e,t.childNodes[i])}}this.injector[_c.behaviorRefProp]=null}}flushPendingEvents(){this.triggerPendingEvents(!0)}requestCheck(){this.performRequestCheck()}getPropChangeEvent(e){const t=this.typeData.changeEvents;if(!t)return null;for(const i of Object.keys(t))if(t[i].indexOf(e)>-1)return i;return null}createEvents(){const e=this.resolvedTypeData.allImplEvents||[];for(const t of e)this.directive[t]=new core_1.EventEmitter(!1)}overrideDirectiveMethods(){const e=this.directive;if(!(e instanceof wijmo.Control&&e._resizeObserverCallback))return;const t=e._resizeObserverCallback.bind(e),i=this;e._resizeObserverCallback=function(e){if(i.isZoneless){t(e);i.requestCheck()}else{if(!core_1.NgZone.isInAngularZone()){const i=_c.getZone(this);if(i){i.run(()=>t(e));return}}t(e)}}.bind(e)}subscribeToEvents(e){const t=this.resolvedTypeData.changeEventMap||[],i=!!e;for(const e of t){i===e.event.indexOf(".")>-1&&this.addHandlers(e)}if(e)for(const e of t)this.triggerPropChangeEvents(e,!0)}addHandlers(e){const t=this.directive,i=_c.evaluatePath(t,e.event);i&&i.addHandler((i,n)=>{this.runChangeDetectionAware(()=>{this.isInitialized&&this.triggerPropChangeEvents(e);e.eventImpl&&this.triggerEvent(t[e.eventImpl],n,!(!e.props||!e.props.length))})})}triggerPropChangeEvents(e,t=!0){var i;if(null===(i=e.props)||void 0===i?void 0:i.length)for(const i of e.props){const e=this.getSignalFriendlyPropValue(this.directive[i.prop]);this.triggerEvent(this.directive[i.evImpl],e,t,!0)}}getSignalFriendlyPropValue(e){return wijmo.isArray(e)?Array.prototype.slice.call(e):e}triggerEvent(e,t,i,n=!1){if(i&&this.isAsyncBinding()){if(n){const i=this.pendingEvents.find(t=>t.event===e);i?i.args=t:this.pendingEvents.push({event:e,args:t})}else this.pendingEvents.push({event:e,args:t});null===this.pendingEventsTimeout&&(this.pendingEventsTimeout=setTimeout(()=>this.triggerPendingEvents(!1),0))}else{e.emit(t);this.performRequestCheck()}}triggerPendingEvents(e){if(null!==this.pendingEventsTimeout){clearTimeout(this.pendingEventsTimeout);this.pendingEventsTimeout=null}if(!this.isDestroyed)do{const e=this.pendingEvents.slice();this.pendingEvents.length=0;for(const t of e)t.event.emit(t.args);this.performRequestCheck()}while(e&&!this.isDestroyed&&this.pendingEvents.length)}setupAsChild(){if(this.isChild()){this.isHostElement()&&(this.elementRef.nativeElement.style.display="none");this.parentBehavior=_c.getBehavior(this.injectedParent)}}isAsyncBinding(){const e=this.directive[_c.asyncBindingUpdatePropAttr];return null==e?WjOptions.asyncBindings:e}isChild(){return this.isParentInitializer()||this.isParentReferencer()}isParentInitializer(){return null!==this.directive[_c.parentPropertyAttr]&&void 0!==this.directive[_c.parentPropertyAttr]}isParentReferencer(){return!!this.typeData.parentRefProperty}getParentProp(){return this.directive[_c.parentPropertyAttr]}getParentReferenceProperty(){return this.typeData.parentRefProperty}parentInCtor(){return this.isParentReferencer()&&""===this.getParentReferenceProperty()}initParent(){if(!this.parentBehavior)return;const e=this.parentBehavior.directive,t=this.getParentProp(),i=this.directive;if(this.isParentInitializer()&&t){const n=e[t];if(this.isParentCollection(n)){let e=this.isHostElement()?this.getSiblingIndex():-1;(e<0||e>=n.length)&&(e=n.length);this.insertIntoParentCollection(n,e,i);if(this.isHostElement()){const e=this.elementRef.nativeElement;this.siblingInsertedObserver=new MutationObserver(this.handleSiblingInserted.bind(this));this.siblingInsertedObserver.observe(e,{childList:!0})}}else e[t]=i}if(this.isParentReferencer()&&!this.parentInCtor()){const t=this.getParentReferenceProperty();t&&(i[t]=e)}}getSiblingIndex(){const e=this.elementRef.nativeElement,t=e.parentElement;if(!t)return-1;const i=t.childNodes,n=this.typeData.siblingId;let r=-1;for(let t=0;t<i.length;t++){const s=i[t];if(1===s.nodeType&&s.getAttribute(_c.siblingDirIdAttr)===n){r++;if(s===e)return r}}return-1}handleSiblingInserted(e){var t;for(const i of e){if("childList"!==i.type||0===i.addedNodes.length)continue;if(!Array.from(i.addedNodes).some(e=>e===this.elementRef.nativeElement))continue;const e=this.getSiblingIndex(),n=null===(t=this.parentBehavior)||void 0===t?void 0:t.directive[this.getParentProp()],r=this.directive,s=this.indexOfParentCollectionItem(n,r);if(e>=0&&s>=0&&e!==s){this.removeAtParentCollectionIndex(n,s);this.insertIntoParentCollection(n,Math.min(e,n.length),r)}}}isParentCollection(e){return!!e&&(wijmo.isArray(e)||"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.indexOf&&("function"==typeof e.splice||"function"==typeof e.insert))}indexOfParentCollectionItem(e,t){return this.isParentCollection(e)?e.indexOf(t):-1}insertIntoParentCollection(e,t,i){this.isParentCollection(e)&&("function"!=typeof e.splice?"function"!=typeof e.insert?"function"==typeof e.push&&e.push(i):e.insert(t,i):e.splice(t,0,i))}removeAtParentCollectionIndex(e,t){!this.isParentCollection(e)||t<0||("function"!=typeof e.removeAt?"function"==typeof e.splice&&e.splice(t,1):e.removeAt(t))}removeFromParentCollection(e,t){if(!this.isParentCollection(e))return;const i=this.indexOfParentCollectionItem(e,t);i>-1&&this.removeAtParentCollectionIndex(e,i)}isHostElement(){return this.elementRef.nativeElement.nodeType===Node.ELEMENT_NODE}static evaluatePath(e,t){_c.pathBinding.path=t;return _c.pathBinding.getValue(e)}detectZonelessMode(){const e=WjOptions.zonelessMode;return!0===e||!1===e?e:!this.nz||isNoopNgZoneLike(this.nz)}runChangeDetectionAware(e){if(!this.isZoneless&&this.nz)this.nzRun(e);else{e();this.performRequestCheck()}}performRequestCheck(){if(this.isZoneless&&(this.appRef||this.cdRef)&&!this.isDestroyed&&!this.pendingCheck){this.pendingCheck=!0;Promise.resolve().then(()=>{var e;this.pendingCheck=!1;this.isDestroyed||(this.appRef?this.appRef.tick():null===(e=this.cdRef)||void 0===e||e.detectChanges())})}}}exports.WjDirectiveBehavior=WjDirectiveBehavior;(_c=WjDirectiveBehavior).directiveTypeDataProp="meta";_c.directiveResolvedTypeDataProp="_wjResolvedMeta";_c.behaviorRefProp="_wjBehaviour";_c.parentPropertyAttr="wjProperty";_c.wjModelPropertyAttr="wjModelProperty";_c.initializedEventAttr="initialized";_c.isInitializedPropAttr="isInitialized";_c.siblingDirIdAttr="wj-directive-id";_c.asyncBindingUpdatePropAttr="asyncBindings";_c.siblingDirId=0;_c.wijmoComponentProviderId="WjComponent";_c.ngZone=null;_c.outsideZoneEvents={pointermove:!0,pointerover:!0,mousemove:!0,wheel:!0,touchmove:!0,pointerenter:!0,pointerleave:!0,pointerout:!0,mouseover:!0,mouseenter:!0,mouseleave:!0,mouseout:!0};_c.pathBinding=new wijmo.Binding("");_c.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:_c,deps:"invalid",target:i0.ɵɵFactoryTarget.Injectable});_c.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:_c});i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:WjDirectiveBehavior,decorators:[{type:core_1.Injectable}],ctorParameters:()=>[{type:void 0},{type:i0.ElementRef},{type:i0.Injector},{type:void 0}]});class Ng2Utils{static getChangeEventNameImplemented(e){return`${_d.getChangeEventNameExposed(e)}${_d.changeEventImplementSuffix}`}static getChangeEventNameExposed(e){return e+"Change"}static getWjEventName(e){if(!e)return null;const t=_d.wjEventImplementSuffix,i=e.length-t.length;return i>0&&e.slice(i)===t?e.slice(0,i):null}static equals(e,t){return Number.isNaN(e)&&Number.isNaN(t)||wijmo.DateTime.equals(e,t)||e===t}}exports.Ng2Utils=Ng2Utils;(_d=Ng2Utils).changeEventImplementSuffix="PC";_d.wjEventImplementSuffix="Ng";class WjValueAccessor{constructor(e){this.writeCount=0;this.ngModelProp=null;this.isSubscribed=!1;this.changeSubscription=null;this.directiveUpdateCount=0;this.initSubscription=null;this.deferredWriteHandle=null;this.deferredWriteAttempts=0;this.initWriteHandle=null;this.initWriteAttempts=0;this.onChangeFn=e=>{};this.onTouchedFn=()=>{};this.handleDirectiveValueChanged=(e,t)=>{var i;if(!this.onChangeFn||!this.directive||!this.ngModelProp)return;const n=this.directive[this.ngModelProp],r=Array.isArray(n)?n.slice():n;let s=this.modelValue;""===s&&(s=null);if(!(this.directiveUpdateCount>0&&isNullOrEmpty(s)&&isNullOrEmpty(n)||Ng2Utils.equals(s,n))||Array.isArray(n)){this.modelValue=r;this.onChangeFn(r);null===(i=this.getBehavior())||void 0===i||i.requestCheck()}};this.handleDirectiveLostFocus=()=>{var e;this.onTouchedFn();null===(e=this.getBehavior())||void 0===e||e.requestCheck()};this.directive=e;this.behavior=WjDirectiveBehavior.getBehavior(e)}writeValue(e){var t,i,n;!(null===(t=this.directive)||void 0===t?void 0:t.isInitialized)&&isNullOrEmpty(e)&&!isNullOrEmpty(this.modelValue)||(this.modelValue=e);this.writeCount++;this.clearDeferredWrite();this.deferredWriteAttempts=0;this.clearInitWrite();this.initWriteAttempts=0;this.applyDirectiveValue();if(null===(i=this.directive)||void 0===i?void 0:i.isInitialized)this.ensureInitSubscriptionDisposed();else{if(!this.initSubscription){const e=null===(n=this.directive)||void 0===n?void 0:n.initialized;this.initSubscription=null==e?void 0:e.subscribe(()=>{this.clearInitWrite();this.applyDirectiveValue();this.ensureInitSubscriptionDisposed()})}this.scheduleInitWriteIfNeeded()}}registerOnChange(e){this.onChangeFn=e}registerOnTouched(e){this.onTouchedFn=e}setDisabledState(e){var t;if(this.directive instanceof wijmo.Control){this.directive.isDisabled=e;null===(t=this.getBehavior())||void 0===t||t.requestCheck()}}updateDirective(){var e;if(this.isFirstChange()&&(null===this.modelValue||void 0===this.modelValue))return;this.ensureNgModelProp();if(!this.directive||!this.ngModelProp)return;const t=this.normalizeModelValue(this.modelValue);this.directiveUpdateCount++;try{this.directive[this.ngModelProp]=t}finally{this.directiveUpdateCount--}null===(e=this.getBehavior())||void 0===e||e.requestCheck();this.ensureSubscribed()}applyDirectiveValue(){this.updateDirective();this.scheduleDeferredWriteIfNeeded()}ensureSubscribed(){var e;if(!this.isSubscribed&&this.directive){this.ensureNgModelProp();if(this.ngModelProp){const t=null===(e=this.getBehavior())||void 0===e?void 0:e.getPropChangeEvent(this.ngModelProp);if(t){const e=this.directive[t];e&&"function"==typeof e.addHandler?e.addHandler(this.handleDirectiveValueChanged,this):e&&"function"==typeof e.subscribe&&(this.changeSubscription=e.subscribe(()=>this.handleDirectiveValueChanged(this.directive,null)))}}this.directive instanceof wijmo.Control&&this.directive.lostFocus.addHandler(this.handleDirectiveLostFocus,this);this.isSubscribed=!0}}ensureNgModelProp(){var e,t;if(!this.ngModelProp&&this.directive){const i=this.directive[WjDirectiveBehavior.wjModelPropertyAttr],n=(null===(t=null===(e=this.getBehavior())||void 0===e?void 0:e.typeData)||void 0===t?void 0:t.defaultModelProperty)||null;this.ngModelProp=i||n}}ensureInitSubscriptionDisposed(){if(this.initSubscription){this.initSubscription.unsubscribe();this.initSubscription=null}}clearDeferredWrite(){if(null!==this.deferredWriteHandle){clearTimeout(this.deferredWriteHandle);this.deferredWriteHandle=null}}clearInitWrite(){if(null!==this.initWriteHandle){clearTimeout(this.initWriteHandle);this.initWriteHandle=null}}scheduleInitWriteIfNeeded(){var e;if(this.directive&&!this.directive.isInitialized&&!(null===(e=this.getBehavior())||void 0===e?void 0:e.isDestroyed))if(this.initWriteAttempts>=_e.maxInitWriteAttempts)this.clearInitWrite();else{this.clearInitWrite();this.initWriteAttempts++;this.initWriteHandle=setTimeout(()=>{var e;this.initWriteHandle=null;if(this.directive&&!(null===(e=this.getBehavior())||void 0===e?void 0:e.isDestroyed))if(this.directive.isInitialized){this.applyDirectiveValue();this.ensureInitSubscriptionDisposed()}else this.scheduleInitWriteIfNeeded()},0)}}scheduleDeferredWriteIfNeeded(){const e=this.getBehavior();if(!this.directive||!this.ngModelProp||(null==e?void 0:e.isDestroyed))return;if(this.isDirectiveValueSynchronized()){this.clearDeferredWrite();return}if(this.deferredWriteAttempts>=_e.maxDeferredWriteAttempts){this.clearDeferredWrite();return}this.clearDeferredWrite();this.deferredWriteAttempts++;const t=this.getDeferredWriteDelay();this.deferredWriteHandle=setTimeout(()=>{var e;this.deferredWriteHandle=null;this.directive&&!(null===(e=this.getBehavior())||void 0===e?void 0:e.isDestroyed)&&this.applyDirectiveValue()},t)}isDirectiveValueSynchronized(){if(!this.directive||!this.ngModelProp)return!0;return areEquivalentValue(this.normalizeModelValue(this.modelValue),this.directive[this.ngModelProp])}normalizeModelValue(e){return""===e?null:e}getDeferredWriteDelay(){return Math.min(_e.maxDeferredWriteDelayMs,2*Math.max(0,this.deferredWriteAttempts-1))}getBehavior(){!this.behavior&&this.directive&&(this.behavior=WjDirectiveBehavior.getBehavior(this.directive));return this.behavior}isFirstChange(){return this.writeCount<2}}exports.WjValueAccessor=WjValueAccessor;(_e=WjValueAccessor).maxDeferredWriteAttempts=20;_e.maxDeferredWriteDelayMs=32;_e.maxInitWriteAttempts=20;function WjValueAccessorFactory(e){return new WjValueAccessor(e)}function isNullOrEmpty(e){return null==e||""===e}function areEquivalentValue(e,t){return!(!isNullOrEmpty(e)||!isNullOrEmpty(t))||(!!areEquivalentArrays(e,t)||(isCellRangeLike(e)&&isCellRangeLike(t)?e.row===t.row&&e.col===t.col&&e.row2===t.row2&&e.col2===t.col2:Ng2Utils.equals(e,t)))}function areEquivalentArrays(e,t){return!(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)&&e.every((e,i)=>areEquivalentValue(e,t[i]))}function isCellRangeLike(e){return!!e&&"object"==typeof e&&"number"==typeof e.row&&"number"==typeof e.col&&"number"==typeof e.row2&&"number"==typeof e.col2}
|
package/es2015-esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.
|
|
3
|
+
* Wijmo Library 5.20262.60
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import{EventEmitter,NgZone}from"@angular/core";import*as wijmo from"@grapecity/wijmo";export class WjOptions{}WjOptions.asyncBindings=!0;export class WjComponentResolvedMetadata{constructor(e){this.changeEventMap=[];this.allImplEvents=[];this.resolveChangeEventMap(e)}resolveChangeEventMap(e){const t=this.changeEventMap,i=e.outputs,n=e.changeEvents||{};t.splice(0,t.length);this.allImplEvents=[];if(!i||!i.length)return;const r=i.map(e=>e.split(":")).map(e=>({implName:e[0].trim(),exposeName:e[1]&&e[1].trim()}));this.allImplEvents=r.map(e=>e.implName);const s=r.filter(e=>e.implName&&e.exposeName);for(const e of s){if(Ng2Utils.getWjEventName(e.implName)){const i={eventImpl:e.implName,event:e.exposeName},r=n[e.exposeName];r&&r.length&&(i.props=r.map(e=>({prop:e,evExposed:Ng2Utils.getChangeEventNameExposed(e),evImpl:Ng2Utils.getChangeEventNameImplemented(e)})));t.push(i)}}for(const e in n)if(e.indexOf(".")>-1){const i={eventImpl:null,event:e,props:n[e].map(e=>({prop:e,evExposed:Ng2Utils.getChangeEventNameExposed(e),evImpl:Ng2Utils.getChangeEventNameImplemented(e)}))};t.push(i)}}}export class WjDirectiveBehavior{constructor(e,t,i,n){this._pendingEvents=[];this.isInitialized=!1;this.isDestroyed=!1;this.nzRun=e=>e();this.directive=e;this.elementRef=t;this.injector=i;this._overrideDirectiveMethods();this.nz=i.get(NgZone);const r=this.nz;r&&(this.nzRun=r.run.bind(r));this.injectedParent=n;this.typeData=e.constructor[WjDirectiveBehavior.directiveTypeDataProp];const s=this.typeData;null==s.siblingId&&(s.siblingId=""+ ++WjDirectiveBehavior.siblingDirId);let o=e.constructor[WjDirectiveBehavior.directiveResolvedTypeDataProp];o?this.resolvedTypeData=o:e.constructor[WjDirectiveBehavior.directiveResolvedTypeDataProp]=o=this.resolvedTypeData=new WjComponentResolvedMetadata(s);e[WjDirectiveBehavior.BehaviourRefProp]=this;i[WjDirectiveBehavior.BehaviourRefProp]=this;e[WjDirectiveBehavior.isInitializedPropAttr]=!1;this._createEvents();this._setupAsChild();this._isHostElement()&&t.nativeElement.setAttribute(WjDirectiveBehavior.siblingDirIdAttr,s.siblingId);this.subscribeToEvents(!1);this.directive instanceof wijmo.Control&&(this.directive.workingAs="Angular2")}static getHostElement(e,t){WjDirectiveBehavior.ngZone=t.get(NgZone);return e.nativeElement}static attach(e,t,i,n){return new WjDirectiveBehavior(e,t,i,n)}static getZone(e){const t=WjDirectiveBehavior.getBehavior(e);return t&&t.nz||WjDirectiveBehavior.ngZone}ngOnInit(){this.isInitialized=!0;this._initParent();this.subscribeToEvents(!0)}ngAfterViewInit(){this.directive[WjDirectiveBehavior.isInitializedPropAttr]=!0;setTimeout(()=>{this.isDestroyed||this.directive[WjDirectiveBehavior.initializedEventAttr].emit(void 0)})}ngOnDestroy(){if(!this.isDestroyed){this.isDestroyed=!0;var e=this.directive;this._siblingInsertedMO&&this._siblingInsertedMO.disconnect();if(this._isChild()&&this.parentBehavior){const t=this.parentBehavior.directive,i=this._getParentProp();if(!this.parentBehavior.isDestroyed&&t&&i&&e){const n=t[i];if(wijmo.isArray(n)&&n){const t=n.indexOf(e);t>=0&&n.splice(t,1)}}}if(e instanceof wijmo.Control&&e.hostElement){const t=this.elementRef.nativeElement,i=t&&t.parentNode,n=i?Array.prototype.indexOf.call(i.childNodes,t):-1;e.dispose();if(n>-1&&Array.prototype.indexOf.call(i.childNodes,t)<0){t.textContent="";n<i.childNodes.length&&i.replaceChild(t,i.childNodes[n])}}this.injector[WjDirectiveBehavior.BehaviourRefProp]=null}}static instantiateTemplate(e,t,i,n=!1,r={}){var s,o=t.createEmbeddedView(i,r,t.length),a=o.rootNodes;if(n&&1===a.length)s=a[0];else{s=document.createElement("div");for(const e of a)s.appendChild(e)}e&&e.appendChild(s);return{viewRef:o,rootElement:s}}getPropChangeEvent(e){const t=this.typeData.changeEvents;if(t)for(const i in t)if(t[i].indexOf(e)>-1)return i;return null}_createEvents(){const e=this.resolvedTypeData.allImplEvents;for(const t of e)this.directive[t]=new EventEmitter(!1)}_overrideDirectiveMethods(){const e=this.directive;if(e instanceof wijmo.Control){const t=e._resizeObserverCallback.bind(e);e._resizeObserverCallback=function(e){NgZone.isInAngularZone()?t(e):WjDirectiveBehavior.getZone(this).run(()=>{t(e)})}.bind(e)}}subscribeToEvents(e){var t=this.resolvedTypeData.changeEventMap;e=!!e;for(const i of t)e!==i.event.indexOf(".")<0&&this.addHandlers(i);if(e)for(const e of t)this.triggerPropChangeEvents(e,!0)}addHandlers(e){const t=this.directive;WjDirectiveBehavior.evaluatePath(t,e.event).addHandler((i,n)=>{this.nzRun(()=>{this.isInitialized&&this.triggerPropChangeEvents(e);e.eventImpl&&this._triggerEvent(t[e.eventImpl],n,e.props&&e.props.length>0)})})}triggerPropChangeEvents(e,t=!0){const i=this.directive;if(e.props&&e.props.length)for(const n of e.props)this._triggerEvent(i[n.evImpl],i[n.prop],t)}_setupAsChild(){if(this._isChild()){this._isHostElement()&&(this.elementRef.nativeElement.style.display="none");this.parentBehavior=WjDirectiveBehavior.getBehavior(this.injectedParent)}}_isAsyncBinding(){const e=this.directive[WjDirectiveBehavior.asyncBindingUpdatePropAttr];return null==e?WjOptions.asyncBindings:e}_isChild(){return this._isParentInitializer()||this._isParentReferencer()}_isParentInitializer(){return null!=this.directive[WjDirectiveBehavior.parPropAttr]}_isParentReferencer(){return!!this.typeData.parentRefProperty}_getParentProp(){return this.directive[WjDirectiveBehavior.parPropAttr]}_getParentReferenceProperty(){return this.typeData.parentRefProperty}_useParentObj(){return!1}_parentInCtor(){return this._isParentReferencer()&&""==this._getParentReferenceProperty()}_initParent(){if(this.parentBehavior&&!this._useParentObj()){var e=this.parentBehavior.directive,t=this._getParentProp(),i=this.directive;if(this._isParentInitializer()){const n=e[t];if(wijmo.isArray(n)){let e=this._isHostElement(),t=e?this._getSiblingIndex():-1;(t<0||t>=n.length)&&(t=n.length);n.splice(t,0,i);if(e){const e=this.elementRef.nativeElement;this._siblingInsertedMO=new MutationObserver(this._siblingInserted.bind(this));this._siblingInsertedMO.observe(e,{childList:!0})}}else e[t]=i}this._isParentReferencer()&&!this._parentInCtor()&&(i[this._getParentReferenceProperty()]=e)}}_getSiblingIndex(){var e=this.elementRef.nativeElement,t=e.parentElement;if(!t)return-1;const i=t.childNodes;let n=-1;const r=this.typeData.siblingId;for(let t=0;t<i.length;t++){const s=i[t];if(1==s.nodeType&&s.getAttribute(WjDirectiveBehavior.siblingDirIdAttr)==r){++n;if(s===e)return n}}return-1}_siblingInserted(e){for(const t of e)if("childList"===t.type&&t.addedNodes.length>0){if(Array.from(t.addedNodes).some(e=>e===this.elementRef.nativeElement)){const e=this._getSiblingIndex(),t=this.parentBehavior.directive[this._getParentProp()],i=this.directive,n=t.indexOf(i);if(e>=0&&n>=0&&e!==n){t.splice(n,1);const r=Math.min(e,t.length);t.splice(r,0,i)}}}}_isHostElement(){return this.elementRef.nativeElement.nodeType===Node.ELEMENT_NODE}_triggerEvent(e,t,i){if(i&&this._isAsyncBinding()){const i={event:e,args:t};this._pendingEvents.push(i);null==this._pendingEventsTO&&(this._pendingEventsTO=setTimeout(()=>{this._triggerPendingEvents(!1)},0))}else e.emit(t)}_triggerPendingEvents(e){if(null!=this._pendingEventsTO){clearTimeout(this._pendingEventsTO);this._pendingEventsTO=null}if(this.isDestroyed)return;const t=[].concat(this._pendingEvents);this._pendingEvents.splice(0,this._pendingEvents.length);for(const e of t)e.event.emit(e.args);e&&this._pendingEvents.length&&this._triggerPendingEvents(!0)}flushPendingEvents(){this._triggerPendingEvents(!0)}static evaluatePath(e,t){WjDirectiveBehavior._pathBinding.path=t;return WjDirectiveBehavior._pathBinding.getValue(e)}static getBehavior(e){return e?e[WjDirectiveBehavior.BehaviourRefProp]:null}}WjDirectiveBehavior.directiveTypeDataProp="meta";WjDirectiveBehavior.directiveResolvedTypeDataProp="_wjResolvedMeta";WjDirectiveBehavior.BehaviourRefProp="_wjBehaviour";WjDirectiveBehavior.parPropAttr="wjProperty";WjDirectiveBehavior.wjModelPropAttr="wjModelProperty";WjDirectiveBehavior.initializedEventAttr="initialized";WjDirectiveBehavior.isInitializedPropAttr="isInitialized";WjDirectiveBehavior.siblingDirIdAttr="wj-directive-id";WjDirectiveBehavior.asyncBindingUpdatePropAttr="asyncBindings";WjDirectiveBehavior.siblingDirId=0;WjDirectiveBehavior.wijmoComponentProviderId="WjComponent";WjDirectiveBehavior.outsideZoneEvents={pointermove:!0,pointerover:!0,mousemove:!0,wheel:!0,touchmove:!0,pointerenter:!0,pointerleave:!0,pointerout:!0,mouseover:!0,mouseenter:!0,mouseleave:!0,mouseout:!0};WjDirectiveBehavior._pathBinding=new wijmo.Binding("");export class Ng2Utils{static initEvents(e,t){var i=[];for(const e of t){const t=e.props;e.event&&e.eventImpl&&i.push(`${e.eventImpl}:${e.event}`);if(t&&t.length)for(const e of t)i.push(`${e.evImpl}:${e.evExposed}`)}return i}static getChangeEventNameImplemented(e){return Ng2Utils.getChangeEventNameExposed(e)+Ng2Utils.changeEventImplementSuffix}static getChangeEventNameExposed(e){return e+"Change"}static getWjEventName(e){if(e){const t=Ng2Utils.wjEventImplementSuffix,i=e.length-t.length;if(i>0&&e.substr(i)===t)return e.substr(0,i)}return null}static getBaseType(e){if(!e)return null;const t=Object.getPrototypeOf(e.prototype);return t&&t.constructor}static getAnnotations(e){return Reflect.getMetadata("annotations",e)}static getAnnotation(e,t){if(t&&e)for(const i of e)if(i instanceof t)return i;return null}static getTypeAnnotation(e,t,i){for(let n=e;n;n=i?null:Ng2Utils.getBaseType(n)){const e=Ng2Utils.getAnnotation(Ng2Utils.getAnnotations(n),t);if(e)return e}return null}static equals(e,t){return e!=e&&t!=t||wijmo.DateTime.equals(e,t)||e===t}static _copy(e,t,i,n,r){if(e&&t)for(const s in t)if(n||"_"!==s[0]){const n=t[s];if(!r||r(s,n)){const t=e[s];wijmo.isArray(n)?e[s]=(!wijmo.isArray(t)||i?[]:t).concat(n):void 0!==n&&(e[s]=n)}}}}Ng2Utils.changeEventImplementSuffix="PC";Ng2Utils.wjEventImplementSuffix="Ng";export class WjValueAccessor{constructor(e){this._writeQnt=0;this._isSubscribed=!1;this._dirUpdateQnt=0;this._onChange=e=>{};this._onTouched=()=>{};this._directive=e;this._behavior=WjDirectiveBehavior.getBehavior(e)}writeValue(e){this._modelValue=e;++this._writeQnt;if(this._directive.isInitialized){this._ensureInitEhUnsubscribed();this._updateDirective()}else if(!this._dirInitEh){const e=this._directive.initialized;this._dirInitEh=e.subscribe(()=>{this._updateDirective();this._ensureInitEhUnsubscribed()})}}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){const t=this._directive;t instanceof wijmo.Control&&(t.isDisabled=e)}_updateDirective(){if(!this._isFirstChange()||null!=this._modelValue){this._ensureNgModelProp();if(this._directive&&this._ngModelProp){let e=this._modelValue;""===e&&(e=null);this._dirUpdateQnt++;try{this._directive[this._ngModelProp]=e}finally{this._dirUpdateQnt--}}this._ensureSubscribed()}}_ensureSubscribed(){if(this._isSubscribed)return;const e=this._directive;if(e){this._ensureNgModelProp();this._ngModelProp=e[WjDirectiveBehavior.wjModelPropAttr];const t=this._ngModelProp;if(t){const i=this._behavior.getPropChangeEvent(t);i&&e[i].addHandler(this._dirValChgEh,this)}e instanceof wijmo.Control&&e.lostFocus.addHandler(this._dirLostFocusEh,this);this._isSubscribed=!0}}_ensureNgModelProp(){!this._ngModelProp&&this._directive&&(this._ngModelProp=this._directive[WjDirectiveBehavior.wjModelPropAttr])}_ensureInitEhUnsubscribed(){if(this._dirInitEh){this._dirInitEh.unsubscribe();this._dirInitEh=null}}_isFirstChange(){return this._writeQnt<2}_dirValChgEh(e,t){if(this._onChange&&this._directive&&this._ngModelProp){let e=this._directive[this._ngModelProp],t=this._modelValue;""===t&&(t=null);if(!(this._dirUpdateQnt>0&&_isNullOrEmpty(t)&&_isNullOrEmpty(e)||Ng2Utils.equals(t,e))||wijmo.isArray(e)){this._modelValue=e;this._onChange(e)}}}_dirLostFocusEh(e,t){this._onTouched&&this._onTouched()}}export function WjValueAccessorFactory(e){return new WjValueAccessor(e)}function _isNullOrEmpty(e){return null==e||""===e}
|
|
14
|
+
var _a,_b,_c,_d,_e;import*as i0 from"@angular/core";import{NgZone,ChangeDetectorRef,ApplicationRef,EventEmitter,Injectable}from"@angular/core";import*as wijmo from"@grapecity/wijmo";class WjOptions{}(_a=WjOptions).asyncBindings=!0;_a.zonelessMode="auto";function isNoopNgZoneLike(e){return!e||!e._inner&&!e._outer&&("function"==typeof e.run&&"function"==typeof e.runGuarded&&"function"==typeof e.runOutsideAngular&&"function"==typeof e.runTask)}class WjComponentResolvedMetadata{constructor(e){this.changeEventMap=[];this.allImplEvents=[];this.resolveChangeEventMap(e)}resolveChangeEventMap(e){var t;const i=e.outputs||[],n=e.changeEvents||{};this.changeEventMap.splice(0,this.changeEventMap.length);this.allImplEvents=[];if(!i.length)return;const r=i.map(e=>e.split(":")).map(e=>{var t,i;return{implName:null===(t=e[0])||void 0===t?void 0:t.trim(),exposeName:null===(i=e[1])||void 0===i?void 0:i.trim()}});this.allImplEvents=r.filter(e=>!!e.implName).map(e=>e.implName);const s=r.filter(e=>e.implName&&e.exposeName);for(const e of s){const i=ResolvedMetadataUtils.getWjEventName(e.implName);if(!i)continue;const r={eventImpl:e.implName,event:e.exposeName},s=null!==(t=n[i])&&void 0!==t?t:n[e.exposeName];(null==s?void 0:s.length)&&(r.props=s.map(e=>({prop:e,evExposed:ResolvedMetadataUtils.getChangeEventNameExposed(e),evImpl:ResolvedMetadataUtils.getChangeEventNameImplemented(e)})));this.changeEventMap.push(r)}for(const e of Object.keys(n)){if(e.indexOf(".")<0)continue;const t={eventImpl:null,event:e,props:n[e].map(e=>({prop:e,evExposed:ResolvedMetadataUtils.getChangeEventNameExposed(e),evImpl:ResolvedMetadataUtils.getChangeEventNameImplemented(e)}))};this.changeEventMap.push(t)}}}class ResolvedMetadataUtils{static getChangeEventNameImplemented(e){return`${_b.getChangeEventNameExposed(e)}${_b.changeEventImplementSuffix}`}static getChangeEventNameExposed(e){return e+"Change"}static getWjEventName(e){if(!e)return null;const t=_b.wijmoEventImplementSuffix,i=e.length-t.length;return i>0&&e.slice(i)===t?e.slice(0,i):null}}(_b=ResolvedMetadataUtils).changeEventImplementSuffix="PC";_b.wijmoEventImplementSuffix="Ng";class WjDirectiveBehavior{static getHostElement(e,t){_c.ngZone=t?t.get(NgZone,null):null;return e.nativeElement}static attach(e,t,i,n){return new _c(e,t,i,n)}static getBehavior(e){var t;return e&&null!==(t=e[_c.behaviorRefProp])&&void 0!==t?t:null}static getZone(e){var t;const i=_c.getBehavior(e);return null!==(t=null==i?void 0:i.nz)&&void 0!==t?t:_c.ngZone}static instantiateTemplate(e,t,i,n=!1,r={}){if(!i)throw new Error("A templateRef is required to instantiate a Wijmo Angular template.");const s=t.createEmbeddedView(i,r,t.length),o=s.rootNodes;let l;if(n&&1===o.length)l=o[0];else{const e=document.createElement("div");for(const t of o)e.appendChild(t);l=e}e&&e.appendChild(l);return{viewRef:s,rootElement:l}}constructor(e,t,i,n){this.parentBehavior=null;this.isInitialized=!1;this.isDestroyed=!1;this.nzRun=e=>e();this.siblingInsertedObserver=null;this.pendingEvents=[];this.pendingEventsTimeout=null;this.pendingCheck=!1;this.directive=e;this.elementRef=t;this.injector=i;this.injectedParent=n;this.nz=i.get(NgZone,null);this.cdRef=i.get(ChangeDetectorRef,null);this.appRef=i.get(ApplicationRef,null);this.isZoneless=this.detectZonelessMode();this.nz&&!this.isZoneless&&(this.nzRun=this.nz.run.bind(this.nz));this.overrideDirectiveMethods();this.typeData=e.constructor[_c.directiveTypeDataProp]||{};null!==this.typeData.siblingId&&void 0!==this.typeData.siblingId||(this.typeData.siblingId=""+ ++_c.siblingDirId);const r=e.constructor[_c.directiveResolvedTypeDataProp]||new WjComponentResolvedMetadata(this.typeData);e.constructor[_c.directiveResolvedTypeDataProp]=r;this.resolvedTypeData=r;e[_c.behaviorRefProp]=this;i[_c.behaviorRefProp]=this;e[_c.isInitializedPropAttr]=!1;this.createEvents();this.setupAsChild();this.isHostElement()&&this.elementRef.nativeElement.setAttribute(_c.siblingDirIdAttr,this.typeData.siblingId);this.subscribeToEvents(!1);e instanceof wijmo.Control&&(e.workingAs="Angular2")}ngOnInit(){this.isInitialized=!0;this.initParent();this.subscribeToEvents(!0)}ngAfterViewInit(){this.directive[_c.isInitializedPropAttr]=!0;setTimeout(()=>{if(!this.isDestroyed){this.directive[_c.initializedEventAttr].emit(void 0);this.requestCheck()}})}ngOnDestroy(){if(!this.isDestroyed){this.isDestroyed=!0;if(this.siblingInsertedObserver){this.siblingInsertedObserver.disconnect();this.siblingInsertedObserver=null}if(this.isChild()&&this.parentBehavior){const e=this.parentBehavior.directive,t=this.getParentProp(),i=this.directive;if(!this.parentBehavior.isDestroyed&&e&&t&&i){const n=e[t];this.removeFromParentCollection(n,i)}}if(this.directive instanceof wijmo.Control&&this.directive.hostElement){const e=this.elementRef.nativeElement,t=null==e?void 0:e.parentNode,i=t?Array.prototype.indexOf.call(t.childNodes,e):-1;this.directive.dispose();if(t&&i>-1&&Array.prototype.indexOf.call(t.childNodes,e)<0){e.textContent="";i<t.childNodes.length&&t.replaceChild(e,t.childNodes[i])}}this.injector[_c.behaviorRefProp]=null}}flushPendingEvents(){this.triggerPendingEvents(!0)}requestCheck(){this.performRequestCheck()}getPropChangeEvent(e){const t=this.typeData.changeEvents;if(!t)return null;for(const i of Object.keys(t))if(t[i].indexOf(e)>-1)return i;return null}createEvents(){const e=this.resolvedTypeData.allImplEvents||[];for(const t of e)this.directive[t]=new EventEmitter(!1)}overrideDirectiveMethods(){const e=this.directive;if(!(e instanceof wijmo.Control&&e._resizeObserverCallback))return;const t=e._resizeObserverCallback.bind(e),i=this;e._resizeObserverCallback=function(e){if(i.isZoneless){t(e);i.requestCheck()}else{if(!NgZone.isInAngularZone()){const i=_c.getZone(this);if(i){i.run(()=>t(e));return}}t(e)}}.bind(e)}subscribeToEvents(e){const t=this.resolvedTypeData.changeEventMap||[],i=!!e;for(const e of t){i===e.event.indexOf(".")>-1&&this.addHandlers(e)}if(e)for(const e of t)this.triggerPropChangeEvents(e,!0)}addHandlers(e){const t=this.directive,i=_c.evaluatePath(t,e.event);i&&i.addHandler((i,n)=>{this.runChangeDetectionAware(()=>{this.isInitialized&&this.triggerPropChangeEvents(e);e.eventImpl&&this.triggerEvent(t[e.eventImpl],n,!(!e.props||!e.props.length))})})}triggerPropChangeEvents(e,t=!0){var i;if(null===(i=e.props)||void 0===i?void 0:i.length)for(const i of e.props){const e=this.getSignalFriendlyPropValue(this.directive[i.prop]);this.triggerEvent(this.directive[i.evImpl],e,t,!0)}}getSignalFriendlyPropValue(e){return wijmo.isArray(e)?Array.prototype.slice.call(e):e}triggerEvent(e,t,i,n=!1){if(i&&this.isAsyncBinding()){if(n){const i=this.pendingEvents.find(t=>t.event===e);i?i.args=t:this.pendingEvents.push({event:e,args:t})}else this.pendingEvents.push({event:e,args:t});null===this.pendingEventsTimeout&&(this.pendingEventsTimeout=setTimeout(()=>this.triggerPendingEvents(!1),0))}else{e.emit(t);this.performRequestCheck()}}triggerPendingEvents(e){if(null!==this.pendingEventsTimeout){clearTimeout(this.pendingEventsTimeout);this.pendingEventsTimeout=null}if(!this.isDestroyed)do{const e=this.pendingEvents.slice();this.pendingEvents.length=0;for(const t of e)t.event.emit(t.args);this.performRequestCheck()}while(e&&!this.isDestroyed&&this.pendingEvents.length)}setupAsChild(){if(this.isChild()){this.isHostElement()&&(this.elementRef.nativeElement.style.display="none");this.parentBehavior=_c.getBehavior(this.injectedParent)}}isAsyncBinding(){const e=this.directive[_c.asyncBindingUpdatePropAttr];return null==e?WjOptions.asyncBindings:e}isChild(){return this.isParentInitializer()||this.isParentReferencer()}isParentInitializer(){return null!==this.directive[_c.parentPropertyAttr]&&void 0!==this.directive[_c.parentPropertyAttr]}isParentReferencer(){return!!this.typeData.parentRefProperty}getParentProp(){return this.directive[_c.parentPropertyAttr]}getParentReferenceProperty(){return this.typeData.parentRefProperty}parentInCtor(){return this.isParentReferencer()&&""===this.getParentReferenceProperty()}initParent(){if(!this.parentBehavior)return;const e=this.parentBehavior.directive,t=this.getParentProp(),i=this.directive;if(this.isParentInitializer()&&t){const n=e[t];if(this.isParentCollection(n)){let e=this.isHostElement()?this.getSiblingIndex():-1;(e<0||e>=n.length)&&(e=n.length);this.insertIntoParentCollection(n,e,i);if(this.isHostElement()){const e=this.elementRef.nativeElement;this.siblingInsertedObserver=new MutationObserver(this.handleSiblingInserted.bind(this));this.siblingInsertedObserver.observe(e,{childList:!0})}}else e[t]=i}if(this.isParentReferencer()&&!this.parentInCtor()){const t=this.getParentReferenceProperty();t&&(i[t]=e)}}getSiblingIndex(){const e=this.elementRef.nativeElement,t=e.parentElement;if(!t)return-1;const i=t.childNodes,n=this.typeData.siblingId;let r=-1;for(let t=0;t<i.length;t++){const s=i[t];if(1===s.nodeType&&s.getAttribute(_c.siblingDirIdAttr)===n){r++;if(s===e)return r}}return-1}handleSiblingInserted(e){var t;for(const i of e){if("childList"!==i.type||0===i.addedNodes.length)continue;if(!Array.from(i.addedNodes).some(e=>e===this.elementRef.nativeElement))continue;const e=this.getSiblingIndex(),n=null===(t=this.parentBehavior)||void 0===t?void 0:t.directive[this.getParentProp()],r=this.directive,s=this.indexOfParentCollectionItem(n,r);if(e>=0&&s>=0&&e!==s){this.removeAtParentCollectionIndex(n,s);this.insertIntoParentCollection(n,Math.min(e,n.length),r)}}}isParentCollection(e){return!!e&&(wijmo.isArray(e)||"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.indexOf&&("function"==typeof e.splice||"function"==typeof e.insert))}indexOfParentCollectionItem(e,t){return this.isParentCollection(e)?e.indexOf(t):-1}insertIntoParentCollection(e,t,i){this.isParentCollection(e)&&("function"!=typeof e.splice?"function"!=typeof e.insert?"function"==typeof e.push&&e.push(i):e.insert(t,i):e.splice(t,0,i))}removeAtParentCollectionIndex(e,t){!this.isParentCollection(e)||t<0||("function"!=typeof e.removeAt?"function"==typeof e.splice&&e.splice(t,1):e.removeAt(t))}removeFromParentCollection(e,t){if(!this.isParentCollection(e))return;const i=this.indexOfParentCollectionItem(e,t);i>-1&&this.removeAtParentCollectionIndex(e,i)}isHostElement(){return this.elementRef.nativeElement.nodeType===Node.ELEMENT_NODE}static evaluatePath(e,t){_c.pathBinding.path=t;return _c.pathBinding.getValue(e)}detectZonelessMode(){const e=WjOptions.zonelessMode;return!0===e||!1===e?e:!this.nz||isNoopNgZoneLike(this.nz)}runChangeDetectionAware(e){if(!this.isZoneless&&this.nz)this.nzRun(e);else{e();this.performRequestCheck()}}performRequestCheck(){if(this.isZoneless&&(this.appRef||this.cdRef)&&!this.isDestroyed&&!this.pendingCheck){this.pendingCheck=!0;Promise.resolve().then(()=>{var e;this.pendingCheck=!1;this.isDestroyed||(this.appRef?this.appRef.tick():null===(e=this.cdRef)||void 0===e||e.detectChanges())})}}}(_c=WjDirectiveBehavior).directiveTypeDataProp="meta";_c.directiveResolvedTypeDataProp="_wjResolvedMeta";_c.behaviorRefProp="_wjBehaviour";_c.parentPropertyAttr="wjProperty";_c.wjModelPropertyAttr="wjModelProperty";_c.initializedEventAttr="initialized";_c.isInitializedPropAttr="isInitialized";_c.siblingDirIdAttr="wj-directive-id";_c.asyncBindingUpdatePropAttr="asyncBindings";_c.siblingDirId=0;_c.wijmoComponentProviderId="WjComponent";_c.ngZone=null;_c.outsideZoneEvents={pointermove:!0,pointerover:!0,mousemove:!0,wheel:!0,touchmove:!0,pointerenter:!0,pointerleave:!0,pointerout:!0,mouseover:!0,mouseenter:!0,mouseleave:!0,mouseout:!0};_c.pathBinding=new wijmo.Binding("");_c.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:_c,deps:"invalid",target:i0.ɵɵFactoryTarget.Injectable});_c.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:_c});i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:WjDirectiveBehavior,decorators:[{type:Injectable}],ctorParameters:()=>[{type:void 0},{type:i0.ElementRef},{type:i0.Injector},{type:void 0}]});class Ng2Utils{static getChangeEventNameImplemented(e){return`${_d.getChangeEventNameExposed(e)}${_d.changeEventImplementSuffix}`}static getChangeEventNameExposed(e){return e+"Change"}static getWjEventName(e){if(!e)return null;const t=_d.wjEventImplementSuffix,i=e.length-t.length;return i>0&&e.slice(i)===t?e.slice(0,i):null}static equals(e,t){return Number.isNaN(e)&&Number.isNaN(t)||wijmo.DateTime.equals(e,t)||e===t}}(_d=Ng2Utils).changeEventImplementSuffix="PC";_d.wjEventImplementSuffix="Ng";class WjValueAccessor{constructor(e){this.writeCount=0;this.ngModelProp=null;this.isSubscribed=!1;this.changeSubscription=null;this.directiveUpdateCount=0;this.initSubscription=null;this.deferredWriteHandle=null;this.deferredWriteAttempts=0;this.initWriteHandle=null;this.initWriteAttempts=0;this.onChangeFn=e=>{};this.onTouchedFn=()=>{};this.handleDirectiveValueChanged=(e,t)=>{var i;if(!this.onChangeFn||!this.directive||!this.ngModelProp)return;const n=this.directive[this.ngModelProp],r=Array.isArray(n)?n.slice():n;let s=this.modelValue;""===s&&(s=null);if(!(this.directiveUpdateCount>0&&isNullOrEmpty(s)&&isNullOrEmpty(n)||Ng2Utils.equals(s,n))||Array.isArray(n)){this.modelValue=r;this.onChangeFn(r);null===(i=this.getBehavior())||void 0===i||i.requestCheck()}};this.handleDirectiveLostFocus=()=>{var e;this.onTouchedFn();null===(e=this.getBehavior())||void 0===e||e.requestCheck()};this.directive=e;this.behavior=WjDirectiveBehavior.getBehavior(e)}writeValue(e){var t,i,n;!(null===(t=this.directive)||void 0===t?void 0:t.isInitialized)&&isNullOrEmpty(e)&&!isNullOrEmpty(this.modelValue)||(this.modelValue=e);this.writeCount++;this.clearDeferredWrite();this.deferredWriteAttempts=0;this.clearInitWrite();this.initWriteAttempts=0;this.applyDirectiveValue();if(null===(i=this.directive)||void 0===i?void 0:i.isInitialized)this.ensureInitSubscriptionDisposed();else{if(!this.initSubscription){const e=null===(n=this.directive)||void 0===n?void 0:n.initialized;this.initSubscription=null==e?void 0:e.subscribe(()=>{this.clearInitWrite();this.applyDirectiveValue();this.ensureInitSubscriptionDisposed()})}this.scheduleInitWriteIfNeeded()}}registerOnChange(e){this.onChangeFn=e}registerOnTouched(e){this.onTouchedFn=e}setDisabledState(e){var t;if(this.directive instanceof wijmo.Control){this.directive.isDisabled=e;null===(t=this.getBehavior())||void 0===t||t.requestCheck()}}updateDirective(){var e;if(this.isFirstChange()&&(null===this.modelValue||void 0===this.modelValue))return;this.ensureNgModelProp();if(!this.directive||!this.ngModelProp)return;const t=this.normalizeModelValue(this.modelValue);this.directiveUpdateCount++;try{this.directive[this.ngModelProp]=t}finally{this.directiveUpdateCount--}null===(e=this.getBehavior())||void 0===e||e.requestCheck();this.ensureSubscribed()}applyDirectiveValue(){this.updateDirective();this.scheduleDeferredWriteIfNeeded()}ensureSubscribed(){var e;if(!this.isSubscribed&&this.directive){this.ensureNgModelProp();if(this.ngModelProp){const t=null===(e=this.getBehavior())||void 0===e?void 0:e.getPropChangeEvent(this.ngModelProp);if(t){const e=this.directive[t];e&&"function"==typeof e.addHandler?e.addHandler(this.handleDirectiveValueChanged,this):e&&"function"==typeof e.subscribe&&(this.changeSubscription=e.subscribe(()=>this.handleDirectiveValueChanged(this.directive,null)))}}this.directive instanceof wijmo.Control&&this.directive.lostFocus.addHandler(this.handleDirectiveLostFocus,this);this.isSubscribed=!0}}ensureNgModelProp(){var e,t;if(!this.ngModelProp&&this.directive){const i=this.directive[WjDirectiveBehavior.wjModelPropertyAttr],n=(null===(t=null===(e=this.getBehavior())||void 0===e?void 0:e.typeData)||void 0===t?void 0:t.defaultModelProperty)||null;this.ngModelProp=i||n}}ensureInitSubscriptionDisposed(){if(this.initSubscription){this.initSubscription.unsubscribe();this.initSubscription=null}}clearDeferredWrite(){if(null!==this.deferredWriteHandle){clearTimeout(this.deferredWriteHandle);this.deferredWriteHandle=null}}clearInitWrite(){if(null!==this.initWriteHandle){clearTimeout(this.initWriteHandle);this.initWriteHandle=null}}scheduleInitWriteIfNeeded(){var e;if(this.directive&&!this.directive.isInitialized&&!(null===(e=this.getBehavior())||void 0===e?void 0:e.isDestroyed))if(this.initWriteAttempts>=_e.maxInitWriteAttempts)this.clearInitWrite();else{this.clearInitWrite();this.initWriteAttempts++;this.initWriteHandle=setTimeout(()=>{var e;this.initWriteHandle=null;if(this.directive&&!(null===(e=this.getBehavior())||void 0===e?void 0:e.isDestroyed))if(this.directive.isInitialized){this.applyDirectiveValue();this.ensureInitSubscriptionDisposed()}else this.scheduleInitWriteIfNeeded()},0)}}scheduleDeferredWriteIfNeeded(){const e=this.getBehavior();if(!this.directive||!this.ngModelProp||(null==e?void 0:e.isDestroyed))return;if(this.isDirectiveValueSynchronized()){this.clearDeferredWrite();return}if(this.deferredWriteAttempts>=_e.maxDeferredWriteAttempts){this.clearDeferredWrite();return}this.clearDeferredWrite();this.deferredWriteAttempts++;const t=this.getDeferredWriteDelay();this.deferredWriteHandle=setTimeout(()=>{var e;this.deferredWriteHandle=null;this.directive&&!(null===(e=this.getBehavior())||void 0===e?void 0:e.isDestroyed)&&this.applyDirectiveValue()},t)}isDirectiveValueSynchronized(){if(!this.directive||!this.ngModelProp)return!0;return areEquivalentValue(this.normalizeModelValue(this.modelValue),this.directive[this.ngModelProp])}normalizeModelValue(e){return""===e?null:e}getDeferredWriteDelay(){return Math.min(_e.maxDeferredWriteDelayMs,2*Math.max(0,this.deferredWriteAttempts-1))}getBehavior(){!this.behavior&&this.directive&&(this.behavior=WjDirectiveBehavior.getBehavior(this.directive));return this.behavior}isFirstChange(){return this.writeCount<2}}(_e=WjValueAccessor).maxDeferredWriteAttempts=20;_e.maxDeferredWriteDelayMs=32;_e.maxInitWriteAttempts=20;function WjValueAccessorFactory(e){return new WjValueAccessor(e)}function isNullOrEmpty(e){return null==e||""===e}function areEquivalentValue(e,t){return!(!isNullOrEmpty(e)||!isNullOrEmpty(t))||(!!areEquivalentArrays(e,t)||(isCellRangeLike(e)&&isCellRangeLike(t)?e.row===t.row&&e.col===t.col&&e.row2===t.row2&&e.col2===t.col2:Ng2Utils.equals(e,t)))}function areEquivalentArrays(e,t){return!(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)&&e.every((e,i)=>areEquivalentValue(e,t[i]))}function isCellRangeLike(e){return!!e&&"object"==typeof e&&"number"==typeof e.row&&"number"==typeof e.col&&"number"==typeof e.row2&&"number"==typeof e.col2}export{Ng2Utils,WjComponentResolvedMetadata,WjDirectiveBehavior,WjOptions,WjValueAccessor,WjValueAccessorFactory,isNoopNgZoneLike};
|
package/es2022-fesm.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* Wijmo Library 5.20262.60
|
|
4
|
+
* https://developer.mescius.com/wijmo
|
|
5
|
+
*
|
|
6
|
+
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
|
|
9
|
+
* us.sales@mescius.com
|
|
10
|
+
* https://developer.mescius.com/wijmo/licensing
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import*as i0 from"@angular/core";import{NgZone,ChangeDetectorRef,ApplicationRef,EventEmitter,Injectable}from"@angular/core";import*as wijmo from"@grapecity/wijmo";class WjOptions{static{this.asyncBindings=!0}static{this.zonelessMode="auto"}}function isNoopNgZoneLike(e){return!e||!e._inner&&!e._outer&&("function"==typeof e.run&&"function"==typeof e.runGuarded&&"function"==typeof e.runOutsideAngular&&"function"==typeof e.runTask)}class WjComponentResolvedMetadata{constructor(e){this.changeEventMap=[];this.allImplEvents=[];this.resolveChangeEventMap(e)}resolveChangeEventMap(e){const t=e.outputs||[],i=e.changeEvents||{};this.changeEventMap.splice(0,this.changeEventMap.length);this.allImplEvents=[];if(!t.length)return;const s=t.map((e=>e.split(":"))).map((e=>({implName:e[0]?.trim(),exposeName:e[1]?.trim()})));this.allImplEvents=s.filter((e=>!!e.implName)).map((e=>e.implName));const n=s.filter((e=>e.implName&&e.exposeName));for(const e of n){const t=ResolvedMetadataUtils.getWjEventName(e.implName);if(!t)continue;const s={eventImpl:e.implName,event:e.exposeName},n=i[t]??i[e.exposeName];n?.length&&(s.props=n.map((e=>({prop:e,evExposed:ResolvedMetadataUtils.getChangeEventNameExposed(e),evImpl:ResolvedMetadataUtils.getChangeEventNameImplemented(e)}))));this.changeEventMap.push(s)}for(const e of Object.keys(i)){if(e.indexOf(".")<0)continue;const t={eventImpl:null,event:e,props:i[e].map((e=>({prop:e,evExposed:ResolvedMetadataUtils.getChangeEventNameExposed(e),evImpl:ResolvedMetadataUtils.getChangeEventNameImplemented(e)})))};this.changeEventMap.push(t)}}}class ResolvedMetadataUtils{static{this.changeEventImplementSuffix="PC"}static{this.wijmoEventImplementSuffix="Ng"}static getChangeEventNameImplemented(e){return`${ResolvedMetadataUtils.getChangeEventNameExposed(e)}${ResolvedMetadataUtils.changeEventImplementSuffix}`}static getChangeEventNameExposed(e){return`${e}Change`}static getWjEventName(e){if(!e)return null;const t=ResolvedMetadataUtils.wijmoEventImplementSuffix,i=e.length-t.length;return i>0&&e.slice(i)===t?e.slice(0,i):null}}class WjDirectiveBehavior{static{this.directiveTypeDataProp="meta"}static{this.directiveResolvedTypeDataProp="_wjResolvedMeta"}static{this.behaviorRefProp="_wjBehaviour"}static{this.parentPropertyAttr="wjProperty"}static{this.wjModelPropertyAttr="wjModelProperty"}static{this.initializedEventAttr="initialized"}static{this.isInitializedPropAttr="isInitialized"}static{this.siblingDirIdAttr="wj-directive-id"}static{this.asyncBindingUpdatePropAttr="asyncBindings"}static{this.siblingDirId=0}static{this.wijmoComponentProviderId="WjComponent"}static{this.ngZone=null}static{this.outsideZoneEvents={pointermove:!0,pointerover:!0,mousemove:!0,wheel:!0,touchmove:!0,pointerenter:!0,pointerleave:!0,pointerout:!0,mouseover:!0,mouseenter:!0,mouseleave:!0,mouseout:!0}}static{this.pathBinding=new wijmo.Binding("")}static getHostElement(e,t){WjDirectiveBehavior.ngZone=t?t.get(NgZone,null):null;return e.nativeElement}static attach(e,t,i,s){return new WjDirectiveBehavior(e,t,i,s)}static getBehavior(e){return e?e[WjDirectiveBehavior.behaviorRefProp]??null:null}static getZone(e){const t=WjDirectiveBehavior.getBehavior(e);return t?.nz??WjDirectiveBehavior.ngZone}static instantiateTemplate(e,t,i,s=!1,n={}){if(!i)throw new Error("A templateRef is required to instantiate a Wijmo Angular template.");const r=t.createEmbeddedView(i,n,t.length),o=r.rootNodes;let a;if(s&&1===o.length)a=o[0];else{const e=document.createElement("div");for(const t of o)e.appendChild(t);a=e}e&&e.appendChild(a);return{viewRef:r,rootElement:a}}constructor(e,t,i,s){this.parentBehavior=null;this.isInitialized=!1;this.isDestroyed=!1;this.nzRun=e=>e();this.siblingInsertedObserver=null;this.pendingEvents=[];this.pendingEventsTimeout=null;this.pendingCheck=!1;this.directive=e;this.elementRef=t;this.injector=i;this.injectedParent=s;this.nz=i.get(NgZone,null);this.cdRef=i.get(ChangeDetectorRef,null);this.appRef=i.get(ApplicationRef,null);this.isZoneless=this.detectZonelessMode();this.nz&&!this.isZoneless&&(this.nzRun=this.nz.run.bind(this.nz));this.overrideDirectiveMethods();this.typeData=e.constructor[WjDirectiveBehavior.directiveTypeDataProp]||{};null!==this.typeData.siblingId&&void 0!==this.typeData.siblingId||(this.typeData.siblingId=""+ ++WjDirectiveBehavior.siblingDirId);const n=e.constructor[WjDirectiveBehavior.directiveResolvedTypeDataProp]||new WjComponentResolvedMetadata(this.typeData);e.constructor[WjDirectiveBehavior.directiveResolvedTypeDataProp]=n;this.resolvedTypeData=n;e[WjDirectiveBehavior.behaviorRefProp]=this;i[WjDirectiveBehavior.behaviorRefProp]=this;e[WjDirectiveBehavior.isInitializedPropAttr]=!1;this.createEvents();this.setupAsChild();this.isHostElement()&&this.elementRef.nativeElement.setAttribute(WjDirectiveBehavior.siblingDirIdAttr,this.typeData.siblingId);this.subscribeToEvents(!1);e instanceof wijmo.Control&&(e.workingAs="Angular2")}ngOnInit(){this.isInitialized=!0;this.initParent();this.subscribeToEvents(!0)}ngAfterViewInit(){this.directive[WjDirectiveBehavior.isInitializedPropAttr]=!0;setTimeout((()=>{if(!this.isDestroyed){this.directive[WjDirectiveBehavior.initializedEventAttr].emit(void 0);this.requestCheck()}}))}ngOnDestroy(){if(!this.isDestroyed){this.isDestroyed=!0;if(this.siblingInsertedObserver){this.siblingInsertedObserver.disconnect();this.siblingInsertedObserver=null}if(this.isChild()&&this.parentBehavior){const e=this.parentBehavior.directive,t=this.getParentProp(),i=this.directive;if(!this.parentBehavior.isDestroyed&&e&&t&&i){const s=e[t];this.removeFromParentCollection(s,i)}}if(this.directive instanceof wijmo.Control&&this.directive.hostElement){const e=this.elementRef.nativeElement,t=e?.parentNode,i=t?Array.prototype.indexOf.call(t.childNodes,e):-1;this.directive.dispose();if(t&&i>-1&&Array.prototype.indexOf.call(t.childNodes,e)<0){e.textContent="";i<t.childNodes.length&&t.replaceChild(e,t.childNodes[i])}}this.injector[WjDirectiveBehavior.behaviorRefProp]=null}}flushPendingEvents(){this.triggerPendingEvents(!0)}requestCheck(){this.performRequestCheck()}getPropChangeEvent(e){const t=this.typeData.changeEvents;if(!t)return null;for(const i of Object.keys(t))if(t[i].indexOf(e)>-1)return i;return null}createEvents(){const e=this.resolvedTypeData.allImplEvents||[];for(const t of e)this.directive[t]=new EventEmitter(!1)}overrideDirectiveMethods(){const e=this.directive;if(!(e instanceof wijmo.Control&&e._resizeObserverCallback))return;const t=e._resizeObserverCallback.bind(e),i=this;e._resizeObserverCallback=function(e){if(i.isZoneless){t(e);i.requestCheck()}else{if(!NgZone.isInAngularZone()){const i=WjDirectiveBehavior.getZone(this);if(i){i.run((()=>t(e)));return}}t(e)}}.bind(e)}subscribeToEvents(e){const t=this.resolvedTypeData.changeEventMap||[],i=!!e;for(const e of t){i===e.event.indexOf(".")>-1&&this.addHandlers(e)}if(e)for(const e of t)this.triggerPropChangeEvents(e,!0)}addHandlers(e){const t=this.directive,i=WjDirectiveBehavior.evaluatePath(t,e.event);i&&i.addHandler(((i,s)=>{this.runChangeDetectionAware((()=>{this.isInitialized&&this.triggerPropChangeEvents(e);e.eventImpl&&this.triggerEvent(t[e.eventImpl],s,!(!e.props||!e.props.length))}))}))}triggerPropChangeEvents(e,t=!0){if(e.props?.length)for(const i of e.props){const e=this.getSignalFriendlyPropValue(this.directive[i.prop]);this.triggerEvent(this.directive[i.evImpl],e,t,!0)}}getSignalFriendlyPropValue(e){return wijmo.isArray(e)?Array.prototype.slice.call(e):e}triggerEvent(e,t,i,s=!1){if(i&&this.isAsyncBinding()){if(s){const i=this.pendingEvents.find((t=>t.event===e));i?i.args=t:this.pendingEvents.push({event:e,args:t})}else this.pendingEvents.push({event:e,args:t});null===this.pendingEventsTimeout&&(this.pendingEventsTimeout=setTimeout((()=>this.triggerPendingEvents(!1)),0))}else{e.emit(t);this.performRequestCheck()}}triggerPendingEvents(e){if(null!==this.pendingEventsTimeout){clearTimeout(this.pendingEventsTimeout);this.pendingEventsTimeout=null}if(!this.isDestroyed)do{const e=this.pendingEvents.slice();this.pendingEvents.length=0;for(const t of e)t.event.emit(t.args);this.performRequestCheck()}while(e&&!this.isDestroyed&&this.pendingEvents.length)}setupAsChild(){if(this.isChild()){this.isHostElement()&&(this.elementRef.nativeElement.style.display="none");this.parentBehavior=WjDirectiveBehavior.getBehavior(this.injectedParent)}}isAsyncBinding(){const e=this.directive[WjDirectiveBehavior.asyncBindingUpdatePropAttr];return null==e?WjOptions.asyncBindings:e}isChild(){return this.isParentInitializer()||this.isParentReferencer()}isParentInitializer(){return null!==this.directive[WjDirectiveBehavior.parentPropertyAttr]&&void 0!==this.directive[WjDirectiveBehavior.parentPropertyAttr]}isParentReferencer(){return!!this.typeData.parentRefProperty}getParentProp(){return this.directive[WjDirectiveBehavior.parentPropertyAttr]}getParentReferenceProperty(){return this.typeData.parentRefProperty}parentInCtor(){return this.isParentReferencer()&&""===this.getParentReferenceProperty()}initParent(){if(!this.parentBehavior)return;const e=this.parentBehavior.directive,t=this.getParentProp(),i=this.directive;if(this.isParentInitializer()&&t){const s=e[t];if(this.isParentCollection(s)){let e=this.isHostElement()?this.getSiblingIndex():-1;(e<0||e>=s.length)&&(e=s.length);this.insertIntoParentCollection(s,e,i);if(this.isHostElement()){const e=this.elementRef.nativeElement;this.siblingInsertedObserver=new MutationObserver(this.handleSiblingInserted.bind(this));this.siblingInsertedObserver.observe(e,{childList:!0})}}else e[t]=i}if(this.isParentReferencer()&&!this.parentInCtor()){const t=this.getParentReferenceProperty();t&&(i[t]=e)}}getSiblingIndex(){const e=this.elementRef.nativeElement,t=e.parentElement;if(!t)return-1;const i=t.childNodes,s=this.typeData.siblingId;let n=-1;for(let t=0;t<i.length;t++){const r=i[t];if(1===r.nodeType&&r.getAttribute(WjDirectiveBehavior.siblingDirIdAttr)===s){n++;if(r===e)return n}}return-1}handleSiblingInserted(e){for(const t of e){if("childList"!==t.type||0===t.addedNodes.length)continue;if(!Array.from(t.addedNodes).some((e=>e===this.elementRef.nativeElement)))continue;const e=this.getSiblingIndex(),i=this.parentBehavior?.directive[this.getParentProp()],s=this.directive,n=this.indexOfParentCollectionItem(i,s);if(e>=0&&n>=0&&e!==n){this.removeAtParentCollectionIndex(i,n);this.insertIntoParentCollection(i,Math.min(e,i.length),s)}}}isParentCollection(e){return!!e&&(wijmo.isArray(e)||"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.indexOf&&("function"==typeof e.splice||"function"==typeof e.insert))}indexOfParentCollectionItem(e,t){return this.isParentCollection(e)?e.indexOf(t):-1}insertIntoParentCollection(e,t,i){this.isParentCollection(e)&&("function"!=typeof e.splice?"function"!=typeof e.insert?"function"==typeof e.push&&e.push(i):e.insert(t,i):e.splice(t,0,i))}removeAtParentCollectionIndex(e,t){!this.isParentCollection(e)||t<0||("function"!=typeof e.removeAt?"function"==typeof e.splice&&e.splice(t,1):e.removeAt(t))}removeFromParentCollection(e,t){if(!this.isParentCollection(e))return;const i=this.indexOfParentCollectionItem(e,t);i>-1&&this.removeAtParentCollectionIndex(e,i)}isHostElement(){return this.elementRef.nativeElement.nodeType===Node.ELEMENT_NODE}static evaluatePath(e,t){WjDirectiveBehavior.pathBinding.path=t;return WjDirectiveBehavior.pathBinding.getValue(e)}detectZonelessMode(){const e=WjOptions.zonelessMode;return!0===e||!1===e?e:!this.nz||isNoopNgZoneLike(this.nz)}runChangeDetectionAware(e){if(!this.isZoneless&&this.nz)this.nzRun(e);else{e();this.performRequestCheck()}}performRequestCheck(){if(this.isZoneless&&(this.appRef||this.cdRef)&&!this.isDestroyed&&!this.pendingCheck){this.pendingCheck=!0;Promise.resolve().then((()=>{this.pendingCheck=!1;this.isDestroyed||(this.appRef?this.appRef.tick():this.cdRef?.detectChanges())}))}}static{this.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:WjDirectiveBehavior,deps:"invalid",target:i0.ɵɵFactoryTarget.Injectable})}static{this.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:WjDirectiveBehavior})}}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:WjDirectiveBehavior,decorators:[{type:Injectable}],ctorParameters:()=>[{type:void 0},{type:i0.ElementRef},{type:i0.Injector},{type:void 0}]});class Ng2Utils{static{this.changeEventImplementSuffix="PC"}static{this.wjEventImplementSuffix="Ng"}static getChangeEventNameImplemented(e){return`${Ng2Utils.getChangeEventNameExposed(e)}${Ng2Utils.changeEventImplementSuffix}`}static getChangeEventNameExposed(e){return`${e}Change`}static getWjEventName(e){if(!e)return null;const t=Ng2Utils.wjEventImplementSuffix,i=e.length-t.length;return i>0&&e.slice(i)===t?e.slice(0,i):null}static equals(e,t){return Number.isNaN(e)&&Number.isNaN(t)||wijmo.DateTime.equals(e,t)||e===t}}class WjValueAccessor{static{this.maxDeferredWriteAttempts=20}static{this.maxDeferredWriteDelayMs=32}static{this.maxInitWriteAttempts=20}constructor(e){this.writeCount=0;this.ngModelProp=null;this.isSubscribed=!1;this.changeSubscription=null;this.directiveUpdateCount=0;this.initSubscription=null;this.deferredWriteHandle=null;this.deferredWriteAttempts=0;this.initWriteHandle=null;this.initWriteAttempts=0;this.onChangeFn=e=>{};this.onTouchedFn=()=>{};this.handleDirectiveValueChanged=(e,t)=>{if(!this.onChangeFn||!this.directive||!this.ngModelProp)return;const i=this.directive[this.ngModelProp],s=Array.isArray(i)?i.slice():i;let n=this.modelValue;""===n&&(n=null);if(!(this.directiveUpdateCount>0&&isNullOrEmpty(n)&&isNullOrEmpty(i)||Ng2Utils.equals(n,i))||Array.isArray(i)){this.modelValue=s;this.onChangeFn(s);this.getBehavior()?.requestCheck()}};this.handleDirectiveLostFocus=()=>{this.onTouchedFn();this.getBehavior()?.requestCheck()};this.directive=e;this.behavior=WjDirectiveBehavior.getBehavior(e)}writeValue(e){!this.directive?.isInitialized&&isNullOrEmpty(e)&&!isNullOrEmpty(this.modelValue)||(this.modelValue=e);this.writeCount++;this.clearDeferredWrite();this.deferredWriteAttempts=0;this.clearInitWrite();this.initWriteAttempts=0;this.applyDirectiveValue();if(this.directive?.isInitialized)this.ensureInitSubscriptionDisposed();else{if(!this.initSubscription){const e=this.directive?.initialized;this.initSubscription=e?.subscribe((()=>{this.clearInitWrite();this.applyDirectiveValue();this.ensureInitSubscriptionDisposed()}))}this.scheduleInitWriteIfNeeded()}}registerOnChange(e){this.onChangeFn=e}registerOnTouched(e){this.onTouchedFn=e}setDisabledState(e){if(this.directive instanceof wijmo.Control){this.directive.isDisabled=e;this.getBehavior()?.requestCheck()}}updateDirective(){if(this.isFirstChange()&&(null===this.modelValue||void 0===this.modelValue))return;this.ensureNgModelProp();if(!this.directive||!this.ngModelProp)return;const e=this.normalizeModelValue(this.modelValue);this.directiveUpdateCount++;try{this.directive[this.ngModelProp]=e}finally{this.directiveUpdateCount--}this.getBehavior()?.requestCheck();this.ensureSubscribed()}applyDirectiveValue(){this.updateDirective();this.scheduleDeferredWriteIfNeeded()}ensureSubscribed(){if(!this.isSubscribed&&this.directive){this.ensureNgModelProp();if(this.ngModelProp){const e=this.getBehavior()?.getPropChangeEvent(this.ngModelProp);if(e){const t=this.directive[e];t&&"function"==typeof t.addHandler?t.addHandler(this.handleDirectiveValueChanged,this):t&&"function"==typeof t.subscribe&&(this.changeSubscription=t.subscribe((()=>this.handleDirectiveValueChanged(this.directive,null))))}}this.directive instanceof wijmo.Control&&this.directive.lostFocus.addHandler(this.handleDirectiveLostFocus,this);this.isSubscribed=!0}}ensureNgModelProp(){if(!this.ngModelProp&&this.directive){const e=this.directive[WjDirectiveBehavior.wjModelPropertyAttr],t=this.getBehavior()?.typeData?.defaultModelProperty||null;this.ngModelProp=e||t}}ensureInitSubscriptionDisposed(){if(this.initSubscription){this.initSubscription.unsubscribe();this.initSubscription=null}}clearDeferredWrite(){if(null!==this.deferredWriteHandle){clearTimeout(this.deferredWriteHandle);this.deferredWriteHandle=null}}clearInitWrite(){if(null!==this.initWriteHandle){clearTimeout(this.initWriteHandle);this.initWriteHandle=null}}scheduleInitWriteIfNeeded(){if(this.directive&&!this.directive.isInitialized&&!this.getBehavior()?.isDestroyed)if(this.initWriteAttempts>=WjValueAccessor.maxInitWriteAttempts)this.clearInitWrite();else{this.clearInitWrite();this.initWriteAttempts++;this.initWriteHandle=setTimeout((()=>{this.initWriteHandle=null;if(this.directive&&!this.getBehavior()?.isDestroyed)if(this.directive.isInitialized){this.applyDirectiveValue();this.ensureInitSubscriptionDisposed()}else this.scheduleInitWriteIfNeeded()}),0)}}scheduleDeferredWriteIfNeeded(){const e=this.getBehavior();if(!this.directive||!this.ngModelProp||e?.isDestroyed)return;if(this.isDirectiveValueSynchronized()){this.clearDeferredWrite();return}if(this.deferredWriteAttempts>=WjValueAccessor.maxDeferredWriteAttempts){this.clearDeferredWrite();return}this.clearDeferredWrite();this.deferredWriteAttempts++;const t=this.getDeferredWriteDelay();this.deferredWriteHandle=setTimeout((()=>{this.deferredWriteHandle=null;this.directive&&!this.getBehavior()?.isDestroyed&&this.applyDirectiveValue()}),t)}isDirectiveValueSynchronized(){if(!this.directive||!this.ngModelProp)return!0;return areEquivalentValue(this.normalizeModelValue(this.modelValue),this.directive[this.ngModelProp])}normalizeModelValue(e){return""===e?null:e}getDeferredWriteDelay(){return Math.min(WjValueAccessor.maxDeferredWriteDelayMs,2*Math.max(0,this.deferredWriteAttempts-1))}getBehavior(){!this.behavior&&this.directive&&(this.behavior=WjDirectiveBehavior.getBehavior(this.directive));return this.behavior}isFirstChange(){return this.writeCount<2}}function WjValueAccessorFactory(e){return new WjValueAccessor(e)}function isNullOrEmpty(e){return null==e||""===e}function areEquivalentValue(e,t){return!(!isNullOrEmpty(e)||!isNullOrEmpty(t))||(!!areEquivalentArrays(e,t)||(isCellRangeLike(e)&&isCellRangeLike(t)?e.row===t.row&&e.col===t.col&&e.row2===t.row2&&e.col2===t.col2:Ng2Utils.equals(e,t)))}function areEquivalentArrays(e,t){return!(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)&&e.every(((e,i)=>areEquivalentValue(e,t[i])))}function isCellRangeLike(e){return!!e&&"object"==typeof e&&"number"==typeof e.row&&"number"==typeof e.col&&"number"==typeof e.row2&&"number"==typeof e.col2}export{Ng2Utils,WjComponentResolvedMetadata,WjDirectiveBehavior,WjOptions,WjValueAccessor,WjValueAccessorFactory,isNoopNgZoneLike};
|
package/es5-esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.
|
|
3
|
+
* Wijmo Library 5.20262.60
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import{EventEmitter,NgZone}from"@angular/core";import*as wijmo from"@grapecity/wijmo";var WjOptions=function(){function WjOptions(){}WjOptions.asyncBindings=!0;return WjOptions}();export{WjOptions};var WjComponentResolvedMetadata=function(){function WjComponentResolvedMetadata(e){this.changeEventMap=[];this.allImplEvents=[];this.resolveChangeEventMap(e)}WjComponentResolvedMetadata.prototype.resolveChangeEventMap=function(e){var t=this.changeEventMap,i=e.outputs,r=e.changeEvents||{};t.splice(0,t.length);this.allImplEvents=[];if(i&&i.length){var n=i.map((function(e){return e.split(":")})).map((function(e){return{implName:e[0].trim(),exposeName:e[1]&&e[1].trim()}}));this.allImplEvents=n.map((function(e){return e.implName}));for(var o=0,s=n.filter((function(e){return e.implName&&e.exposeName}));o<s.length;o++){var a=s[o];if(Ng2Utils.getWjEventName(a.implName)){var v={eventImpl:a.implName,event:a.exposeName},h=r[a.exposeName];h&&h.length&&(v.props=h.map((function(e){return{prop:e,evExposed:Ng2Utils.getChangeEventNameExposed(e),evImpl:Ng2Utils.getChangeEventNameImplemented(e)}})));t.push(v)}}for(var c in r)if(c.indexOf(".")>-1){v={eventImpl:null,event:c,props:r[c].map((function(e){return{prop:e,evExposed:Ng2Utils.getChangeEventNameExposed(e),evImpl:Ng2Utils.getChangeEventNameImplemented(e)}}))};t.push(v)}}};return WjComponentResolvedMetadata}();export{WjComponentResolvedMetadata};var WjDirectiveBehavior=function(){function WjDirectiveBehavior(e,t,i,r){this._pendingEvents=[];this.isInitialized=!1;this.isDestroyed=!1;this.nzRun=function(e){return e()};this.directive=e;this.elementRef=t;this.injector=i;this._overrideDirectiveMethods();this.nz=i.get(NgZone);var n=this.nz;n&&(this.nzRun=n.run.bind(n));this.injectedParent=r;this.typeData=e.constructor[WjDirectiveBehavior.directiveTypeDataProp];var o=this.typeData;null==o.siblingId&&(o.siblingId=""+ ++WjDirectiveBehavior.siblingDirId);var s=e.constructor[WjDirectiveBehavior.directiveResolvedTypeDataProp];s?this.resolvedTypeData=s:e.constructor[WjDirectiveBehavior.directiveResolvedTypeDataProp]=s=this.resolvedTypeData=new WjComponentResolvedMetadata(o);e[WjDirectiveBehavior.BehaviourRefProp]=this;i[WjDirectiveBehavior.BehaviourRefProp]=this;e[WjDirectiveBehavior.isInitializedPropAttr]=!1;this._createEvents();this._setupAsChild();this._isHostElement()&&t.nativeElement.setAttribute(WjDirectiveBehavior.siblingDirIdAttr,o.siblingId);this.subscribeToEvents(!1);this.directive instanceof wijmo.Control&&(this.directive.workingAs="Angular2")}WjDirectiveBehavior.getHostElement=function(e,t){WjDirectiveBehavior.ngZone=t.get(NgZone);return e.nativeElement};WjDirectiveBehavior.attach=function(e,t,i,r){return new WjDirectiveBehavior(e,t,i,r)};WjDirectiveBehavior.getZone=function(e){var t=WjDirectiveBehavior.getBehavior(e);return t&&t.nz||WjDirectiveBehavior.ngZone};WjDirectiveBehavior.prototype.ngOnInit=function(){this.isInitialized=!0;this._initParent();this.subscribeToEvents(!0)};WjDirectiveBehavior.prototype.ngAfterViewInit=function(){var e=this;this.directive[WjDirectiveBehavior.isInitializedPropAttr]=!0;setTimeout((function(){e.isDestroyed||e.directive[WjDirectiveBehavior.initializedEventAttr].emit(void 0)}))};WjDirectiveBehavior.prototype.ngOnDestroy=function(){if(!this.isDestroyed){this.isDestroyed=!0;var e=this.directive;this._siblingInsertedMO&&this._siblingInsertedMO.disconnect();if(this._isChild()&&this.parentBehavior){var t=this.parentBehavior.directive,i=this._getParentProp();if(!this.parentBehavior.isDestroyed&&t&&i&&e){var r=t[i];if(wijmo.isArray(r)&&r){var n=r.indexOf(e);n>=0&&r.splice(n,1)}}}if(e instanceof wijmo.Control&&e.hostElement){var o=this.elementRef.nativeElement,s=o&&o.parentNode,a=s?Array.prototype.indexOf.call(s.childNodes,o):-1;e.dispose();if(a>-1&&Array.prototype.indexOf.call(s.childNodes,o)<0){o.textContent="";a<s.childNodes.length&&s.replaceChild(o,s.childNodes[a])}}this.injector[WjDirectiveBehavior.BehaviourRefProp]=null}};WjDirectiveBehavior.instantiateTemplate=function(e,t,i,r,n){void 0===r&&(r=!1);void 0===n&&(n={});var o,s=t.createEmbeddedView(i,n,t.length),a=s.rootNodes;if(r&&1===a.length)o=a[0];else{o=document.createElement("div");for(var v=0,h=a;v<h.length;v++){var c=h[v];o.appendChild(c)}}e&&e.appendChild(o);return{viewRef:s,rootElement:o}};WjDirectiveBehavior.prototype.getPropChangeEvent=function(e){var t=this.typeData.changeEvents;if(t)for(var i in t)if(t[i].indexOf(e)>-1)return i;return null};WjDirectiveBehavior.prototype._createEvents=function(){for(var e=0,t=this.resolvedTypeData.allImplEvents;e<t.length;e++){var i=t[e];this.directive[i]=new EventEmitter(!1)}};WjDirectiveBehavior.prototype._overrideDirectiveMethods=function(){var e=this.directive;if(e instanceof wijmo.Control){var t=e._resizeObserverCallback.bind(e);e._resizeObserverCallback=function(e){NgZone.isInAngularZone()?t(e):WjDirectiveBehavior.getZone(this).run((function(){t(e)}))}.bind(e)}};WjDirectiveBehavior.prototype.subscribeToEvents=function(e){var t=this.resolvedTypeData.changeEventMap;e=!!e;for(var i=0,r=t;i<r.length;i++){e!==(s=r[i]).event.indexOf(".")<0&&this.addHandlers(s)}if(e)for(var n=0,o=t;n<o.length;n++){var s=o[n];this.triggerPropChangeEvents(s,!0)}};WjDirectiveBehavior.prototype.addHandlers=function(e){var t=this,i=this.directive;WjDirectiveBehavior.evaluatePath(i,e.event).addHandler((function(r,n){t.nzRun((function(){t.isInitialized&&t.triggerPropChangeEvents(e);e.eventImpl&&t._triggerEvent(i[e.eventImpl],n,e.props&&e.props.length>0)}))}))};WjDirectiveBehavior.prototype.triggerPropChangeEvents=function(e,t){void 0===t&&(t=!0);var i=this.directive;if(e.props&&e.props.length)for(var r=0,n=e.props;r<n.length;r++){var o=n[r];this._triggerEvent(i[o.evImpl],i[o.prop],t)}};WjDirectiveBehavior.prototype._setupAsChild=function(){if(this._isChild()){this._isHostElement()&&(this.elementRef.nativeElement.style.display="none");this.parentBehavior=WjDirectiveBehavior.getBehavior(this.injectedParent)}};WjDirectiveBehavior.prototype._isAsyncBinding=function(){var e=this.directive[WjDirectiveBehavior.asyncBindingUpdatePropAttr];return null==e?WjOptions.asyncBindings:e};WjDirectiveBehavior.prototype._isChild=function(){return this._isParentInitializer()||this._isParentReferencer()};WjDirectiveBehavior.prototype._isParentInitializer=function(){return null!=this.directive[WjDirectiveBehavior.parPropAttr]};WjDirectiveBehavior.prototype._isParentReferencer=function(){return!!this.typeData.parentRefProperty};WjDirectiveBehavior.prototype._getParentProp=function(){return this.directive[WjDirectiveBehavior.parPropAttr]};WjDirectiveBehavior.prototype._getParentReferenceProperty=function(){return this.typeData.parentRefProperty};WjDirectiveBehavior.prototype._useParentObj=function(){return!1};WjDirectiveBehavior.prototype._parentInCtor=function(){return this._isParentReferencer()&&""==this._getParentReferenceProperty()};WjDirectiveBehavior.prototype._initParent=function(){if(this.parentBehavior&&!this._useParentObj()){var e=this.parentBehavior.directive,t=this._getParentProp(),i=this.directive;if(this._isParentInitializer()){var r=e[t];if(wijmo.isArray(r)){var n=this._isHostElement(),o=n?this._getSiblingIndex():-1;(o<0||o>=r.length)&&(o=r.length);r.splice(o,0,i);if(n){var s=this.elementRef.nativeElement;this._siblingInsertedMO=new MutationObserver(this._siblingInserted.bind(this));this._siblingInsertedMO.observe(s,{childList:!0})}}else e[t]=i}this._isParentReferencer()&&!this._parentInCtor()&&(i[this._getParentReferenceProperty()]=e)}};WjDirectiveBehavior.prototype._getSiblingIndex=function(){var e=this.elementRef.nativeElement,t=e.parentElement;if(!t)return-1;for(var i=t.childNodes,r=-1,n=this.typeData.siblingId,o=0;o<i.length;o++){var s=i[o];if(1==s.nodeType&&s.getAttribute(WjDirectiveBehavior.siblingDirIdAttr)==n){++r;if(s===e)return r}}return-1};WjDirectiveBehavior.prototype._siblingInserted=function(e){for(var t=this,i=0,r=e;i<r.length;i++){var n=r[i];if("childList"===n.type&&n.addedNodes.length>0){if(Array.from(n.addedNodes).some((function(e){return e===t.elementRef.nativeElement}))){var o=this._getSiblingIndex(),s=this.parentBehavior.directive[this._getParentProp()],a=this.directive,v=s.indexOf(a);if(o>=0&&v>=0&&o!==v){s.splice(v,1);var h=Math.min(o,s.length);s.splice(h,0,a)}}}}};WjDirectiveBehavior.prototype._isHostElement=function(){return this.elementRef.nativeElement.nodeType===Node.ELEMENT_NODE};WjDirectiveBehavior.prototype._triggerEvent=function(e,t,i){var r=this;if(i&&this._isAsyncBinding()){var n={event:e,args:t};this._pendingEvents.push(n);null==this._pendingEventsTO&&(this._pendingEventsTO=setTimeout((function(){r._triggerPendingEvents(!1)}),0))}else e.emit(t)};WjDirectiveBehavior.prototype._triggerPendingEvents=function(e){if(null!=this._pendingEventsTO){clearTimeout(this._pendingEventsTO);this._pendingEventsTO=null}if(!this.isDestroyed){var t=[].concat(this._pendingEvents);this._pendingEvents.splice(0,this._pendingEvents.length);for(var i=0,r=t;i<r.length;i++){var n=r[i];n.event.emit(n.args)}e&&this._pendingEvents.length&&this._triggerPendingEvents(!0)}};WjDirectiveBehavior.prototype.flushPendingEvents=function(){this._triggerPendingEvents(!0)};WjDirectiveBehavior.evaluatePath=function(e,t){WjDirectiveBehavior._pathBinding.path=t;return WjDirectiveBehavior._pathBinding.getValue(e)};WjDirectiveBehavior.getBehavior=function(e){return e?e[WjDirectiveBehavior.BehaviourRefProp]:null};WjDirectiveBehavior.directiveTypeDataProp="meta";WjDirectiveBehavior.directiveResolvedTypeDataProp="_wjResolvedMeta";WjDirectiveBehavior.BehaviourRefProp="_wjBehaviour";WjDirectiveBehavior.parPropAttr="wjProperty";WjDirectiveBehavior.wjModelPropAttr="wjModelProperty";WjDirectiveBehavior.initializedEventAttr="initialized";WjDirectiveBehavior.isInitializedPropAttr="isInitialized";WjDirectiveBehavior.siblingDirIdAttr="wj-directive-id";WjDirectiveBehavior.asyncBindingUpdatePropAttr="asyncBindings";WjDirectiveBehavior.siblingDirId=0;WjDirectiveBehavior.wijmoComponentProviderId="WjComponent";WjDirectiveBehavior.outsideZoneEvents={pointermove:!0,pointerover:!0,mousemove:!0,wheel:!0,touchmove:!0,pointerenter:!0,pointerleave:!0,pointerout:!0,mouseover:!0,mouseenter:!0,mouseleave:!0,mouseout:!0};WjDirectiveBehavior._pathBinding=new wijmo.Binding("");return WjDirectiveBehavior}();export{WjDirectiveBehavior};var Ng2Utils=function(){function Ng2Utils(){}Ng2Utils.initEvents=function(e,t){for(var i=[],r=0,n=t;r<n.length;r++){var o=n[r],s=o.props;o.event&&o.eventImpl&&i.push(o.eventImpl+":"+o.event);if(s&&s.length)for(var a=0,v=s;a<v.length;a++){var h=v[a];i.push(h.evImpl+":"+h.evExposed)}}return i};Ng2Utils.getChangeEventNameImplemented=function(e){return Ng2Utils.getChangeEventNameExposed(e)+Ng2Utils.changeEventImplementSuffix};Ng2Utils.getChangeEventNameExposed=function(e){return e+"Change"};Ng2Utils.getWjEventName=function(e){if(e){var t=Ng2Utils.wjEventImplementSuffix,i=e.length-t.length;if(i>0&&e.substr(i)===t)return e.substr(0,i)}return null};Ng2Utils.getBaseType=function(e){if(!e)return null;var t=Object.getPrototypeOf(e.prototype);return t&&t.constructor};Ng2Utils.getAnnotations=function(e){return Reflect.getMetadata("annotations",e)};Ng2Utils.getAnnotation=function(e,t){if(t&&e)for(var i=0,r=e;i<r.length;i++){var n=r[i];if(n instanceof t)return n}return null};Ng2Utils.getTypeAnnotation=function(e,t,i){for(var r=e;r;r=i?null:Ng2Utils.getBaseType(r)){var n=Ng2Utils.getAnnotation(Ng2Utils.getAnnotations(r),t);if(n)return n}return null};Ng2Utils.equals=function(e,t){return e!=e&&t!=t||wijmo.DateTime.equals(e,t)||e===t};Ng2Utils._copy=function(e,t,i,r,n){if(e&&t)for(var o in t)if(r||"_"!==o[0]){var s=t[o];if(!n||n(o,s)){var a=e[o];wijmo.isArray(s)?e[o]=(!wijmo.isArray(a)||i?[]:a).concat(s):void 0!==s&&(e[o]=s)}}};Ng2Utils.changeEventImplementSuffix="PC";Ng2Utils.wjEventImplementSuffix="Ng";return Ng2Utils}();export{Ng2Utils};var WjValueAccessor=function(){function WjValueAccessor(e){this._writeQnt=0;this._isSubscribed=!1;this._dirUpdateQnt=0;this._onChange=function(e){};this._onTouched=function(){};this._directive=e;this._behavior=WjDirectiveBehavior.getBehavior(e)}WjValueAccessor.prototype.writeValue=function(e){var t=this;this._modelValue=e;++this._writeQnt;if(this._directive.isInitialized){this._ensureInitEhUnsubscribed();this._updateDirective()}else if(!this._dirInitEh){var i=this._directive.initialized;this._dirInitEh=i.subscribe((function(){t._updateDirective();t._ensureInitEhUnsubscribed()}))}};WjValueAccessor.prototype.registerOnChange=function(e){this._onChange=e};WjValueAccessor.prototype.registerOnTouched=function(e){this._onTouched=e};WjValueAccessor.prototype.setDisabledState=function(e){var t=this._directive;t instanceof wijmo.Control&&(t.isDisabled=e)};WjValueAccessor.prototype._updateDirective=function(){if(!this._isFirstChange()||null!=this._modelValue){this._ensureNgModelProp();if(this._directive&&this._ngModelProp){var e=this._modelValue;""===e&&(e=null);this._dirUpdateQnt++;try{this._directive[this._ngModelProp]=e}finally{this._dirUpdateQnt--}}this._ensureSubscribed()}};WjValueAccessor.prototype._ensureSubscribed=function(){if(!this._isSubscribed){var e=this._directive;if(e){this._ensureNgModelProp();this._ngModelProp=e[WjDirectiveBehavior.wjModelPropAttr];var t=this._ngModelProp;if(t){var i=this._behavior.getPropChangeEvent(t);i&&e[i].addHandler(this._dirValChgEh,this)}e instanceof wijmo.Control&&e.lostFocus.addHandler(this._dirLostFocusEh,this);this._isSubscribed=!0}}};WjValueAccessor.prototype._ensureNgModelProp=function(){!this._ngModelProp&&this._directive&&(this._ngModelProp=this._directive[WjDirectiveBehavior.wjModelPropAttr])};WjValueAccessor.prototype._ensureInitEhUnsubscribed=function(){if(this._dirInitEh){this._dirInitEh.unsubscribe();this._dirInitEh=null}};WjValueAccessor.prototype._isFirstChange=function(){return this._writeQnt<2};WjValueAccessor.prototype._dirValChgEh=function(e,t){if(this._onChange&&this._directive&&this._ngModelProp){var i=this._directive[this._ngModelProp],r=this._modelValue;""===r&&(r=null);if(!(this._dirUpdateQnt>0&&_isNullOrEmpty(r)&&_isNullOrEmpty(i)||Ng2Utils.equals(r,i))||wijmo.isArray(i)){this._modelValue=i;this._onChange(i)}}};WjValueAccessor.prototype._dirLostFocusEh=function(e,t){this._onTouched&&this._onTouched()};return WjValueAccessor}();export{WjValueAccessor};export function WjValueAccessorFactory(e){return new WjValueAccessor(e)}function _isNullOrEmpty(e){return null==e||""===e}
|
|
14
|
+
var _a,_b,_c,_d,_e;import*as i0 from"@angular/core";import{NgZone,ChangeDetectorRef,ApplicationRef,EventEmitter,Injectable}from"@angular/core";import*as wijmo from"@grapecity/wijmo";var WjOptions=function WjOptions(){};(_a=WjOptions).asyncBindings=!0;_a.zonelessMode="auto";function isNoopNgZoneLike(e){return!e||!e._inner&&!e._outer&&("function"==typeof e.run&&"function"==typeof e.runGuarded&&"function"==typeof e.runOutsideAngular&&"function"==typeof e.runTask)}var WjComponentResolvedMetadata=function(){function WjComponentResolvedMetadata(e){this.changeEventMap=[];this.allImplEvents=[];this.resolveChangeEventMap(e)}WjComponentResolvedMetadata.prototype.resolveChangeEventMap=function(e){var t,i=e.outputs||[],n=e.changeEvents||{};this.changeEventMap.splice(0,this.changeEventMap.length);this.allImplEvents=[];if(i.length){var r=i.map((function(e){return e.split(":")})).map((function(e){var t,i;return{implName:null===(t=e[0])||void 0===t?void 0:t.trim(),exposeName:null===(i=e[1])||void 0===i?void 0:i.trim()}}));this.allImplEvents=r.filter((function(e){return!!e.implName})).map((function(e){return e.implName}));for(var o=0,s=r.filter((function(e){return e.implName&&e.exposeName}));o<s.length;o++){var a=s[o],l=ResolvedMetadataUtils.getWjEventName(a.implName);if(l){var c={eventImpl:a.implName,event:a.exposeName},h=null!==(t=n[l])&&void 0!==t?t:n[a.exposeName];(null==h?void 0:h.length)&&(c.props=h.map((function(e){return{prop:e,evExposed:ResolvedMetadataUtils.getChangeEventNameExposed(e),evImpl:ResolvedMetadataUtils.getChangeEventNameImplemented(e)}})));this.changeEventMap.push(c)}}for(var v=0,d=Object.keys(n);v<d.length;v++){var u=d[v];if(!(u.indexOf(".")<0)){c={eventImpl:null,event:u,props:n[u].map((function(e){return{prop:e,evExposed:ResolvedMetadataUtils.getChangeEventNameExposed(e),evImpl:ResolvedMetadataUtils.getChangeEventNameImplemented(e)}}))};this.changeEventMap.push(c)}}}};return WjComponentResolvedMetadata}(),ResolvedMetadataUtils=function(){function ResolvedMetadataUtils(){}ResolvedMetadataUtils.getChangeEventNameImplemented=function(e){return"".concat(_b.getChangeEventNameExposed(e)).concat(_b.changeEventImplementSuffix)};ResolvedMetadataUtils.getChangeEventNameExposed=function(e){return"".concat(e,"Change")};ResolvedMetadataUtils.getWjEventName=function(e){if(!e)return null;var t=_b.wijmoEventImplementSuffix,i=e.length-t.length;return i>0&&e.slice(i)===t?e.slice(0,i):null};return ResolvedMetadataUtils}();(_b=ResolvedMetadataUtils).changeEventImplementSuffix="PC";_b.wijmoEventImplementSuffix="Ng";var WjDirectiveBehavior=function(){function WjDirectiveBehavior(e,t,i,n){this.parentBehavior=null;this.isInitialized=!1;this.isDestroyed=!1;this.nzRun=function(e){return e()};this.siblingInsertedObserver=null;this.pendingEvents=[];this.pendingEventsTimeout=null;this.pendingCheck=!1;this.directive=e;this.elementRef=t;this.injector=i;this.injectedParent=n;this.nz=i.get(NgZone,null);this.cdRef=i.get(ChangeDetectorRef,null);this.appRef=i.get(ApplicationRef,null);this.isZoneless=this.detectZonelessMode();this.nz&&!this.isZoneless&&(this.nzRun=this.nz.run.bind(this.nz));this.overrideDirectiveMethods();this.typeData=e.constructor[_c.directiveTypeDataProp]||{};null!==this.typeData.siblingId&&void 0!==this.typeData.siblingId||(this.typeData.siblingId="".concat(++_c.siblingDirId));var r=e.constructor[_c.directiveResolvedTypeDataProp]||new WjComponentResolvedMetadata(this.typeData);e.constructor[_c.directiveResolvedTypeDataProp]=r;this.resolvedTypeData=r;e[_c.behaviorRefProp]=this;i[_c.behaviorRefProp]=this;e[_c.isInitializedPropAttr]=!1;this.createEvents();this.setupAsChild();this.isHostElement()&&this.elementRef.nativeElement.setAttribute(_c.siblingDirIdAttr,this.typeData.siblingId);this.subscribeToEvents(!1);e instanceof wijmo.Control&&(e.workingAs="Angular2")}WjDirectiveBehavior.getHostElement=function(e,t){_c.ngZone=t?t.get(NgZone,null):null;return e.nativeElement};WjDirectiveBehavior.attach=function(e,t,i,n){return new _c(e,t,i,n)};WjDirectiveBehavior.getBehavior=function(e){var t;return e&&null!==(t=e[_c.behaviorRefProp])&&void 0!==t?t:null};WjDirectiveBehavior.getZone=function(e){var t,i=_c.getBehavior(e);return null!==(t=null==i?void 0:i.nz)&&void 0!==t?t:_c.ngZone};WjDirectiveBehavior.instantiateTemplate=function(e,t,i,n,r){void 0===n&&(n=!1);void 0===r&&(r={});if(!i)throw new Error("A templateRef is required to instantiate a Wijmo Angular template.");var o,s=t.createEmbeddedView(i,r,t.length),a=s.rootNodes;if(n&&1===a.length)o=a[0];else{for(var l=document.createElement("div"),c=0,h=a;c<h.length;c++){var v=h[c];l.appendChild(v)}o=l}e&&e.appendChild(o);return{viewRef:s,rootElement:o}};WjDirectiveBehavior.prototype.ngOnInit=function(){this.isInitialized=!0;this.initParent();this.subscribeToEvents(!0)};WjDirectiveBehavior.prototype.ngAfterViewInit=function(){var e=this;this.directive[_c.isInitializedPropAttr]=!0;setTimeout((function(){if(!e.isDestroyed){e.directive[_c.initializedEventAttr].emit(void 0);e.requestCheck()}}))};WjDirectiveBehavior.prototype.ngOnDestroy=function(){if(!this.isDestroyed){this.isDestroyed=!0;if(this.siblingInsertedObserver){this.siblingInsertedObserver.disconnect();this.siblingInsertedObserver=null}if(this.isChild()&&this.parentBehavior){var e=this.parentBehavior.directive,t=this.getParentProp(),i=this.directive;if(!this.parentBehavior.isDestroyed&&e&&t&&i){var n=e[t];this.removeFromParentCollection(n,i)}}if(this.directive instanceof wijmo.Control&&this.directive.hostElement){var r=this.elementRef.nativeElement,o=null==r?void 0:r.parentNode,s=o?Array.prototype.indexOf.call(o.childNodes,r):-1;this.directive.dispose();if(o&&s>-1&&Array.prototype.indexOf.call(o.childNodes,r)<0){r.textContent="";s<o.childNodes.length&&o.replaceChild(r,o.childNodes[s])}}this.injector[_c.behaviorRefProp]=null}};WjDirectiveBehavior.prototype.flushPendingEvents=function(){this.triggerPendingEvents(!0)};WjDirectiveBehavior.prototype.requestCheck=function(){this.performRequestCheck()};WjDirectiveBehavior.prototype.getPropChangeEvent=function(e){var t=this.typeData.changeEvents;if(!t)return null;for(var i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];if(t[r].indexOf(e)>-1)return r}return null};WjDirectiveBehavior.prototype.createEvents=function(){for(var e=0,t=this.resolvedTypeData.allImplEvents||[];e<t.length;e++){var i=t[e];this.directive[i]=new EventEmitter(!1)}};WjDirectiveBehavior.prototype.overrideDirectiveMethods=function(){var e=this.directive;if(e instanceof wijmo.Control&&e._resizeObserverCallback){var t=e._resizeObserverCallback.bind(e),i=this;e._resizeObserverCallback=function(e){if(i.isZoneless){t(e);i.requestCheck()}else{if(!NgZone.isInAngularZone()){var n=_c.getZone(this);if(n){n.run((function(){return t(e)}));return}}t(e)}}.bind(e)}};WjDirectiveBehavior.prototype.subscribeToEvents=function(e){for(var t=this.resolvedTypeData.changeEventMap||[],i=!!e,n=0,r=t;n<r.length;n++){i===(a=r[n]).event.indexOf(".")>-1&&this.addHandlers(a)}if(e)for(var o=0,s=t;o<s.length;o++){var a=s[o];this.triggerPropChangeEvents(a,!0)}};WjDirectiveBehavior.prototype.addHandlers=function(e){var t=this,i=this.directive,n=_c.evaluatePath(i,e.event);n&&n.addHandler((function(n,r){t.runChangeDetectionAware((function(){t.isInitialized&&t.triggerPropChangeEvents(e);e.eventImpl&&t.triggerEvent(i[e.eventImpl],r,!(!e.props||!e.props.length))}))}))};WjDirectiveBehavior.prototype.triggerPropChangeEvents=function(e,t){var i;void 0===t&&(t=!0);if(null===(i=e.props)||void 0===i?void 0:i.length)for(var n=0,r=e.props;n<r.length;n++){var o=r[n],s=this.getSignalFriendlyPropValue(this.directive[o.prop]);this.triggerEvent(this.directive[o.evImpl],s,t,!0)}};WjDirectiveBehavior.prototype.getSignalFriendlyPropValue=function(e){return wijmo.isArray(e)?Array.prototype.slice.call(e):e};WjDirectiveBehavior.prototype.triggerEvent=function(e,t,i,n){var r=this;void 0===n&&(n=!1);if(i&&this.isAsyncBinding()){if(n){var o=this.pendingEvents.find((function(t){return t.event===e}));o?o.args=t:this.pendingEvents.push({event:e,args:t})}else this.pendingEvents.push({event:e,args:t});null===this.pendingEventsTimeout&&(this.pendingEventsTimeout=setTimeout((function(){return r.triggerPendingEvents(!1)}),0))}else{e.emit(t);this.performRequestCheck()}};WjDirectiveBehavior.prototype.triggerPendingEvents=function(e){if(null!==this.pendingEventsTimeout){clearTimeout(this.pendingEventsTimeout);this.pendingEventsTimeout=null}if(!this.isDestroyed)do{var t=this.pendingEvents.slice();this.pendingEvents.length=0;for(var i=0,n=t;i<n.length;i++){var r=n[i];r.event.emit(r.args)}this.performRequestCheck()}while(e&&!this.isDestroyed&&this.pendingEvents.length)};WjDirectiveBehavior.prototype.setupAsChild=function(){if(this.isChild()){this.isHostElement()&&(this.elementRef.nativeElement.style.display="none");this.parentBehavior=_c.getBehavior(this.injectedParent)}};WjDirectiveBehavior.prototype.isAsyncBinding=function(){var e=this.directive[_c.asyncBindingUpdatePropAttr];return null==e?WjOptions.asyncBindings:e};WjDirectiveBehavior.prototype.isChild=function(){return this.isParentInitializer()||this.isParentReferencer()};WjDirectiveBehavior.prototype.isParentInitializer=function(){return null!==this.directive[_c.parentPropertyAttr]&&void 0!==this.directive[_c.parentPropertyAttr]};WjDirectiveBehavior.prototype.isParentReferencer=function(){return!!this.typeData.parentRefProperty};WjDirectiveBehavior.prototype.getParentProp=function(){return this.directive[_c.parentPropertyAttr]};WjDirectiveBehavior.prototype.getParentReferenceProperty=function(){return this.typeData.parentRefProperty};WjDirectiveBehavior.prototype.parentInCtor=function(){return this.isParentReferencer()&&""===this.getParentReferenceProperty()};WjDirectiveBehavior.prototype.initParent=function(){if(this.parentBehavior){var e=this.parentBehavior.directive,t=this.getParentProp(),i=this.directive;if(this.isParentInitializer()&&t){var n=e[t];if(this.isParentCollection(n)){var r=this.isHostElement()?this.getSiblingIndex():-1;(r<0||r>=n.length)&&(r=n.length);this.insertIntoParentCollection(n,r,i);if(this.isHostElement()){var o=this.elementRef.nativeElement;this.siblingInsertedObserver=new MutationObserver(this.handleSiblingInserted.bind(this));this.siblingInsertedObserver.observe(o,{childList:!0})}}else e[t]=i}if(this.isParentReferencer()&&!this.parentInCtor()){var s=this.getParentReferenceProperty();s&&(i[s]=e)}}};WjDirectiveBehavior.prototype.getSiblingIndex=function(){var e=this.elementRef.nativeElement,t=e.parentElement;if(!t)return-1;for(var i=t.childNodes,n=this.typeData.siblingId,r=-1,o=0;o<i.length;o++){var s=i[o];if(1===s.nodeType&&s.getAttribute(_c.siblingDirIdAttr)===n){r++;if(s===e)return r}}return-1};WjDirectiveBehavior.prototype.handleSiblingInserted=function(e){for(var t,i=this,n=0,r=e;n<r.length;n++){var o=r[n];if("childList"===o.type&&0!==o.addedNodes.length){if(Array.from(o.addedNodes).some((function(e){return e===i.elementRef.nativeElement}))){var s=this.getSiblingIndex(),a=null===(t=this.parentBehavior)||void 0===t?void 0:t.directive[this.getParentProp()],l=this.directive,c=this.indexOfParentCollectionItem(a,l);if(s>=0&&c>=0&&s!==c){this.removeAtParentCollectionIndex(a,c);this.insertIntoParentCollection(a,Math.min(s,a.length),l)}}}}};WjDirectiveBehavior.prototype.isParentCollection=function(e){return!!e&&(wijmo.isArray(e)||"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.indexOf&&("function"==typeof e.splice||"function"==typeof e.insert))};WjDirectiveBehavior.prototype.indexOfParentCollectionItem=function(e,t){return this.isParentCollection(e)?e.indexOf(t):-1};WjDirectiveBehavior.prototype.insertIntoParentCollection=function(e,t,i){this.isParentCollection(e)&&("function"!=typeof e.splice?"function"!=typeof e.insert?"function"==typeof e.push&&e.push(i):e.insert(t,i):e.splice(t,0,i))};WjDirectiveBehavior.prototype.removeAtParentCollectionIndex=function(e,t){!this.isParentCollection(e)||t<0||("function"!=typeof e.removeAt?"function"==typeof e.splice&&e.splice(t,1):e.removeAt(t))};WjDirectiveBehavior.prototype.removeFromParentCollection=function(e,t){if(this.isParentCollection(e)){var i=this.indexOfParentCollectionItem(e,t);i>-1&&this.removeAtParentCollectionIndex(e,i)}};WjDirectiveBehavior.prototype.isHostElement=function(){return this.elementRef.nativeElement.nodeType===Node.ELEMENT_NODE};WjDirectiveBehavior.evaluatePath=function(e,t){_c.pathBinding.path=t;return _c.pathBinding.getValue(e)};WjDirectiveBehavior.prototype.detectZonelessMode=function(){var e=WjOptions.zonelessMode;return!0===e||!1===e?e:!this.nz||isNoopNgZoneLike(this.nz)};WjDirectiveBehavior.prototype.runChangeDetectionAware=function(e){if(!this.isZoneless&&this.nz)this.nzRun(e);else{e();this.performRequestCheck()}};WjDirectiveBehavior.prototype.performRequestCheck=function(){var e=this;if(this.isZoneless&&(this.appRef||this.cdRef)&&!this.isDestroyed&&!this.pendingCheck){this.pendingCheck=!0;Promise.resolve().then((function(){var t;e.pendingCheck=!1;e.isDestroyed||(e.appRef?e.appRef.tick():null===(t=e.cdRef)||void 0===t||t.detectChanges())}))}};return WjDirectiveBehavior}();(_c=WjDirectiveBehavior).directiveTypeDataProp="meta";_c.directiveResolvedTypeDataProp="_wjResolvedMeta";_c.behaviorRefProp="_wjBehaviour";_c.parentPropertyAttr="wjProperty";_c.wjModelPropertyAttr="wjModelProperty";_c.initializedEventAttr="initialized";_c.isInitializedPropAttr="isInitialized";_c.siblingDirIdAttr="wj-directive-id";_c.asyncBindingUpdatePropAttr="asyncBindings";_c.siblingDirId=0;_c.wijmoComponentProviderId="WjComponent";_c.ngZone=null;_c.outsideZoneEvents={pointermove:!0,pointerover:!0,mousemove:!0,wheel:!0,touchmove:!0,pointerenter:!0,pointerleave:!0,pointerout:!0,mouseover:!0,mouseenter:!0,mouseleave:!0,mouseout:!0};_c.pathBinding=new wijmo.Binding("");_c.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:_c,deps:"invalid",target:i0.ɵɵFactoryTarget.Injectable});_c.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:_c});i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:WjDirectiveBehavior,decorators:[{type:Injectable}],ctorParameters:function(){return[{type:void 0},{type:i0.ElementRef},{type:i0.Injector},{type:void 0}]}});var Ng2Utils=function(){function Ng2Utils(){}Ng2Utils.getChangeEventNameImplemented=function(e){return"".concat(_d.getChangeEventNameExposed(e)).concat(_d.changeEventImplementSuffix)};Ng2Utils.getChangeEventNameExposed=function(e){return"".concat(e,"Change")};Ng2Utils.getWjEventName=function(e){if(!e)return null;var t=_d.wjEventImplementSuffix,i=e.length-t.length;return i>0&&e.slice(i)===t?e.slice(0,i):null};Ng2Utils.equals=function(e,t){return Number.isNaN(e)&&Number.isNaN(t)||wijmo.DateTime.equals(e,t)||e===t};return Ng2Utils}();(_d=Ng2Utils).changeEventImplementSuffix="PC";_d.wjEventImplementSuffix="Ng";var WjValueAccessor=function(){function WjValueAccessor(e){var t=this;this.writeCount=0;this.ngModelProp=null;this.isSubscribed=!1;this.changeSubscription=null;this.directiveUpdateCount=0;this.initSubscription=null;this.deferredWriteHandle=null;this.deferredWriteAttempts=0;this.initWriteHandle=null;this.initWriteAttempts=0;this.onChangeFn=function(e){};this.onTouchedFn=function(){};this.handleDirectiveValueChanged=function(e,i){var n;if(t.onChangeFn&&t.directive&&t.ngModelProp){var r=t.directive[t.ngModelProp],o=Array.isArray(r)?r.slice():r,s=t.modelValue;""===s&&(s=null);if(!(t.directiveUpdateCount>0&&isNullOrEmpty(s)&&isNullOrEmpty(r)||Ng2Utils.equals(s,r))||Array.isArray(r)){t.modelValue=o;t.onChangeFn(o);null===(n=t.getBehavior())||void 0===n||n.requestCheck()}}};this.handleDirectiveLostFocus=function(){var e;t.onTouchedFn();null===(e=t.getBehavior())||void 0===e||e.requestCheck()};this.directive=e;this.behavior=WjDirectiveBehavior.getBehavior(e)}WjValueAccessor.prototype.writeValue=function(e){var t,i,n,r=this;!(null===(t=this.directive)||void 0===t?void 0:t.isInitialized)&&isNullOrEmpty(e)&&!isNullOrEmpty(this.modelValue)||(this.modelValue=e);this.writeCount++;this.clearDeferredWrite();this.deferredWriteAttempts=0;this.clearInitWrite();this.initWriteAttempts=0;this.applyDirectiveValue();if(null===(i=this.directive)||void 0===i?void 0:i.isInitialized)this.ensureInitSubscriptionDisposed();else{if(!this.initSubscription){var o=null===(n=this.directive)||void 0===n?void 0:n.initialized;this.initSubscription=null==o?void 0:o.subscribe((function(){r.clearInitWrite();r.applyDirectiveValue();r.ensureInitSubscriptionDisposed()}))}this.scheduleInitWriteIfNeeded()}};WjValueAccessor.prototype.registerOnChange=function(e){this.onChangeFn=e};WjValueAccessor.prototype.registerOnTouched=function(e){this.onTouchedFn=e};WjValueAccessor.prototype.setDisabledState=function(e){var t;if(this.directive instanceof wijmo.Control){this.directive.isDisabled=e;null===(t=this.getBehavior())||void 0===t||t.requestCheck()}};WjValueAccessor.prototype.updateDirective=function(){var e;if(!this.isFirstChange()||null!==this.modelValue&&void 0!==this.modelValue){this.ensureNgModelProp();if(this.directive&&this.ngModelProp){var t=this.normalizeModelValue(this.modelValue);this.directiveUpdateCount++;try{this.directive[this.ngModelProp]=t}finally{this.directiveUpdateCount--}null===(e=this.getBehavior())||void 0===e||e.requestCheck();this.ensureSubscribed()}}};WjValueAccessor.prototype.applyDirectiveValue=function(){this.updateDirective();this.scheduleDeferredWriteIfNeeded()};WjValueAccessor.prototype.ensureSubscribed=function(){var e,t=this;if(!this.isSubscribed&&this.directive){this.ensureNgModelProp();if(this.ngModelProp){var i=null===(e=this.getBehavior())||void 0===e?void 0:e.getPropChangeEvent(this.ngModelProp);if(i){var n=this.directive[i];n&&"function"==typeof n.addHandler?n.addHandler(this.handleDirectiveValueChanged,this):n&&"function"==typeof n.subscribe&&(this.changeSubscription=n.subscribe((function(){return t.handleDirectiveValueChanged(t.directive,null)})))}}this.directive instanceof wijmo.Control&&this.directive.lostFocus.addHandler(this.handleDirectiveLostFocus,this);this.isSubscribed=!0}};WjValueAccessor.prototype.ensureNgModelProp=function(){var e,t;if(!this.ngModelProp&&this.directive){var i=this.directive[WjDirectiveBehavior.wjModelPropertyAttr],n=(null===(t=null===(e=this.getBehavior())||void 0===e?void 0:e.typeData)||void 0===t?void 0:t.defaultModelProperty)||null;this.ngModelProp=i||n}};WjValueAccessor.prototype.ensureInitSubscriptionDisposed=function(){if(this.initSubscription){this.initSubscription.unsubscribe();this.initSubscription=null}};WjValueAccessor.prototype.clearDeferredWrite=function(){if(null!==this.deferredWriteHandle){clearTimeout(this.deferredWriteHandle);this.deferredWriteHandle=null}};WjValueAccessor.prototype.clearInitWrite=function(){if(null!==this.initWriteHandle){clearTimeout(this.initWriteHandle);this.initWriteHandle=null}};WjValueAccessor.prototype.scheduleInitWriteIfNeeded=function(){var e,t=this;if(this.directive&&!this.directive.isInitialized&&!(null===(e=this.getBehavior())||void 0===e?void 0:e.isDestroyed))if(this.initWriteAttempts>=_e.maxInitWriteAttempts)this.clearInitWrite();else{this.clearInitWrite();this.initWriteAttempts++;this.initWriteHandle=setTimeout((function(){var e;t.initWriteHandle=null;if(t.directive&&!(null===(e=t.getBehavior())||void 0===e?void 0:e.isDestroyed))if(t.directive.isInitialized){t.applyDirectiveValue();t.ensureInitSubscriptionDisposed()}else t.scheduleInitWriteIfNeeded()}),0)}};WjValueAccessor.prototype.scheduleDeferredWriteIfNeeded=function(){var e=this,t=this.getBehavior();if(this.directive&&this.ngModelProp&&!(null==t?void 0:t.isDestroyed))if(this.isDirectiveValueSynchronized())this.clearDeferredWrite();else if(this.deferredWriteAttempts>=_e.maxDeferredWriteAttempts)this.clearDeferredWrite();else{this.clearDeferredWrite();this.deferredWriteAttempts++;var i=this.getDeferredWriteDelay();this.deferredWriteHandle=setTimeout((function(){var t;e.deferredWriteHandle=null;e.directive&&!(null===(t=e.getBehavior())||void 0===t?void 0:t.isDestroyed)&&e.applyDirectiveValue()}),i)}};WjValueAccessor.prototype.isDirectiveValueSynchronized=function(){return!this.directive||!this.ngModelProp||areEquivalentValue(this.normalizeModelValue(this.modelValue),this.directive[this.ngModelProp])};WjValueAccessor.prototype.normalizeModelValue=function(e){return""===e?null:e};WjValueAccessor.prototype.getDeferredWriteDelay=function(){return Math.min(_e.maxDeferredWriteDelayMs,2*Math.max(0,this.deferredWriteAttempts-1))};WjValueAccessor.prototype.getBehavior=function(){!this.behavior&&this.directive&&(this.behavior=WjDirectiveBehavior.getBehavior(this.directive));return this.behavior};WjValueAccessor.prototype.isFirstChange=function(){return this.writeCount<2};return WjValueAccessor}();(_e=WjValueAccessor).maxDeferredWriteAttempts=20;_e.maxDeferredWriteDelayMs=32;_e.maxInitWriteAttempts=20;function WjValueAccessorFactory(e){return new WjValueAccessor(e)}function isNullOrEmpty(e){return null==e||""===e}function areEquivalentValue(e,t){return!(!isNullOrEmpty(e)||!isNullOrEmpty(t))||(!!areEquivalentArrays(e,t)||(isCellRangeLike(e)&&isCellRangeLike(t)?e.row===t.row&&e.col===t.col&&e.row2===t.row2&&e.col2===t.col2:Ng2Utils.equals(e,t)))}function areEquivalentArrays(e,t){return!(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)&&e.every((function(e,i){return areEquivalentValue(e,t[i])}))}function isCellRangeLike(e){return!!e&&"object"==typeof e&&"number"==typeof e.row&&"number"==typeof e.col&&"number"==typeof e.row2&&"number"==typeof e.col2}export{Ng2Utils,WjComponentResolvedMetadata,WjDirectiveBehavior,WjOptions,WjValueAccessor,WjValueAccessorFactory,isNoopNgZoneLike};
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.
|
|
3
|
+
* Wijmo Library 5.20262.60
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* us.sales@mescius.com
|
|
10
10
|
* https://developer.mescius.com/wijmo/licensing
|
|
11
11
|
*
|
|
12
|
-
*/
|
|
12
|
+
*/
|
|
13
13
|
/**
|
|
14
14
|
* {@module wijmo.angular2legacy.directivebase}
|
|
15
15
|
* Basic Wijmo for Angular 2 module containing internal common services and platform options.
|
|
@@ -21,14 +21,15 @@
|
|
|
21
21
|
*
|
|
22
22
|
* wjBase.WjOptions.asyncBindings = false;</pre>
|
|
23
23
|
*
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
export declare var ___keepComment: any;
|
|
29
|
-
import
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export declare var ___keepComment: any;
|
|
29
|
+
import * as i0 from '@angular/core';
|
|
30
|
+
import { EventEmitter, NgZone, ElementRef, Injector, ViewContainerRef, TemplateRef, EmbeddedViewRef } from '@angular/core';
|
|
30
31
|
import { ControlValueAccessor } from '@angular/forms';
|
|
31
|
-
|
|
32
|
+
|
|
32
33
|
/**
|
|
33
34
|
* Exposes global options for the Wijmo for Angular 2 interop.
|
|
34
35
|
*/
|
|
@@ -76,7 +77,10 @@ export declare class WjOptions {
|
|
|
76
77
|
* <pre><wj-input-number [asyncBindings]="false" [(value)]="amount"></wj-input-number></pre>
|
|
77
78
|
*/
|
|
78
79
|
static asyncBindings: boolean;
|
|
80
|
+
static zonelessMode: boolean | 'auto';
|
|
79
81
|
}
|
|
82
|
+
export declare function isNoopNgZoneLike(ngZone: any): boolean;
|
|
83
|
+
|
|
80
84
|
export interface IWjMetaBase {
|
|
81
85
|
selector: string;
|
|
82
86
|
inputs: string[];
|
|
@@ -89,17 +93,17 @@ export interface IWjComponentMeta extends IWjMetaBase {
|
|
|
89
93
|
export interface IWjDirectiveMeta extends IWjMetaBase {
|
|
90
94
|
exportAs: string;
|
|
91
95
|
}
|
|
92
|
-
export
|
|
96
|
+
export type ChangePropertyEvent = {
|
|
93
97
|
prop: string;
|
|
94
98
|
evExposed: string;
|
|
95
99
|
evImpl: string;
|
|
96
100
|
};
|
|
97
|
-
export
|
|
101
|
+
export type EventPropertiesItem = {
|
|
98
102
|
event: string;
|
|
99
|
-
eventImpl: string;
|
|
103
|
+
eventImpl: string | null;
|
|
100
104
|
props?: ChangePropertyEvent[];
|
|
101
105
|
};
|
|
102
|
-
export
|
|
106
|
+
export type EventProperties = EventPropertiesItem[];
|
|
103
107
|
export interface IWjComponentMetadata {
|
|
104
108
|
changeEvents?: {
|
|
105
109
|
[event: string]: string[];
|
|
@@ -113,125 +117,141 @@ export interface IPendingEvent {
|
|
|
113
117
|
args: any;
|
|
114
118
|
}
|
|
115
119
|
export declare class WjComponentResolvedMetadata {
|
|
116
|
-
readonly changeEventMap:
|
|
120
|
+
readonly changeEventMap: EventProperties;
|
|
117
121
|
allImplEvents: string[];
|
|
118
122
|
constructor(rawMeta: IWjComponentMetadata);
|
|
119
123
|
private resolveChangeEventMap;
|
|
120
124
|
}
|
|
125
|
+
|
|
121
126
|
export declare class WjDirectiveBehavior {
|
|
122
127
|
static directiveTypeDataProp: string;
|
|
123
128
|
static directiveResolvedTypeDataProp: string;
|
|
124
|
-
static
|
|
125
|
-
static
|
|
126
|
-
static
|
|
129
|
+
static behaviorRefProp: string;
|
|
130
|
+
static parentPropertyAttr: string;
|
|
131
|
+
static wjModelPropertyAttr: string;
|
|
127
132
|
static initializedEventAttr: string;
|
|
128
133
|
static isInitializedPropAttr: string;
|
|
129
134
|
static siblingDirIdAttr: string;
|
|
130
135
|
static asyncBindingUpdatePropAttr: string;
|
|
131
136
|
static siblingDirId: number;
|
|
132
137
|
static wijmoComponentProviderId: string;
|
|
133
|
-
static ngZone: NgZone;
|
|
134
|
-
static outsideZoneEvents:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
mousemove: boolean;
|
|
138
|
-
wheel: boolean;
|
|
139
|
-
touchmove: boolean;
|
|
140
|
-
pointerenter: boolean;
|
|
141
|
-
pointerleave: boolean;
|
|
142
|
-
pointerout: boolean;
|
|
143
|
-
mouseover: boolean;
|
|
144
|
-
mouseenter: boolean;
|
|
145
|
-
mouseleave: boolean;
|
|
146
|
-
mouseout: boolean;
|
|
147
|
-
};
|
|
148
|
-
private static _pathBinding;
|
|
149
|
-
private _siblingInsertedMO;
|
|
150
|
-
private _pendingEvents;
|
|
151
|
-
private _pendingEventsTO;
|
|
152
|
-
directive: Object;
|
|
138
|
+
static ngZone: NgZone | null;
|
|
139
|
+
static outsideZoneEvents: Record<string, boolean>;
|
|
140
|
+
private static readonly pathBinding;
|
|
141
|
+
directive: any;
|
|
153
142
|
typeData: IWjComponentMetadata;
|
|
154
143
|
resolvedTypeData: WjComponentResolvedMetadata;
|
|
155
|
-
elementRef:
|
|
156
|
-
injector:
|
|
144
|
+
elementRef: ElementRef;
|
|
145
|
+
injector: Injector;
|
|
157
146
|
injectedParent: any;
|
|
158
|
-
parentBehavior: WjDirectiveBehavior;
|
|
147
|
+
parentBehavior: WjDirectiveBehavior | null;
|
|
159
148
|
isInitialized: boolean;
|
|
160
149
|
isDestroyed: boolean;
|
|
161
|
-
nz: NgZone;
|
|
162
|
-
nzRun: (fn:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
150
|
+
readonly nz: NgZone | null;
|
|
151
|
+
nzRun: (fn: () => void) => void;
|
|
152
|
+
private readonly cdRef;
|
|
153
|
+
private readonly appRef;
|
|
154
|
+
private readonly isZoneless;
|
|
155
|
+
private siblingInsertedObserver;
|
|
156
|
+
private pendingEvents;
|
|
157
|
+
private pendingEventsTimeout;
|
|
158
|
+
private pendingCheck;
|
|
159
|
+
static getHostElement(hostElRef: ElementRef, injector?: Injector): HTMLElement;
|
|
160
|
+
static attach(directive: object, elementRef: ElementRef, injector: Injector, injectedParent: any): WjDirectiveBehavior;
|
|
161
|
+
static getBehavior(directive: any): WjDirectiveBehavior | null;
|
|
162
|
+
static getZone(directive: any): NgZone | null;
|
|
163
|
+
static instantiateTemplate(parent: HTMLElement | null, viewContainerRef: ViewContainerRef, templateRef: TemplateRef<any> | null, useTemplateRoot?: boolean, dataContext?: any): {
|
|
164
|
+
viewRef: EmbeddedViewRef<any>;
|
|
165
|
+
rootElement: Element;
|
|
166
|
+
};
|
|
167
|
+
constructor(directive: any, elementRef: ElementRef, injector: Injector, injectedParent: any);
|
|
167
168
|
ngOnInit(): void;
|
|
168
169
|
ngAfterViewInit(): void;
|
|
169
170
|
ngOnDestroy(): void;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
private _createEvents;
|
|
176
|
-
private _overrideDirectiveMethods;
|
|
171
|
+
flushPendingEvents(): void;
|
|
172
|
+
requestCheck(): void;
|
|
173
|
+
getPropChangeEvent(propName: string): string | null;
|
|
174
|
+
private createEvents;
|
|
175
|
+
private overrideDirectiveMethods;
|
|
177
176
|
private subscribeToEvents;
|
|
178
177
|
private addHandlers;
|
|
179
178
|
private triggerPropChangeEvents;
|
|
180
|
-
private
|
|
181
|
-
private
|
|
182
|
-
private
|
|
183
|
-
private
|
|
184
|
-
private
|
|
185
|
-
private
|
|
186
|
-
private
|
|
187
|
-
private
|
|
188
|
-
private
|
|
189
|
-
private
|
|
190
|
-
|
|
191
|
-
private
|
|
192
|
-
private
|
|
193
|
-
private
|
|
194
|
-
private
|
|
195
|
-
|
|
179
|
+
private getSignalFriendlyPropValue;
|
|
180
|
+
private triggerEvent;
|
|
181
|
+
private triggerPendingEvents;
|
|
182
|
+
private setupAsChild;
|
|
183
|
+
private isAsyncBinding;
|
|
184
|
+
private isChild;
|
|
185
|
+
private isParentInitializer;
|
|
186
|
+
private isParentReferencer;
|
|
187
|
+
private getParentProp;
|
|
188
|
+
private getParentReferenceProperty;
|
|
189
|
+
private parentInCtor;
|
|
190
|
+
private initParent;
|
|
191
|
+
private getSiblingIndex;
|
|
192
|
+
private handleSiblingInserted;
|
|
193
|
+
private isParentCollection;
|
|
194
|
+
private indexOfParentCollectionItem;
|
|
195
|
+
private insertIntoParentCollection;
|
|
196
|
+
private removeAtParentCollectionIndex;
|
|
197
|
+
private removeFromParentCollection;
|
|
198
|
+
private isHostElement;
|
|
196
199
|
private static evaluatePath;
|
|
197
|
-
|
|
200
|
+
private detectZonelessMode;
|
|
201
|
+
private runChangeDetectionAware;
|
|
202
|
+
private performRequestCheck;
|
|
203
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WjDirectiveBehavior, never>;
|
|
204
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WjDirectiveBehavior>;
|
|
198
205
|
}
|
|
199
206
|
export declare class Ng2Utils {
|
|
200
207
|
static changeEventImplementSuffix: string;
|
|
201
208
|
static wjEventImplementSuffix: string;
|
|
202
|
-
static
|
|
203
|
-
static
|
|
204
|
-
static
|
|
205
|
-
static
|
|
206
|
-
static getBaseType(type: any): any;
|
|
207
|
-
static getAnnotations(type: any): any[];
|
|
208
|
-
static getAnnotation(annotations: any[], annotationType: any): any;
|
|
209
|
-
static getTypeAnnotation(type: any, annotationType: any, own?: boolean): any;
|
|
210
|
-
static equals(v1: any, v2: any): boolean;
|
|
211
|
-
static _copy(dst: any, src: any, override?: boolean, includePrivate?: boolean, filter?: (name: string, value: any) => boolean): void;
|
|
209
|
+
static getChangeEventNameImplemented(propertyName: string): string;
|
|
210
|
+
static getChangeEventNameExposed(propertyName: string): string;
|
|
211
|
+
static getWjEventName(ngEventName: string): string | null;
|
|
212
|
+
static equals(valueA: any, valueB: any): boolean;
|
|
212
213
|
}
|
|
214
|
+
|
|
213
215
|
export declare class WjValueAccessor implements ControlValueAccessor {
|
|
214
|
-
private
|
|
215
|
-
private
|
|
216
|
-
private
|
|
217
|
-
private
|
|
218
|
-
private
|
|
219
|
-
private
|
|
220
|
-
private
|
|
221
|
-
private
|
|
222
|
-
private
|
|
223
|
-
private
|
|
224
|
-
|
|
216
|
+
private static readonly maxDeferredWriteAttempts;
|
|
217
|
+
private static readonly maxDeferredWriteDelayMs;
|
|
218
|
+
private static readonly maxInitWriteAttempts;
|
|
219
|
+
private writeCount;
|
|
220
|
+
private directive;
|
|
221
|
+
private behavior;
|
|
222
|
+
private ngModelProp;
|
|
223
|
+
private modelValue;
|
|
224
|
+
private isSubscribed;
|
|
225
|
+
private changeSubscription;
|
|
226
|
+
private directiveUpdateCount;
|
|
227
|
+
private initSubscription;
|
|
228
|
+
private deferredWriteHandle;
|
|
229
|
+
private deferredWriteAttempts;
|
|
230
|
+
private initWriteHandle;
|
|
231
|
+
private initWriteAttempts;
|
|
232
|
+
private onChangeFn;
|
|
233
|
+
private onTouchedFn;
|
|
234
|
+
constructor(directive: any);
|
|
225
235
|
writeValue(value: any): void;
|
|
226
236
|
registerOnChange(fn: (_: any) => void): void;
|
|
227
237
|
registerOnTouched(fn: () => void): void;
|
|
228
238
|
setDisabledState(isDisabled: boolean): void;
|
|
229
|
-
private
|
|
230
|
-
private
|
|
231
|
-
private
|
|
232
|
-
private
|
|
233
|
-
private
|
|
234
|
-
private
|
|
235
|
-
private
|
|
239
|
+
private updateDirective;
|
|
240
|
+
private applyDirectiveValue;
|
|
241
|
+
private ensureSubscribed;
|
|
242
|
+
private ensureNgModelProp;
|
|
243
|
+
private ensureInitSubscriptionDisposed;
|
|
244
|
+
private clearDeferredWrite;
|
|
245
|
+
private clearInitWrite;
|
|
246
|
+
private scheduleInitWriteIfNeeded;
|
|
247
|
+
private scheduleDeferredWriteIfNeeded;
|
|
248
|
+
private isDirectiveValueSynchronized;
|
|
249
|
+
private normalizeModelValue;
|
|
250
|
+
private getDeferredWriteDelay;
|
|
251
|
+
private getBehavior;
|
|
252
|
+
private isFirstChange;
|
|
253
|
+
private handleDirectiveValueChanged;
|
|
254
|
+
private handleDirectiveLostFocus;
|
|
236
255
|
}
|
|
237
|
-
export declare function WjValueAccessorFactory(
|
|
256
|
+
export declare function WjValueAccessorFactory(directive: any): WjValueAccessor;
|
|
257
|
+
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.
|
|
3
|
+
* Wijmo Library 5.20262.60
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
"use strict";var __importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.hasOwnProperty.call(e,i)&&(t[i]=e[i]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var core_1=require("@angular/core"),wijmo=__importStar(require("@grapecity/wijmo")),WjOptions=function(){function WjOptions(){}WjOptions.asyncBindings=!0;return WjOptions}();exports.WjOptions=WjOptions;var WjComponentResolvedMetadata=function(){function WjComponentResolvedMetadata(e){this.changeEventMap=[];this.allImplEvents=[];this.resolveChangeEventMap(e)}WjComponentResolvedMetadata.prototype.resolveChangeEventMap=function(e){var t=this.changeEventMap,i=e.outputs,r=e.changeEvents||{};t.splice(0,t.length);this.allImplEvents=[];if(i&&i.length){var n=i.map((function(e){return e.split(":")})).map((function(e){return{implName:e[0].trim(),exposeName:e[1]&&e[1].trim()}}));this.allImplEvents=n.map((function(e){return e.implName}));for(var o=0,s=n.filter((function(e){return e.implName&&e.exposeName}));o<s.length;o++){var a=s[o];if(Ng2Utils.getWjEventName(a.implName)){var v={eventImpl:a.implName,event:a.exposeName},h=r[a.exposeName];h&&h.length&&(v.props=h.map((function(e){return{prop:e,evExposed:Ng2Utils.getChangeEventNameExposed(e),evImpl:Ng2Utils.getChangeEventNameImplemented(e)}})));t.push(v)}}for(var c in r)if(c.indexOf(".")>-1){v={eventImpl:null,event:c,props:r[c].map((function(e){return{prop:e,evExposed:Ng2Utils.getChangeEventNameExposed(e),evImpl:Ng2Utils.getChangeEventNameImplemented(e)}}))};t.push(v)}}};return WjComponentResolvedMetadata}();exports.WjComponentResolvedMetadata=WjComponentResolvedMetadata;var WjDirectiveBehavior=function(){function WjDirectiveBehavior(e,t,i,r){this._pendingEvents=[];this.isInitialized=!1;this.isDestroyed=!1;this.nzRun=function(e){return e()};this.directive=e;this.elementRef=t;this.injector=i;this._overrideDirectiveMethods();this.nz=i.get(core_1.NgZone);var n=this.nz;n&&(this.nzRun=n.run.bind(n));this.injectedParent=r;this.typeData=e.constructor[WjDirectiveBehavior.directiveTypeDataProp];var o=this.typeData;null==o.siblingId&&(o.siblingId=""+ ++WjDirectiveBehavior.siblingDirId);var s=e.constructor[WjDirectiveBehavior.directiveResolvedTypeDataProp];s?this.resolvedTypeData=s:e.constructor[WjDirectiveBehavior.directiveResolvedTypeDataProp]=s=this.resolvedTypeData=new WjComponentResolvedMetadata(o);e[WjDirectiveBehavior.BehaviourRefProp]=this;i[WjDirectiveBehavior.BehaviourRefProp]=this;e[WjDirectiveBehavior.isInitializedPropAttr]=!1;this._createEvents();this._setupAsChild();this._isHostElement()&&t.nativeElement.setAttribute(WjDirectiveBehavior.siblingDirIdAttr,o.siblingId);this.subscribeToEvents(!1);this.directive instanceof wijmo.Control&&(this.directive.workingAs="Angular2")}WjDirectiveBehavior.getHostElement=function(e,t){WjDirectiveBehavior.ngZone=t.get(core_1.NgZone);return e.nativeElement};WjDirectiveBehavior.attach=function(e,t,i,r){return new WjDirectiveBehavior(e,t,i,r)};WjDirectiveBehavior.getZone=function(e){var t=WjDirectiveBehavior.getBehavior(e);return t&&t.nz||WjDirectiveBehavior.ngZone};WjDirectiveBehavior.prototype.ngOnInit=function(){this.isInitialized=!0;this._initParent();this.subscribeToEvents(!0)};WjDirectiveBehavior.prototype.ngAfterViewInit=function(){var e=this;this.directive[WjDirectiveBehavior.isInitializedPropAttr]=!0;setTimeout((function(){e.isDestroyed||e.directive[WjDirectiveBehavior.initializedEventAttr].emit(void 0)}))};WjDirectiveBehavior.prototype.ngOnDestroy=function(){if(!this.isDestroyed){this.isDestroyed=!0;var e=this.directive;this._siblingInsertedMO&&this._siblingInsertedMO.disconnect();if(this._isChild()&&this.parentBehavior){var t=this.parentBehavior.directive,i=this._getParentProp();if(!this.parentBehavior.isDestroyed&&t&&i&&e){var r=t[i];if(wijmo.isArray(r)&&r){var n=r.indexOf(e);n>=0&&r.splice(n,1)}}}if(e instanceof wijmo.Control&&e.hostElement){var o=this.elementRef.nativeElement,s=o&&o.parentNode,a=s?Array.prototype.indexOf.call(s.childNodes,o):-1;e.dispose();if(a>-1&&Array.prototype.indexOf.call(s.childNodes,o)<0){o.textContent="";a<s.childNodes.length&&s.replaceChild(o,s.childNodes[a])}}this.injector[WjDirectiveBehavior.BehaviourRefProp]=null}};WjDirectiveBehavior.instantiateTemplate=function(e,t,i,r,n){void 0===r&&(r=!1);void 0===n&&(n={});var o,s=t.createEmbeddedView(i,n,t.length),a=s.rootNodes;if(r&&1===a.length)o=a[0];else{o=document.createElement("div");for(var v=0,h=a;v<h.length;v++){var c=h[v];o.appendChild(c)}}e&&e.appendChild(o);return{viewRef:s,rootElement:o}};WjDirectiveBehavior.prototype.getPropChangeEvent=function(e){var t=this.typeData.changeEvents;if(t)for(var i in t)if(t[i].indexOf(e)>-1)return i;return null};WjDirectiveBehavior.prototype._createEvents=function(){for(var e=0,t=this.resolvedTypeData.allImplEvents;e<t.length;e++){var i=t[e];this.directive[i]=new core_1.EventEmitter(!1)}};WjDirectiveBehavior.prototype._overrideDirectiveMethods=function(){var e=this.directive;if(e instanceof wijmo.Control){var t=e._resizeObserverCallback.bind(e);e._resizeObserverCallback=function(e){core_1.NgZone.isInAngularZone()?t(e):WjDirectiveBehavior.getZone(this).run((function(){t(e)}))}.bind(e)}};WjDirectiveBehavior.prototype.subscribeToEvents=function(e){var t=this.resolvedTypeData.changeEventMap;e=!!e;for(var i=0,r=t;i<r.length;i++){e!==(s=r[i]).event.indexOf(".")<0&&this.addHandlers(s)}if(e)for(var n=0,o=t;n<o.length;n++){var s=o[n];this.triggerPropChangeEvents(s,!0)}};WjDirectiveBehavior.prototype.addHandlers=function(e){var t=this,i=this.directive;WjDirectiveBehavior.evaluatePath(i,e.event).addHandler((function(r,n){t.nzRun((function(){t.isInitialized&&t.triggerPropChangeEvents(e);e.eventImpl&&t._triggerEvent(i[e.eventImpl],n,e.props&&e.props.length>0)}))}))};WjDirectiveBehavior.prototype.triggerPropChangeEvents=function(e,t){void 0===t&&(t=!0);var i=this.directive;if(e.props&&e.props.length)for(var r=0,n=e.props;r<n.length;r++){var o=n[r];this._triggerEvent(i[o.evImpl],i[o.prop],t)}};WjDirectiveBehavior.prototype._setupAsChild=function(){if(this._isChild()){this._isHostElement()&&(this.elementRef.nativeElement.style.display="none");this.parentBehavior=WjDirectiveBehavior.getBehavior(this.injectedParent)}};WjDirectiveBehavior.prototype._isAsyncBinding=function(){var e=this.directive[WjDirectiveBehavior.asyncBindingUpdatePropAttr];return null==e?WjOptions.asyncBindings:e};WjDirectiveBehavior.prototype._isChild=function(){return this._isParentInitializer()||this._isParentReferencer()};WjDirectiveBehavior.prototype._isParentInitializer=function(){return null!=this.directive[WjDirectiveBehavior.parPropAttr]};WjDirectiveBehavior.prototype._isParentReferencer=function(){return!!this.typeData.parentRefProperty};WjDirectiveBehavior.prototype._getParentProp=function(){return this.directive[WjDirectiveBehavior.parPropAttr]};WjDirectiveBehavior.prototype._getParentReferenceProperty=function(){return this.typeData.parentRefProperty};WjDirectiveBehavior.prototype._useParentObj=function(){return!1};WjDirectiveBehavior.prototype._parentInCtor=function(){return this._isParentReferencer()&&""==this._getParentReferenceProperty()};WjDirectiveBehavior.prototype._initParent=function(){if(this.parentBehavior&&!this._useParentObj()){var e=this.parentBehavior.directive,t=this._getParentProp(),i=this.directive;if(this._isParentInitializer()){var r=e[t];if(wijmo.isArray(r)){var n=this._isHostElement(),o=n?this._getSiblingIndex():-1;(o<0||o>=r.length)&&(o=r.length);r.splice(o,0,i);if(n){var s=this.elementRef.nativeElement;this._siblingInsertedMO=new MutationObserver(this._siblingInserted.bind(this));this._siblingInsertedMO.observe(s,{childList:!0})}}else e[t]=i}this._isParentReferencer()&&!this._parentInCtor()&&(i[this._getParentReferenceProperty()]=e)}};WjDirectiveBehavior.prototype._getSiblingIndex=function(){var e=this.elementRef.nativeElement,t=e.parentElement;if(!t)return-1;for(var i=t.childNodes,r=-1,n=this.typeData.siblingId,o=0;o<i.length;o++){var s=i[o];if(1==s.nodeType&&s.getAttribute(WjDirectiveBehavior.siblingDirIdAttr)==n){++r;if(s===e)return r}}return-1};WjDirectiveBehavior.prototype._siblingInserted=function(e){for(var t=this,i=0,r=e;i<r.length;i++){var n=r[i];if("childList"===n.type&&n.addedNodes.length>0){if(Array.from(n.addedNodes).some((function(e){return e===t.elementRef.nativeElement}))){var o=this._getSiblingIndex(),s=this.parentBehavior.directive[this._getParentProp()],a=this.directive,v=s.indexOf(a);if(o>=0&&v>=0&&o!==v){s.splice(v,1);var h=Math.min(o,s.length);s.splice(h,0,a)}}}}};WjDirectiveBehavior.prototype._isHostElement=function(){return this.elementRef.nativeElement.nodeType===Node.ELEMENT_NODE};WjDirectiveBehavior.prototype._triggerEvent=function(e,t,i){var r=this;if(i&&this._isAsyncBinding()){var n={event:e,args:t};this._pendingEvents.push(n);null==this._pendingEventsTO&&(this._pendingEventsTO=setTimeout((function(){r._triggerPendingEvents(!1)}),0))}else e.emit(t)};WjDirectiveBehavior.prototype._triggerPendingEvents=function(e){if(null!=this._pendingEventsTO){clearTimeout(this._pendingEventsTO);this._pendingEventsTO=null}if(!this.isDestroyed){var t=[].concat(this._pendingEvents);this._pendingEvents.splice(0,this._pendingEvents.length);for(var i=0,r=t;i<r.length;i++){var n=r[i];n.event.emit(n.args)}e&&this._pendingEvents.length&&this._triggerPendingEvents(!0)}};WjDirectiveBehavior.prototype.flushPendingEvents=function(){this._triggerPendingEvents(!0)};WjDirectiveBehavior.evaluatePath=function(e,t){WjDirectiveBehavior._pathBinding.path=t;return WjDirectiveBehavior._pathBinding.getValue(e)};WjDirectiveBehavior.getBehavior=function(e){return e?e[WjDirectiveBehavior.BehaviourRefProp]:null};WjDirectiveBehavior.directiveTypeDataProp="meta";WjDirectiveBehavior.directiveResolvedTypeDataProp="_wjResolvedMeta";WjDirectiveBehavior.BehaviourRefProp="_wjBehaviour";WjDirectiveBehavior.parPropAttr="wjProperty";WjDirectiveBehavior.wjModelPropAttr="wjModelProperty";WjDirectiveBehavior.initializedEventAttr="initialized";WjDirectiveBehavior.isInitializedPropAttr="isInitialized";WjDirectiveBehavior.siblingDirIdAttr="wj-directive-id";WjDirectiveBehavior.asyncBindingUpdatePropAttr="asyncBindings";WjDirectiveBehavior.siblingDirId=0;WjDirectiveBehavior.wijmoComponentProviderId="WjComponent";WjDirectiveBehavior.outsideZoneEvents={pointermove:!0,pointerover:!0,mousemove:!0,wheel:!0,touchmove:!0,pointerenter:!0,pointerleave:!0,pointerout:!0,mouseover:!0,mouseenter:!0,mouseleave:!0,mouseout:!0};WjDirectiveBehavior._pathBinding=new wijmo.Binding("");return WjDirectiveBehavior}();exports.WjDirectiveBehavior=WjDirectiveBehavior;var Ng2Utils=function(){function Ng2Utils(){}Ng2Utils.initEvents=function(e,t){for(var i=[],r=0,n=t;r<n.length;r++){var o=n[r],s=o.props;o.event&&o.eventImpl&&i.push(o.eventImpl+":"+o.event);if(s&&s.length)for(var a=0,v=s;a<v.length;a++){var h=v[a];i.push(h.evImpl+":"+h.evExposed)}}return i};Ng2Utils.getChangeEventNameImplemented=function(e){return Ng2Utils.getChangeEventNameExposed(e)+Ng2Utils.changeEventImplementSuffix};Ng2Utils.getChangeEventNameExposed=function(e){return e+"Change"};Ng2Utils.getWjEventName=function(e){if(e){var t=Ng2Utils.wjEventImplementSuffix,i=e.length-t.length;if(i>0&&e.substr(i)===t)return e.substr(0,i)}return null};Ng2Utils.getBaseType=function(e){if(!e)return null;var t=Object.getPrototypeOf(e.prototype);return t&&t.constructor};Ng2Utils.getAnnotations=function(e){return Reflect.getMetadata("annotations",e)};Ng2Utils.getAnnotation=function(e,t){if(t&&e)for(var i=0,r=e;i<r.length;i++){var n=r[i];if(n instanceof t)return n}return null};Ng2Utils.getTypeAnnotation=function(e,t,i){for(var r=e;r;r=i?null:Ng2Utils.getBaseType(r)){var n=Ng2Utils.getAnnotation(Ng2Utils.getAnnotations(r),t);if(n)return n}return null};Ng2Utils.equals=function(e,t){return e!=e&&t!=t||wijmo.DateTime.equals(e,t)||e===t};Ng2Utils._copy=function(e,t,i,r,n){if(e&&t)for(var o in t)if(r||"_"!==o[0]){var s=t[o];if(!n||n(o,s)){var a=e[o];wijmo.isArray(s)?e[o]=(!wijmo.isArray(a)||i?[]:a).concat(s):void 0!==s&&(e[o]=s)}}};Ng2Utils.changeEventImplementSuffix="PC";Ng2Utils.wjEventImplementSuffix="Ng";return Ng2Utils}();exports.Ng2Utils=Ng2Utils;var WjValueAccessor=function(){function WjValueAccessor(e){this._writeQnt=0;this._isSubscribed=!1;this._dirUpdateQnt=0;this._onChange=function(e){};this._onTouched=function(){};this._directive=e;this._behavior=WjDirectiveBehavior.getBehavior(e)}WjValueAccessor.prototype.writeValue=function(e){var t=this;this._modelValue=e;++this._writeQnt;if(this._directive.isInitialized){this._ensureInitEhUnsubscribed();this._updateDirective()}else if(!this._dirInitEh){var i=this._directive.initialized;this._dirInitEh=i.subscribe((function(){t._updateDirective();t._ensureInitEhUnsubscribed()}))}};WjValueAccessor.prototype.registerOnChange=function(e){this._onChange=e};WjValueAccessor.prototype.registerOnTouched=function(e){this._onTouched=e};WjValueAccessor.prototype.setDisabledState=function(e){var t=this._directive;t instanceof wijmo.Control&&(t.isDisabled=e)};WjValueAccessor.prototype._updateDirective=function(){if(!this._isFirstChange()||null!=this._modelValue){this._ensureNgModelProp();if(this._directive&&this._ngModelProp){var e=this._modelValue;""===e&&(e=null);this._dirUpdateQnt++;try{this._directive[this._ngModelProp]=e}finally{this._dirUpdateQnt--}}this._ensureSubscribed()}};WjValueAccessor.prototype._ensureSubscribed=function(){if(!this._isSubscribed){var e=this._directive;if(e){this._ensureNgModelProp();this._ngModelProp=e[WjDirectiveBehavior.wjModelPropAttr];var t=this._ngModelProp;if(t){var i=this._behavior.getPropChangeEvent(t);i&&e[i].addHandler(this._dirValChgEh,this)}e instanceof wijmo.Control&&e.lostFocus.addHandler(this._dirLostFocusEh,this);this._isSubscribed=!0}}};WjValueAccessor.prototype._ensureNgModelProp=function(){!this._ngModelProp&&this._directive&&(this._ngModelProp=this._directive[WjDirectiveBehavior.wjModelPropAttr])};WjValueAccessor.prototype._ensureInitEhUnsubscribed=function(){if(this._dirInitEh){this._dirInitEh.unsubscribe();this._dirInitEh=null}};WjValueAccessor.prototype._isFirstChange=function(){return this._writeQnt<2};WjValueAccessor.prototype._dirValChgEh=function(e,t){if(this._onChange&&this._directive&&this._ngModelProp){var i=this._directive[this._ngModelProp],r=this._modelValue;""===r&&(r=null);if(!(this._dirUpdateQnt>0&&_isNullOrEmpty(r)&&_isNullOrEmpty(i)||Ng2Utils.equals(r,i))||wijmo.isArray(i)){this._modelValue=i;this._onChange(i)}}};WjValueAccessor.prototype._dirLostFocusEh=function(e,t){this._onTouched&&this._onTouched()};return WjValueAccessor}();exports.WjValueAccessor=WjValueAccessor;function WjValueAccessorFactory(e){return new WjValueAccessor(e)}exports.WjValueAccessorFactory=WjValueAccessorFactory;function _isNullOrEmpty(e){return null==e||""===e}
|
|
14
|
+
"use strict";var _a,_b,_c,_d,_e;Object.defineProperty(exports,"__esModule",{value:!0});exports.WjValueAccessor=exports.WjOptions=exports.WjDirectiveBehavior=exports.WjComponentResolvedMetadata=exports.Ng2Utils=void 0;exports.WjValueAccessorFactory=WjValueAccessorFactory;exports.isNoopNgZoneLike=isNoopNgZoneLike;var i0=require("@angular/core"),core_1=require("@angular/core"),wijmo=require("@grapecity/wijmo"),WjOptions=function WjOptions(){};exports.WjOptions=WjOptions;(_a=WjOptions).asyncBindings=!0;_a.zonelessMode="auto";function isNoopNgZoneLike(e){return!e||!e._inner&&!e._outer&&("function"==typeof e.run&&"function"==typeof e.runGuarded&&"function"==typeof e.runOutsideAngular&&"function"==typeof e.runTask)}var WjComponentResolvedMetadata=function(){function WjComponentResolvedMetadata(e){this.changeEventMap=[];this.allImplEvents=[];this.resolveChangeEventMap(e)}WjComponentResolvedMetadata.prototype.resolveChangeEventMap=function(e){var t,i=e.outputs||[],r=e.changeEvents||{};this.changeEventMap.splice(0,this.changeEventMap.length);this.allImplEvents=[];if(i.length){var n=i.map((function(e){return e.split(":")})).map((function(e){var t,i;return{implName:null===(t=e[0])||void 0===t?void 0:t.trim(),exposeName:null===(i=e[1])||void 0===i?void 0:i.trim()}}));this.allImplEvents=n.filter((function(e){return!!e.implName})).map((function(e){return e.implName}));for(var o=0,s=n.filter((function(e){return e.implName&&e.exposeName}));o<s.length;o++){var a=s[o],l=ResolvedMetadataUtils.getWjEventName(a.implName);if(l){var c={eventImpl:a.implName,event:a.exposeName},h=null!==(t=r[l])&&void 0!==t?t:r[a.exposeName];(null==h?void 0:h.length)&&(c.props=h.map((function(e){return{prop:e,evExposed:ResolvedMetadataUtils.getChangeEventNameExposed(e),evImpl:ResolvedMetadataUtils.getChangeEventNameImplemented(e)}})));this.changeEventMap.push(c)}}for(var v=0,d=Object.keys(r);v<d.length;v++){var u=d[v];if(!(u.indexOf(".")<0)){c={eventImpl:null,event:u,props:r[u].map((function(e){return{prop:e,evExposed:ResolvedMetadataUtils.getChangeEventNameExposed(e),evImpl:ResolvedMetadataUtils.getChangeEventNameImplemented(e)}}))};this.changeEventMap.push(c)}}}};return WjComponentResolvedMetadata}();exports.WjComponentResolvedMetadata=WjComponentResolvedMetadata;var ResolvedMetadataUtils=function(){function ResolvedMetadataUtils(){}ResolvedMetadataUtils.getChangeEventNameImplemented=function(e){return"".concat(_b.getChangeEventNameExposed(e)).concat(_b.changeEventImplementSuffix)};ResolvedMetadataUtils.getChangeEventNameExposed=function(e){return"".concat(e,"Change")};ResolvedMetadataUtils.getWjEventName=function(e){if(!e)return null;var t=_b.wijmoEventImplementSuffix,i=e.length-t.length;return i>0&&e.slice(i)===t?e.slice(0,i):null};return ResolvedMetadataUtils}();(_b=ResolvedMetadataUtils).changeEventImplementSuffix="PC";_b.wijmoEventImplementSuffix="Ng";var WjDirectiveBehavior=function(){function WjDirectiveBehavior(e,t,i,r){this.parentBehavior=null;this.isInitialized=!1;this.isDestroyed=!1;this.nzRun=function(e){return e()};this.siblingInsertedObserver=null;this.pendingEvents=[];this.pendingEventsTimeout=null;this.pendingCheck=!1;this.directive=e;this.elementRef=t;this.injector=i;this.injectedParent=r;this.nz=i.get(core_1.NgZone,null);this.cdRef=i.get(core_1.ChangeDetectorRef,null);this.appRef=i.get(core_1.ApplicationRef,null);this.isZoneless=this.detectZonelessMode();this.nz&&!this.isZoneless&&(this.nzRun=this.nz.run.bind(this.nz));this.overrideDirectiveMethods();this.typeData=e.constructor[_c.directiveTypeDataProp]||{};null!==this.typeData.siblingId&&void 0!==this.typeData.siblingId||(this.typeData.siblingId="".concat(++_c.siblingDirId));var n=e.constructor[_c.directiveResolvedTypeDataProp]||new WjComponentResolvedMetadata(this.typeData);e.constructor[_c.directiveResolvedTypeDataProp]=n;this.resolvedTypeData=n;e[_c.behaviorRefProp]=this;i[_c.behaviorRefProp]=this;e[_c.isInitializedPropAttr]=!1;this.createEvents();this.setupAsChild();this.isHostElement()&&this.elementRef.nativeElement.setAttribute(_c.siblingDirIdAttr,this.typeData.siblingId);this.subscribeToEvents(!1);e instanceof wijmo.Control&&(e.workingAs="Angular2")}WjDirectiveBehavior.getHostElement=function(e,t){_c.ngZone=t?t.get(core_1.NgZone,null):null;return e.nativeElement};WjDirectiveBehavior.attach=function(e,t,i,r){return new _c(e,t,i,r)};WjDirectiveBehavior.getBehavior=function(e){var t;return e&&null!==(t=e[_c.behaviorRefProp])&&void 0!==t?t:null};WjDirectiveBehavior.getZone=function(e){var t,i=_c.getBehavior(e);return null!==(t=null==i?void 0:i.nz)&&void 0!==t?t:_c.ngZone};WjDirectiveBehavior.instantiateTemplate=function(e,t,i,r,n){void 0===r&&(r=!1);void 0===n&&(n={});if(!i)throw new Error("A templateRef is required to instantiate a Wijmo Angular template.");var o,s=t.createEmbeddedView(i,n,t.length),a=s.rootNodes;if(r&&1===a.length)o=a[0];else{for(var l=document.createElement("div"),c=0,h=a;c<h.length;c++){var v=h[c];l.appendChild(v)}o=l}e&&e.appendChild(o);return{viewRef:s,rootElement:o}};WjDirectiveBehavior.prototype.ngOnInit=function(){this.isInitialized=!0;this.initParent();this.subscribeToEvents(!0)};WjDirectiveBehavior.prototype.ngAfterViewInit=function(){var e=this;this.directive[_c.isInitializedPropAttr]=!0;setTimeout((function(){if(!e.isDestroyed){e.directive[_c.initializedEventAttr].emit(void 0);e.requestCheck()}}))};WjDirectiveBehavior.prototype.ngOnDestroy=function(){if(!this.isDestroyed){this.isDestroyed=!0;if(this.siblingInsertedObserver){this.siblingInsertedObserver.disconnect();this.siblingInsertedObserver=null}if(this.isChild()&&this.parentBehavior){var e=this.parentBehavior.directive,t=this.getParentProp(),i=this.directive;if(!this.parentBehavior.isDestroyed&&e&&t&&i){var r=e[t];this.removeFromParentCollection(r,i)}}if(this.directive instanceof wijmo.Control&&this.directive.hostElement){var n=this.elementRef.nativeElement,o=null==n?void 0:n.parentNode,s=o?Array.prototype.indexOf.call(o.childNodes,n):-1;this.directive.dispose();if(o&&s>-1&&Array.prototype.indexOf.call(o.childNodes,n)<0){n.textContent="";s<o.childNodes.length&&o.replaceChild(n,o.childNodes[s])}}this.injector[_c.behaviorRefProp]=null}};WjDirectiveBehavior.prototype.flushPendingEvents=function(){this.triggerPendingEvents(!0)};WjDirectiveBehavior.prototype.requestCheck=function(){this.performRequestCheck()};WjDirectiveBehavior.prototype.getPropChangeEvent=function(e){var t=this.typeData.changeEvents;if(!t)return null;for(var i=0,r=Object.keys(t);i<r.length;i++){var n=r[i];if(t[n].indexOf(e)>-1)return n}return null};WjDirectiveBehavior.prototype.createEvents=function(){for(var e=0,t=this.resolvedTypeData.allImplEvents||[];e<t.length;e++){var i=t[e];this.directive[i]=new core_1.EventEmitter(!1)}};WjDirectiveBehavior.prototype.overrideDirectiveMethods=function(){var e=this.directive;if(e instanceof wijmo.Control&&e._resizeObserverCallback){var t=e._resizeObserverCallback.bind(e),i=this;e._resizeObserverCallback=function(e){if(i.isZoneless){t(e);i.requestCheck()}else{if(!core_1.NgZone.isInAngularZone()){var r=_c.getZone(this);if(r){r.run((function(){return t(e)}));return}}t(e)}}.bind(e)}};WjDirectiveBehavior.prototype.subscribeToEvents=function(e){for(var t=this.resolvedTypeData.changeEventMap||[],i=!!e,r=0,n=t;r<n.length;r++){i===(a=n[r]).event.indexOf(".")>-1&&this.addHandlers(a)}if(e)for(var o=0,s=t;o<s.length;o++){var a=s[o];this.triggerPropChangeEvents(a,!0)}};WjDirectiveBehavior.prototype.addHandlers=function(e){var t=this,i=this.directive,r=_c.evaluatePath(i,e.event);r&&r.addHandler((function(r,n){t.runChangeDetectionAware((function(){t.isInitialized&&t.triggerPropChangeEvents(e);e.eventImpl&&t.triggerEvent(i[e.eventImpl],n,!(!e.props||!e.props.length))}))}))};WjDirectiveBehavior.prototype.triggerPropChangeEvents=function(e,t){var i;void 0===t&&(t=!0);if(null===(i=e.props)||void 0===i?void 0:i.length)for(var r=0,n=e.props;r<n.length;r++){var o=n[r],s=this.getSignalFriendlyPropValue(this.directive[o.prop]);this.triggerEvent(this.directive[o.evImpl],s,t,!0)}};WjDirectiveBehavior.prototype.getSignalFriendlyPropValue=function(e){return wijmo.isArray(e)?Array.prototype.slice.call(e):e};WjDirectiveBehavior.prototype.triggerEvent=function(e,t,i,r){var n=this;void 0===r&&(r=!1);if(i&&this.isAsyncBinding()){if(r){var o=this.pendingEvents.find((function(t){return t.event===e}));o?o.args=t:this.pendingEvents.push({event:e,args:t})}else this.pendingEvents.push({event:e,args:t});null===this.pendingEventsTimeout&&(this.pendingEventsTimeout=setTimeout((function(){return n.triggerPendingEvents(!1)}),0))}else{e.emit(t);this.performRequestCheck()}};WjDirectiveBehavior.prototype.triggerPendingEvents=function(e){if(null!==this.pendingEventsTimeout){clearTimeout(this.pendingEventsTimeout);this.pendingEventsTimeout=null}if(!this.isDestroyed)do{var t=this.pendingEvents.slice();this.pendingEvents.length=0;for(var i=0,r=t;i<r.length;i++){var n=r[i];n.event.emit(n.args)}this.performRequestCheck()}while(e&&!this.isDestroyed&&this.pendingEvents.length)};WjDirectiveBehavior.prototype.setupAsChild=function(){if(this.isChild()){this.isHostElement()&&(this.elementRef.nativeElement.style.display="none");this.parentBehavior=_c.getBehavior(this.injectedParent)}};WjDirectiveBehavior.prototype.isAsyncBinding=function(){var e=this.directive[_c.asyncBindingUpdatePropAttr];return null==e?WjOptions.asyncBindings:e};WjDirectiveBehavior.prototype.isChild=function(){return this.isParentInitializer()||this.isParentReferencer()};WjDirectiveBehavior.prototype.isParentInitializer=function(){return null!==this.directive[_c.parentPropertyAttr]&&void 0!==this.directive[_c.parentPropertyAttr]};WjDirectiveBehavior.prototype.isParentReferencer=function(){return!!this.typeData.parentRefProperty};WjDirectiveBehavior.prototype.getParentProp=function(){return this.directive[_c.parentPropertyAttr]};WjDirectiveBehavior.prototype.getParentReferenceProperty=function(){return this.typeData.parentRefProperty};WjDirectiveBehavior.prototype.parentInCtor=function(){return this.isParentReferencer()&&""===this.getParentReferenceProperty()};WjDirectiveBehavior.prototype.initParent=function(){if(this.parentBehavior){var e=this.parentBehavior.directive,t=this.getParentProp(),i=this.directive;if(this.isParentInitializer()&&t){var r=e[t];if(this.isParentCollection(r)){var n=this.isHostElement()?this.getSiblingIndex():-1;(n<0||n>=r.length)&&(n=r.length);this.insertIntoParentCollection(r,n,i);if(this.isHostElement()){var o=this.elementRef.nativeElement;this.siblingInsertedObserver=new MutationObserver(this.handleSiblingInserted.bind(this));this.siblingInsertedObserver.observe(o,{childList:!0})}}else e[t]=i}if(this.isParentReferencer()&&!this.parentInCtor()){var s=this.getParentReferenceProperty();s&&(i[s]=e)}}};WjDirectiveBehavior.prototype.getSiblingIndex=function(){var e=this.elementRef.nativeElement,t=e.parentElement;if(!t)return-1;for(var i=t.childNodes,r=this.typeData.siblingId,n=-1,o=0;o<i.length;o++){var s=i[o];if(1===s.nodeType&&s.getAttribute(_c.siblingDirIdAttr)===r){n++;if(s===e)return n}}return-1};WjDirectiveBehavior.prototype.handleSiblingInserted=function(e){for(var t,i=this,r=0,n=e;r<n.length;r++){var o=n[r];if("childList"===o.type&&0!==o.addedNodes.length){if(Array.from(o.addedNodes).some((function(e){return e===i.elementRef.nativeElement}))){var s=this.getSiblingIndex(),a=null===(t=this.parentBehavior)||void 0===t?void 0:t.directive[this.getParentProp()],l=this.directive,c=this.indexOfParentCollectionItem(a,l);if(s>=0&&c>=0&&s!==c){this.removeAtParentCollectionIndex(a,c);this.insertIntoParentCollection(a,Math.min(s,a.length),l)}}}}};WjDirectiveBehavior.prototype.isParentCollection=function(e){return!!e&&(wijmo.isArray(e)||"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.indexOf&&("function"==typeof e.splice||"function"==typeof e.insert))};WjDirectiveBehavior.prototype.indexOfParentCollectionItem=function(e,t){return this.isParentCollection(e)?e.indexOf(t):-1};WjDirectiveBehavior.prototype.insertIntoParentCollection=function(e,t,i){this.isParentCollection(e)&&("function"!=typeof e.splice?"function"!=typeof e.insert?"function"==typeof e.push&&e.push(i):e.insert(t,i):e.splice(t,0,i))};WjDirectiveBehavior.prototype.removeAtParentCollectionIndex=function(e,t){!this.isParentCollection(e)||t<0||("function"!=typeof e.removeAt?"function"==typeof e.splice&&e.splice(t,1):e.removeAt(t))};WjDirectiveBehavior.prototype.removeFromParentCollection=function(e,t){if(this.isParentCollection(e)){var i=this.indexOfParentCollectionItem(e,t);i>-1&&this.removeAtParentCollectionIndex(e,i)}};WjDirectiveBehavior.prototype.isHostElement=function(){return this.elementRef.nativeElement.nodeType===Node.ELEMENT_NODE};WjDirectiveBehavior.evaluatePath=function(e,t){_c.pathBinding.path=t;return _c.pathBinding.getValue(e)};WjDirectiveBehavior.prototype.detectZonelessMode=function(){var e=WjOptions.zonelessMode;return!0===e||!1===e?e:!this.nz||isNoopNgZoneLike(this.nz)};WjDirectiveBehavior.prototype.runChangeDetectionAware=function(e){if(!this.isZoneless&&this.nz)this.nzRun(e);else{e();this.performRequestCheck()}};WjDirectiveBehavior.prototype.performRequestCheck=function(){var e=this;if(this.isZoneless&&(this.appRef||this.cdRef)&&!this.isDestroyed&&!this.pendingCheck){this.pendingCheck=!0;Promise.resolve().then((function(){var t;e.pendingCheck=!1;e.isDestroyed||(e.appRef?e.appRef.tick():null===(t=e.cdRef)||void 0===t||t.detectChanges())}))}};return WjDirectiveBehavior}();exports.WjDirectiveBehavior=WjDirectiveBehavior;(_c=WjDirectiveBehavior).directiveTypeDataProp="meta";_c.directiveResolvedTypeDataProp="_wjResolvedMeta";_c.behaviorRefProp="_wjBehaviour";_c.parentPropertyAttr="wjProperty";_c.wjModelPropertyAttr="wjModelProperty";_c.initializedEventAttr="initialized";_c.isInitializedPropAttr="isInitialized";_c.siblingDirIdAttr="wj-directive-id";_c.asyncBindingUpdatePropAttr="asyncBindings";_c.siblingDirId=0;_c.wijmoComponentProviderId="WjComponent";_c.ngZone=null;_c.outsideZoneEvents={pointermove:!0,pointerover:!0,mousemove:!0,wheel:!0,touchmove:!0,pointerenter:!0,pointerleave:!0,pointerout:!0,mouseover:!0,mouseenter:!0,mouseleave:!0,mouseout:!0};_c.pathBinding=new wijmo.Binding("");_c.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:_c,deps:"invalid",target:i0.ɵɵFactoryTarget.Injectable});_c.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:_c});i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"20.3.27",ngImport:i0,type:WjDirectiveBehavior,decorators:[{type:core_1.Injectable}],ctorParameters:function(){return[{type:void 0},{type:i0.ElementRef},{type:i0.Injector},{type:void 0}]}});var Ng2Utils=function(){function Ng2Utils(){}Ng2Utils.getChangeEventNameImplemented=function(e){return"".concat(_d.getChangeEventNameExposed(e)).concat(_d.changeEventImplementSuffix)};Ng2Utils.getChangeEventNameExposed=function(e){return"".concat(e,"Change")};Ng2Utils.getWjEventName=function(e){if(!e)return null;var t=_d.wjEventImplementSuffix,i=e.length-t.length;return i>0&&e.slice(i)===t?e.slice(0,i):null};Ng2Utils.equals=function(e,t){return Number.isNaN(e)&&Number.isNaN(t)||wijmo.DateTime.equals(e,t)||e===t};return Ng2Utils}();exports.Ng2Utils=Ng2Utils;(_d=Ng2Utils).changeEventImplementSuffix="PC";_d.wjEventImplementSuffix="Ng";var WjValueAccessor=function(){function WjValueAccessor(e){var t=this;this.writeCount=0;this.ngModelProp=null;this.isSubscribed=!1;this.changeSubscription=null;this.directiveUpdateCount=0;this.initSubscription=null;this.deferredWriteHandle=null;this.deferredWriteAttempts=0;this.initWriteHandle=null;this.initWriteAttempts=0;this.onChangeFn=function(e){};this.onTouchedFn=function(){};this.handleDirectiveValueChanged=function(e,i){var r;if(t.onChangeFn&&t.directive&&t.ngModelProp){var n=t.directive[t.ngModelProp],o=Array.isArray(n)?n.slice():n,s=t.modelValue;""===s&&(s=null);if(!(t.directiveUpdateCount>0&&isNullOrEmpty(s)&&isNullOrEmpty(n)||Ng2Utils.equals(s,n))||Array.isArray(n)){t.modelValue=o;t.onChangeFn(o);null===(r=t.getBehavior())||void 0===r||r.requestCheck()}}};this.handleDirectiveLostFocus=function(){var e;t.onTouchedFn();null===(e=t.getBehavior())||void 0===e||e.requestCheck()};this.directive=e;this.behavior=WjDirectiveBehavior.getBehavior(e)}WjValueAccessor.prototype.writeValue=function(e){var t,i,r,n=this;!(null===(t=this.directive)||void 0===t?void 0:t.isInitialized)&&isNullOrEmpty(e)&&!isNullOrEmpty(this.modelValue)||(this.modelValue=e);this.writeCount++;this.clearDeferredWrite();this.deferredWriteAttempts=0;this.clearInitWrite();this.initWriteAttempts=0;this.applyDirectiveValue();if(null===(i=this.directive)||void 0===i?void 0:i.isInitialized)this.ensureInitSubscriptionDisposed();else{if(!this.initSubscription){var o=null===(r=this.directive)||void 0===r?void 0:r.initialized;this.initSubscription=null==o?void 0:o.subscribe((function(){n.clearInitWrite();n.applyDirectiveValue();n.ensureInitSubscriptionDisposed()}))}this.scheduleInitWriteIfNeeded()}};WjValueAccessor.prototype.registerOnChange=function(e){this.onChangeFn=e};WjValueAccessor.prototype.registerOnTouched=function(e){this.onTouchedFn=e};WjValueAccessor.prototype.setDisabledState=function(e){var t;if(this.directive instanceof wijmo.Control){this.directive.isDisabled=e;null===(t=this.getBehavior())||void 0===t||t.requestCheck()}};WjValueAccessor.prototype.updateDirective=function(){var e;if(!this.isFirstChange()||null!==this.modelValue&&void 0!==this.modelValue){this.ensureNgModelProp();if(this.directive&&this.ngModelProp){var t=this.normalizeModelValue(this.modelValue);this.directiveUpdateCount++;try{this.directive[this.ngModelProp]=t}finally{this.directiveUpdateCount--}null===(e=this.getBehavior())||void 0===e||e.requestCheck();this.ensureSubscribed()}}};WjValueAccessor.prototype.applyDirectiveValue=function(){this.updateDirective();this.scheduleDeferredWriteIfNeeded()};WjValueAccessor.prototype.ensureSubscribed=function(){var e,t=this;if(!this.isSubscribed&&this.directive){this.ensureNgModelProp();if(this.ngModelProp){var i=null===(e=this.getBehavior())||void 0===e?void 0:e.getPropChangeEvent(this.ngModelProp);if(i){var r=this.directive[i];r&&"function"==typeof r.addHandler?r.addHandler(this.handleDirectiveValueChanged,this):r&&"function"==typeof r.subscribe&&(this.changeSubscription=r.subscribe((function(){return t.handleDirectiveValueChanged(t.directive,null)})))}}this.directive instanceof wijmo.Control&&this.directive.lostFocus.addHandler(this.handleDirectiveLostFocus,this);this.isSubscribed=!0}};WjValueAccessor.prototype.ensureNgModelProp=function(){var e,t;if(!this.ngModelProp&&this.directive){var i=this.directive[WjDirectiveBehavior.wjModelPropertyAttr],r=(null===(t=null===(e=this.getBehavior())||void 0===e?void 0:e.typeData)||void 0===t?void 0:t.defaultModelProperty)||null;this.ngModelProp=i||r}};WjValueAccessor.prototype.ensureInitSubscriptionDisposed=function(){if(this.initSubscription){this.initSubscription.unsubscribe();this.initSubscription=null}};WjValueAccessor.prototype.clearDeferredWrite=function(){if(null!==this.deferredWriteHandle){clearTimeout(this.deferredWriteHandle);this.deferredWriteHandle=null}};WjValueAccessor.prototype.clearInitWrite=function(){if(null!==this.initWriteHandle){clearTimeout(this.initWriteHandle);this.initWriteHandle=null}};WjValueAccessor.prototype.scheduleInitWriteIfNeeded=function(){var e,t=this;if(this.directive&&!this.directive.isInitialized&&!(null===(e=this.getBehavior())||void 0===e?void 0:e.isDestroyed))if(this.initWriteAttempts>=_e.maxInitWriteAttempts)this.clearInitWrite();else{this.clearInitWrite();this.initWriteAttempts++;this.initWriteHandle=setTimeout((function(){var e;t.initWriteHandle=null;if(t.directive&&!(null===(e=t.getBehavior())||void 0===e?void 0:e.isDestroyed))if(t.directive.isInitialized){t.applyDirectiveValue();t.ensureInitSubscriptionDisposed()}else t.scheduleInitWriteIfNeeded()}),0)}};WjValueAccessor.prototype.scheduleDeferredWriteIfNeeded=function(){var e=this,t=this.getBehavior();if(this.directive&&this.ngModelProp&&!(null==t?void 0:t.isDestroyed))if(this.isDirectiveValueSynchronized())this.clearDeferredWrite();else if(this.deferredWriteAttempts>=_e.maxDeferredWriteAttempts)this.clearDeferredWrite();else{this.clearDeferredWrite();this.deferredWriteAttempts++;var i=this.getDeferredWriteDelay();this.deferredWriteHandle=setTimeout((function(){var t;e.deferredWriteHandle=null;e.directive&&!(null===(t=e.getBehavior())||void 0===t?void 0:t.isDestroyed)&&e.applyDirectiveValue()}),i)}};WjValueAccessor.prototype.isDirectiveValueSynchronized=function(){return!this.directive||!this.ngModelProp||areEquivalentValue(this.normalizeModelValue(this.modelValue),this.directive[this.ngModelProp])};WjValueAccessor.prototype.normalizeModelValue=function(e){return""===e?null:e};WjValueAccessor.prototype.getDeferredWriteDelay=function(){return Math.min(_e.maxDeferredWriteDelayMs,2*Math.max(0,this.deferredWriteAttempts-1))};WjValueAccessor.prototype.getBehavior=function(){!this.behavior&&this.directive&&(this.behavior=WjDirectiveBehavior.getBehavior(this.directive));return this.behavior};WjValueAccessor.prototype.isFirstChange=function(){return this.writeCount<2};return WjValueAccessor}();exports.WjValueAccessor=WjValueAccessor;(_e=WjValueAccessor).maxDeferredWriteAttempts=20;_e.maxDeferredWriteDelayMs=32;_e.maxInitWriteAttempts=20;function WjValueAccessorFactory(e){return new WjValueAccessor(e)}function isNullOrEmpty(e){return null==e||""===e}function areEquivalentValue(e,t){return!(!isNullOrEmpty(e)||!isNullOrEmpty(t))||(!!areEquivalentArrays(e,t)||(isCellRangeLike(e)&&isCellRangeLike(t)?e.row===t.row&&e.col===t.col&&e.row2===t.row2&&e.col2===t.col2:Ng2Utils.equals(e,t)))}function areEquivalentArrays(e,t){return!(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)&&e.every((function(e,i){return areEquivalentValue(e,t[i])}))}function isCellRangeLike(e){return!!e&&"object"==typeof e&&"number"==typeof e.row&&"number"==typeof e.col&&"number"==typeof e.row2&&"number"==typeof e.col2}
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grapecity/wijmo.angular2legacy.directivebase",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.20262.60",
|
|
4
|
+
"module": "./es5-esm.js",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@grapecity/wijmo": "5.20262.60"
|
|
7
|
+
},
|
|
4
8
|
"description": "UI library for pure JS, Angular, React, Vue and more...",
|
|
5
9
|
"author": "MESCIUS inc",
|
|
6
10
|
"license": "Commercial",
|
|
7
|
-
"main": "./index.js",
|
|
8
|
-
"types": "./index.d.ts",
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@grapecity/wijmo": "5.20261.50"
|
|
11
|
-
},
|
|
12
11
|
"homepage": "https://developer.mescius.com/wijmo",
|
|
13
12
|
"bugs": {
|
|
14
13
|
"url": "https://developer.mescius.com/forums/wijmo"
|
|
@@ -34,13 +33,14 @@
|
|
|
34
33
|
"react-grid",
|
|
35
34
|
"vue-grid"
|
|
36
35
|
],
|
|
37
|
-
"
|
|
36
|
+
"main": "./index.js",
|
|
38
37
|
"esm5": "./es5-esm.js",
|
|
39
38
|
"wj-esm5": "./es5-esm.js",
|
|
40
39
|
"es2015Cjs": "./es2015-commonjs.js",
|
|
41
40
|
"wj-es2015Cjs": "./es2015-commonjs.js",
|
|
42
41
|
"esm2015": "./es2015-esm.js",
|
|
43
42
|
"wj-esm2015": "./es2015-esm.js",
|
|
43
|
+
"types": "./index.d.ts",
|
|
44
44
|
"bin": {
|
|
45
45
|
"wijmo-esm": "./tools/wijmo-esm.js"
|
|
46
46
|
}
|
package/index.metadata.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":3,"metadata":{"___keepComment":{"__symbolic":"error","message":"Variable not initialized","line":28,"character":19},"WjOptions":{"__symbolic":"class","statics":{"asyncBindings":true}},"IWjMetaBase":{"__symbolic":"interface"},"IWjComponentMeta":{"__symbolic":"interface"},"IWjDirectiveMeta":{"__symbolic":"interface"},"ChangePropertyEvent":{"__symbolic":"interface"},"EventPropertiesItem":{"__symbolic":"interface"},"EventProperties":{"__symbolic":"interface"},"IWjComponentMetadata":{"__symbolic":"interface"},"IPendingEvent":{"__symbolic":"interface"},"WjComponentResolvedMetadata":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"resolveChangeEventMap":[{"__symbolic":"method"}]}},"WjDirectiveBehavior":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Object"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Injector"},{"__symbolic":"reference","name":"any"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"getPropChangeEvent":[{"__symbolic":"method"}],"_createEvents":[{"__symbolic":"method"}],"_overrideDirectiveMethods":[{"__symbolic":"method"}],"subscribeToEvents":[{"__symbolic":"method"}],"addHandlers":[{"__symbolic":"method"}],"triggerPropChangeEvents":[{"__symbolic":"method"}],"_setupAsChild":[{"__symbolic":"method"}],"_isAsyncBinding":[{"__symbolic":"method"}],"_isChild":[{"__symbolic":"method"}],"_isParentInitializer":[{"__symbolic":"method"}],"_isParentReferencer":[{"__symbolic":"method"}],"_getParentProp":[{"__symbolic":"method"}],"_getParentReferenceProperty":[{"__symbolic":"method"}],"_useParentObj":[{"__symbolic":"method"}],"_parentInCtor":[{"__symbolic":"method"}],"_initParent":[{"__symbolic":"method"}],"_getSiblingIndex":[{"__symbolic":"method"}],"_siblingInserted":[{"__symbolic":"method"}],"_isHostElement":[{"__symbolic":"method"}],"_triggerEvent":[{"__symbolic":"method"}],"_triggerPendingEvents":[{"__symbolic":"method"}],"flushPendingEvents":[{"__symbolic":"method"}]},"statics":{"directiveTypeDataProp":"meta","directiveResolvedTypeDataProp":"_wjResolvedMeta","BehaviourRefProp":"_wjBehaviour","parPropAttr":"wjProperty","wjModelPropAttr":"wjModelProperty","initializedEventAttr":"initialized","isInitializedPropAttr":"isInitialized","siblingDirIdAttr":"wj-directive-id","asyncBindingUpdatePropAttr":"asyncBindings","siblingDirId":0,"wijmoComponentProviderId":"WjComponent","ngZone":{"__symbolic":"error","message":"Variable not initialized","line":214,"character":11},"outsideZoneEvents":{"pointermove":true,"pointerover":true,"mousemove":true,"wheel":true,"touchmove":true,"pointerenter":true,"pointerleave":true,"pointerout":true,"mouseover":true,"mouseenter":true,"mouseleave":true,"mouseout":true},"_pathBinding":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@grapecity/wijmo","name":"Binding"},"arguments":[""]},"attach":{"__symbolic":"function","parameters":["directive","elementRef","injector","injectedParent"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"WjDirectiveBehavior"},"arguments":[{"__symbolic":"reference","name":"directive"},{"__symbolic":"reference","name":"elementRef"},{"__symbolic":"reference","name":"injector"},{"__symbolic":"reference","name":"injectedParent"}]}},"getBehavior":{"__symbolic":"function","parameters":["directive"],"value":{"__symbolic":"if","condition":{"__symbolic":"reference","name":"directive"},"thenExpression":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"directive"},"index":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"WjDirectiveBehavior"},"member":"BehaviourRefProp"}},"elseExpression":null}}}},"Ng2Utils":{"__symbolic":"class","statics":{"changeEventImplementSuffix":"PC","wjEventImplementSuffix":"Ng","getChangeEventNameImplemented":{"__symbolic":"function","parameters":["propertyName"],"value":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Ng2Utils"},"member":"getChangeEventNameExposed"},"arguments":[{"__symbolic":"reference","name":"propertyName"}]},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Ng2Utils"},"member":"changeEventImplementSuffix"}}},"getChangeEventNameExposed":{"__symbolic":"function","parameters":["propertyName"],"value":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"reference","name":"propertyName"},"right":"Change"}},"getAnnotations":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Reflect"},"member":"getMetadata"},"arguments":["annotations",{"__symbolic":"reference","name":"type"}]}},"equals":{"__symbolic":"function","parameters":["v1","v2"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!=","left":{"__symbolic":"reference","name":"v1"},"right":{"__symbolic":"reference","name":"v1"}},"right":{"__symbolic":"binop","operator":"!=","left":{"__symbolic":"reference","name":"v2"},"right":{"__symbolic":"reference","name":"v2"}}},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@grapecity/wijmo","name":"DateTime"},"member":"equals"},"arguments":[{"__symbolic":"reference","name":"v1"},{"__symbolic":"reference","name":"v2"}]}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"v1"},"right":{"__symbolic":"reference","name":"v2"}}}}}},"WjValueAccessor":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}],"_updateDirective":[{"__symbolic":"method"}],"_ensureSubscribed":[{"__symbolic":"method"}],"_ensureNgModelProp":[{"__symbolic":"method"}],"_ensureInitEhUnsubscribed":[{"__symbolic":"method"}],"_isFirstChange":[{"__symbolic":"method"}],"_dirValChgEh":[{"__symbolic":"method"}],"_dirLostFocusEh":[{"__symbolic":"method"}]}},"WjValueAccessorFactory":{"__symbolic":"function","parameters":["directive"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"WjValueAccessor"},"arguments":[{"__symbolic":"reference","name":"directive"}]}}}},{"__symbolic":"module","version":1,"metadata":{"___keepComment":{"__symbolic":"error","message":"Variable not initialized","line":28,"character":19},"WjOptions":{"__symbolic":"class","statics":{"asyncBindings":true}},"IWjMetaBase":{"__symbolic":"interface"},"IWjComponentMeta":{"__symbolic":"interface"},"IWjDirectiveMeta":{"__symbolic":"interface"},"ChangePropertyEvent":{"__symbolic":"interface"},"EventPropertiesItem":{"__symbolic":"interface"},"EventProperties":{"__symbolic":"interface"},"IWjComponentMetadata":{"__symbolic":"interface"},"IPendingEvent":{"__symbolic":"interface"},"WjComponentResolvedMetadata":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"resolveChangeEventMap":[{"__symbolic":"method"}]}},"WjDirectiveBehavior":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Object"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Injector"},{"__symbolic":"reference","name":"any"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"getPropChangeEvent":[{"__symbolic":"method"}],"_createEvents":[{"__symbolic":"method"}],"_overrideDirectiveMethods":[{"__symbolic":"method"}],"subscribeToEvents":[{"__symbolic":"method"}],"addHandlers":[{"__symbolic":"method"}],"triggerPropChangeEvents":[{"__symbolic":"method"}],"_setupAsChild":[{"__symbolic":"method"}],"_isAsyncBinding":[{"__symbolic":"method"}],"_isChild":[{"__symbolic":"method"}],"_isParentInitializer":[{"__symbolic":"method"}],"_isParentReferencer":[{"__symbolic":"method"}],"_getParentProp":[{"__symbolic":"method"}],"_getParentReferenceProperty":[{"__symbolic":"method"}],"_useParentObj":[{"__symbolic":"method"}],"_parentInCtor":[{"__symbolic":"method"}],"_initParent":[{"__symbolic":"method"}],"_getSiblingIndex":[{"__symbolic":"method"}],"_siblingInserted":[{"__symbolic":"method"}],"_isHostElement":[{"__symbolic":"method"}],"_triggerEvent":[{"__symbolic":"method"}],"_triggerPendingEvents":[{"__symbolic":"method"}],"flushPendingEvents":[{"__symbolic":"method"}]},"statics":{"directiveTypeDataProp":"meta","directiveResolvedTypeDataProp":"_wjResolvedMeta","BehaviourRefProp":"_wjBehaviour","parPropAttr":"wjProperty","wjModelPropAttr":"wjModelProperty","initializedEventAttr":"initialized","isInitializedPropAttr":"isInitialized","siblingDirIdAttr":"wj-directive-id","asyncBindingUpdatePropAttr":"asyncBindings","siblingDirId":0,"wijmoComponentProviderId":"WjComponent","ngZone":{"__symbolic":"error","message":"Variable not initialized","line":214,"character":11},"outsideZoneEvents":{"pointermove":true,"pointerover":true,"mousemove":true,"wheel":true,"touchmove":true,"pointerenter":true,"pointerleave":true,"pointerout":true,"mouseover":true,"mouseenter":true,"mouseleave":true,"mouseout":true},"_pathBinding":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@grapecity/wijmo","name":"Binding"},"arguments":[""]},"attach":{"__symbolic":"function","parameters":["directive","elementRef","injector","injectedParent"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"WjDirectiveBehavior"},"arguments":[{"__symbolic":"reference","name":"directive"},{"__symbolic":"reference","name":"elementRef"},{"__symbolic":"reference","name":"injector"},{"__symbolic":"reference","name":"injectedParent"}]}},"getBehavior":{"__symbolic":"function","parameters":["directive"],"value":{"__symbolic":"if","condition":{"__symbolic":"reference","name":"directive"},"thenExpression":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"directive"},"index":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"WjDirectiveBehavior"},"member":"BehaviourRefProp"}},"elseExpression":null}}}},"Ng2Utils":{"__symbolic":"class","statics":{"changeEventImplementSuffix":"PC","wjEventImplementSuffix":"Ng","getChangeEventNameImplemented":{"__symbolic":"function","parameters":["propertyName"],"value":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Ng2Utils"},"member":"getChangeEventNameExposed"},"arguments":[{"__symbolic":"reference","name":"propertyName"}]},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Ng2Utils"},"member":"changeEventImplementSuffix"}}},"getChangeEventNameExposed":{"__symbolic":"function","parameters":["propertyName"],"value":{"__symbolic":"binop","operator":"+","left":{"__symbolic":"reference","name":"propertyName"},"right":"Change"}},"getAnnotations":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Reflect"},"member":"getMetadata"},"arguments":["annotations",{"__symbolic":"reference","name":"type"}]}},"equals":{"__symbolic":"function","parameters":["v1","v2"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!=","left":{"__symbolic":"reference","name":"v1"},"right":{"__symbolic":"reference","name":"v1"}},"right":{"__symbolic":"binop","operator":"!=","left":{"__symbolic":"reference","name":"v2"},"right":{"__symbolic":"reference","name":"v2"}}},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@grapecity/wijmo","name":"DateTime"},"member":"equals"},"arguments":[{"__symbolic":"reference","name":"v1"},{"__symbolic":"reference","name":"v2"}]}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"v1"},"right":{"__symbolic":"reference","name":"v2"}}}}}},"WjValueAccessor":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}],"_updateDirective":[{"__symbolic":"method"}],"_ensureSubscribed":[{"__symbolic":"method"}],"_ensureNgModelProp":[{"__symbolic":"method"}],"_ensureInitEhUnsubscribed":[{"__symbolic":"method"}],"_isFirstChange":[{"__symbolic":"method"}],"_dirValChgEh":[{"__symbolic":"method"}],"_dirLostFocusEh":[{"__symbolic":"method"}]}},"WjValueAccessorFactory":{"__symbolic":"function","parameters":["directive"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"WjValueAccessor"},"arguments":[{"__symbolic":"reference","name":"directive"}]}}}}]
|