@colijnit/corecomponents_v12 261.20.15 → 261.20.17
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.
|
Binary file
|
|
@@ -7190,7 +7190,7 @@ class InputTextComponent extends BaseInputComponent {
|
|
|
7190
7190
|
rightIconData;
|
|
7191
7191
|
selectOnFocus = false;
|
|
7192
7192
|
emptyPlace = false;
|
|
7193
|
-
firstDayOfWeek = '1'; //
|
|
7193
|
+
firstDayOfWeek = '1'; // Monday by default
|
|
7194
7194
|
noStyle = false;
|
|
7195
7195
|
hideArrowButtons = false;
|
|
7196
7196
|
get isDate() {
|
|
@@ -7402,18 +7402,19 @@ class InputTextComponent extends BaseInputComponent {
|
|
|
7402
7402
|
// Internal default first day of week
|
|
7403
7403
|
let weekdayOffset = parseInt(this.firstDayOfWeek, 10);
|
|
7404
7404
|
if (isNaN(weekdayOffset) || weekdayOffset < 1 || weekdayOffset > 7) {
|
|
7405
|
-
weekdayOffset =
|
|
7405
|
+
weekdayOffset = 1; // Monday
|
|
7406
7406
|
}
|
|
7407
|
-
|
|
7407
|
+
// 1 = Monday, 2 = Tuesday, 3 = Wednesday, ..., 7 = Sunday
|
|
7408
|
+
const jsWeekdayIndex = weekdayOffset - 1;
|
|
7408
7409
|
const jan4 = new Date(year, 0, 4);
|
|
7409
7410
|
const jan4Day = jan4.getDay();
|
|
7410
7411
|
const diffToMonday = (jan4Day + 6) % 7;
|
|
7411
7412
|
const firstWeekMonday = new Date(jan4);
|
|
7412
|
-
firstWeekMonday.setDate(jan4.getDate() - diffToMonday);
|
|
7413
|
+
firstWeekMonday.setDate(jan4.getDate() - diffToMonday);
|
|
7413
7414
|
const baseWeekStart = new Date(firstWeekMonday);
|
|
7414
|
-
baseWeekStart.setDate(
|
|
7415
|
-
|
|
7416
|
-
targetDate.setDate(
|
|
7415
|
+
baseWeekStart.setDate(firstWeekMonday.getDate() + (week - 1) * 7);
|
|
7416
|
+
let targetDate = new Date(baseWeekStart);
|
|
7417
|
+
targetDate.setDate(targetDate.getDate() + jsWeekdayIndex);
|
|
7417
7418
|
if (targetDate < today) {
|
|
7418
7419
|
year += 1;
|
|
7419
7420
|
const jan4Next = new Date(year, 0, 4);
|
|
@@ -7422,14 +7423,19 @@ class InputTextComponent extends BaseInputComponent {
|
|
|
7422
7423
|
const firstWeekMondayNext = new Date(jan4Next);
|
|
7423
7424
|
firstWeekMondayNext.setDate(jan4Next.getDate() - diffToMondayNext);
|
|
7424
7425
|
const baseWeekStartNext = new Date(firstWeekMondayNext);
|
|
7425
|
-
baseWeekStartNext.setDate(
|
|
7426
|
-
targetDate
|
|
7427
|
-
targetDate.
|
|
7428
|
-
targetDate.setDate(baseWeekStartNext.getDate() + jsWeekdayIndex);
|
|
7426
|
+
baseWeekStartNext.setDate(firstWeekMondayNext.getDate() + (week - 1) * 7);
|
|
7427
|
+
targetDate = new Date(baseWeekStartNext);
|
|
7428
|
+
targetDate.setDate(targetDate.getDate() + jsWeekdayIndex);
|
|
7429
7429
|
}
|
|
7430
|
-
this.model =
|
|
7430
|
+
this.model = this.formatDateLocal(targetDate);
|
|
7431
7431
|
this.modelChange.emit(this.model);
|
|
7432
7432
|
}
|
|
7433
|
+
formatDateLocal(date) {
|
|
7434
|
+
const year = date.getFullYear();
|
|
7435
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
7436
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
7437
|
+
return `${year}-${month}-${day}`;
|
|
7438
|
+
}
|
|
7433
7439
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: InputTextComponent, deps: [{ token: FormComponent, optional: true }, { token: i0.ChangeDetectorRef }, { token: OverlayService }, { token: FormInputUserModelChangeListenerService }, { token: NgZoneWrapperService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
7434
7440
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: InputTextComponent, isStandalone: false, selector: "co-input-text", inputs: { useContent: "useContent", placeholder: "placeholder", align: "align", type: "type", formatPipe: "formatPipe", min: "min", max: "max", pattern: "pattern", digitsOnly: "digitsOnly", excludePlusMinus: "excludePlusMinus", showClearButton: "showClearButton", keyDownWhiteList: "keyDownWhiteList", showPlaceholderOnFocus: "showPlaceholderOnFocus", leftIcon: "leftIcon", rightIcon: "rightIcon", leftIconData: "leftIconData", rightIconData: "rightIconData", selectOnFocus: "selectOnFocus", emptyPlace: "emptyPlace", firstDayOfWeek: "firstDayOfWeek", noStyle: "noStyle", hideArrowButtons: "hideArrowButtons", model: "model" }, outputs: { leftIconClick: "leftIconClick", leftIconMouseDown: "leftIconMouseDown", leftIconMouseUp: "leftIconMouseUp", rightIconClick: "rightIconClick", rightIconMouseDown: "rightIconMouseDown", rightIconMouseUp: "rightIconMouseUp", clearIconClick: "clearIconClick", isFocused: "isFocused" }, host: { listeners: { "document:pointerup": "handleDocumentPointerUp($event)", "document:pointercancel": "handleDocumentPointerUp($event)" }, properties: { "class.no-style": "this.noStyle", "class.hide-arrows": "this.hideArrowButtons", "class.isDate": "this.isDate", "class.co-input-text": "this.showClass", "class.has-left-icon": "this.hasLeftIcon", "class.has-right-icon": "this.hasRightIcon", "class.has-own-label": "this.hasOwnLabel" } }, providers: [
|
|
7435
7441
|
OverlayService, {
|
|
@@ -9577,6 +9583,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
9577
9583
|
|
|
9578
9584
|
class InputSearchComponent extends BaseInputComponent {
|
|
9579
9585
|
searchIcon = CoreComponentsIcon.Magnifier;
|
|
9586
|
+
inputSearchText;
|
|
9580
9587
|
placeholder;
|
|
9581
9588
|
handleKeydown = true;
|
|
9582
9589
|
search = new EventEmitter();
|
|
@@ -9608,14 +9615,18 @@ class InputSearchComponent extends BaseInputComponent {
|
|
|
9608
9615
|
this.model = model;
|
|
9609
9616
|
this.modelChange.next(this.model);
|
|
9610
9617
|
}
|
|
9618
|
+
requestFocus() {
|
|
9619
|
+
this.inputSearchText.requestFocus();
|
|
9620
|
+
}
|
|
9611
9621
|
isMobileDevice() {
|
|
9612
9622
|
return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
9613
9623
|
}
|
|
9614
9624
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: InputSearchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9615
9625
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: InputSearchComponent, isStandalone: false, selector: "co-input-search", inputs: { placeholder: "placeholder", handleKeydown: "handleKeydown", useLeftIcon: "useLeftIcon", useRightIcon: "useRightIcon", leftIconData: "leftIconData", rightIconData: "rightIconData", centerLabel: "centerLabel" }, outputs: { search: "search", isFocused: "isFocused", leftIconClick: "leftIconClick", rightIconClick: "rightIconClick" }, host: { properties: { "class.center-label": "this.centerLabel", "class.co-input-search": "this.showClass" } }, providers: [
|
|
9616
9626
|
OverlayService
|
|
9617
|
-
], usesInheritance: true, ngImport: i0, template: `
|
|
9627
|
+
], viewQueries: [{ propertyName: "inputSearchText", first: true, predicate: ["inputText"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
9618
9628
|
<co-input-text
|
|
9629
|
+
#inputText
|
|
9619
9630
|
[ngClass]="customCssClass"
|
|
9620
9631
|
[model]="model"
|
|
9621
9632
|
[leftIcon]="useLeftIcon ? searchIcon : null"
|
|
@@ -9645,6 +9656,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
9645
9656
|
selector: 'co-input-search',
|
|
9646
9657
|
template: `
|
|
9647
9658
|
<co-input-text
|
|
9659
|
+
#inputText
|
|
9648
9660
|
[ngClass]="customCssClass"
|
|
9649
9661
|
[model]="model"
|
|
9650
9662
|
[leftIcon]="useLeftIcon ? searchIcon : null"
|
|
@@ -9668,7 +9680,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
9668
9680
|
encapsulation: ViewEncapsulation.None,
|
|
9669
9681
|
standalone: false
|
|
9670
9682
|
}]
|
|
9671
|
-
}], propDecorators: {
|
|
9683
|
+
}], propDecorators: { inputSearchText: [{
|
|
9684
|
+
type: ViewChild,
|
|
9685
|
+
args: ['inputText']
|
|
9686
|
+
}], placeholder: [{
|
|
9672
9687
|
type: Input
|
|
9673
9688
|
}], handleKeydown: [{
|
|
9674
9689
|
type: Input
|
|
@@ -16826,6 +16841,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
16826
16841
|
|
|
16827
16842
|
class InputScannerComponent {
|
|
16828
16843
|
_scannerService;
|
|
16844
|
+
inputSearch;
|
|
16829
16845
|
model;
|
|
16830
16846
|
placeholder;
|
|
16831
16847
|
centerLabel = false;
|
|
@@ -16876,6 +16892,9 @@ class InputScannerComponent {
|
|
|
16876
16892
|
this.barCodeScanned.next(this.model);
|
|
16877
16893
|
this._blockEnterKeydown = false;
|
|
16878
16894
|
}
|
|
16895
|
+
requestFocus() {
|
|
16896
|
+
this.inputSearch.requestFocus();
|
|
16897
|
+
}
|
|
16879
16898
|
_clearTimeout() {
|
|
16880
16899
|
clearTimeout(this._keyDownTimeout);
|
|
16881
16900
|
this._keyDownTimeout = undefined;
|
|
@@ -16884,43 +16903,45 @@ class InputScannerComponent {
|
|
|
16884
16903
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: InputScannerComponent, isStandalone: false, selector: "co-input-scanner", inputs: { model: "model", placeholder: "placeholder", centerLabel: "centerLabel", useLeftIcon: "useLeftIcon", useRightIcon: "useRightIcon", leftIconData: "leftIconData", rightIconData: "rightIconData", customCssClass: "customCssClass", scannerDisabled: "scannerDisabled" }, outputs: { modelChange: "modelChange", leftIconClick: "leftIconClick", rightIconClick: "rightIconClick", search: "search", isFocused: "isFocused", barCodeScanned: "barCodeScanned" }, host: { listeners: { "keydown": "handleKeyDown($event)" }, properties: { "class.co-input-scanner": "this.showClass" } }, providers: [
|
|
16885
16904
|
ScannerService,
|
|
16886
16905
|
OverlayService
|
|
16887
|
-
], ngImport: i0, template: `
|
|
16888
|
-
|
|
16889
|
-
|
|
16890
|
-
|
|
16891
|
-
|
|
16892
|
-
|
|
16893
|
-
|
|
16894
|
-
|
|
16895
|
-
|
|
16896
|
-
|
|
16897
|
-
|
|
16898
|
-
|
|
16899
|
-
|
|
16900
|
-
|
|
16901
|
-
|
|
16902
|
-
|
|
16906
|
+
], viewQueries: [{ propertyName: "inputSearch", first: true, predicate: ["inputSearch"], descendants: true }], ngImport: i0, template: `
|
|
16907
|
+
<co-input-search
|
|
16908
|
+
#inputSearch
|
|
16909
|
+
[(model)]="model"
|
|
16910
|
+
[handleKeydown]="false"
|
|
16911
|
+
[customCssClass]="customCssClass"
|
|
16912
|
+
[placeholder]="placeholder"
|
|
16913
|
+
[centerLabel]="centerLabel"
|
|
16914
|
+
[useLeftIcon]="useLeftIcon"
|
|
16915
|
+
[leftIconData]="leftIconData"
|
|
16916
|
+
[useRightIcon]="useRightIcon"
|
|
16917
|
+
[rightIconData]="rightIconData"
|
|
16918
|
+
(leftIconClick)="leftIconClick.emit($event)"
|
|
16919
|
+
(rightIconClick)="rightIconClick.emit($event)"
|
|
16920
|
+
(isFocused)="isFocused.emit($event)"
|
|
16921
|
+
></co-input-search>
|
|
16922
|
+
`, isInline: true, dependencies: [{ kind: "component", type: InputSearchComponent, selector: "co-input-search", inputs: ["placeholder", "handleKeydown", "useLeftIcon", "useRightIcon", "leftIconData", "rightIconData", "centerLabel"], outputs: ["search", "isFocused", "leftIconClick", "rightIconClick"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
16903
16923
|
}
|
|
16904
16924
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: InputScannerComponent, decorators: [{
|
|
16905
16925
|
type: Component,
|
|
16906
16926
|
args: [{
|
|
16907
16927
|
selector: 'co-input-scanner',
|
|
16908
16928
|
template: `
|
|
16909
|
-
|
|
16910
|
-
|
|
16911
|
-
|
|
16912
|
-
|
|
16913
|
-
|
|
16914
|
-
|
|
16915
|
-
|
|
16916
|
-
|
|
16917
|
-
|
|
16918
|
-
|
|
16919
|
-
|
|
16920
|
-
|
|
16921
|
-
|
|
16922
|
-
|
|
16923
|
-
|
|
16929
|
+
<co-input-search
|
|
16930
|
+
#inputSearch
|
|
16931
|
+
[(model)]="model"
|
|
16932
|
+
[handleKeydown]="false"
|
|
16933
|
+
[customCssClass]="customCssClass"
|
|
16934
|
+
[placeholder]="placeholder"
|
|
16935
|
+
[centerLabel]="centerLabel"
|
|
16936
|
+
[useLeftIcon]="useLeftIcon"
|
|
16937
|
+
[leftIconData]="leftIconData"
|
|
16938
|
+
[useRightIcon]="useRightIcon"
|
|
16939
|
+
[rightIconData]="rightIconData"
|
|
16940
|
+
(leftIconClick)="leftIconClick.emit($event)"
|
|
16941
|
+
(rightIconClick)="rightIconClick.emit($event)"
|
|
16942
|
+
(isFocused)="isFocused.emit($event)"
|
|
16943
|
+
></co-input-search>
|
|
16944
|
+
`,
|
|
16924
16945
|
providers: [
|
|
16925
16946
|
ScannerService,
|
|
16926
16947
|
OverlayService
|
|
@@ -16928,7 +16949,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
16928
16949
|
encapsulation: ViewEncapsulation.None,
|
|
16929
16950
|
standalone: false
|
|
16930
16951
|
}]
|
|
16931
|
-
}], ctorParameters: () => [{ type: ScannerService }], propDecorators: {
|
|
16952
|
+
}], ctorParameters: () => [{ type: ScannerService }], propDecorators: { inputSearch: [{
|
|
16953
|
+
type: ViewChild,
|
|
16954
|
+
args: ['inputSearch']
|
|
16955
|
+
}], model: [{
|
|
16932
16956
|
type: Input
|
|
16933
16957
|
}], placeholder: [{
|
|
16934
16958
|
type: Input
|