@brggroup/share-lib 0.1.26 → 0.1.27
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 +64 -22
- 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/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: [{
|