@simplism/angular
Advanced tools
Comparing version 3.2.4 to 3.2.9
@@ -34,2 +34,4 @@ "use strict"; | ||
_this.resizing(); | ||
}, { | ||
childList: false | ||
}); | ||
@@ -124,2 +126,4 @@ }); | ||
_this._container.resizing(); | ||
}, { | ||
childList: false | ||
}); | ||
@@ -126,0 +130,0 @@ }); |
@@ -1,4 +0,4 @@ | ||
import { AfterViewInit, ElementRef, EventEmitter, Injector, OnDestroy } from "@angular/core"; | ||
import { AfterViewInit, ElementRef, EventEmitter, Injector } from "@angular/core"; | ||
import { SdToastProvider } from "../providers/SdToastProvider"; | ||
export declare class SdFormControl implements AfterViewInit, OnDestroy { | ||
export declare class SdFormControl implements AfterViewInit { | ||
private _elementRef; | ||
@@ -9,6 +9,4 @@ private _toast; | ||
table: boolean; | ||
useSaveShortcut: boolean; | ||
constructor(_elementRef: ElementRef, _toast: SdToastProvider); | ||
ngAfterViewInit(): void; | ||
ngOnDestroy(): void; | ||
requestSubmit(param?: any): void; | ||
@@ -15,0 +13,0 @@ onSubmit(e: Event): void; |
@@ -22,6 +22,4 @@ "use strict"; | ||
this.table = false; | ||
this.useSaveShortcut = false; | ||
} | ||
SdFormControl.prototype.ngAfterViewInit = function () { | ||
var _this = this; | ||
var $this = $(this._elementRef.nativeElement); | ||
@@ -32,12 +30,3 @@ if (($this.attr("class") || "").includes("sd-padding-") || | ||
} | ||
$(document).on("keydown.sd.form", function (e) { | ||
if (e.which === 83 && e.ctrlKey) { | ||
e.preventDefault(); | ||
_this.requestSubmit(); | ||
} | ||
}); | ||
}; | ||
SdFormControl.prototype.ngOnDestroy = function () { | ||
$(document).off("keydown.sd.form"); | ||
}; | ||
SdFormControl.prototype.requestSubmit = function (param) { | ||
@@ -77,6 +66,2 @@ var $this = $(this._elementRef.nativeElement); | ||
], SdFormControl.prototype, "table", void 0); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata("design:type", Object) | ||
], SdFormControl.prototype, "useSaveShortcut", void 0); | ||
SdFormControl = __decorate([ | ||
@@ -108,3 +93,3 @@ core_1.Component({ | ||
set: function (value) { | ||
if (!(typeof value === "string")) { | ||
if (value !== undefined && !(typeof value === "string")) { | ||
throw new core_2.Exception("'sd-form.label'\uC5D0 \uC798\uBABB\uB41C\uAC12 '" + JSON.stringify(value) + "'\uAC00 \uC785\uB825\uB418\uC5C8\uC2B5\uB2C8\uB2E4."); | ||
@@ -111,0 +96,0 @@ } |
@@ -5,6 +5,6 @@ import { Routes } from "@angular/router"; | ||
private static _isDetectElementChangeEnable; | ||
private static logger; | ||
static getChromeVersion(): number | undefined; | ||
static detectElementChange(element: Element, callback: () => void, options?: { | ||
resize?: boolean; | ||
childList?: boolean; | ||
}): void; | ||
@@ -11,0 +11,0 @@ static stopDetectElementChanges(): void; |
@@ -56,7 +56,7 @@ "use strict"; | ||
var _this = this; | ||
options = __assign({ resize: true }, options); | ||
var logger = core_1.Logger.getLogger("SimgularHelpers"); | ||
options = __assign({ resize: true, childList: true }, options); | ||
var nowWait = false; | ||
var runCallback = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var _this = this; | ||
var elementTagName; | ||
return __generator(this, function (_a) { | ||
@@ -72,6 +72,2 @@ switch (_a.label) { | ||
nowWait = false; | ||
elementTagName = element.tagName.toLowerCase().startsWith("sd-") ? element.tagName.toLowerCase() : undefined; | ||
elementTagName = elementTagName ? elementTagName : $(element).parents().toArray().firstOr({ tagName: "" }, function (item) { return item.tagName.toLowerCase().startsWith("sd-"); }).tagName.toLowerCase(); | ||
elementTagName = elementTagName || element.tagName.toLowerCase(); | ||
this.logger.log("detect: " + elementTagName); | ||
callback(); | ||
@@ -82,10 +78,15 @@ return [2]; | ||
}); }; | ||
var logger = core_1.Logger.getLogger("SimgularHelpers"); | ||
new MutationObserver(function () { | ||
runCallback(); | ||
}).observe(element, { | ||
childList: true, | ||
characterData: true, | ||
subtree: true | ||
}); | ||
var elementTagName = element.tagName.toLowerCase().startsWith("sd-") ? element.tagName.toLowerCase() : undefined; | ||
elementTagName = elementTagName ? elementTagName : $(element).parents().toArray().firstOr({ tagName: "" }, function (item) { return item.tagName.toLowerCase().startsWith("sd-"); }).tagName.toLowerCase(); | ||
elementTagName = elementTagName || element.tagName.toLowerCase(); | ||
if (options.childList) { | ||
new MutationObserver(function () { | ||
logger.log("detect: mutate: " + elementTagName); | ||
runCallback(); | ||
}).observe(element, { | ||
childList: true, | ||
characterData: true, | ||
subtree: true | ||
}); | ||
} | ||
if (options.resize) { | ||
@@ -96,2 +97,3 @@ var chromeVersion = SimgularHelpers.getChromeVersion(); | ||
$(window).on("resize", function () { | ||
logger.log("detect: resize: " + elementTagName); | ||
runCallback(); | ||
@@ -102,2 +104,3 @@ }); | ||
new window["ResizeObserver"](function () { | ||
logger.log("detect: resize: " + elementTagName); | ||
runCallback(); | ||
@@ -128,3 +131,2 @@ }).observe(element); | ||
SimgularHelpers._isDetectElementChangeEnable = true; | ||
SimgularHelpers.logger = core_1.Logger.getLogger("SimgularHelpers"); | ||
return SimgularHelpers; | ||
@@ -131,0 +133,0 @@ }()); |
@@ -13,3 +13,3 @@ { | ||
"style": "./dist/simgular.css", | ||
"version": "3.2.4", | ||
"version": "3.2.9", | ||
"dependencies": { | ||
@@ -27,6 +27,6 @@ "core-js": "^2.5.4", | ||
"@fortawesome/fontawesome-free-webfonts": "^1.0.5", | ||
"@simplism/core": "^3.2.3", | ||
"@simplism/excel": "^3.2.3", | ||
"@simplism/socket-client": "^3.2.3", | ||
"@simplism/socket-common": "^3.2.3", | ||
"@simplism/core": "^3.2.8", | ||
"@simplism/excel": "^3.2.8", | ||
"@simplism/socket-client": "^3.2.8", | ||
"@simplism/socket-common": "^3.2.8", | ||
"@types/jquery": "^3.3.1", | ||
@@ -33,0 +33,0 @@ "jquery": "^3.3.1", |
@@ -39,2 +39,4 @@ import { | ||
this.resizing(); | ||
}, { | ||
childList: false | ||
}); | ||
@@ -136,2 +138,4 @@ }); | ||
this._container.resizing(); | ||
}, { | ||
childList: false | ||
}); | ||
@@ -138,0 +142,0 @@ }); |
@@ -9,3 +9,2 @@ import { | ||
Input, | ||
OnDestroy, | ||
Output | ||
@@ -38,7 +37,6 @@ } from "@angular/core"; | ||
}) | ||
export class SdFormControl implements AfterViewInit, OnDestroy { | ||
export class SdFormControl implements AfterViewInit { | ||
@Output() submit = new EventEmitter<any>(); | ||
@Input() inline = false; | ||
@Input() table = false; | ||
@Input() useSaveShortcut = false; | ||
@@ -57,15 +55,4 @@ constructor(private _elementRef: ElementRef, | ||
} | ||
$(document).on("keydown.sd.form", (e: any) => { | ||
if (e.which === 83 && e.ctrlKey) { | ||
e.preventDefault(); | ||
this.requestSubmit(); | ||
} | ||
}); | ||
} | ||
ngOnDestroy(): void { | ||
$(document).off("keydown.sd.form"); | ||
} | ||
requestSubmit(param?: any): void { | ||
@@ -110,3 +97,3 @@ const $this = $(this._elementRef.nativeElement); | ||
set label(value: string) { | ||
if (!(typeof value === "string")) { | ||
if (value !== undefined && !(typeof value === "string")) { | ||
throw new Exception(`'sd-form.label'에 잘못된값 '${JSON.stringify(value)}'가 입력되었습니다.`); | ||
@@ -113,0 +100,0 @@ } |
@@ -7,3 +7,2 @@ import {Logger, Wait} from "@simplism/core"; | ||
private static _isDetectElementChangeEnable = true; | ||
private static logger = Logger.getLogger("SimgularHelpers"); | ||
@@ -15,5 +14,11 @@ static getChromeVersion(): number | undefined { | ||
static detectElementChange(element: Element, callback: () => void, options?: { resize?: boolean }): void { | ||
static detectElementChange(element: Element, callback: () => void, options?: { | ||
resize?: boolean; | ||
childList?: boolean; | ||
}): void { | ||
const logger = Logger.getLogger("SimgularHelpers"); | ||
options = { | ||
resize: true, | ||
childList: true, | ||
...options | ||
@@ -30,18 +35,20 @@ }; | ||
let elementTagName = element.tagName.toLowerCase().startsWith("sd-") ? element.tagName.toLowerCase() : undefined; | ||
elementTagName = elementTagName ? elementTagName : $(element).parents().toArray().firstOr({tagName: ""}, item => item.tagName.toLowerCase().startsWith("sd-")).tagName.toLowerCase(); | ||
elementTagName = elementTagName || element.tagName.toLowerCase(); | ||
this.logger.log("detect: " + elementTagName); | ||
callback(); | ||
}; | ||
const logger = Logger.getLogger("SimgularHelpers"); | ||
new MutationObserver(() => { | ||
runCallback(); | ||
}).observe(element, { | ||
childList: true, | ||
characterData: true, | ||
subtree: true | ||
}); | ||
let elementTagName = element.tagName.toLowerCase().startsWith("sd-") ? element.tagName.toLowerCase() : undefined; | ||
elementTagName = elementTagName ? elementTagName : $(element).parents().toArray().firstOr({tagName: ""}, item => item.tagName.toLowerCase().startsWith("sd-")).tagName.toLowerCase(); | ||
elementTagName = elementTagName || element.tagName.toLowerCase(); | ||
if (options.childList) { | ||
new MutationObserver(() => { | ||
logger.log("detect: mutate: " + elementTagName); | ||
runCallback(); | ||
}).observe(element, { | ||
childList: true, | ||
characterData: true, | ||
subtree: true | ||
}); | ||
} | ||
if (options.resize) { | ||
@@ -52,2 +59,3 @@ const chromeVersion = SimgularHelpers.getChromeVersion(); | ||
$(window).on("resize", () => { | ||
logger.log("detect: resize: " + elementTagName); | ||
runCallback(); | ||
@@ -58,2 +66,3 @@ }); | ||
new window["ResizeObserver"](() => { | ||
logger.log("detect: resize: " + elementTagName); | ||
runCallback(); | ||
@@ -60,0 +69,0 @@ }).observe(element); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
8688142
19503