@brggroup/share-lib 0.1.26 → 0.1.28
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/fesm2022/brggroup-share-lib.mjs +135 -84
- package/fesm2022/brggroup-share-lib.mjs.map +1 -1
- package/lib/components/extend-date-picker/extend-date-picker.d.ts +2 -1
- package/lib/components/extend-date-picker/extend-date-picker.d.ts.map +1 -1
- package/lib/components/layout/layout-user/layout-user.d.ts +3 -0
- package/lib/components/layout/layout-user/layout-user.d.ts.map +1 -1
- package/lib/directive/date-input-parser.directive.d.ts +3 -3
- package/lib/directive/date-input-parser.directive.d.ts.map +1 -1
- package/lib/helper/date.helper.d.ts +1 -1
- package/lib/helper/date.helper.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ import * as i5 from 'ng-zorro-antd/form';
|
|
|
30
30
|
import { NzFormModule } from 'ng-zorro-antd/form';
|
|
31
31
|
import * as i5$1 from 'ng-zorro-antd/date-picker';
|
|
32
32
|
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
|
|
33
|
-
import { startOfWeek, endOfWeek, subWeeks, startOfMonth, endOfMonth, subMonths } from 'date-fns';
|
|
33
|
+
import { parse, isValid, startOfWeek, endOfWeek, subWeeks, startOfMonth, endOfMonth, subMonths } from 'date-fns';
|
|
34
34
|
import * as i6 from 'ng-zorro-antd/input-number';
|
|
35
35
|
import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
|
|
36
36
|
import * as i6$1 from 'ng-zorro-antd/input';
|
|
@@ -1979,10 +1979,27 @@ class DateTimeHelper {
|
|
|
1979
1979
|
return n.toString().padStart(2, '0');
|
|
1980
1980
|
}
|
|
1981
1981
|
static parser(dateStr) {
|
|
1982
|
-
if (!dateStr
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1982
|
+
if (!dateStr)
|
|
1983
|
+
return '';
|
|
1984
|
+
dateStr = dateStr.trim();
|
|
1985
|
+
let timeStr = '00:00'; // Mặc định giờ/phút nếu người dùng không nhập
|
|
1986
|
+
let datePart = dateStr;
|
|
1987
|
+
// 1. Tách phần Giờ và phần Ngày nếu chuỗi có chứa khoảng trắng
|
|
1988
|
+
if (dateStr.includes(' ')) {
|
|
1989
|
+
const splitBySpace = dateStr.split(' ');
|
|
1990
|
+
// Tìm xem phần nào chứa ':' (giờ) và phần nào chứa '/' (ngày) hoặc số
|
|
1991
|
+
const hasTime = splitBySpace.find((s) => s.includes(':'));
|
|
1992
|
+
const hasDate = splitBySpace.find((s) => !s.includes(':'));
|
|
1993
|
+
if (hasTime)
|
|
1994
|
+
timeStr = hasTime;
|
|
1995
|
+
if (hasDate)
|
|
1996
|
+
datePart = hasDate;
|
|
1997
|
+
}
|
|
1998
|
+
// 2. Xử lý DatePart (Logic cũ của bạn)
|
|
1999
|
+
if (!datePart.includes('/')) {
|
|
2000
|
+
datePart = this.formatNumberToDate(datePart);
|
|
2001
|
+
}
|
|
2002
|
+
const parts = datePart.split('/');
|
|
1986
2003
|
const current = new Date();
|
|
1987
2004
|
let normalizedValue = '';
|
|
1988
2005
|
if (parts.length === 1 && /^\d{1,2}$/.test(parts[0])) {
|
|
@@ -1995,15 +2012,28 @@ class DateTimeHelper {
|
|
|
1995
2012
|
}
|
|
1996
2013
|
else {
|
|
1997
2014
|
// Đã đủ 3 phần
|
|
1998
|
-
normalizedValue =
|
|
2015
|
+
normalizedValue = datePart;
|
|
1999
2016
|
}
|
|
2017
|
+
// 3. Xử lý TimePart & Parse thành Date
|
|
2000
2018
|
if (normalizedValue) {
|
|
2001
|
-
const
|
|
2002
|
-
const day = +
|
|
2003
|
-
const month = +
|
|
2004
|
-
const year = +
|
|
2019
|
+
const dateParts = normalizedValue.split('/');
|
|
2020
|
+
const day = +dateParts[0];
|
|
2021
|
+
const month = +dateParts[1];
|
|
2022
|
+
const year = +dateParts[2];
|
|
2023
|
+
let hours = 0;
|
|
2024
|
+
let minutes = 0;
|
|
2025
|
+
if (timeStr.includes(':')) {
|
|
2026
|
+
const timeParts = timeStr.split(':');
|
|
2027
|
+
hours = +timeParts[0] || 0;
|
|
2028
|
+
minutes = +timeParts[1] || 0;
|
|
2029
|
+
}
|
|
2030
|
+
// Giả định DateTimeHelper.isValidDate của bạn vẫn chỉ check valid ngày/tháng/năm
|
|
2005
2031
|
if (DateTimeHelper.isValidDate(year, month, day)) {
|
|
2006
|
-
|
|
2032
|
+
// Lưu ý: Nếu DateTimeHelper.createDate của bạn chưa hỗ trợ truyền hours/minutes,
|
|
2033
|
+
// bạn có thể trả về trực tiếp new Date() như sau:
|
|
2034
|
+
return new Date(year, month - 1, day, hours, minutes);
|
|
2035
|
+
// Hoặc nếu bạn nâng cấp hàm createDate:
|
|
2036
|
+
// return DateTimeHelper.createDate(year, month, day, hours, minutes);
|
|
2007
2037
|
}
|
|
2008
2038
|
}
|
|
2009
2039
|
return '';
|
|
@@ -2131,34 +2161,43 @@ class DateInputParserDirective {
|
|
|
2131
2161
|
this.ngControl = ngControl;
|
|
2132
2162
|
}
|
|
2133
2163
|
ngAfterViewInit() {
|
|
2134
|
-
// Tìm thẻ input bên trong nz-date-picker
|
|
2135
2164
|
this.inputElement = this.el.nativeElement.querySelector('input');
|
|
2136
|
-
// Gắn listener blur vào input
|
|
2137
2165
|
if (this.inputElement) {
|
|
2138
2166
|
this.inputElement.addEventListener('blur', this.blurHandler);
|
|
2139
2167
|
}
|
|
2140
2168
|
}
|
|
2141
2169
|
ngOnDestroy() {
|
|
2142
|
-
// Cleanup blur listener để tránh memory leak
|
|
2143
2170
|
if (this.inputElement) {
|
|
2144
2171
|
this.inputElement.removeEventListener('blur', this.blurHandler);
|
|
2145
2172
|
}
|
|
2146
2173
|
}
|
|
2147
2174
|
onEnter() {
|
|
2148
2175
|
this.tryParseAndSet();
|
|
2149
|
-
this.inputElement?.blur();
|
|
2176
|
+
this.inputElement?.blur();
|
|
2150
2177
|
}
|
|
2151
2178
|
tryParseAndSet() {
|
|
2152
2179
|
if (!this.inputElement)
|
|
2153
2180
|
return;
|
|
2154
2181
|
const rawValue = this.inputElement.value.trim();
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2182
|
+
if (!rawValue)
|
|
2183
|
+
return;
|
|
2184
|
+
// 1. Cố gắng parse bằng date-fns với format truyền vào (ví dụ: 'HH:mm dd/MM/yyyy')
|
|
2185
|
+
const parsedDate = parse(rawValue, this.format, new Date());
|
|
2186
|
+
if (isValid(parsedDate)) {
|
|
2187
|
+
// Nếu parse thành công theo format -> set value
|
|
2188
|
+
this.ngControl?.control?.setValue(parsedDate);
|
|
2189
|
+
}
|
|
2190
|
+
else {
|
|
2191
|
+
// 2. (Tùy chọn) Fallback lại hàm parser cũ nếu người dùng nhập sai format
|
|
2192
|
+
// nhưng helper của bạn có khả năng "đoán" được
|
|
2193
|
+
const fallbackParsed = DateTimeHelper.parser(rawValue);
|
|
2194
|
+
if (fallbackParsed) {
|
|
2195
|
+
this.ngControl?.control?.setValue(fallbackParsed);
|
|
2196
|
+
}
|
|
2158
2197
|
}
|
|
2159
2198
|
}
|
|
2160
2199
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: DateInputParserDirective, deps: [{ token: i0.ElementRef }, { token: i2$1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2161
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.7", type: DateInputParserDirective, isStandalone: true, selector: "nz-date-picker", inputs: { format: "format" }, host: { listeners: { "keyup.enter": "onEnter()" } }, ngImport: i0 });
|
|
2200
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.7", type: DateInputParserDirective, isStandalone: true, selector: "nz-date-picker", inputs: { format: ["nzFormat", "format"] }, host: { listeners: { "keyup.enter": "onEnter()" } }, ngImport: i0 });
|
|
2162
2201
|
}
|
|
2163
2202
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: DateInputParserDirective, decorators: [{
|
|
2164
2203
|
type: Directive,
|
|
@@ -2171,7 +2210,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
|
2171
2210
|
type: Self
|
|
2172
2211
|
}] }], propDecorators: { format: [{
|
|
2173
2212
|
type: Input,
|
|
2174
|
-
args: ['
|
|
2213
|
+
args: ['nzFormat']
|
|
2175
2214
|
}], onEnter: [{
|
|
2176
2215
|
type: HostListener,
|
|
2177
2216
|
args: ['keyup.enter']
|
|
@@ -2184,6 +2223,7 @@ class ExtendDatePicker {
|
|
|
2184
2223
|
placeHolder = '';
|
|
2185
2224
|
labelAlign = 'left';
|
|
2186
2225
|
floatingLabel = false;
|
|
2226
|
+
showTime = false;
|
|
2187
2227
|
/**
|
|
2188
2228
|
* default = 8
|
|
2189
2229
|
*/
|
|
@@ -2291,7 +2331,7 @@ class ExtendDatePicker {
|
|
|
2291
2331
|
invalidDate: 'Ngày không hợp lệ',
|
|
2292
2332
|
};
|
|
2293
2333
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: ExtendDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2294
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.7", type: ExtendDatePicker, isStandalone: true, selector: "extend-date-picker", inputs: { dateFormat: "dateFormat", layOutType: "layOutType", label: "label", placeHolder: "placeHolder", labelAlign: "labelAlign", floatingLabel: "floatingLabel", labelSpan: "labelSpan", labelFlex: "labelFlex", inputFlex: "inputFlex", disabled: "disabled", required: "required", isSubmited: "isSubmited", noBottom: "noBottom", selectModeType: "selectModeType", inputWidth: "inputWidth", inputHeight: "inputHeight", borderBottomOnly: "borderBottomOnly", displayInline: "displayInline", size: "size", minDate: "minDate", maxDate: "maxDate", lstItem: "lstItem", displayField: "displayField", valueField: "valueField", formData: "formData", controlName: "controlName", _ngModel: "_ngModel", isTouched: "isTouched", inputErrorMessage: "inputErrorMessage", errorMessages: "errorMessages" }, outputs: { _ngModelChange: "_ngModelChange" }, ngImport: i0, template: "<div\n class=\"extend-wrapper\"\n [ngClass]=\"[layOutType, floatingLabel ? 'floating-label' : '']\"\n [ngStyle]=\"{ display: displayInline ? 'inline' : null }\"\n>\n @if (controlName) {\n <div [formGroup]=\"formData\">\n <nz-form-item>\n <nz-form-label\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? labelSpan : null\"\n [nzFlex]=\"labelFlex\"\n [nzLabelAlign]=\"labelAlign\"\n [nzRequired]=\"required\"\n [nzFor]=\"controlName\"\n nzNoColon\n nzLabelWrap\n >\n {{ label }}\n </nz-form-label>\n <nz-form-control\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? 24 - labelSpan : null\"\n [nzFlex]=\"inputFlex\"\n [ngClass]=\"{ 'full-width': layOutType == 'vertical' }\"\n [nzErrorTip]=\"dynamicErrorTemplate\"\n >\n <nz-date-picker\n class=\"full-width\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [nzSize]=\"size\"\n [formControlName]=\"controlName\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n ></nz-date-picker>\n </nz-form-control>\n </nz-form-item>\n\n <ng-template #dynamicErrorTemplate let-control>\n <ng-container *ngFor=\"let error of errorMessages | keyvalue\">\n <ng-container *ngIf=\"control.hasError(error.key)\">\n {{ error.value }}\n </ng-container>\n </ng-container>\n </ng-template>\n </div>\n } @else {\n @if (label) {\n <nz-form-item>\n <nz-form-label\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? labelSpan : null\"\n [nzFlex]=\"labelFlex\"\n [nzLabelAlign]=\"labelAlign\"\n [nzRequired]=\"required\"\n [nzFor]=\"controlName\"\n nzNoColon\n nzLabelWrap\n >\n {{ label }}\n </nz-form-label>\n <nz-form-control\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? 24 - labelSpan : null\"\n [nzFlex]=\"inputFlex\"\n [ngClass]=\"{ 'full-width': layOutType == 'vertical' }\"\n [nzErrorTip]=\"customValidateStatus\"\n [nzValidateStatus]=\"customValidateStatus ? 'error' : ''\"\n >\n <nz-date-picker\n class=\"full-width\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [nzSize]=\"size\"\n [disabled]=\"disabled\"\n [nzDisabledDate]=\"disabledDate\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n [(ngModel)]=\"_ngModel\"\n (ngModelChange)=\"onNgModelChange($event)\"\n (blur)=\"onBlur()\"\n ></nz-date-picker>\n </nz-form-control>\n </nz-form-item>\n } @else {\n <nz-date-picker\n class=\"full-width\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n [nzSize]=\"size\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"_ngModel\"\n (ngModelChange)=\"onNgModelChange($event)\"\n ></nz-date-picker>\n }\n }\n</div>\n", styles: ["::ng-deep .extend-wrapper.vertical .ant-form-vertical .ant-form-item-label,::ng-deep .extend-wrapper.vertical .ant-col-24.ant-form-item-label,::ng-deep .extend-wrapper.vertical .ant-col-xl-24.ant-form-item-label{padding:0}::ng-deep .floating-label{position:relative;padding-top:14px}::ng-deep .floating-label nz-form-item nz-form-label{position:absolute;top:0;left:6px;background:#fff;z-index:10;font-weight:700;height:18px}::ng-deep .floating-label nz-form-item nz-form-label label{font-size:12px;color:#595959;padding:0 6px;height:18px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i1$3.KeyValuePipe, name: "keyvalue" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i4.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i4.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "component", type: i5.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i5.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i5.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: NzDatePickerModule }, { kind: "component", type: i5$1.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-quarter-picker,nz-year-picker,nz-range-picker", inputs: ["nzAllowClear", "nzAutoFocus", "nzDisabled", "nzBorderless", "nzInputReadOnly", "nzInline", "nzOpen", "nzDisabledDate", "nzLocale", "nzPlaceHolder", "nzPopupStyle", "nzDropdownClassName", "nzSize", "nzStatus", "nzFormat", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzShowToday", "nzMode", "nzShowNow", "nzRanges", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzPlacement", "nzShowWeekNumber", "nzShowTime"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: DateInputParserDirective, selector: "nz-date-picker", inputs: ["
|
|
2334
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.7", type: ExtendDatePicker, isStandalone: true, selector: "extend-date-picker", inputs: { dateFormat: "dateFormat", layOutType: "layOutType", label: "label", placeHolder: "placeHolder", labelAlign: "labelAlign", floatingLabel: "floatingLabel", showTime: "showTime", labelSpan: "labelSpan", labelFlex: "labelFlex", inputFlex: "inputFlex", disabled: "disabled", required: "required", isSubmited: "isSubmited", noBottom: "noBottom", selectModeType: "selectModeType", inputWidth: "inputWidth", inputHeight: "inputHeight", borderBottomOnly: "borderBottomOnly", displayInline: "displayInline", size: "size", minDate: "minDate", maxDate: "maxDate", lstItem: "lstItem", displayField: "displayField", valueField: "valueField", formData: "formData", controlName: "controlName", _ngModel: "_ngModel", isTouched: "isTouched", inputErrorMessage: "inputErrorMessage", errorMessages: "errorMessages" }, outputs: { _ngModelChange: "_ngModelChange" }, ngImport: i0, template: "<div\n class=\"extend-wrapper\"\n [ngClass]=\"[layOutType, floatingLabel ? 'floating-label' : '']\"\n [ngStyle]=\"{ display: displayInline ? 'inline' : null }\"\n>\n @if (controlName) {\n <div [formGroup]=\"formData\">\n <nz-form-item>\n <nz-form-label\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? labelSpan : null\"\n [nzFlex]=\"labelFlex\"\n [nzLabelAlign]=\"labelAlign\"\n [nzRequired]=\"required\"\n [nzFor]=\"controlName\"\n nzNoColon\n nzLabelWrap\n >\n {{ label }}\n </nz-form-label>\n <nz-form-control\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? 24 - labelSpan : null\"\n [nzFlex]=\"inputFlex\"\n [ngClass]=\"{ 'full-width': layOutType == 'vertical' }\"\n [nzErrorTip]=\"dynamicErrorTemplate\"\n >\n <nz-date-picker\n class=\"full-width\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [nzSize]=\"size\"\n [formControlName]=\"controlName\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n [nzShowTime]=\"showTime\"\n ></nz-date-picker>\n </nz-form-control>\n </nz-form-item>\n\n <ng-template #dynamicErrorTemplate let-control>\n <ng-container *ngFor=\"let error of errorMessages | keyvalue\">\n <ng-container *ngIf=\"control.hasError(error.key)\">\n {{ error.value }}\n </ng-container>\n </ng-container>\n </ng-template>\n </div>\n } @else {\n @if (label) {\n <nz-form-item>\n <nz-form-label\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? labelSpan : null\"\n [nzFlex]=\"labelFlex\"\n [nzLabelAlign]=\"labelAlign\"\n [nzRequired]=\"required\"\n [nzFor]=\"controlName\"\n nzNoColon\n nzLabelWrap\n >\n {{ label }}\n </nz-form-label>\n <nz-form-control\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? 24 - labelSpan : null\"\n [nzFlex]=\"inputFlex\"\n [ngClass]=\"{ 'full-width': layOutType == 'vertical' }\"\n [nzErrorTip]=\"customValidateStatus\"\n [nzValidateStatus]=\"customValidateStatus ? 'error' : ''\"\n >\n <nz-date-picker\n class=\"full-width\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [nzSize]=\"size\"\n [disabled]=\"disabled\"\n [nzDisabledDate]=\"disabledDate\"\n [nzShowTime]=\"showTime\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n [(ngModel)]=\"_ngModel\"\n (ngModelChange)=\"onNgModelChange($event)\"\n (blur)=\"onBlur()\"\n ></nz-date-picker>\n </nz-form-control>\n </nz-form-item>\n } @else {\n <nz-date-picker\n class=\"full-width\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n [nzSize]=\"size\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [nzShowTime]=\"showTime\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"_ngModel\"\n (ngModelChange)=\"onNgModelChange($event)\"\n ></nz-date-picker>\n }\n }\n</div>\n", styles: ["::ng-deep .extend-wrapper.vertical .ant-form-vertical .ant-form-item-label,::ng-deep .extend-wrapper.vertical .ant-col-24.ant-form-item-label,::ng-deep .extend-wrapper.vertical .ant-col-xl-24.ant-form-item-label{padding:0}::ng-deep .floating-label{position:relative;padding-top:14px}::ng-deep .floating-label nz-form-item nz-form-label{position:absolute;top:0;left:6px;background:#fff;z-index:10;font-weight:700;height:18px}::ng-deep .floating-label nz-form-item nz-form-label label{font-size:12px;color:#595959;padding:0 6px;height:18px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i1$3.KeyValuePipe, name: "keyvalue" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i4.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i4.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "component", type: i5.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i5.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i5.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: NzDatePickerModule }, { kind: "component", type: i5$1.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-quarter-picker,nz-year-picker,nz-range-picker", inputs: ["nzAllowClear", "nzAutoFocus", "nzDisabled", "nzBorderless", "nzInputReadOnly", "nzInline", "nzOpen", "nzDisabledDate", "nzLocale", "nzPlaceHolder", "nzPopupStyle", "nzDropdownClassName", "nzSize", "nzStatus", "nzFormat", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzShowToday", "nzMode", "nzShowNow", "nzRanges", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzPlacement", "nzShowWeekNumber", "nzShowTime"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: DateInputParserDirective, selector: "nz-date-picker", inputs: ["nzFormat"] }] });
|
|
2295
2335
|
}
|
|
2296
2336
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: ExtendDatePicker, decorators: [{
|
|
2297
2337
|
type: Component,
|
|
@@ -2303,7 +2343,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
|
2303
2343
|
NzDatePickerModule,
|
|
2304
2344
|
TranslateModule,
|
|
2305
2345
|
DateInputParserDirective,
|
|
2306
|
-
], template: "<div\n class=\"extend-wrapper\"\n [ngClass]=\"[layOutType, floatingLabel ? 'floating-label' : '']\"\n [ngStyle]=\"{ display: displayInline ? 'inline' : null }\"\n>\n @if (controlName) {\n <div [formGroup]=\"formData\">\n <nz-form-item>\n <nz-form-label\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? labelSpan : null\"\n [nzFlex]=\"labelFlex\"\n [nzLabelAlign]=\"labelAlign\"\n [nzRequired]=\"required\"\n [nzFor]=\"controlName\"\n nzNoColon\n nzLabelWrap\n >\n {{ label }}\n </nz-form-label>\n <nz-form-control\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? 24 - labelSpan : null\"\n [nzFlex]=\"inputFlex\"\n [ngClass]=\"{ 'full-width': layOutType == 'vertical' }\"\n [nzErrorTip]=\"dynamicErrorTemplate\"\n >\n <nz-date-picker\n class=\"full-width\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [nzSize]=\"size\"\n [formControlName]=\"controlName\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n ></nz-date-picker>\n </nz-form-control>\n </nz-form-item>\n\n <ng-template #dynamicErrorTemplate let-control>\n <ng-container *ngFor=\"let error of errorMessages | keyvalue\">\n <ng-container *ngIf=\"control.hasError(error.key)\">\n {{ error.value }}\n </ng-container>\n </ng-container>\n </ng-template>\n </div>\n } @else {\n @if (label) {\n <nz-form-item>\n <nz-form-label\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? labelSpan : null\"\n [nzFlex]=\"labelFlex\"\n [nzLabelAlign]=\"labelAlign\"\n [nzRequired]=\"required\"\n [nzFor]=\"controlName\"\n nzNoColon\n nzLabelWrap\n >\n {{ label }}\n </nz-form-label>\n <nz-form-control\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? 24 - labelSpan : null\"\n [nzFlex]=\"inputFlex\"\n [ngClass]=\"{ 'full-width': layOutType == 'vertical' }\"\n [nzErrorTip]=\"customValidateStatus\"\n [nzValidateStatus]=\"customValidateStatus ? 'error' : ''\"\n >\n <nz-date-picker\n class=\"full-width\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [nzSize]=\"size\"\n [disabled]=\"disabled\"\n [nzDisabledDate]=\"disabledDate\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n [(ngModel)]=\"_ngModel\"\n (ngModelChange)=\"onNgModelChange($event)\"\n (blur)=\"onBlur()\"\n ></nz-date-picker>\n </nz-form-control>\n </nz-form-item>\n } @else {\n <nz-date-picker\n class=\"full-width\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n [nzSize]=\"size\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"_ngModel\"\n (ngModelChange)=\"onNgModelChange($event)\"\n ></nz-date-picker>\n }\n }\n</div>\n", styles: ["::ng-deep .extend-wrapper.vertical .ant-form-vertical .ant-form-item-label,::ng-deep .extend-wrapper.vertical .ant-col-24.ant-form-item-label,::ng-deep .extend-wrapper.vertical .ant-col-xl-24.ant-form-item-label{padding:0}::ng-deep .floating-label{position:relative;padding-top:14px}::ng-deep .floating-label nz-form-item nz-form-label{position:absolute;top:0;left:6px;background:#fff;z-index:10;font-weight:700;height:18px}::ng-deep .floating-label nz-form-item nz-form-label label{font-size:12px;color:#595959;padding:0 6px;height:18px}\n"] }]
|
|
2346
|
+
], template: "<div\n class=\"extend-wrapper\"\n [ngClass]=\"[layOutType, floatingLabel ? 'floating-label' : '']\"\n [ngStyle]=\"{ display: displayInline ? 'inline' : null }\"\n>\n @if (controlName) {\n <div [formGroup]=\"formData\">\n <nz-form-item>\n <nz-form-label\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? labelSpan : null\"\n [nzFlex]=\"labelFlex\"\n [nzLabelAlign]=\"labelAlign\"\n [nzRequired]=\"required\"\n [nzFor]=\"controlName\"\n nzNoColon\n nzLabelWrap\n >\n {{ label }}\n </nz-form-label>\n <nz-form-control\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? 24 - labelSpan : null\"\n [nzFlex]=\"inputFlex\"\n [ngClass]=\"{ 'full-width': layOutType == 'vertical' }\"\n [nzErrorTip]=\"dynamicErrorTemplate\"\n >\n <nz-date-picker\n class=\"full-width\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [nzSize]=\"size\"\n [formControlName]=\"controlName\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n [nzShowTime]=\"showTime\"\n ></nz-date-picker>\n </nz-form-control>\n </nz-form-item>\n\n <ng-template #dynamicErrorTemplate let-control>\n <ng-container *ngFor=\"let error of errorMessages | keyvalue\">\n <ng-container *ngIf=\"control.hasError(error.key)\">\n {{ error.value }}\n </ng-container>\n </ng-container>\n </ng-template>\n </div>\n } @else {\n @if (label) {\n <nz-form-item>\n <nz-form-label\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? labelSpan : null\"\n [nzFlex]=\"labelFlex\"\n [nzLabelAlign]=\"labelAlign\"\n [nzRequired]=\"required\"\n [nzFor]=\"controlName\"\n nzNoColon\n nzLabelWrap\n >\n {{ label }}\n </nz-form-label>\n <nz-form-control\n [nzSpan]=\"layOutType == 'horizontal' && !labelFlex ? 24 - labelSpan : null\"\n [nzFlex]=\"inputFlex\"\n [ngClass]=\"{ 'full-width': layOutType == 'vertical' }\"\n [nzErrorTip]=\"customValidateStatus\"\n [nzValidateStatus]=\"customValidateStatus ? 'error' : ''\"\n >\n <nz-date-picker\n class=\"full-width\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [nzSize]=\"size\"\n [disabled]=\"disabled\"\n [nzDisabledDate]=\"disabledDate\"\n [nzShowTime]=\"showTime\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n [(ngModel)]=\"_ngModel\"\n (ngModelChange)=\"onNgModelChange($event)\"\n (blur)=\"onBlur()\"\n ></nz-date-picker>\n </nz-form-control>\n </nz-form-item>\n } @else {\n <nz-date-picker\n class=\"full-width\"\n [ngStyle]=\"{\n width: inputWidth,\n height: inputHeight,\n }\"\n [ngClass]=\"{\n 'border-bottom-only': borderBottomOnly,\n }\"\n [nzSize]=\"size\"\n [nzPlaceHolder]=\"placeHolder || ' '\"\n [nzFormat]=\"dateFormat\"\n [nzShowTime]=\"showTime\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"_ngModel\"\n (ngModelChange)=\"onNgModelChange($event)\"\n ></nz-date-picker>\n }\n }\n</div>\n", styles: ["::ng-deep .extend-wrapper.vertical .ant-form-vertical .ant-form-item-label,::ng-deep .extend-wrapper.vertical .ant-col-24.ant-form-item-label,::ng-deep .extend-wrapper.vertical .ant-col-xl-24.ant-form-item-label{padding:0}::ng-deep .floating-label{position:relative;padding-top:14px}::ng-deep .floating-label nz-form-item nz-form-label{position:absolute;top:0;left:6px;background:#fff;z-index:10;font-weight:700;height:18px}::ng-deep .floating-label nz-form-item nz-form-label label{font-size:12px;color:#595959;padding:0 6px;height:18px}\n"] }]
|
|
2307
2347
|
}], propDecorators: { dateFormat: [{
|
|
2308
2348
|
type: Input
|
|
2309
2349
|
}], layOutType: [{
|
|
@@ -2316,6 +2356,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
|
2316
2356
|
type: Input
|
|
2317
2357
|
}], floatingLabel: [{
|
|
2318
2358
|
type: Input
|
|
2359
|
+
}], showTime: [{
|
|
2360
|
+
type: Input
|
|
2319
2361
|
}], labelSpan: [{
|
|
2320
2362
|
type: Input
|
|
2321
2363
|
}], labelFlex: [{
|
|
@@ -6585,68 +6627,6 @@ const fadeSlide = trigger('fadeSlide', [
|
|
|
6585
6627
|
]),
|
|
6586
6628
|
]);
|
|
6587
6629
|
|
|
6588
|
-
class LayoutUser extends BaseComponent {
|
|
6589
|
-
cms = inject(CommonService);
|
|
6590
|
-
authService = inject(AuthService);
|
|
6591
|
-
sessionManager = inject(SessionManagerService);
|
|
6592
|
-
breakpointObserver = inject(BreakpointObserver);
|
|
6593
|
-
TokenStorage = TokenStorage;
|
|
6594
|
-
isXSmall = false;
|
|
6595
|
-
lstOrg = [];
|
|
6596
|
-
ngOnInit() {
|
|
6597
|
-
this.breakpointObserver.observe([Breakpoints.XSmall, Breakpoints.Small]).subscribe((result) => {
|
|
6598
|
-
this.isXSmall = result.matches;
|
|
6599
|
-
});
|
|
6600
|
-
this.getLstOrg();
|
|
6601
|
-
}
|
|
6602
|
-
getLstOrg() {
|
|
6603
|
-
this.cms
|
|
6604
|
-
.ESP({
|
|
6605
|
-
SPN: 'App_User_getLstOrg',
|
|
6606
|
-
})
|
|
6607
|
-
.then((res) => (this.lstOrg = res.Data), (err) => this.handleError(err));
|
|
6608
|
-
}
|
|
6609
|
-
async changeOrg(org) {
|
|
6610
|
-
if (await this.confirm(`Chuyển sang đơn vị: ${org.Name}`)) {
|
|
6611
|
-
this.authService.changeOrg(org).then(async (res) => {
|
|
6612
|
-
if (res) {
|
|
6613
|
-
await this.notiService.success(`Đã chuyển sang đơn vị: ${org.Name}`, '', true);
|
|
6614
|
-
window.location.reload();
|
|
6615
|
-
}
|
|
6616
|
-
}, (err) => this.handleError(err));
|
|
6617
|
-
}
|
|
6618
|
-
}
|
|
6619
|
-
gotoSetting() {
|
|
6620
|
-
this.goto('/admin/user_profile');
|
|
6621
|
-
}
|
|
6622
|
-
logout() {
|
|
6623
|
-
this.sessionManager.logout();
|
|
6624
|
-
}
|
|
6625
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: LayoutUser, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
6626
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.7", type: LayoutUser, isStandalone: true, selector: "layout-user", usesInheritance: true, ngImport: i0, template: "<nz-badge [nzSize]=\"'small'\" [nzCount]=\"0\">\n <button nz-button nzType=\"text\" nzSize=\"small\">\n <nz-icon nzType=\"bell\" nzTheme=\"outline\" style=\"color: #ffffff\" />\n </button>\n</nz-badge>\n\n<button\n *ngIf=\"!isXSmall && TokenStorage.getOrgName()\"\n [@fadeInOut]\n nz-button\n nzType=\"text\"\n nz-dropdown\n [nzDropdownMenu]=\"menuOrg\"\n [nzTrigger]=\"'click'\"\n style=\"height: 50px; color: #ffffff\"\n>\n <nz-icon nzType=\"cluster\" nzTheme=\"outline\" />\n {{ TokenStorage.getOrgName() }}\n</button>\n\n<nz-dropdown-menu #menuOrg=\"nzDropdownMenu\">\n <ul nz-menu>\n @for (org of lstOrg; track $index) {\n <li *ngIf=\"$index > 0\" nz-menu-divider></li>\n <li nz-menu-item (click)=\"changeOrg(org)\">\n <nz-icon nzType=\"swap\" nzTheme=\"outline\" /> {{ org.Name }}\n </li>\n }\n </ul>\n</nz-dropdown-menu>\n\n<button\n nz-button\n nzType=\"text\"\n nz-dropdown\n [nzDropdownMenu]=\"menuUser\"\n [nzTrigger]=\"'click'\"\n style=\"height: 50px; color: #ffffff\"\n>\n <nz-icon nzType=\"user\" nzTheme=\"outline\" />\n {{ TokenStorage.getUserFullname() }}\n</button>\n\n<nz-dropdown-menu #menuUser=\"nzDropdownMenu\">\n <ul nz-menu>\n <li *ngIf=\"!(!isXSmall && TokenStorage.getOrgName())\" nz-menu-item>\n <nz-icon nzType=\"cluster\" nzTheme=\"outline\" /> {{ TokenStorage.getOrgName() }}\n </li>\n <li *ngIf=\"!(!isXSmall && TokenStorage.getOrgName())\" nz-menu-divider></li>\n <li nz-menu-item (click)=\"gotoSetting()\">\n <nz-icon nzType=\"setting\" nzTheme=\"outline\" /> {{ TranslateKey.SETTING | translate }}\n </li>\n <li nz-menu-divider></li>\n <li nz-menu-item (click)=\"logout()\">\n <nz-icon nzType=\"logout\" nzTheme=\"outline\" /> {{ TranslateKey.LOGOUT | translate }}\n </li>\n </ul>\n</nz-dropdown-menu>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: NzLayoutModule }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1$2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i4$2.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i4$2.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i4$2.NzMenuDividerDirective, selector: "[nz-menu-divider]", exportAs: ["nzMenuDivider"] }, { kind: "directive", type: i5$3.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i5$3.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i5$3.NzDropdownButtonDirective, selector: "[nz-button][nz-dropdown]" }, { kind: "ngmodule", type: NzGridModule }, { kind: "ngmodule", type: NzFlexModule }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i8.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i9.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "ngmodule", type: NzTreeModule }, { kind: "ngmodule", type: NzBackTopModule }, { kind: "ngmodule", type: NzDrawerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: NzInputModule }, { kind: "ngmodule", type: NzSegmentedModule }, { kind: "ngmodule", type: NzBadgeModule }, { kind: "component", type: i8$1.NzBadgeComponent, selector: "nz-badge", inputs: ["nzShowZero", "nzShowDot", "nzStandalone", "nzDot", "nzOverflowCount", "nzColor", "nzStyle", "nzText", "nzTitle", "nzStatus", "nzCount", "nzOffset", "nzSize"], exportAs: ["nzBadge"] }], animations: [fadeInOut] });
|
|
6627
|
-
}
|
|
6628
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: LayoutUser, decorators: [{
|
|
6629
|
-
type: Component,
|
|
6630
|
-
args: [{ selector: 'layout-user', imports: [
|
|
6631
|
-
CommonModule,
|
|
6632
|
-
TranslateModule,
|
|
6633
|
-
NzLayoutModule,
|
|
6634
|
-
NzIconModule,
|
|
6635
|
-
NzDropDownModule,
|
|
6636
|
-
NzGridModule,
|
|
6637
|
-
NzFlexModule,
|
|
6638
|
-
NzButtonModule,
|
|
6639
|
-
NzTreeModule,
|
|
6640
|
-
NzBackTopModule,
|
|
6641
|
-
NzDrawerModule,
|
|
6642
|
-
FormsModule,
|
|
6643
|
-
NzInputModule,
|
|
6644
|
-
NzTreeModule,
|
|
6645
|
-
NzSegmentedModule,
|
|
6646
|
-
NzBadgeModule,
|
|
6647
|
-
], animations: [fadeInOut], template: "<nz-badge [nzSize]=\"'small'\" [nzCount]=\"0\">\n <button nz-button nzType=\"text\" nzSize=\"small\">\n <nz-icon nzType=\"bell\" nzTheme=\"outline\" style=\"color: #ffffff\" />\n </button>\n</nz-badge>\n\n<button\n *ngIf=\"!isXSmall && TokenStorage.getOrgName()\"\n [@fadeInOut]\n nz-button\n nzType=\"text\"\n nz-dropdown\n [nzDropdownMenu]=\"menuOrg\"\n [nzTrigger]=\"'click'\"\n style=\"height: 50px; color: #ffffff\"\n>\n <nz-icon nzType=\"cluster\" nzTheme=\"outline\" />\n {{ TokenStorage.getOrgName() }}\n</button>\n\n<nz-dropdown-menu #menuOrg=\"nzDropdownMenu\">\n <ul nz-menu>\n @for (org of lstOrg; track $index) {\n <li *ngIf=\"$index > 0\" nz-menu-divider></li>\n <li nz-menu-item (click)=\"changeOrg(org)\">\n <nz-icon nzType=\"swap\" nzTheme=\"outline\" /> {{ org.Name }}\n </li>\n }\n </ul>\n</nz-dropdown-menu>\n\n<button\n nz-button\n nzType=\"text\"\n nz-dropdown\n [nzDropdownMenu]=\"menuUser\"\n [nzTrigger]=\"'click'\"\n style=\"height: 50px; color: #ffffff\"\n>\n <nz-icon nzType=\"user\" nzTheme=\"outline\" />\n {{ TokenStorage.getUserFullname() }}\n</button>\n\n<nz-dropdown-menu #menuUser=\"nzDropdownMenu\">\n <ul nz-menu>\n <li *ngIf=\"!(!isXSmall && TokenStorage.getOrgName())\" nz-menu-item>\n <nz-icon nzType=\"cluster\" nzTheme=\"outline\" /> {{ TokenStorage.getOrgName() }}\n </li>\n <li *ngIf=\"!(!isXSmall && TokenStorage.getOrgName())\" nz-menu-divider></li>\n <li nz-menu-item (click)=\"gotoSetting()\">\n <nz-icon nzType=\"setting\" nzTheme=\"outline\" /> {{ TranslateKey.SETTING | translate }}\n </li>\n <li nz-menu-divider></li>\n <li nz-menu-item (click)=\"logout()\">\n <nz-icon nzType=\"logout\" nzTheme=\"outline\" /> {{ TranslateKey.LOGOUT | translate }}\n </li>\n </ul>\n</nz-dropdown-menu>\n" }]
|
|
6648
|
-
}] });
|
|
6649
|
-
|
|
6650
6630
|
const URLs$2 = {
|
|
6651
6631
|
getById: '/api/App_Setting/GetById',
|
|
6652
6632
|
getAll: '/api/App_Setting/GetAll',
|
|
@@ -6716,6 +6696,77 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
|
6716
6696
|
}]
|
|
6717
6697
|
}] });
|
|
6718
6698
|
|
|
6699
|
+
class LayoutUser extends BaseComponent {
|
|
6700
|
+
cms = inject(CommonService);
|
|
6701
|
+
authService = inject(AuthService);
|
|
6702
|
+
sessionManager = inject(SessionManagerService);
|
|
6703
|
+
breakpointObserver = inject(BreakpointObserver);
|
|
6704
|
+
settingService = inject(SettingService);
|
|
6705
|
+
TokenStorage = TokenStorage;
|
|
6706
|
+
isXSmall = false;
|
|
6707
|
+
lstOrg = [];
|
|
6708
|
+
isOneUserMultiOrgs = false;
|
|
6709
|
+
ngOnInit() {
|
|
6710
|
+
this.breakpointObserver.observe([Breakpoints.XSmall, Breakpoints.Small]).subscribe((result) => {
|
|
6711
|
+
this.isXSmall = result.matches;
|
|
6712
|
+
});
|
|
6713
|
+
this.settingService.getByCodeAnonymous('ONE_USER_MULTI_ORGS').then((res) => {
|
|
6714
|
+
if (res?.Data) {
|
|
6715
|
+
if (res.Data == '1') {
|
|
6716
|
+
this.isOneUserMultiOrgs = true;
|
|
6717
|
+
this.getLstOrg();
|
|
6718
|
+
}
|
|
6719
|
+
}
|
|
6720
|
+
}, (err) => this.handleError(err));
|
|
6721
|
+
}
|
|
6722
|
+
getLstOrg() {
|
|
6723
|
+
this.cms
|
|
6724
|
+
.ESP({
|
|
6725
|
+
SPN: 'App_User_getLstOrg',
|
|
6726
|
+
})
|
|
6727
|
+
.then((res) => (this.lstOrg = res.Data), (err) => this.handleError(err));
|
|
6728
|
+
}
|
|
6729
|
+
async changeOrg(org) {
|
|
6730
|
+
if (await this.confirm(`Chuyển sang đơn vị: ${org.Name}`)) {
|
|
6731
|
+
this.authService.changeOrg(org).then(async (res) => {
|
|
6732
|
+
if (res) {
|
|
6733
|
+
await this.notiService.success(`Đã chuyển sang đơn vị: ${org.Name}`, '', true);
|
|
6734
|
+
window.location.reload();
|
|
6735
|
+
}
|
|
6736
|
+
}, (err) => this.handleError(err));
|
|
6737
|
+
}
|
|
6738
|
+
}
|
|
6739
|
+
gotoSetting() {
|
|
6740
|
+
this.goto('/admin/user_profile');
|
|
6741
|
+
}
|
|
6742
|
+
logout() {
|
|
6743
|
+
this.sessionManager.logout();
|
|
6744
|
+
}
|
|
6745
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: LayoutUser, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
6746
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.7", type: LayoutUser, isStandalone: true, selector: "layout-user", usesInheritance: true, ngImport: i0, template: "<nz-badge [nzSize]=\"'small'\" [nzCount]=\"0\">\n <button nz-button nzType=\"text\" nzSize=\"small\">\n <nz-icon nzType=\"bell\" nzTheme=\"outline\" style=\"color: #ffffff\" />\n </button>\n</nz-badge>\n\n<button\n *ngIf=\"!isXSmall && TokenStorage.getOrgName()\"\n [@fadeInOut]\n nz-button\n nzType=\"text\"\n nz-dropdown\n [nzDropdownMenu]=\"isOneUserMultiOrgs ? menuOrg : null\"\n [nzTrigger]=\"'click'\"\n style=\"height: 50px; color: #ffffff\"\n>\n <nz-icon nzType=\"cluster\" nzTheme=\"outline\" />\n {{ TokenStorage.getOrgName() }}\n</button>\n\n<nz-dropdown-menu #menuOrg=\"nzDropdownMenu\">\n <ul nz-menu>\n @for (org of lstOrg; track $index) {\n <li *ngIf=\"$index > 0\" nz-menu-divider></li>\n <li nz-menu-item (click)=\"changeOrg(org)\">\n <nz-icon nzType=\"swap\" nzTheme=\"outline\" /> {{ org.Name }}\n </li>\n }\n </ul>\n</nz-dropdown-menu>\n\n<button\n nz-button\n nzType=\"text\"\n nz-dropdown\n [nzDropdownMenu]=\"menuUser\"\n [nzTrigger]=\"'click'\"\n style=\"height: 50px; color: #ffffff\"\n>\n <nz-icon nzType=\"user\" nzTheme=\"outline\" />\n {{ TokenStorage.getUserFullname() }}\n</button>\n\n<nz-dropdown-menu #menuUser=\"nzDropdownMenu\">\n <ul nz-menu>\n <li *ngIf=\"!(!isXSmall && TokenStorage.getOrgName())\" nz-menu-item>\n <nz-icon nzType=\"cluster\" nzTheme=\"outline\" /> {{ TokenStorage.getOrgName() }}\n </li>\n <li *ngIf=\"!(!isXSmall && TokenStorage.getOrgName())\" nz-menu-divider></li>\n <li nz-menu-item (click)=\"gotoSetting()\">\n <nz-icon nzType=\"setting\" nzTheme=\"outline\" /> {{ TranslateKey.SETTING | translate }}\n </li>\n <li nz-menu-divider></li>\n <li nz-menu-item (click)=\"logout()\">\n <nz-icon nzType=\"logout\" nzTheme=\"outline\" /> {{ TranslateKey.LOGOUT | translate }}\n </li>\n </ul>\n</nz-dropdown-menu>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: NzLayoutModule }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1$2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i4$2.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i4$2.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i4$2.NzMenuDividerDirective, selector: "[nz-menu-divider]", exportAs: ["nzMenuDivider"] }, { kind: "directive", type: i5$3.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i5$3.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i5$3.NzDropdownButtonDirective, selector: "[nz-button][nz-dropdown]" }, { kind: "ngmodule", type: NzGridModule }, { kind: "ngmodule", type: NzFlexModule }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i8.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i9.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "ngmodule", type: NzTreeModule }, { kind: "ngmodule", type: NzBackTopModule }, { kind: "ngmodule", type: NzDrawerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: NzInputModule }, { kind: "ngmodule", type: NzSegmentedModule }, { kind: "ngmodule", type: NzBadgeModule }, { kind: "component", type: i8$1.NzBadgeComponent, selector: "nz-badge", inputs: ["nzShowZero", "nzShowDot", "nzStandalone", "nzDot", "nzOverflowCount", "nzColor", "nzStyle", "nzText", "nzTitle", "nzStatus", "nzCount", "nzOffset", "nzSize"], exportAs: ["nzBadge"] }], animations: [fadeInOut] });
|
|
6747
|
+
}
|
|
6748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: LayoutUser, decorators: [{
|
|
6749
|
+
type: Component,
|
|
6750
|
+
args: [{ selector: 'layout-user', imports: [
|
|
6751
|
+
CommonModule,
|
|
6752
|
+
TranslateModule,
|
|
6753
|
+
NzLayoutModule,
|
|
6754
|
+
NzIconModule,
|
|
6755
|
+
NzDropDownModule,
|
|
6756
|
+
NzGridModule,
|
|
6757
|
+
NzFlexModule,
|
|
6758
|
+
NzButtonModule,
|
|
6759
|
+
NzTreeModule,
|
|
6760
|
+
NzBackTopModule,
|
|
6761
|
+
NzDrawerModule,
|
|
6762
|
+
FormsModule,
|
|
6763
|
+
NzInputModule,
|
|
6764
|
+
NzTreeModule,
|
|
6765
|
+
NzSegmentedModule,
|
|
6766
|
+
NzBadgeModule,
|
|
6767
|
+
], animations: [fadeInOut], template: "<nz-badge [nzSize]=\"'small'\" [nzCount]=\"0\">\n <button nz-button nzType=\"text\" nzSize=\"small\">\n <nz-icon nzType=\"bell\" nzTheme=\"outline\" style=\"color: #ffffff\" />\n </button>\n</nz-badge>\n\n<button\n *ngIf=\"!isXSmall && TokenStorage.getOrgName()\"\n [@fadeInOut]\n nz-button\n nzType=\"text\"\n nz-dropdown\n [nzDropdownMenu]=\"isOneUserMultiOrgs ? menuOrg : null\"\n [nzTrigger]=\"'click'\"\n style=\"height: 50px; color: #ffffff\"\n>\n <nz-icon nzType=\"cluster\" nzTheme=\"outline\" />\n {{ TokenStorage.getOrgName() }}\n</button>\n\n<nz-dropdown-menu #menuOrg=\"nzDropdownMenu\">\n <ul nz-menu>\n @for (org of lstOrg; track $index) {\n <li *ngIf=\"$index > 0\" nz-menu-divider></li>\n <li nz-menu-item (click)=\"changeOrg(org)\">\n <nz-icon nzType=\"swap\" nzTheme=\"outline\" /> {{ org.Name }}\n </li>\n }\n </ul>\n</nz-dropdown-menu>\n\n<button\n nz-button\n nzType=\"text\"\n nz-dropdown\n [nzDropdownMenu]=\"menuUser\"\n [nzTrigger]=\"'click'\"\n style=\"height: 50px; color: #ffffff\"\n>\n <nz-icon nzType=\"user\" nzTheme=\"outline\" />\n {{ TokenStorage.getUserFullname() }}\n</button>\n\n<nz-dropdown-menu #menuUser=\"nzDropdownMenu\">\n <ul nz-menu>\n <li *ngIf=\"!(!isXSmall && TokenStorage.getOrgName())\" nz-menu-item>\n <nz-icon nzType=\"cluster\" nzTheme=\"outline\" /> {{ TokenStorage.getOrgName() }}\n </li>\n <li *ngIf=\"!(!isXSmall && TokenStorage.getOrgName())\" nz-menu-divider></li>\n <li nz-menu-item (click)=\"gotoSetting()\">\n <nz-icon nzType=\"setting\" nzTheme=\"outline\" /> {{ TranslateKey.SETTING | translate }}\n </li>\n <li nz-menu-divider></li>\n <li nz-menu-item (click)=\"logout()\">\n <nz-icon nzType=\"logout\" nzTheme=\"outline\" /> {{ TranslateKey.LOGOUT | translate }}\n </li>\n </ul>\n</nz-dropdown-menu>\n" }]
|
|
6768
|
+
}] });
|
|
6769
|
+
|
|
6719
6770
|
const URLs$1 = {
|
|
6720
6771
|
getById: '/api/file/GetById',
|
|
6721
6772
|
getAll: '/api/file/GetAll',
|