@sd-angular/core 0.0.1039 → 0.0.1043
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/assets/scss/quill-mention/quill-mention.css +55 -0
- package/assets/scss/sd-core.scss +1 -0
- package/bundles/sd-angular-core-chip.umd.js +41 -10
- package/bundles/sd-angular-core-chip.umd.js.map +1 -1
- package/bundles/sd-angular-core-chip.umd.min.js +2 -2
- package/bundles/sd-angular-core-chip.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-comment.umd.js +16 -15
- package/bundles/sd-angular-core-comment.umd.js.map +1 -1
- package/bundles/sd-angular-core-comment.umd.min.js +2 -2
- package/bundles/sd-angular-core-comment.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-editor.umd.js +73 -18
- package/bundles/sd-angular-core-editor.umd.js.map +1 -1
- package/bundles/sd-angular-core-editor.umd.min.js +2 -2
- package/bundles/sd-angular-core-editor.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-filter.umd.js +703 -0
- package/bundles/sd-angular-core-filter.umd.js.map +1 -0
- package/bundles/sd-angular-core-filter.umd.min.js +2 -0
- package/bundles/sd-angular-core-filter.umd.min.js.map +1 -0
- package/bundles/sd-angular-core-form.umd.js +6 -4
- package/bundles/sd-angular-core-form.umd.js.map +1 -1
- package/bundles/sd-angular-core-form.umd.min.js +1 -1
- package/bundles/sd-angular-core-form.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.js +96 -48
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-modal-custom.umd.js +487 -0
- package/bundles/sd-angular-core-modal-custom.umd.js.map +1 -0
- package/bundles/sd-angular-core-modal-custom.umd.min.js +16 -0
- package/bundles/sd-angular-core-modal-custom.umd.min.js.map +1 -0
- package/bundles/sd-angular-core-modal-resizable.umd.js +487 -0
- package/bundles/sd-angular-core-modal-resizable.umd.js.map +1 -0
- package/bundles/sd-angular-core-modal-resizable.umd.min.js +16 -0
- package/bundles/sd-angular-core-modal-resizable.umd.min.js.map +1 -0
- package/bundles/sd-angular-core-setting.umd.js +176 -117
- package/bundles/sd-angular-core-setting.umd.js.map +1 -1
- package/bundles/sd-angular-core-setting.umd.min.js +1 -1
- package/bundles/sd-angular-core-setting.umd.min.js.map +1 -1
- package/bundles/sd-angular-core.umd.js +4 -4
- package/bundles/sd-angular-core.umd.min.js +1 -1
- package/bundles/sd-angular-core.umd.min.js.map +1 -1
- package/chip/sd-angular-core-chip.metadata.json +1 -1
- package/chip/src/lib/chip.component.d.ts +8 -1
- package/comment/sd-angular-core-comment.metadata.json +1 -1
- package/comment/src/lib/comment.model.d.ts +11 -0
- package/editor/sd-angular-core-editor.metadata.json +1 -1
- package/editor/src/lib/editor.component.d.ts +17 -3
- package/esm2015/chip/src/lib/chip.component.js +34 -4
- package/esm2015/chip/src/lib/chip.module.js +6 -3
- package/esm2015/comment/src/lib/comment.component.js +4 -4
- package/esm2015/comment/src/lib/comment.model.js +1 -1
- package/esm2015/comment/src/lib/comment.module.js +3 -1
- package/esm2015/editor/src/lib/editor.component.js +70 -14
- package/esm2015/editor/src/lib/editor.module.js +4 -2
- package/esm2015/filter/index.js +2 -0
- package/esm2015/filter/sd-angular-core-filter.js +8 -0
- package/esm2015/filter/src/lib/directives/sd-filter-def.directive.js +22 -0
- package/esm2015/filter/src/lib/filter.component.js +161 -0
- package/esm2015/filter/src/lib/filter.model.js +2 -0
- package/esm2015/filter/src/lib/filter.module.js +47 -0
- package/esm2015/filter/src/lib/filter.service.js +60 -0
- package/esm2015/filter/src/lib/pipes/values-local.pipe.js +19 -0
- package/esm2015/filter/src/lib/pipes/values-server.pipe.js +18 -0
- package/esm2015/filter/src/public-api.js +8 -0
- package/esm2015/form/src/lib/form.module.js +4 -1
- package/esm2015/grid-material/src/lib/components/column-inline-filter/column-inline-filter.component.js +10 -7
- package/esm2015/grid-material/src/lib/components/quick-action/quick-action.component.js +1 -1
- package/esm2015/grid-material/src/lib/grid-material.component.js +1 -6
- package/esm2015/grid-material/src/lib/models/grid-column.model.js +1 -1
- package/esm2015/grid-material/src/lib/services/generated-column/generated-column.service.js +28 -12
- package/esm2015/grid-material/src/lib/services/grid-configuration.service.js +50 -21
- package/esm2015/modal-custom/index.js +2 -0
- package/esm2015/modal-custom/sd-angular-core-modal-custom.js +5 -0
- package/esm2015/modal-custom/src/lib/modal-custom/modal-custom.component.js +123 -0
- package/esm2015/modal-custom/src/lib/modal-custom.module.js +30 -0
- package/esm2015/modal-custom/src/public-api.js +6 -0
- package/esm2015/modal-resizable/index.js +2 -0
- package/esm2015/modal-resizable/sd-angular-core-modal-resizable.js +5 -0
- package/esm2015/modal-resizable/src/lib/modal-resizable/modal-resizable.component.js +123 -0
- package/esm2015/modal-resizable/src/lib/modal-resizable.module.js +30 -0
- package/esm2015/modal-resizable/src/public-api.js +6 -0
- package/esm2015/public-api.js +3 -1
- package/esm2015/setting/src/lib/setting.model.js +1 -1
- package/esm2015/setting/src/lib/setting.service.js +119 -58
- package/fesm2015/sd-angular-core-chip.js +37 -5
- package/fesm2015/sd-angular-core-chip.js.map +1 -1
- package/fesm2015/sd-angular-core-comment.js +5 -3
- package/fesm2015/sd-angular-core-comment.js.map +1 -1
- package/fesm2015/sd-angular-core-editor.js +72 -15
- package/fesm2015/sd-angular-core-editor.js.map +1 -1
- package/fesm2015/sd-angular-core-filter.js +323 -0
- package/fesm2015/sd-angular-core-filter.js.map +1 -0
- package/fesm2015/sd-angular-core-form.js +3 -0
- package/fesm2015/sd-angular-core-form.js.map +1 -1
- package/fesm2015/sd-angular-core-grid-material.js +86 -43
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/fesm2015/sd-angular-core-modal-custom.js +161 -0
- package/fesm2015/sd-angular-core-modal-custom.js.map +1 -0
- package/fesm2015/sd-angular-core-modal-resizable.js +161 -0
- package/fesm2015/sd-angular-core-modal-resizable.js.map +1 -0
- package/fesm2015/sd-angular-core-setting.js +119 -58
- package/fesm2015/sd-angular-core-setting.js.map +1 -1
- package/fesm2015/sd-angular-core.js +2 -0
- package/fesm2015/sd-angular-core.js.map +1 -1
- package/filter/index.d.ts +1 -0
- package/filter/package.json +12 -0
- package/filter/sd-angular-core-filter.d.ts +7 -0
- package/filter/sd-angular-core-filter.metadata.json +1 -0
- package/filter/src/lib/directives/sd-filter-def.directive.d.ts +8 -0
- package/filter/src/lib/filter.component.d.ts +31 -0
- package/filter/src/lib/filter.model.d.ts +105 -0
- package/filter/src/lib/filter.module.d.ts +2 -0
- package/filter/src/lib/filter.service.d.ts +9 -0
- package/filter/src/lib/pipes/values-local.pipe.d.ts +5 -0
- package/filter/src/lib/pipes/values-server.pipe.d.ts +5 -0
- package/filter/src/public-api.d.ts +4 -0
- package/form/sd-angular-core-form.metadata.json +1 -1
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/grid-material/src/lib/models/grid-column.model.d.ts +1 -0
- package/grid-material/src/lib/services/generated-column/generated-column.service.d.ts +3 -2
- package/modal-custom/index.d.ts +1 -0
- package/modal-custom/package.json +12 -0
- package/modal-custom/sd-angular-core-modal-custom.d.ts +4 -0
- package/modal-custom/sd-angular-core-modal-custom.metadata.json +1 -0
- package/modal-custom/src/lib/modal-custom/modal-custom.component.d.ts +31 -0
- package/modal-custom/src/lib/modal-custom.module.d.ts +2 -0
- package/modal-custom/src/public-api.d.ts +2 -0
- package/modal-resizable/index.d.ts +1 -0
- package/modal-resizable/package.json +12 -0
- package/modal-resizable/sd-angular-core-modal-resizable.d.ts +4 -0
- package/modal-resizable/sd-angular-core-modal-resizable.metadata.json +1 -0
- package/modal-resizable/src/lib/modal-resizable/modal-resizable.component.d.ts +31 -0
- package/modal-resizable/src/lib/modal-resizable.module.d.ts +2 -0
- package/modal-resizable/src/public-api.d.ts +2 -0
- package/package.json +3 -2
- package/public-api.d.ts +2 -0
- package/{sd-angular-core-0.0.1039.tgz → sd-angular-core-0.0.1043.tgz} +0 -0
- package/setting/sd-angular-core-setting.metadata.json +1 -1
- package/setting/src/lib/setting.model.d.ts +20 -6
- package/setting/src/lib/setting.service.d.ts +2 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/cdk/portal"),require("uuid"),require("@sd-angular/core/loading"),require("jquery"),require("@angular/common"),require("@angular/material/icon"),require("@angular/material/dialog"),require("@angular/material/button"),require("@sd-angular/core/button")):"function"==typeof define&&define.amd?define("@sd-angular/core/modal-resizable",["exports","@angular/core","@angular/cdk/portal","uuid","@sd-angular/core/loading","jquery","@angular/common","@angular/material/icon","@angular/material/dialog","@angular/material/button","@sd-angular/core/button"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self)["sd-angular"]=t["sd-angular"]||{},t["sd-angular"].core=t["sd-angular"].core||{},t["sd-angular"].core["modal-resizable"]={}),t.ng.core,t.ng.cdk.portal,t.uuid,t["sd-angular"].core.loading,t.$,t.ng.common,t.ng.material.icon,t.ng.material.dialog,t.ng.material.button,t["sd-angular"].core.button)}(this,(function(t,e,o,i,n,a,r,s,d,c,l){"use strict";function u(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var m=u(a);
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */Object.create;var p,g;Object.create;function f(t,e,o,i){if("a"===o&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?i:"a"===o?i.call(t):i?i.value:e.get(t)}var h=function(){function t(t,o,n,a,r){var s=this;this.cfr=t,this.ar=o,this.injector=n,this.ref=a,this.loadingService=r,this.id="I"+i.v4(),this.width="480px",this.editingChanged=new e.EventEmitter,p.set(this,void 0),this.isEditing=!1,this.isOpened=!1,this.isHover=!1,this.isLoading=!1,this.isMinium=!1,this.open=function(){s.ref.markForCheck(),s.isOpened=!0,m.default("#"+s.id).hasClass("c-minium")||setTimeout((function(){var t=m.default("#"+s.id).width();t>0&&m.default("#"+s.id).attr("data-width",t),m.default("#"+s.id).removeClass("c-closed")}),100),s.maxium()},this.close=function(){s.ref.markForCheck(),s.isOpened=!1,setTimeout((function(){m.default("#"+s.id).css({width:"0px",right:"0px"}).removeClass("c-minium").addClass("c-closed")}),100),s.stopLoading(),f(s,g).call(s)},this.minium=function(){s.ref.markForCheck(),s.isMinium=!0,f(s,g).call(s)},this.maxium=function(){s.ref.markForCheck(),s.isMinium=!1,f(s,g).call(s)},g.set(this,(function(){setTimeout((function(){var t=8;m.default(".modal-custom").each((function(e,o){if(m.default(o).hasClass("c-minium"))m.default(o).css({width:"300px",right:t+"px"}),t+=308;else if(!m.default(o).hasClass("c-closed")){var i=parseInt(m.default(o).attr("data-width"),0);i>0&&(m.default(o).css({width:i+"px",right:t+"px"}),t+=i+8)}}))}),100)})),this.startLoading=function(){s.isLoading=!0,s.loadingService.stop(),s.loadingService.start("#"+s.id)},this.stopLoading=function(){s.isLoading=!1,s.loadingService.stop()}}return t.prototype.ngAfterViewInit=function(){!function(t,e,o,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===i?n.call(t,o):n?n.value=o:e.set(t,o)}(this,p,new o.DomPortalOutlet(document.body,this.cfr,this.ar,this.injector).attachTemplatePortal(this.portal))},t.prototype.ngOnDestroy=function(){f(this,p).destroy()},t.prototype.toggleEditable=function(){this.isEditing=!this.isEditing,this.editingChanged.emit(this.isEditing)},t}();p=new WeakMap,g=new WeakMap,h.decorators=[{type:e.Component,args:[{selector:"sd-modal-resizable",template:'<ng-template cdkPortal>\r\n <div [id]="id" class="modal-custom" [ngStyle]="{\'width\': width}"\r\n [ngClass]="{\'modal-custom--active\': isOpened,\'modal-custom--loading\': isLoading, \'c-minium\': isMinium}"\r\n (mouseover)="isHover = true" (mouseout)="isHover = false">\r\n <ng-container *ngIf="isOpened">\r\n <div class="modal-custom__header media align-items-center">\r\n <div class="modal-custom__title media-body">\r\n <ng-content select="[sdTitle]"></ng-content>\r\n </div>\r\n <button type="button" class="c-action--white c-min" (click)="minium()" *ngIf="!isMinium" mat-icon-button\r\n title="Thu nhỏ">\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n <button type="button" class="c-action--white c-max" (click)="maxium()" *ngIf="isMinium" mat-icon-button\r\n title="Phóng to">\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n <button type="button" class="c-action--white" (click)="close()" mat-icon-button title="Đóng">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n <div *ngIf="isOpened" class="modal-custom__body">\r\n <div class="modal-custom__content">\r\n <ng-content select="[sdBody]"></ng-content>\r\n </div>\r\n </div>\r\n <div class="modal-custom__footer">\r\n <ng-content select="[sdFooter]"></ng-content>\r\n </div>\r\n </ng-container>\r\n </div>\r\n</ng-template>',changeDetection:e.ChangeDetectionStrategy.OnPush,styles:[".modal-custom{background-color:#fff;border-radius:4px 4px 0 0;bottom:0;box-shadow:0 .4px .8px rgba(0,0,0,.1),0 3px 6px rgba(0,0,0,.2);display:flex;flex-direction:column;opacity:0;pointer-events:none;position:fixed;right:12px;top:80px;transform:translate3d(0,100%,0);transition:all .3s ease-in-out;visibility:hidden;z-index:999}.modal-custom.c-minium-of-list{bottom:0;opacity:1;pointer-events:all;top:auto;transform:translateZ(0);visibility:visible}.modal-custom.c-minium{top:auto}.modal-custom.c-minium .modal-custom__body,.modal-custom.c-minium .modal-custom__footer{display:none}.c-action{color:#212121}.c-action:focus{outline:none}.c-action--white{color:#fff}.c-action--white.c-min{margin-bottom:-12px}.c-action--white.c-max{margin-top:-12px}.modal-custom__icon{background:transparent;border:0;color:#212121;outline:none;overflow:hidden}.modal-custom__icon .mat-icon{float:left}.modal-custom__header{background-color:#5d6165;border-radius:4px 4px 0 0;color:#fff;min-height:40px;padding:0 16px}.modal-custom__body{flex:1;position:relative}.modal-custom__content{bottom:0;left:0;overflow:auto;padding:8px 16px 16px;position:absolute;right:0;top:0}.modal-custom__footer{border-top:1px solid #dde0e5;padding:5px 0}.modal-custom-backdrop{background:none;border:0;bottom:0;height:100%;left:0;outline:none!important;position:fixed;right:0;top:0;transition:all .3s ease-in-out;width:100%;z-index:99}.modal-custom-backdrop--active{background-color:rgba(0,0,0,.4)}.modal-custom--active{opacity:1;pointer-events:all;transform:translateZ(0);visibility:visible}.modal-custom__title{font-size:14px;font-weight:500;line-height:20px}"]}]}],h.ctorParameters=function(){return[{type:e.ComponentFactoryResolver},{type:e.ApplicationRef},{type:e.Injector},{type:e.ChangeDetectorRef},{type:n.SdLoadingService}]},h.propDecorators={portal:[{type:e.ViewChild,args:[o.CdkPortal]}],editable:[{type:e.Input}],width:[{type:e.Input}],editingChanged:[{type:e.Output}]};var b=function(){};b.decorators=[{type:e.NgModule,args:[{imports:[r.CommonModule,s.MatIconModule,d.MatDialogModule,c.MatButtonModule,l.SdButtonModule,o.PortalModule],declarations:[h],exports:[h],providers:[]}]}],t.SdModalResizable=h,t.SdModalResizableModule=b,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
16
|
+
//# sourceMappingURL=sd-angular-core-modal-resizable.umd.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../node_modules/tslib/tslib.es6.js","../../../../projects/sd-core/modal-resizable/src/lib/modal-resizable/modal-resizable.component.ts","../../../../projects/sd-core/modal-resizable/src/lib/modal-resizable.module.ts"],"names":["Object","create","__classPrivateFieldGet","receiver","state","kind","f","TypeError","has","call","value","get","SdModalResizable","cfr","ar","injector","ref","loadingService","_this","this","id","uuid.v4","width","editingChanged","EventEmitter","_embeddedViewRef","set","isEditing","isOpened","isHover","isLoading","isMinium","open","markForCheck","$","hasClass","setTimeout","maxiumWidth","attr","removeClass","maxium","close","css","right","addClass","stopLoading","_drawMiniumBar","minium","totalRight","each","index","item","miniumWidth","parseInt","startLoading","stop","start","prototype","ngAfterViewInit","__classPrivateFieldSet","DomPortalOutlet","document","body","attachTemplatePortal","portal","ngOnDestroy","destroy","toggleEditable","emit","Component","args","selector","template","changeDetection","ChangeDetectionStrategy","OnPush","ComponentFactoryResolver","ApplicationRef","Injector","ChangeDetectorRef","SdLoadingService","ViewChild","CdkPortal","Input","Output","NgModule","imports","CommonModule","MatIconModule","MatDialogModule","MatButtonModule","SdButtonModule","PortalModule","declarations","exports","providers"],"mappings":"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","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import {\r\n Component,\r\n ViewChild,\r\n ComponentFactoryResolver,\r\n ApplicationRef,\r\n Injector,\r\n EmbeddedViewRef,\r\n AfterViewInit,\r\n OnDestroy,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n} from '@angular/core';\r\nimport {CdkPortal, DomPortalOutlet} from '@angular/cdk/portal';\r\nimport * as uuid from 'uuid';\r\nimport {SdLoadingService} from '@sd-angular/core/loading';\r\nimport $ from 'jquery';\r\n\r\n@Component({\r\n selector: 'sd-modal-resizable',\r\n templateUrl: './modal-resizable.component.html',\r\n styleUrls: ['./modal-resizable.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdModalResizable implements AfterViewInit, OnDestroy {\r\n id = `I${uuid.v4()}`;\r\n @ViewChild(CdkPortal) portal: CdkPortal;\r\n @Input() editable: boolean;\r\n @Input() width = '480px';\r\n @Output() editingChanged = new EventEmitter<boolean>();\r\n #embeddedViewRef: EmbeddedViewRef<any>;\r\n isEditing = false;\r\n isOpened = false;\r\n isHover = false;\r\n isLoading = false;\r\n isMinium = false;\r\n\r\n constructor(\r\n private cfr: ComponentFactoryResolver,\r\n private ar: ApplicationRef,\r\n private injector: Injector,\r\n private ref: ChangeDetectorRef,\r\n private loadingService: SdLoadingService\r\n ) {\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#embeddedViewRef = new DomPortalOutlet(\r\n document.body,\r\n this.cfr,\r\n this.ar,\r\n this.injector\r\n ).attachTemplatePortal(this.portal);\r\n }\r\n\r\n open = () => {\r\n this.ref.markForCheck();\r\n this.isOpened = true;\r\n // console.log('OPEN isMinium' + this.id, this.isMinium);\r\n\r\n // tinh toan width maxium lần đầu khi không ở trạng thái minium\r\n if (!$('#' + this.id).hasClass('c-minium')) {\r\n setTimeout(() => {\r\n const maxiumWidth = $('#' + this.id).width();\r\n if (maxiumWidth > 0) {\r\n $('#' + this.id).attr('data-width', maxiumWidth);\r\n }\r\n $('#' + this.id).removeClass('c-closed');\r\n }, 100);\r\n }\r\n\r\n this.maxium();\r\n }\r\n\r\n close = () => {\r\n this.ref.markForCheck();\r\n this.isOpened = false;\r\n setTimeout(() => {\r\n $('#' + this.id).css({width: '0px', right: '0px'}).removeClass('c-minium').addClass('c-closed');\r\n }, 100);\r\n this.stopLoading();\r\n\r\n this.#drawMiniumBar();\r\n }\r\n\r\n minium = () => {\r\n this.ref.markForCheck();\r\n this.isMinium = true;\r\n // console.log('MINIUM isMinium' + this.id, this.isMinium);\r\n this.#drawMiniumBar();\r\n }\r\n\r\n maxium = () => {\r\n this.ref.markForCheck();\r\n this.isMinium = false;\r\n // console.log('MAXIUM isMinium' + this.id, this.isMinium);\r\n this.#drawMiniumBar();\r\n }\r\n\r\n #drawMiniumBar = () => {\r\n setTimeout(() => {\r\n let totalRight = 8;\r\n const miniumWidth = 300;\r\n $('.modal-custom').each((index, item) => {\r\n if ($(item).hasClass('c-minium')) {\r\n $(item).css({width: 300 + 'px', right: totalRight + 'px'});\r\n totalRight += miniumWidth + 8;\r\n } else if (!$(item).hasClass('c-closed')) {\r\n const maxiumWidth = parseInt($(item).attr('data-width'), 0);\r\n if (maxiumWidth > 0) {\r\n $(item).css({width: maxiumWidth + 'px', right: totalRight + 'px'});\r\n totalRight += maxiumWidth + 8;\r\n }\r\n }\r\n\r\n });\r\n }, 100);\r\n\r\n }\r\n\r\n startLoading = () => {\r\n this.isLoading = true;\r\n this.loadingService.stop();\r\n this.loadingService.start(`#${this.id}`);\r\n }\r\n\r\n stopLoading = () => {\r\n this.isLoading = false;\r\n this.loadingService.stop();\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#embeddedViewRef.destroy();\r\n }\r\n\r\n toggleEditable() {\r\n this.isEditing = !this.isEditing;\r\n this.editingChanged.emit(this.isEditing);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { SdButtonModule } from '@sd-angular/core/button';\r\nimport { SdModalResizable } from './modal-resizable/modal-resizable.component';\r\nimport { PortalModule } from '@angular/cdk/portal';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatIconModule,\r\n MatDialogModule,\r\n MatButtonModule,\r\n SdButtonModule,\r\n PortalModule\r\n ],\r\n declarations: [\r\n SdModalResizable\r\n ],\r\n exports: [\r\n SdModalResizable\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdModalResizableModule {\r\n\r\n}\r\n"]}
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
var _cache, _subject, _get, _set, _has, _remove;
|
|
331
|
+
var _cache, _subject, _get, _getServer, _set, _setServer, _has, _hasServer, _remove, _removeServer;
|
|
332
332
|
var SdSettingService = /** @class */ (function () {
|
|
333
333
|
function SdSettingService(configuration) {
|
|
334
334
|
var _this = this;
|
|
@@ -336,43 +336,49 @@
|
|
|
336
336
|
_cache.set(this, {});
|
|
337
337
|
_subject.set(this, {});
|
|
338
338
|
_get.set(this, function (key, option) {
|
|
339
|
+
return function () {
|
|
340
|
+
var cache = __classPrivateFieldGet(_this, _cache)[key];
|
|
341
|
+
if ((option === null || option === void 0 ? void 0 : option.type) === 'session') {
|
|
342
|
+
try {
|
|
343
|
+
cache = JSON.parse(sessionStorage.getItem(key));
|
|
344
|
+
}
|
|
345
|
+
catch (_a) {
|
|
346
|
+
cache = undefined;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
try {
|
|
351
|
+
cache = JSON.parse(localStorage.getItem(key));
|
|
352
|
+
}
|
|
353
|
+
catch (_b) {
|
|
354
|
+
cache = undefined;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (!cache) {
|
|
358
|
+
return option === null || option === void 0 ? void 0 : option.default;
|
|
359
|
+
}
|
|
360
|
+
return JSON.parse(JSON.stringify(cache.data));
|
|
361
|
+
};
|
|
362
|
+
});
|
|
363
|
+
_getServer.set(this, function (key, option) {
|
|
339
364
|
return function () { return __awaiter(_this, void 0, void 0, function () {
|
|
340
|
-
var _a, cache,
|
|
365
|
+
var _a, cache, _b_1;
|
|
341
366
|
return __generator(this, function (_e) {
|
|
342
367
|
switch (_e.label) {
|
|
343
368
|
case 0:
|
|
344
369
|
cache = __classPrivateFieldGet(this, _cache)[key];
|
|
345
|
-
|
|
346
|
-
try {
|
|
347
|
-
cache = JSON.parse(sessionStorage.getItem(key));
|
|
348
|
-
}
|
|
349
|
-
catch (_b) {
|
|
350
|
-
cache = undefined;
|
|
351
|
-
}
|
|
352
|
-
return [3 /*break*/, 7];
|
|
370
|
+
_e.label = 1;
|
|
353
371
|
case 1:
|
|
354
|
-
|
|
355
|
-
_e.label = 2;
|
|
356
|
-
case 2:
|
|
357
|
-
_e.trys.push([2, 4, , 5]);
|
|
372
|
+
_e.trys.push([1, 3, , 4]);
|
|
358
373
|
return [4 /*yield*/, ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.get(key, option))];
|
|
359
|
-
case
|
|
374
|
+
case 2:
|
|
360
375
|
cache = _e.sent();
|
|
361
|
-
return [3 /*break*/,
|
|
362
|
-
case
|
|
363
|
-
|
|
376
|
+
return [3 /*break*/, 4];
|
|
377
|
+
case 3:
|
|
378
|
+
_b_1 = _e.sent();
|
|
364
379
|
cache = undefined;
|
|
365
|
-
return [3 /*break*/,
|
|
366
|
-
case
|
|
367
|
-
case 6:
|
|
368
|
-
try {
|
|
369
|
-
cache = JSON.parse(localStorage.getItem(key));
|
|
370
|
-
}
|
|
371
|
-
catch (_d) {
|
|
372
|
-
cache = undefined;
|
|
373
|
-
}
|
|
374
|
-
_e.label = 7;
|
|
375
|
-
case 7:
|
|
380
|
+
return [3 /*break*/, 4];
|
|
381
|
+
case 4:
|
|
376
382
|
if (!cache) {
|
|
377
383
|
return [2 /*return*/, option === null || option === void 0 ? void 0 : option.default];
|
|
378
384
|
}
|
|
@@ -382,6 +388,32 @@
|
|
|
382
388
|
}); };
|
|
383
389
|
});
|
|
384
390
|
_set.set(this, function (key, option) {
|
|
391
|
+
return function (data) {
|
|
392
|
+
__classPrivateFieldGet(_this, _cache)[key] = {
|
|
393
|
+
data: JSON.parse(JSON.stringify(data)),
|
|
394
|
+
createdOn: new Date()
|
|
395
|
+
};
|
|
396
|
+
if ((option === null || option === void 0 ? void 0 : option.type) === 'session') {
|
|
397
|
+
try {
|
|
398
|
+
sessionStorage.setItem(key, JSON.stringify(__classPrivateFieldGet(_this, _cache)[key]));
|
|
399
|
+
__classPrivateFieldGet(_this, _subject)[key].next(__classPrivateFieldGet(_this, _cache)[key].data);
|
|
400
|
+
}
|
|
401
|
+
catch (err) {
|
|
402
|
+
console.error(err);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
try {
|
|
407
|
+
localStorage.setItem(key, JSON.stringify(__classPrivateFieldGet(_this, _cache)[key]));
|
|
408
|
+
__classPrivateFieldGet(_this, _subject)[key].next(__classPrivateFieldGet(_this, _cache)[key].data);
|
|
409
|
+
}
|
|
410
|
+
catch (err) {
|
|
411
|
+
console.error(err);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
});
|
|
416
|
+
_setServer.set(this, function (key, option) {
|
|
385
417
|
return function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
386
418
|
var _a, err_1;
|
|
387
419
|
return __generator(this, function (_e) {
|
|
@@ -391,82 +423,67 @@
|
|
|
391
423
|
data: JSON.parse(JSON.stringify(data)),
|
|
392
424
|
createdOn: new Date()
|
|
393
425
|
};
|
|
394
|
-
|
|
395
|
-
try {
|
|
396
|
-
sessionStorage.setItem(key, JSON.stringify(__classPrivateFieldGet(this, _cache)[key]));
|
|
397
|
-
__classPrivateFieldGet(this, _subject)[key].next(__classPrivateFieldGet(this, _cache)[key].data);
|
|
398
|
-
}
|
|
399
|
-
catch (err) {
|
|
400
|
-
console.error(err);
|
|
401
|
-
}
|
|
402
|
-
return [3 /*break*/, 7];
|
|
426
|
+
_e.label = 1;
|
|
403
427
|
case 1:
|
|
404
|
-
|
|
405
|
-
_e.label = 2;
|
|
406
|
-
case 2:
|
|
407
|
-
_e.trys.push([2, 4, , 5]);
|
|
428
|
+
_e.trys.push([1, 3, , 4]);
|
|
408
429
|
return [4 /*yield*/, ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.set(key, __classPrivateFieldGet(this, _cache)[key]))];
|
|
409
|
-
case
|
|
430
|
+
case 2:
|
|
410
431
|
_e.sent();
|
|
411
432
|
__classPrivateFieldGet(this, _subject)[key].next(__classPrivateFieldGet(this, _cache)[key].data);
|
|
412
|
-
return [3 /*break*/,
|
|
413
|
-
case
|
|
433
|
+
return [3 /*break*/, 4];
|
|
434
|
+
case 3:
|
|
414
435
|
err_1 = _e.sent();
|
|
415
436
|
console.error(err_1);
|
|
416
|
-
return [3 /*break*/,
|
|
417
|
-
case
|
|
418
|
-
case 6:
|
|
419
|
-
try {
|
|
420
|
-
localStorage.setItem(key, JSON.stringify(__classPrivateFieldGet(this, _cache)[key]));
|
|
421
|
-
__classPrivateFieldGet(this, _subject)[key].next(__classPrivateFieldGet(this, _cache)[key].data);
|
|
422
|
-
}
|
|
423
|
-
catch (err) {
|
|
424
|
-
console.error(err);
|
|
425
|
-
}
|
|
426
|
-
_e.label = 7;
|
|
427
|
-
case 7: return [2 /*return*/];
|
|
437
|
+
return [3 /*break*/, 4];
|
|
438
|
+
case 4: return [2 /*return*/];
|
|
428
439
|
}
|
|
429
440
|
});
|
|
430
441
|
}); };
|
|
431
442
|
});
|
|
432
443
|
_has.set(this, function (key, option) {
|
|
444
|
+
return function () {
|
|
445
|
+
var cache = __classPrivateFieldGet(_this, _cache)[key];
|
|
446
|
+
if ((option === null || option === void 0 ? void 0 : option.type) === 'session') {
|
|
447
|
+
try {
|
|
448
|
+
cache = JSON.parse(sessionStorage.getItem(key));
|
|
449
|
+
}
|
|
450
|
+
catch (_a) {
|
|
451
|
+
cache = undefined;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
try {
|
|
456
|
+
cache = JSON.parse(localStorage.getItem(key));
|
|
457
|
+
}
|
|
458
|
+
catch (_b) {
|
|
459
|
+
cache = undefined;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if (!cache) {
|
|
463
|
+
return false;
|
|
464
|
+
}
|
|
465
|
+
return true;
|
|
466
|
+
};
|
|
467
|
+
});
|
|
468
|
+
_hasServer.set(this, function (key, option) {
|
|
433
469
|
return function () { return __awaiter(_this, void 0, void 0, function () {
|
|
434
|
-
var _a, cache,
|
|
470
|
+
var _a, cache, _b_2;
|
|
435
471
|
return __generator(this, function (_e) {
|
|
436
472
|
switch (_e.label) {
|
|
437
473
|
case 0:
|
|
438
474
|
cache = __classPrivateFieldGet(this, _cache)[key];
|
|
439
|
-
|
|
440
|
-
try {
|
|
441
|
-
cache = JSON.parse(sessionStorage.getItem(key));
|
|
442
|
-
}
|
|
443
|
-
catch (_b) {
|
|
444
|
-
cache = undefined;
|
|
445
|
-
}
|
|
446
|
-
return [3 /*break*/, 7];
|
|
475
|
+
_e.label = 1;
|
|
447
476
|
case 1:
|
|
448
|
-
|
|
449
|
-
_e.label = 2;
|
|
450
|
-
case 2:
|
|
451
|
-
_e.trys.push([2, 4, , 5]);
|
|
477
|
+
_e.trys.push([1, 3, , 4]);
|
|
452
478
|
return [4 /*yield*/, ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.get(key, option))];
|
|
453
|
-
case
|
|
479
|
+
case 2:
|
|
454
480
|
cache = _e.sent();
|
|
455
|
-
return [3 /*break*/,
|
|
456
|
-
case
|
|
457
|
-
|
|
481
|
+
return [3 /*break*/, 4];
|
|
482
|
+
case 3:
|
|
483
|
+
_b_2 = _e.sent();
|
|
458
484
|
cache = undefined;
|
|
459
|
-
return [3 /*break*/,
|
|
460
|
-
case
|
|
461
|
-
case 6:
|
|
462
|
-
try {
|
|
463
|
-
cache = JSON.parse(localStorage.getItem(key));
|
|
464
|
-
}
|
|
465
|
-
catch (_d) {
|
|
466
|
-
cache = undefined;
|
|
467
|
-
}
|
|
468
|
-
_e.label = 7;
|
|
469
|
-
case 7:
|
|
485
|
+
return [3 /*break*/, 4];
|
|
486
|
+
case 4:
|
|
470
487
|
if (!cache) {
|
|
471
488
|
return [2 /*return*/, false];
|
|
472
489
|
}
|
|
@@ -476,39 +493,83 @@
|
|
|
476
493
|
}); };
|
|
477
494
|
});
|
|
478
495
|
_remove.set(this, function (key, option) {
|
|
496
|
+
return function () { return __awaiter(_this, void 0, void 0, function () {
|
|
497
|
+
return __generator(this, function (_e) {
|
|
498
|
+
try {
|
|
499
|
+
if ((option === null || option === void 0 ? void 0 : option.type) === 'session') {
|
|
500
|
+
sessionStorage.removeItem(key);
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
localStorage.removeItem(key);
|
|
504
|
+
}
|
|
505
|
+
__classPrivateFieldGet(this, _cache)[key] = undefined;
|
|
506
|
+
__classPrivateFieldGet(this, _subject)[key].next(undefined);
|
|
507
|
+
}
|
|
508
|
+
catch (err) {
|
|
509
|
+
console.error(err);
|
|
510
|
+
}
|
|
511
|
+
return [2 /*return*/];
|
|
512
|
+
});
|
|
513
|
+
}); };
|
|
514
|
+
});
|
|
515
|
+
_removeServer.set(this, function (key, option) {
|
|
479
516
|
return function () { return __awaiter(_this, void 0, void 0, function () {
|
|
480
517
|
var _a, err_2;
|
|
481
518
|
return __generator(this, function (_e) {
|
|
482
519
|
switch (_e.label) {
|
|
483
520
|
case 0:
|
|
484
|
-
_e.trys.push([0,
|
|
485
|
-
if (!((option === null || option === void 0 ? void 0 : option.type) === 'session')) return [3 /*break*/, 1];
|
|
486
|
-
sessionStorage.removeItem(key);
|
|
487
|
-
return [3 /*break*/, 4];
|
|
488
|
-
case 1:
|
|
489
|
-
if (!((option === null || option === void 0 ? void 0 : option.type) === 'server')) return [3 /*break*/, 3];
|
|
521
|
+
_e.trys.push([0, 2, , 3]);
|
|
490
522
|
return [4 /*yield*/, ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.remove(key, option))];
|
|
491
|
-
case
|
|
523
|
+
case 1:
|
|
492
524
|
_e.sent();
|
|
493
|
-
return [3 /*break*/, 4];
|
|
494
|
-
case 3:
|
|
495
|
-
localStorage.removeItem(key);
|
|
496
|
-
_e.label = 4;
|
|
497
|
-
case 4:
|
|
498
525
|
__classPrivateFieldGet(this, _cache)[key] = undefined;
|
|
499
526
|
__classPrivateFieldGet(this, _subject)[key].next(undefined);
|
|
500
|
-
return [3 /*break*/,
|
|
501
|
-
case
|
|
527
|
+
return [3 /*break*/, 3];
|
|
528
|
+
case 2:
|
|
502
529
|
err_2 = _e.sent();
|
|
503
530
|
console.error(err_2);
|
|
504
|
-
return [3 /*break*/,
|
|
505
|
-
case
|
|
531
|
+
return [3 /*break*/, 3];
|
|
532
|
+
case 3: return [2 /*return*/];
|
|
506
533
|
}
|
|
507
534
|
});
|
|
508
535
|
}); };
|
|
509
536
|
});
|
|
510
537
|
}
|
|
511
538
|
SdSettingService.prototype.create = function (key, option) {
|
|
539
|
+
var _a;
|
|
540
|
+
if (!key) {
|
|
541
|
+
throw new Error('Key is required');
|
|
542
|
+
}
|
|
543
|
+
var hashKey = null;
|
|
544
|
+
if (typeof (key) === 'string') {
|
|
545
|
+
hashKey = key;
|
|
546
|
+
}
|
|
547
|
+
else if (typeof (key) === 'object') {
|
|
548
|
+
hashKey = hash__default['default'](key);
|
|
549
|
+
}
|
|
550
|
+
else {
|
|
551
|
+
throw new Error('Invalid key');
|
|
552
|
+
}
|
|
553
|
+
if ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.convertKey) {
|
|
554
|
+
hashKey = this.configuration.convertKey(hashKey);
|
|
555
|
+
}
|
|
556
|
+
var get = __classPrivateFieldGet(this, _get).call(this, hashKey, option);
|
|
557
|
+
var set = __classPrivateFieldGet(this, _set).call(this, hashKey, option);
|
|
558
|
+
var has = __classPrivateFieldGet(this, _has).call(this, hashKey, option);
|
|
559
|
+
var remove = __classPrivateFieldGet(this, _remove).call(this, hashKey, option);
|
|
560
|
+
if (!__classPrivateFieldGet(this, _subject)[hashKey]) {
|
|
561
|
+
__classPrivateFieldGet(this, _subject)[hashKey] = new rxjs.BehaviorSubject(get());
|
|
562
|
+
}
|
|
563
|
+
return {
|
|
564
|
+
get: get,
|
|
565
|
+
set: set,
|
|
566
|
+
has: has,
|
|
567
|
+
remove: remove,
|
|
568
|
+
subject: __classPrivateFieldGet(this, _subject)[hashKey],
|
|
569
|
+
observer: __classPrivateFieldGet(this, _subject)[hashKey].pipe(operators.startWith(__classPrivateFieldGet(this, _subject)[hashKey].getValue()))
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
SdSettingService.prototype.createServer = function (key, option) {
|
|
512
573
|
var _a, _b, _c, _d;
|
|
513
574
|
if (!key) {
|
|
514
575
|
throw new Error('Key is required');
|
|
@@ -526,23 +587,21 @@
|
|
|
526
587
|
if ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.convertKey) {
|
|
527
588
|
hashKey = this.configuration.convertKey(hashKey);
|
|
528
589
|
}
|
|
529
|
-
if ((
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
throw new Error('Please init setting configuration method remove for type server');
|
|
538
|
-
}
|
|
590
|
+
if (!((_b = this.configuration) === null || _b === void 0 ? void 0 : _b.get)) {
|
|
591
|
+
throw new Error('Please init setting configuration method get for type server');
|
|
592
|
+
}
|
|
593
|
+
if (!((_c = this.configuration) === null || _c === void 0 ? void 0 : _c.set)) {
|
|
594
|
+
throw new Error('Please init setting configuration method set for type server');
|
|
595
|
+
}
|
|
596
|
+
if (!((_d = this.configuration) === null || _d === void 0 ? void 0 : _d.remove)) {
|
|
597
|
+
throw new Error('Please init setting configuration method remove for type server');
|
|
539
598
|
}
|
|
540
599
|
if (!__classPrivateFieldGet(this, _subject)[hashKey]) {
|
|
541
|
-
__classPrivateFieldGet(this, _subject)[hashKey] = new rxjs.
|
|
600
|
+
__classPrivateFieldGet(this, _subject)[hashKey] = new rxjs.BehaviorSubject(option === null || option === void 0 ? void 0 : option.default);
|
|
542
601
|
}
|
|
543
|
-
var get = __classPrivateFieldGet(this,
|
|
544
|
-
var set = __classPrivateFieldGet(this,
|
|
545
|
-
var has = __classPrivateFieldGet(this,
|
|
602
|
+
var get = __classPrivateFieldGet(this, _getServer).call(this, hashKey, option);
|
|
603
|
+
var set = __classPrivateFieldGet(this, _setServer).call(this, hashKey, option);
|
|
604
|
+
var has = __classPrivateFieldGet(this, _hasServer).call(this, hashKey, option);
|
|
546
605
|
var remove = __classPrivateFieldGet(this, _remove).call(this, hashKey, option);
|
|
547
606
|
return {
|
|
548
607
|
get: get,
|
|
@@ -550,12 +609,12 @@
|
|
|
550
609
|
has: has,
|
|
551
610
|
remove: remove,
|
|
552
611
|
subject: __classPrivateFieldGet(this, _subject)[hashKey],
|
|
553
|
-
observer: __classPrivateFieldGet(this, _subject)[hashKey].pipe(operators.startWith(
|
|
612
|
+
observer: __classPrivateFieldGet(this, _subject)[hashKey].pipe(operators.startWith(__classPrivateFieldGet(this, _subject)[hashKey].getValue()), operators.switchMap(get))
|
|
554
613
|
};
|
|
555
614
|
};
|
|
556
615
|
return SdSettingService;
|
|
557
616
|
}());
|
|
558
|
-
_cache = new WeakMap(), _subject = new WeakMap(), _get = new WeakMap(), _set = new WeakMap(), _has = new WeakMap(), _remove = new WeakMap();
|
|
617
|
+
_cache = new WeakMap(), _subject = new WeakMap(), _get = new WeakMap(), _getServer = new WeakMap(), _set = new WeakMap(), _setServer = new WeakMap(), _has = new WeakMap(), _hasServer = new WeakMap(), _remove = new WeakMap(), _removeServer = new WeakMap();
|
|
559
618
|
SdSettingService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SdSettingService_Factory() { return new SdSettingService(i0.ɵɵinject(SETTING_CONFIG, 8)); }, token: SdSettingService, providedIn: "root" });
|
|
560
619
|
SdSettingService.decorators = [
|
|
561
620
|
{ type: i0.Injectable, args: [{
|