@ibragim-dev-org/ui-forge-library 1.2.8 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -37,11 +37,8 @@ class DateUtils {
|
|
|
37
37
|
const y = date.getFullYear();
|
|
38
38
|
return isUsaDateFormat ? `${m}/${d}/${y}` : `${d}/${m}/${y}`;
|
|
39
39
|
}
|
|
40
|
-
static isUsaDateFormat() {
|
|
41
|
-
|
|
42
|
-
const localeFromNavigator = typeof navigator !== 'undefined' ? navigator.language : undefined;
|
|
43
|
-
const locale = (localeFromIntl || localeFromNavigator || '').toLowerCase();
|
|
44
|
-
return locale === 'en-us' || locale.startsWith('en-us-');
|
|
40
|
+
static isUsaDateFormat(format = undefined) {
|
|
41
|
+
return format === 'usa';
|
|
45
42
|
}
|
|
46
43
|
static setMonthSafe(date, month) {
|
|
47
44
|
const d = new Date(date);
|
|
@@ -239,21 +236,22 @@ class LazyImgDirective {
|
|
|
239
236
|
lazySrc;
|
|
240
237
|
loadError = new EventEmitter();
|
|
241
238
|
observer;
|
|
239
|
+
onError = () => {
|
|
240
|
+
this.loadError.emit();
|
|
241
|
+
};
|
|
242
242
|
constructor(el, lazyService) {
|
|
243
243
|
this.el = el;
|
|
244
244
|
this.lazyService = lazyService;
|
|
245
245
|
}
|
|
246
|
-
onError() {
|
|
247
|
-
this.loadError.emit();
|
|
248
|
-
}
|
|
249
246
|
ngOnInit() {
|
|
250
247
|
const img = this.el.nativeElement;
|
|
251
|
-
|
|
248
|
+
const lazySrc = this.lazySrc?.trim() ?? '';
|
|
249
|
+
if (lazySrc.length === 0 || /(?:^|\/)null(?:[?#].*)?$/i.test(lazySrc)) {
|
|
252
250
|
this.loadError.emit();
|
|
253
251
|
return;
|
|
254
252
|
}
|
|
255
253
|
img.addEventListener('error', this.onError);
|
|
256
|
-
img.setAttribute('data-src',
|
|
254
|
+
img.setAttribute('data-src', lazySrc);
|
|
257
255
|
this.observer = this.lazyService.getObserver();
|
|
258
256
|
this.observer.observe(img);
|
|
259
257
|
}
|
|
@@ -1163,6 +1161,7 @@ class UiDailyCalendarDirective {
|
|
|
1163
1161
|
weekDaysEuropean = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
|
1164
1162
|
weekDaysUsa = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
1165
1163
|
$isRangeSelection = input(false, ...(ngDevMode ? [{ debugName: "$isRangeSelection" }] : []));
|
|
1164
|
+
$dateFormat = input(undefined, ...(ngDevMode ? [{ debugName: "$dateFormat" }] : []));
|
|
1166
1165
|
$minDate = input(undefined, ...(ngDevMode ? [{ debugName: "$minDate" }] : []));
|
|
1167
1166
|
$maxDate = input(undefined, ...(ngDevMode ? [{ debugName: "$maxDate" }] : []));
|
|
1168
1167
|
get weekDays() {
|
|
@@ -1317,7 +1316,7 @@ class UiDailyCalendarDirective {
|
|
|
1317
1316
|
this.$hoverDate.set(date);
|
|
1318
1317
|
}
|
|
1319
1318
|
isUsaDateFormat() {
|
|
1320
|
-
return DateUtils.isUsaDateFormat();
|
|
1319
|
+
return DateUtils.isUsaDateFormat(this.$dateFormat());
|
|
1321
1320
|
}
|
|
1322
1321
|
select(date) {
|
|
1323
1322
|
if (this.isDisabledDate(date)) {
|
|
@@ -1351,14 +1350,14 @@ class UiDailyCalendarDirective {
|
|
|
1351
1350
|
}
|
|
1352
1351
|
}
|
|
1353
1352
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiDailyCalendarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1354
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: UiDailyCalendarDirective, isStandalone: true, selector: "app-ui-daily-calendar", inputs: { $isRangeSelection: { classPropertyName: "$isRangeSelection", publicName: "$isRangeSelection", isSignal: true, isRequired: false, transformFunction: null }, $minDate: { classPropertyName: "$minDate", publicName: "$minDate", isSignal: true, isRequired: false, transformFunction: null }, $maxDate: { classPropertyName: "$maxDate", publicName: "$maxDate", isSignal: true, isRequired: false, transformFunction: null }, $dateStart: { classPropertyName: "$dateStart", publicName: "$dateStart", isSignal: true, isRequired: false, transformFunction: null }, $dateEnd: { classPropertyName: "$dateEnd", publicName: "$dateEnd", isSignal: true, isRequired: false, transformFunction: null }, $currentMonth: { classPropertyName: "$currentMonth", publicName: "$currentMonth", isSignal: true, isRequired: true, transformFunction: null }, $currentYear: { classPropertyName: "$currentYear", publicName: "$currentYear", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { $dateStart: "$dateStartChange", $dateEnd: "$dateEndChange", $currentMonth: "$currentMonthChange", $currentYear: "$currentYearChange", $onRangeSelect: "$onRangeSelect", $onSelect: "$onSelect" }, ngImport: i0 });
|
|
1353
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: UiDailyCalendarDirective, isStandalone: true, selector: "app-ui-daily-calendar", inputs: { $isRangeSelection: { classPropertyName: "$isRangeSelection", publicName: "$isRangeSelection", isSignal: true, isRequired: false, transformFunction: null }, $dateFormat: { classPropertyName: "$dateFormat", publicName: "$dateFormat", isSignal: true, isRequired: false, transformFunction: null }, $minDate: { classPropertyName: "$minDate", publicName: "$minDate", isSignal: true, isRequired: false, transformFunction: null }, $maxDate: { classPropertyName: "$maxDate", publicName: "$maxDate", isSignal: true, isRequired: false, transformFunction: null }, $dateStart: { classPropertyName: "$dateStart", publicName: "$dateStart", isSignal: true, isRequired: false, transformFunction: null }, $dateEnd: { classPropertyName: "$dateEnd", publicName: "$dateEnd", isSignal: true, isRequired: false, transformFunction: null }, $currentMonth: { classPropertyName: "$currentMonth", publicName: "$currentMonth", isSignal: true, isRequired: true, transformFunction: null }, $currentYear: { classPropertyName: "$currentYear", publicName: "$currentYear", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { $dateStart: "$dateStartChange", $dateEnd: "$dateEndChange", $currentMonth: "$currentMonthChange", $currentYear: "$currentYearChange", $onRangeSelect: "$onRangeSelect", $onSelect: "$onSelect" }, ngImport: i0 });
|
|
1355
1354
|
}
|
|
1356
1355
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiDailyCalendarDirective, decorators: [{
|
|
1357
1356
|
type: Directive,
|
|
1358
1357
|
args: [{
|
|
1359
1358
|
selector: 'app-ui-daily-calendar',
|
|
1360
1359
|
}]
|
|
1361
|
-
}], propDecorators: { $isRangeSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRangeSelection", required: false }] }], $minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$minDate", required: false }] }], $maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$maxDate", required: false }] }], $dateStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateStart", required: false }] }, { type: i0.Output, args: ["$dateStartChange"] }], $dateEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateEnd", required: false }] }, { type: i0.Output, args: ["$dateEndChange"] }], $currentMonth: [{ type: i0.Input, args: [{ isSignal: true, alias: "$currentMonth", required: true }] }, { type: i0.Output, args: ["$currentMonthChange"] }], $currentYear: [{ type: i0.Input, args: [{ isSignal: true, alias: "$currentYear", required: true }] }, { type: i0.Output, args: ["$currentYearChange"] }], $onRangeSelect: [{ type: i0.Output, args: ["$onRangeSelect"] }], $onSelect: [{ type: i0.Output, args: ["$onSelect"] }] } });
|
|
1360
|
+
}], propDecorators: { $isRangeSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRangeSelection", required: false }] }], $dateFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateFormat", required: false }] }], $minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$minDate", required: false }] }], $maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$maxDate", required: false }] }], $dateStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateStart", required: false }] }, { type: i0.Output, args: ["$dateStartChange"] }], $dateEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateEnd", required: false }] }, { type: i0.Output, args: ["$dateEndChange"] }], $currentMonth: [{ type: i0.Input, args: [{ isSignal: true, alias: "$currentMonth", required: true }] }, { type: i0.Output, args: ["$currentMonthChange"] }], $currentYear: [{ type: i0.Input, args: [{ isSignal: true, alias: "$currentYear", required: true }] }, { type: i0.Output, args: ["$currentYearChange"] }], $onRangeSelect: [{ type: i0.Output, args: ["$onRangeSelect"] }], $onSelect: [{ type: i0.Output, args: ["$onSelect"] }] } });
|
|
1362
1361
|
|
|
1363
1362
|
class UiMonthlyCalendarDirective {
|
|
1364
1363
|
$date = model(new Date(), ...(ngDevMode ? [{ debugName: "$date" }] : []));
|
|
@@ -1469,6 +1468,7 @@ class UiCalendarDropdownDirective {
|
|
|
1469
1468
|
isRangeSelection = false;
|
|
1470
1469
|
minDate = undefined;
|
|
1471
1470
|
maxDate = undefined;
|
|
1471
|
+
dateFormat = undefined;
|
|
1472
1472
|
$close = signal(false, ...(ngDevMode ? [{ debugName: "$close" }] : []));
|
|
1473
1473
|
$height = signal(0, ...(ngDevMode ? [{ debugName: "$height" }] : []));
|
|
1474
1474
|
$width = signal(0, ...(ngDevMode ? [{ debugName: "$width" }] : []));
|
|
@@ -1538,7 +1538,7 @@ class UiCalendarDropdownDirective {
|
|
|
1538
1538
|
this.$width.set(size.width);
|
|
1539
1539
|
}
|
|
1540
1540
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiCalendarDropdownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1541
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: UiCalendarDropdownDirective, isStandalone: true, selector: "app-ui-calendar-dropdown-calendar", inputs: { action: "action", rangeSelect: "rangeSelect", startDate: "startDate", endDate: "endDate", isRangeSelection: "isRangeSelection", minDate: "minDate", maxDate: "maxDate" }, usesOnChanges: true, ngImport: i0 });
|
|
1541
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: UiCalendarDropdownDirective, isStandalone: true, selector: "app-ui-calendar-dropdown-calendar", inputs: { action: "action", rangeSelect: "rangeSelect", startDate: "startDate", endDate: "endDate", isRangeSelection: "isRangeSelection", minDate: "minDate", maxDate: "maxDate", dateFormat: "dateFormat" }, usesOnChanges: true, ngImport: i0 });
|
|
1542
1542
|
}
|
|
1543
1543
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiCalendarDropdownDirective, decorators: [{
|
|
1544
1544
|
type: Directive,
|
|
@@ -1559,6 +1559,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
1559
1559
|
type: Input
|
|
1560
1560
|
}], maxDate: [{
|
|
1561
1561
|
type: Input
|
|
1562
|
+
}], dateFormat: [{
|
|
1563
|
+
type: Input
|
|
1562
1564
|
}] } });
|
|
1563
1565
|
|
|
1564
1566
|
const typescript = {
|
|
@@ -3252,6 +3254,7 @@ class UiInputDirective extends UiFieldBaseDirective {
|
|
|
3252
3254
|
renderer;
|
|
3253
3255
|
$size = input('medium', ...(ngDevMode ? [{ debugName: "$size" }] : []));
|
|
3254
3256
|
$placeholder = input('', ...(ngDevMode ? [{ debugName: "$placeholder" }] : []));
|
|
3257
|
+
$maxLength = input(undefined, ...(ngDevMode ? [{ debugName: "$maxLength" }] : []));
|
|
3255
3258
|
$inputMode = input('text', ...(ngDevMode ? [{ debugName: "$inputMode" }] : []));
|
|
3256
3259
|
$label = input('', ...(ngDevMode ? [{ debugName: "$label" }] : []));
|
|
3257
3260
|
$shouldFocusedAfterViewInit = input(false, ...(ngDevMode ? [{ debugName: "$shouldFocusedAfterViewInit" }] : []));
|
|
@@ -3283,14 +3286,14 @@ class UiInputDirective extends UiFieldBaseDirective {
|
|
|
3283
3286
|
});
|
|
3284
3287
|
}
|
|
3285
3288
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiInputDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3286
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: UiInputDirective, isStandalone: true, selector: "app-ui-input", inputs: { $size: { classPropertyName: "$size", publicName: "$size", isSignal: true, isRequired: false, transformFunction: null }, $placeholder: { classPropertyName: "$placeholder", publicName: "$placeholder", isSignal: true, isRequired: false, transformFunction: null }, $inputMode: { classPropertyName: "$inputMode", publicName: "$inputMode", isSignal: true, isRequired: false, transformFunction: null }, $label: { classPropertyName: "$label", publicName: "$label", isSignal: true, isRequired: false, transformFunction: null }, $shouldFocusedAfterViewInit: { classPropertyName: "$shouldFocusedAfterViewInit", publicName: "$shouldFocusedAfterViewInit", isSignal: true, isRequired: false, transformFunction: null }, $isRounded: { classPropertyName: "$isRounded", publicName: "$isRounded", isSignal: true, isRequired: false, transformFunction: null }, $hideValidatorErrors: { classPropertyName: "$hideValidatorErrors", publicName: "$hideValidatorErrors", isSignal: true, isRequired: false, transformFunction: null }, $icon: { classPropertyName: "$icon", publicName: "$icon", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
|
|
3289
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: UiInputDirective, isStandalone: true, selector: "app-ui-input", inputs: { $size: { classPropertyName: "$size", publicName: "$size", isSignal: true, isRequired: false, transformFunction: null }, $placeholder: { classPropertyName: "$placeholder", publicName: "$placeholder", isSignal: true, isRequired: false, transformFunction: null }, $maxLength: { classPropertyName: "$maxLength", publicName: "$maxLength", isSignal: true, isRequired: false, transformFunction: null }, $inputMode: { classPropertyName: "$inputMode", publicName: "$inputMode", isSignal: true, isRequired: false, transformFunction: null }, $label: { classPropertyName: "$label", publicName: "$label", isSignal: true, isRequired: false, transformFunction: null }, $shouldFocusedAfterViewInit: { classPropertyName: "$shouldFocusedAfterViewInit", publicName: "$shouldFocusedAfterViewInit", isSignal: true, isRequired: false, transformFunction: null }, $isRounded: { classPropertyName: "$isRounded", publicName: "$isRounded", isSignal: true, isRequired: false, transformFunction: null }, $hideValidatorErrors: { classPropertyName: "$hideValidatorErrors", publicName: "$hideValidatorErrors", isSignal: true, isRequired: false, transformFunction: null }, $icon: { classPropertyName: "$icon", publicName: "$icon", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
|
|
3287
3290
|
}
|
|
3288
3291
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiInputDirective, decorators: [{
|
|
3289
3292
|
type: Directive,
|
|
3290
3293
|
args: [{
|
|
3291
3294
|
selector: 'app-ui-input',
|
|
3292
3295
|
}]
|
|
3293
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { $size: [{ type: i0.Input, args: [{ isSignal: true, alias: "$size", required: false }] }], $placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "$placeholder", required: false }] }], $inputMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "$inputMode", required: false }] }], $label: [{ type: i0.Input, args: [{ isSignal: true, alias: "$label", required: false }] }], $shouldFocusedAfterViewInit: [{ type: i0.Input, args: [{ isSignal: true, alias: "$shouldFocusedAfterViewInit", required: false }] }], $isRounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRounded", required: false }] }], $hideValidatorErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "$hideValidatorErrors", required: false }] }], $icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "$icon", required: false }] }] } });
|
|
3296
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { $size: [{ type: i0.Input, args: [{ isSignal: true, alias: "$size", required: false }] }], $placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "$placeholder", required: false }] }], $maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "$maxLength", required: false }] }], $inputMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "$inputMode", required: false }] }], $label: [{ type: i0.Input, args: [{ isSignal: true, alias: "$label", required: false }] }], $shouldFocusedAfterViewInit: [{ type: i0.Input, args: [{ isSignal: true, alias: "$shouldFocusedAfterViewInit", required: false }] }], $isRounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRounded", required: false }] }], $hideValidatorErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "$hideValidatorErrors", required: false }] }], $icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "$icon", required: false }] }] } });
|
|
3294
3297
|
|
|
3295
3298
|
class UiInputCountryDirective extends UiInputDirective {
|
|
3296
3299
|
$selectedCountry = signal(emptyCountry, ...(ngDevMode ? [{ debugName: "$selectedCountry" }] : []));
|
|
@@ -3353,6 +3356,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
3353
3356
|
class UIInputDateDirective extends UiInputDirective {
|
|
3354
3357
|
$isOpen = signal(false, ...(ngDevMode ? [{ debugName: "$isOpen" }] : []));
|
|
3355
3358
|
$isRangeSelection = input(false, ...(ngDevMode ? [{ debugName: "$isRangeSelection" }] : []));
|
|
3359
|
+
$dateFormat = input(undefined, ...(ngDevMode ? [{ debugName: "$dateFormat" }] : []));
|
|
3356
3360
|
$dividePattern = input('/', ...(ngDevMode ? [{ debugName: "$dividePattern" }] : []));
|
|
3357
3361
|
$minDate = input(undefined, ...(ngDevMode ? [{ debugName: "$minDate" }] : []));
|
|
3358
3362
|
$maxDate = input(undefined, ...(ngDevMode ? [{ debugName: "$maxDate" }] : []));
|
|
@@ -3371,7 +3375,7 @@ class UIInputDateDirective extends UiInputDirective {
|
|
|
3371
3375
|
return day + pattern + month + pattern + date.getFullYear();
|
|
3372
3376
|
}
|
|
3373
3377
|
isUsaDateFormat() {
|
|
3374
|
-
return DateUtils.isUsaDateFormat();
|
|
3378
|
+
return DateUtils.isUsaDateFormat(this.$dateFormat());
|
|
3375
3379
|
}
|
|
3376
3380
|
setRangeDates(dates) {
|
|
3377
3381
|
if (!dates.start) {
|
|
@@ -3434,14 +3438,14 @@ class UIInputDateDirective extends UiInputDirective {
|
|
|
3434
3438
|
return formatSingle(limited);
|
|
3435
3439
|
}
|
|
3436
3440
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UIInputDateDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3437
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.1", type: UIInputDateDirective, isStandalone: true, selector: "app-ui-input-date", inputs: { $isRangeSelection: { classPropertyName: "$isRangeSelection", publicName: "$isRangeSelection", isSignal: true, isRequired: false, transformFunction: null }, $dividePattern: { classPropertyName: "$dividePattern", publicName: "$dividePattern", isSignal: true, isRequired: false, transformFunction: null }, $minDate: { classPropertyName: "$minDate", publicName: "$minDate", isSignal: true, isRequired: false, transformFunction: null }, $maxDate: { classPropertyName: "$maxDate", publicName: "$maxDate", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "$inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
|
|
3441
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.1", type: UIInputDateDirective, isStandalone: true, selector: "app-ui-input-date", inputs: { $isRangeSelection: { classPropertyName: "$isRangeSelection", publicName: "$isRangeSelection", isSignal: true, isRequired: false, transformFunction: null }, $dateFormat: { classPropertyName: "$dateFormat", publicName: "$dateFormat", isSignal: true, isRequired: false, transformFunction: null }, $dividePattern: { classPropertyName: "$dividePattern", publicName: "$dividePattern", isSignal: true, isRequired: false, transformFunction: null }, $minDate: { classPropertyName: "$minDate", publicName: "$minDate", isSignal: true, isRequired: false, transformFunction: null }, $maxDate: { classPropertyName: "$maxDate", publicName: "$maxDate", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "$inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
|
|
3438
3442
|
}
|
|
3439
3443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UIInputDateDirective, decorators: [{
|
|
3440
3444
|
type: Directive,
|
|
3441
3445
|
args: [{
|
|
3442
3446
|
selector: 'app-ui-input-date',
|
|
3443
3447
|
}]
|
|
3444
|
-
}], propDecorators: { $isRangeSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRangeSelection", required: false }] }], $dividePattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dividePattern", required: false }] }], $minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$minDate", required: false }] }], $maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$maxDate", required: false }] }], $inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
|
|
3448
|
+
}], propDecorators: { $isRangeSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isRangeSelection", required: false }] }], $dateFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dateFormat", required: false }] }], $dividePattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "$dividePattern", required: false }] }], $minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$minDate", required: false }] }], $maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "$maxDate", required: false }] }], $inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
|
|
3445
3449
|
|
|
3446
3450
|
class UIPhoneNumberDirective extends UiInputDirective {
|
|
3447
3451
|
$selectedCountry = signal(emptyCountry, ...(ngDevMode ? [{ debugName: "$selectedCountry" }] : []));
|
|
@@ -3600,6 +3604,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
3600
3604
|
}] } });
|
|
3601
3605
|
|
|
3602
3606
|
class UiInputTimeDirective extends UiInputDirective {
|
|
3607
|
+
$timeFormat = input(undefined, ...(ngDevMode ? [{ debugName: "$timeFormat" }] : []));
|
|
3603
3608
|
get times() {
|
|
3604
3609
|
const items = [];
|
|
3605
3610
|
for (let hour = 0; hour < 24; hour++) {
|
|
@@ -3609,7 +3614,7 @@ class UiInputTimeDirective extends UiInputDirective {
|
|
|
3609
3614
|
return items;
|
|
3610
3615
|
}
|
|
3611
3616
|
get inputMode() {
|
|
3612
|
-
return this.
|
|
3617
|
+
return this.is12HourFormat() ? 'text' : 'numeric';
|
|
3613
3618
|
}
|
|
3614
3619
|
$inputElement = viewChild('input', ...(ngDevMode ? [{ debugName: "$inputElement" }] : []));
|
|
3615
3620
|
$isOpen = signal(false, ...(ngDevMode ? [{ debugName: "$isOpen" }] : []));
|
|
@@ -3627,7 +3632,7 @@ class UiInputTimeDirective extends UiInputDirective {
|
|
|
3627
3632
|
const oldMeridiemLength = this.extractMeridiem(oldValue).length;
|
|
3628
3633
|
const newMeridiemLength = this.extractMeridiem(newValue).length;
|
|
3629
3634
|
const meridiemAdded = newMeridiemLength > oldMeridiemLength;
|
|
3630
|
-
const meridiemFormatted = this.
|
|
3635
|
+
const meridiemFormatted = this.is12HourFormat() && oldValue !== newValue;
|
|
3631
3636
|
super.onInput(newValue);
|
|
3632
3637
|
inputElement.value = newValue;
|
|
3633
3638
|
if (colonAdded || meridiemAdded || meridiemFormatted) {
|
|
@@ -3641,7 +3646,7 @@ class UiInputTimeDirective extends UiInputDirective {
|
|
|
3641
3646
|
if (!value) {
|
|
3642
3647
|
return '';
|
|
3643
3648
|
}
|
|
3644
|
-
if (this.
|
|
3649
|
+
if (this.is12HourFormat()) {
|
|
3645
3650
|
return this.mask12HourTime(value);
|
|
3646
3651
|
}
|
|
3647
3652
|
const digits = value.replace(/\D/g, '').slice(0, 4);
|
|
@@ -3730,11 +3735,11 @@ class UiInputTimeDirective extends UiInputDirective {
|
|
|
3730
3735
|
}
|
|
3731
3736
|
return '';
|
|
3732
3737
|
}
|
|
3733
|
-
|
|
3734
|
-
return
|
|
3738
|
+
is12HourFormat() {
|
|
3739
|
+
return this.$timeFormat() === '12h';
|
|
3735
3740
|
}
|
|
3736
3741
|
formatTime(hour, minute) {
|
|
3737
|
-
if (!this.
|
|
3742
|
+
if (!this.is12HourFormat()) {
|
|
3738
3743
|
return `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
|
|
3739
3744
|
}
|
|
3740
3745
|
const period = hour >= 12 ? 'PM' : 'AM';
|
|
@@ -3742,14 +3747,14 @@ class UiInputTimeDirective extends UiInputDirective {
|
|
|
3742
3747
|
return `${normalizedHour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')} ${period}`;
|
|
3743
3748
|
}
|
|
3744
3749
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiInputTimeDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3745
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.1", type: UiInputTimeDirective, isStandalone: true, selector: "app-ui-input-time", viewQueries: [{ propertyName: "$inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
|
|
3750
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.1", type: UiInputTimeDirective, isStandalone: true, selector: "app-ui-input-time", inputs: { $timeFormat: { classPropertyName: "$timeFormat", publicName: "$timeFormat", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "$inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
|
|
3746
3751
|
}
|
|
3747
3752
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiInputTimeDirective, decorators: [{
|
|
3748
3753
|
type: Directive,
|
|
3749
3754
|
args: [{
|
|
3750
3755
|
selector: 'app-ui-input-time',
|
|
3751
3756
|
}]
|
|
3752
|
-
}], propDecorators: { $inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
|
|
3757
|
+
}], propDecorators: { $timeFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "$timeFormat", required: false }] }], $inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
|
|
3753
3758
|
|
|
3754
3759
|
class UiValidationErrorsDirective {
|
|
3755
3760
|
$isError = input(false, ...(ngDevMode ? [{ debugName: "$isError" }] : []));
|
|
@@ -3766,7 +3771,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
3766
3771
|
|
|
3767
3772
|
class UiTimeDropdownDirective {
|
|
3768
3773
|
$close = signal(false, ...(ngDevMode ? [{ debugName: "$close" }] : []));
|
|
3769
|
-
is12HourFormat = new Intl.DateTimeFormat(undefined, { hour: 'numeric' }).resolvedOptions().hour12 ?? false;
|
|
3770
3774
|
$hourForm = signal('', ...(ngDevMode ? [{ debugName: "$hourForm" }] : []));
|
|
3771
3775
|
$minuteForm = signal('', ...(ngDevMode ? [{ debugName: "$minuteForm" }] : []));
|
|
3772
3776
|
$periodForm = signal('', ...(ngDevMode ? [{ debugName: "$periodForm" }] : []));
|
|
@@ -3775,39 +3779,28 @@ class UiTimeDropdownDirective {
|
|
|
3775
3779
|
$period = form(this.$periodForm);
|
|
3776
3780
|
action = () => { };
|
|
3777
3781
|
initialValue = null;
|
|
3782
|
+
timeFormat = undefined;
|
|
3783
|
+
get is12HourFormat() {
|
|
3784
|
+
return this.timeFormat === '12h';
|
|
3785
|
+
}
|
|
3778
3786
|
ngOnInit() {
|
|
3779
3787
|
this.setInitialTime();
|
|
3780
3788
|
}
|
|
3781
|
-
onHourInput(
|
|
3782
|
-
const
|
|
3783
|
-
if (!inputElement) {
|
|
3784
|
-
return;
|
|
3785
|
-
}
|
|
3786
|
-
const newValue = this.normalizeHourInput(inputElement.value);
|
|
3787
|
-
inputElement.value = newValue;
|
|
3789
|
+
onHourInput(_) {
|
|
3790
|
+
const newValue = this.normalizeHourInput(this.$hour().value());
|
|
3788
3791
|
this.$hour().value.set(newValue);
|
|
3789
3792
|
this.emitTime();
|
|
3790
3793
|
}
|
|
3791
|
-
onMinuteInput(
|
|
3792
|
-
const
|
|
3793
|
-
if (!inputElement) {
|
|
3794
|
-
return;
|
|
3795
|
-
}
|
|
3796
|
-
const newValue = this.normalizeMinuteInput(inputElement.value);
|
|
3797
|
-
inputElement.value = newValue;
|
|
3794
|
+
onMinuteInput(_) {
|
|
3795
|
+
const newValue = this.normalizeMinuteInput(this.$minute().value());
|
|
3798
3796
|
this.$minute().value.set(newValue);
|
|
3799
3797
|
this.emitTime();
|
|
3800
3798
|
}
|
|
3801
|
-
onPeriodInput(
|
|
3799
|
+
onPeriodInput(_) {
|
|
3802
3800
|
if (!this.is12HourFormat) {
|
|
3803
3801
|
return;
|
|
3804
3802
|
}
|
|
3805
|
-
const
|
|
3806
|
-
if (!inputElement) {
|
|
3807
|
-
return;
|
|
3808
|
-
}
|
|
3809
|
-
const newValue = this.normalizePeriodInput(inputElement.value);
|
|
3810
|
-
inputElement.value = newValue;
|
|
3803
|
+
const newValue = this.normalizePeriodInput(this.$period().value());
|
|
3811
3804
|
this.$period().value.set(newValue);
|
|
3812
3805
|
this.emitTime();
|
|
3813
3806
|
}
|
|
@@ -4005,7 +3998,7 @@ class UiTimeDropdownDirective {
|
|
|
4005
3998
|
this.action(time);
|
|
4006
3999
|
}
|
|
4007
4000
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiTimeDropdownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4008
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: UiTimeDropdownDirective, isStandalone: true, selector: "app-ui-time-dropdown", inputs: { action: "action", initialValue: "initialValue" }, ngImport: i0 });
|
|
4001
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: UiTimeDropdownDirective, isStandalone: true, selector: "app-ui-time-dropdown", inputs: { action: "action", initialValue: "initialValue", timeFormat: "timeFormat" }, ngImport: i0 });
|
|
4009
4002
|
}
|
|
4010
4003
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: UiTimeDropdownDirective, decorators: [{
|
|
4011
4004
|
type: Directive,
|
|
@@ -4016,6 +4009,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
4016
4009
|
type: Input
|
|
4017
4010
|
}], initialValue: [{
|
|
4018
4011
|
type: Input
|
|
4012
|
+
}], timeFormat: [{
|
|
4013
|
+
type: Input
|
|
4019
4014
|
}] } });
|
|
4020
4015
|
|
|
4021
4016
|
/*
|