@skyux/core 6.3.3 → 6.4.0
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/documentation.json +925 -684
- package/esm2020/index.mjs +3 -1
- package/esm2020/lib/modules/trim/trim.directive.mjs +67 -0
- package/esm2020/lib/modules/trim/trim.module.mjs +16 -0
- package/fesm2015/skyux-core.mjs +76 -1
- package/fesm2015/skyux-core.mjs.map +1 -1
- package/fesm2020/skyux-core.mjs +76 -1
- package/fesm2020/skyux-core.mjs.map +1 -1
- package/index.d.ts +2 -0
- package/lib/modules/trim/trim.directive.d.ts +16 -0
- package/lib/modules/trim/trim.module.d.ts +7 -0
- package/package.json +2 -2
package/fesm2020/skyux-core.mjs
CHANGED
@@ -2886,6 +2886,81 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
2886
2886
|
}]
|
2887
2887
|
}], ctorParameters: function () { return [{ type: i1$1.Title }]; } });
|
2888
2888
|
|
2889
|
+
var _SkyTrimDirective_instances, _SkyTrimDirective_obs, _SkyTrimDirective_observe, _SkyTrimDirective_disconnect, _SkyTrimDirective_trim;
|
2890
|
+
/**
|
2891
|
+
* Trims whitespace in each text node that is a direct descendent of the current element.
|
2892
|
+
*/
|
2893
|
+
class SkyTrimDirective {
|
2894
|
+
constructor(elRef, mutationObs) {
|
2895
|
+
this.elRef = elRef;
|
2896
|
+
this.mutationObs = mutationObs;
|
2897
|
+
_SkyTrimDirective_instances.add(this);
|
2898
|
+
_SkyTrimDirective_obs.set(this, void 0);
|
2899
|
+
__classPrivateFieldSet(this, _SkyTrimDirective_obs, this.mutationObs.create((mutations) => {
|
2900
|
+
const nodes = [];
|
2901
|
+
// Only trim white space inside direct descendents of the current element.
|
2902
|
+
for (const mutation of mutations) {
|
2903
|
+
if (mutation.target.parentNode === this.elRef.nativeElement) {
|
2904
|
+
nodes.push(mutation.target);
|
2905
|
+
}
|
2906
|
+
}
|
2907
|
+
__classPrivateFieldGet(this, _SkyTrimDirective_instances, "m", _SkyTrimDirective_trim).call(this, nodes);
|
2908
|
+
}), "f");
|
2909
|
+
__classPrivateFieldGet(this, _SkyTrimDirective_instances, "m", _SkyTrimDirective_observe).call(this);
|
2910
|
+
}
|
2911
|
+
ngOnInit() {
|
2912
|
+
const el = this.elRef.nativeElement;
|
2913
|
+
__classPrivateFieldGet(this, _SkyTrimDirective_instances, "m", _SkyTrimDirective_trim).call(this, Array.from(el.childNodes));
|
2914
|
+
}
|
2915
|
+
ngOnDestroy() {
|
2916
|
+
__classPrivateFieldGet(this, _SkyTrimDirective_instances, "m", _SkyTrimDirective_disconnect).call(this);
|
2917
|
+
__classPrivateFieldSet(this, _SkyTrimDirective_obs, undefined, "f");
|
2918
|
+
}
|
2919
|
+
}
|
2920
|
+
_SkyTrimDirective_obs = new WeakMap(), _SkyTrimDirective_instances = new WeakSet(), _SkyTrimDirective_observe = function _SkyTrimDirective_observe() {
|
2921
|
+
__classPrivateFieldGet(this, _SkyTrimDirective_obs, "f").observe(this.elRef.nativeElement, {
|
2922
|
+
characterData: true,
|
2923
|
+
subtree: true,
|
2924
|
+
});
|
2925
|
+
}, _SkyTrimDirective_disconnect = function _SkyTrimDirective_disconnect() {
|
2926
|
+
__classPrivateFieldGet(this, _SkyTrimDirective_obs, "f").disconnect();
|
2927
|
+
}, _SkyTrimDirective_trim = function _SkyTrimDirective_trim(nodes) {
|
2928
|
+
// Suspend the MutationObserver so altering the text content of each node
|
2929
|
+
// doesn't retrigger the observe callback.
|
2930
|
+
__classPrivateFieldGet(this, _SkyTrimDirective_instances, "m", _SkyTrimDirective_disconnect).call(this);
|
2931
|
+
for (const node of nodes) {
|
2932
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
2933
|
+
const textContent = node.textContent;
|
2934
|
+
const textContentTrimmed = textContent.trim();
|
2935
|
+
if (textContent !== textContentTrimmed) {
|
2936
|
+
node.textContent = textContentTrimmed;
|
2937
|
+
}
|
2938
|
+
}
|
2939
|
+
}
|
2940
|
+
__classPrivateFieldGet(this, _SkyTrimDirective_instances, "m", _SkyTrimDirective_observe).call(this);
|
2941
|
+
};
|
2942
|
+
SkyTrimDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyTrimDirective, deps: [{ token: i0.ElementRef }, { token: MutationObserverService }], target: i0.ɵɵFactoryTarget.Directive });
|
2943
|
+
SkyTrimDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: SkyTrimDirective, selector: "[skyTrim]", ngImport: i0 });
|
2944
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyTrimDirective, decorators: [{
|
2945
|
+
type: Directive,
|
2946
|
+
args: [{
|
2947
|
+
selector: '[skyTrim]',
|
2948
|
+
}]
|
2949
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MutationObserverService }]; } });
|
2950
|
+
|
2951
|
+
class SkyTrimModule {
|
2952
|
+
}
|
2953
|
+
SkyTrimModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyTrimModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
2954
|
+
SkyTrimModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyTrimModule, declarations: [SkyTrimDirective], exports: [SkyTrimDirective] });
|
2955
|
+
SkyTrimModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyTrimModule });
|
2956
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyTrimModule, decorators: [{
|
2957
|
+
type: NgModule,
|
2958
|
+
args: [{
|
2959
|
+
declarations: [SkyTrimDirective],
|
2960
|
+
exports: [SkyTrimDirective],
|
2961
|
+
}]
|
2962
|
+
}] });
|
2963
|
+
|
2889
2964
|
class SkyUIConfigService {
|
2890
2965
|
getConfig(key, defaultConfig) {
|
2891
2966
|
return of(defaultConfig);
|
@@ -3320,5 +3395,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
3320
3395
|
* Generated bundle index. Do not edit.
|
3321
3396
|
*/
|
3322
3397
|
|
3323
|
-
export { MutationObserverService, NumericOptions, SKY_LOG_LEVEL, SkyAffixAutoFitContext, SkyAffixModule, SkyAffixService, SkyAffixer, SkyAppFormat, SkyAppTitleService, SkyAppWindowRef, SkyCoreAdapterModule, SkyCoreAdapterService, SkyDockItem, SkyDockLocation, SkyDockModule, SkyDockService, SkyDynamicComponentLocation, SkyDynamicComponentModule, SkyDynamicComponentService, SkyIdModule, SkyLogModule, SkyLogService, SkyMediaBreakpoints, SkyMediaQueryModule, SkyMediaQueryService, SkyNumericModule, SkyNumericPipe, SkyNumericService, SkyOverlayInstance, SkyOverlayModule, SkyOverlayService, SkyPercentPipe, SkyPercentPipeModule, SkyResizeObserverMediaQueryService, SkyResizeObserverService, SkyScrollableHostService, SkyUIConfigService, SkyViewkeeperHostOptions, SkyViewkeeperModule, SkyViewkeeperService, getWindow, SkyAffixDirective as λ1, SkyIdDirective as λ2, SkyViewkeeperDirective as λ3 };
|
3398
|
+
export { MutationObserverService, NumericOptions, SKY_LOG_LEVEL, SkyAffixAutoFitContext, SkyAffixModule, SkyAffixService, SkyAffixer, SkyAppFormat, SkyAppTitleService, SkyAppWindowRef, SkyCoreAdapterModule, SkyCoreAdapterService, SkyDockItem, SkyDockLocation, SkyDockModule, SkyDockService, SkyDynamicComponentLocation, SkyDynamicComponentModule, SkyDynamicComponentService, SkyIdModule, SkyLogModule, SkyLogService, SkyMediaBreakpoints, SkyMediaQueryModule, SkyMediaQueryService, SkyNumericModule, SkyNumericPipe, SkyNumericService, SkyOverlayInstance, SkyOverlayModule, SkyOverlayService, SkyPercentPipe, SkyPercentPipeModule, SkyResizeObserverMediaQueryService, SkyResizeObserverService, SkyScrollableHostService, SkyTrimModule, SkyUIConfigService, SkyViewkeeperHostOptions, SkyViewkeeperModule, SkyViewkeeperService, getWindow, SkyAffixDirective as λ1, SkyIdDirective as λ2, SkyViewkeeperDirective as λ3, SkyTrimDirective as λ4 };
|
3324
3399
|
//# sourceMappingURL=skyux-core.mjs.map
|