ngx-core-components 0.3.20 → 0.3.21
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/charts/gantt-chart/gantt-chart.component.d.ts +1 -0
- package/dialog/dialog-container.component.d.ts +4 -0
- package/dialog/dialog.service.d.ts +1 -0
- package/fesm2022/ngx-core-components-charts.mjs +8 -6
- package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
- package/fesm2022/ngx-core-components-dialog.mjs +78 -11
- package/fesm2022/ngx-core-components-dialog.mjs.map +1 -1
- package/fesm2022/ngx-core-components-feedback.mjs +8 -4
- package/fesm2022/ngx-core-components-feedback.mjs.map +1 -1
- package/fesm2022/ngx-core-components-grid.mjs +143 -115
- package/fesm2022/ngx-core-components-grid.mjs.map +1 -1
- package/fesm2022/ngx-core-components-i18n.mjs +149 -0
- package/fesm2022/ngx-core-components-i18n.mjs.map +1 -0
- package/fesm2022/ngx-core-components-inputs.mjs +145 -75
- package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
- package/fesm2022/ngx-core-components-layout.mjs +12 -8
- package/fesm2022/ngx-core-components-layout.mjs.map +1 -1
- package/fesm2022/ngx-core-components-views.mjs +86 -20
- package/fesm2022/ngx-core-components-views.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs +1 -0
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/grid/data-grid/data-grid.component.d.ts +4 -104
- package/grid/data-grid/grid-export.service.d.ts +26 -0
- package/grid/data-grid/models.d.ts +105 -0
- package/grid/public-api.d.ts +2 -1
- package/i18n/index.d.ts +5 -0
- package/i18n/ngx-core-i18n.d.ts +111 -0
- package/i18n/public-api.d.ts +2 -0
- package/inputs/autocomplete/autocomplete.component.d.ts +3 -1
- package/inputs/date-picker/date-picker.component.d.ts +4 -2
- package/inputs/dropdown/dropdown.component.d.ts +3 -1
- package/inputs/file-upload/file-upload.component.d.ts +1 -0
- package/inputs/multi-select/multi-select.component.d.ts +3 -1
- package/layout/accordion/accordion.component.d.ts +1 -0
- package/layout/drawer/drawer.component.d.ts +1 -0
- package/package.json +30 -12
- package/public-api.d.ts +2 -0
- package/schematics/collection.json +7 -1
- package/schematics/grid/index.js +68 -0
- package/schematics/grid/schema.json +19 -0
- package/schematics/ng-add/index.js +177 -9
- package/schematics/ng-add/schema.json +29 -0
- package/themes/theme.css +118 -26
- package/views/kanban/kanban.component.d.ts +1 -0
- package/views/list-view/list-view.component.d.ts +1 -0
- package/views/scheduler/scheduler.component.d.ts +2 -0
|
@@ -2,6 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, output, signal, computed, forwardRef, ChangeDetectionStrategy, Component, inject, ElementRef, HostListener, model, effect, ViewChild } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
5
|
+
import { NGX_CORE_I18N } from 'ngx-core-components/i18n';
|
|
5
6
|
import { CommonModule } from '@angular/common';
|
|
6
7
|
|
|
7
8
|
class TextBoxComponent {
|
|
@@ -579,13 +580,15 @@ class DropdownComponent {
|
|
|
579
580
|
options = input([]);
|
|
580
581
|
value = input(null);
|
|
581
582
|
label = input('');
|
|
582
|
-
placeholder = input(
|
|
583
|
+
placeholder = input(null);
|
|
583
584
|
disabled = input(false);
|
|
584
585
|
filterable = input(false);
|
|
585
586
|
required = input(false);
|
|
586
587
|
error = input('');
|
|
587
588
|
hint = input('');
|
|
588
589
|
valueChange = output();
|
|
590
|
+
i18n = inject(NGX_CORE_I18N);
|
|
591
|
+
effectivePlaceholder = computed(() => this.placeholder() ?? this.i18n.dropdown.selectPlaceholder);
|
|
589
592
|
isOpen = signal(false);
|
|
590
593
|
filterText = signal('');
|
|
591
594
|
focusedIndex = signal(-1);
|
|
@@ -772,11 +775,11 @@ class DropdownComponent {
|
|
|
772
775
|
[attr.tabindex]="disabled() ? -1 : 0"
|
|
773
776
|
(click)="toggle()"
|
|
774
777
|
(keydown)="onTriggerKey($event)"
|
|
775
|
-
[attr.aria-label]="!label() ? (selectedLabel() ||
|
|
778
|
+
[attr.aria-label]="!label() ? (selectedLabel() || effectivePlaceholder()) : null"
|
|
776
779
|
[attr.aria-disabled]="disabled()"
|
|
777
780
|
>
|
|
778
781
|
<span class="trigger-text" [class.placeholder]="!selectedLabel()">
|
|
779
|
-
{{ selectedLabel() ||
|
|
782
|
+
{{ selectedLabel() || effectivePlaceholder() }}
|
|
780
783
|
</span>
|
|
781
784
|
<span class="trigger-arrow" [class.open]="isOpen()">▼</span>
|
|
782
785
|
</div>
|
|
@@ -787,6 +790,7 @@ class DropdownComponent {
|
|
|
787
790
|
class="ngx-dropdown-popup"
|
|
788
791
|
[id]="uid + '-popup'"
|
|
789
792
|
role="listbox"
|
|
793
|
+
aria-live="polite"
|
|
790
794
|
[attr.aria-labelledby]="label() ? uid + '-label' : null"
|
|
791
795
|
>
|
|
792
796
|
@if (filterable()) {
|
|
@@ -794,7 +798,7 @@ class DropdownComponent {
|
|
|
794
798
|
<input
|
|
795
799
|
#filterInput
|
|
796
800
|
class="popup-search-input"
|
|
797
|
-
placeholder="
|
|
801
|
+
[placeholder]="i18n.dropdown.searchPlaceholder"
|
|
798
802
|
[value]="filterText()"
|
|
799
803
|
(input)="filterText.set($any($event.target).value)"
|
|
800
804
|
(keydown)="onFilterKey($event)"
|
|
@@ -819,7 +823,7 @@ class DropdownComponent {
|
|
|
819
823
|
>{{ opt.label }}</div>
|
|
820
824
|
}
|
|
821
825
|
@if (filteredOptions().length === 0) {
|
|
822
|
-
<div class="popup-empty" role="status">
|
|
826
|
+
<div class="popup-empty" role="status">{{ i18n.dropdown.noResults }}</div>
|
|
823
827
|
}
|
|
824
828
|
</div>
|
|
825
829
|
</div>
|
|
@@ -830,7 +834,7 @@ class DropdownComponent {
|
|
|
830
834
|
<div [id]="uid + '-hint'" class="ngx-dropdown-hint">{{ hint() }}</div>
|
|
831
835
|
}
|
|
832
836
|
</div>
|
|
833
|
-
`, isInline: true, styles: [":host{display:block}.ngx-dropdown{position:relative;font-family:inherit}.ngx-dropdown-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500}.ngx-dropdown-trigger{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg, #fff);cursor:pointer;-webkit-user-select:none;user-select:none;font-size:14px;transition:all .2s cubic-bezier(.4,0,.2,1);outline:none}.ngx-dropdown-trigger:hover{border-color:var(--ngx-input-focus, #4f46e5)}.ngx-dropdown-trigger:focus-visible{border-color:var(--ngx-input-focus, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15));outline:none}.open .ngx-dropdown-trigger{border-color:var(--ngx-input-focus, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15))}.disabled .ngx-dropdown-trigger{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed;color
|
|
837
|
+
`, isInline: true, styles: [":host{display:block}.ngx-dropdown{position:relative;font-family:inherit}.ngx-dropdown-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500}.ngx-dropdown-trigger{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg, #fff);cursor:pointer;-webkit-user-select:none;user-select:none;font-size:14px;transition:all .2s cubic-bezier(.4,0,.2,1);outline:none}.ngx-dropdown-trigger:hover{border-color:var(--ngx-input-focus, #4f46e5)}.ngx-dropdown-trigger:focus-visible{border-color:var(--ngx-input-focus, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15));outline:none}.open .ngx-dropdown-trigger{border-color:var(--ngx-input-focus, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15))}.disabled .ngx-dropdown-trigger{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed;color:var(--ngx-color-text-disabled, #767b83)}.trigger-text{flex:1;color:var(--ngx-input-text, #212529)}.trigger-text.placeholder{color:var(--ngx-color-text-disabled, #767b83)}.trigger-arrow{font-size:10px;color:#6c757d;transition:transform .15s}.trigger-arrow.open{transform:rotate(180deg)}.ngx-dropdown-popup{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:1000;background:var(--ngx-input-bg, #fff);border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 8px);box-shadow:var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,.1));overflow:hidden;transform-origin:top;animation:popup-slide .18s cubic-bezier(.4,0,.2,1)}@keyframes popup-slide{0%{opacity:0;transform:translateY(-4px) scaleY(.95)}to{opacity:1;transform:translateY(0) scaleY(1)}}.popup-search{padding:8px;border-bottom:1px solid var(--ngx-input-border, #ced4da)}.popup-search-input{width:100%;padding:6px 10px;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--radius-sm, 6px);font-size:13px;outline:none;font-family:inherit;background:var(--bg-primary);color:var(--text-primary);transition:all .15s ease}.popup-search-input:focus{border-color:var(--ngx-input-focus, #4f46e5);background:var(--bg-secondary)}.popup-list{max-height:240px;overflow-y:auto}.popup-item{padding:8px 12px;font-size:14px;cursor:pointer;color:var(--ngx-input-text, #212529);transition:all .12s}.popup-item:hover,.popup-item.focused{background:var(--ngx-grid-hover-bg, #f1f3f5);color:var(--ngx-input-focus, #4f46e5)}.popup-item.selected{background:var(--ngx-grid-selected-bg, #e8f0fe);color:var(--ngx-input-focus, #4f46e5);font-weight:600}.popup-item.disabled{color:var(--ngx-color-text-disabled, #767b83);cursor:not-allowed}.popup-item.disabled:hover{background:none}.popup-empty{padding:12px;text-align:center;color:var(--ngx-color-text-disabled, #767b83);font-size:13px}.has-error .ngx-dropdown-trigger{border-color:var(--ngx-input-error, #e74c3c)}.has-error.focused .ngx-dropdown-trigger,.has-error.open .ngx-dropdown-trigger{box-shadow:0 0 0 2px #e74c3c2e}.ngx-dropdown-error{font-size:12px;color:var(--ngx-input-error, #e74c3c);margin-top:4px}.ngx-dropdown-hint{font-size:12px;color:var(--ngx-input-label, #6c757d);margin-top:4px}.ngx-dropdown-required{color:var(--ngx-input-error, #e74c3c);margin-left:2px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
834
838
|
}
|
|
835
839
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
836
840
|
type: Component,
|
|
@@ -868,11 +872,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
868
872
|
[attr.tabindex]="disabled() ? -1 : 0"
|
|
869
873
|
(click)="toggle()"
|
|
870
874
|
(keydown)="onTriggerKey($event)"
|
|
871
|
-
[attr.aria-label]="!label() ? (selectedLabel() ||
|
|
875
|
+
[attr.aria-label]="!label() ? (selectedLabel() || effectivePlaceholder()) : null"
|
|
872
876
|
[attr.aria-disabled]="disabled()"
|
|
873
877
|
>
|
|
874
878
|
<span class="trigger-text" [class.placeholder]="!selectedLabel()">
|
|
875
|
-
{{ selectedLabel() ||
|
|
879
|
+
{{ selectedLabel() || effectivePlaceholder() }}
|
|
876
880
|
</span>
|
|
877
881
|
<span class="trigger-arrow" [class.open]="isOpen()">▼</span>
|
|
878
882
|
</div>
|
|
@@ -883,6 +887,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
883
887
|
class="ngx-dropdown-popup"
|
|
884
888
|
[id]="uid + '-popup'"
|
|
885
889
|
role="listbox"
|
|
890
|
+
aria-live="polite"
|
|
886
891
|
[attr.aria-labelledby]="label() ? uid + '-label' : null"
|
|
887
892
|
>
|
|
888
893
|
@if (filterable()) {
|
|
@@ -890,7 +895,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
890
895
|
<input
|
|
891
896
|
#filterInput
|
|
892
897
|
class="popup-search-input"
|
|
893
|
-
placeholder="
|
|
898
|
+
[placeholder]="i18n.dropdown.searchPlaceholder"
|
|
894
899
|
[value]="filterText()"
|
|
895
900
|
(input)="filterText.set($any($event.target).value)"
|
|
896
901
|
(keydown)="onFilterKey($event)"
|
|
@@ -915,7 +920,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
915
920
|
>{{ opt.label }}</div>
|
|
916
921
|
}
|
|
917
922
|
@if (filteredOptions().length === 0) {
|
|
918
|
-
<div class="popup-empty" role="status">
|
|
923
|
+
<div class="popup-empty" role="status">{{ i18n.dropdown.noResults }}</div>
|
|
919
924
|
}
|
|
920
925
|
</div>
|
|
921
926
|
</div>
|
|
@@ -926,7 +931,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
926
931
|
<div [id]="uid + '-hint'" class="ngx-dropdown-hint">{{ hint() }}</div>
|
|
927
932
|
}
|
|
928
933
|
</div>
|
|
929
|
-
`, styles: [":host{display:block}.ngx-dropdown{position:relative;font-family:inherit}.ngx-dropdown-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500}.ngx-dropdown-trigger{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg, #fff);cursor:pointer;-webkit-user-select:none;user-select:none;font-size:14px;transition:all .2s cubic-bezier(.4,0,.2,1);outline:none}.ngx-dropdown-trigger:hover{border-color:var(--ngx-input-focus, #4f46e5)}.ngx-dropdown-trigger:focus-visible{border-color:var(--ngx-input-focus, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15));outline:none}.open .ngx-dropdown-trigger{border-color:var(--ngx-input-focus, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15))}.disabled .ngx-dropdown-trigger{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed;color
|
|
934
|
+
`, styles: [":host{display:block}.ngx-dropdown{position:relative;font-family:inherit}.ngx-dropdown-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500}.ngx-dropdown-trigger{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg, #fff);cursor:pointer;-webkit-user-select:none;user-select:none;font-size:14px;transition:all .2s cubic-bezier(.4,0,.2,1);outline:none}.ngx-dropdown-trigger:hover{border-color:var(--ngx-input-focus, #4f46e5)}.ngx-dropdown-trigger:focus-visible{border-color:var(--ngx-input-focus, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15));outline:none}.open .ngx-dropdown-trigger{border-color:var(--ngx-input-focus, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15))}.disabled .ngx-dropdown-trigger{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed;color:var(--ngx-color-text-disabled, #767b83)}.trigger-text{flex:1;color:var(--ngx-input-text, #212529)}.trigger-text.placeholder{color:var(--ngx-color-text-disabled, #767b83)}.trigger-arrow{font-size:10px;color:#6c757d;transition:transform .15s}.trigger-arrow.open{transform:rotate(180deg)}.ngx-dropdown-popup{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:1000;background:var(--ngx-input-bg, #fff);border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 8px);box-shadow:var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,.1));overflow:hidden;transform-origin:top;animation:popup-slide .18s cubic-bezier(.4,0,.2,1)}@keyframes popup-slide{0%{opacity:0;transform:translateY(-4px) scaleY(.95)}to{opacity:1;transform:translateY(0) scaleY(1)}}.popup-search{padding:8px;border-bottom:1px solid var(--ngx-input-border, #ced4da)}.popup-search-input{width:100%;padding:6px 10px;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--radius-sm, 6px);font-size:13px;outline:none;font-family:inherit;background:var(--bg-primary);color:var(--text-primary);transition:all .15s ease}.popup-search-input:focus{border-color:var(--ngx-input-focus, #4f46e5);background:var(--bg-secondary)}.popup-list{max-height:240px;overflow-y:auto}.popup-item{padding:8px 12px;font-size:14px;cursor:pointer;color:var(--ngx-input-text, #212529);transition:all .12s}.popup-item:hover,.popup-item.focused{background:var(--ngx-grid-hover-bg, #f1f3f5);color:var(--ngx-input-focus, #4f46e5)}.popup-item.selected{background:var(--ngx-grid-selected-bg, #e8f0fe);color:var(--ngx-input-focus, #4f46e5);font-weight:600}.popup-item.disabled{color:var(--ngx-color-text-disabled, #767b83);cursor:not-allowed}.popup-item.disabled:hover{background:none}.popup-empty{padding:12px;text-align:center;color:var(--ngx-color-text-disabled, #767b83);font-size:13px}.has-error .ngx-dropdown-trigger{border-color:var(--ngx-input-error, #e74c3c)}.has-error.focused .ngx-dropdown-trigger,.has-error.open .ngx-dropdown-trigger{box-shadow:0 0 0 2px #e74c3c2e}.ngx-dropdown-error{font-size:12px;color:var(--ngx-input-error, #e74c3c);margin-top:4px}.ngx-dropdown-hint{font-size:12px;color:var(--ngx-input-label, #6c757d);margin-top:4px}.ngx-dropdown-required{color:var(--ngx-input-error, #e74c3c);margin-left:2px}\n"] }]
|
|
930
935
|
}], propDecorators: { onDocClick: [{
|
|
931
936
|
type: HostListener,
|
|
932
937
|
args: ['document:click', ['$event']]
|
|
@@ -936,20 +941,22 @@ class MultiSelectComponent {
|
|
|
936
941
|
options = input([]);
|
|
937
942
|
values = input([]);
|
|
938
943
|
label = input('');
|
|
939
|
-
placeholder = input(
|
|
944
|
+
placeholder = input(null);
|
|
940
945
|
disabled = input(false);
|
|
941
946
|
filterable = input(false);
|
|
942
947
|
maxTags = input(Infinity);
|
|
943
948
|
valuesChange = output();
|
|
949
|
+
i18n = inject(NGX_CORE_I18N);
|
|
950
|
+
effectivePlaceholder = computed(() => this.placeholder() ?? this.i18n.dropdown.selectPlaceholder);
|
|
944
951
|
isOpen = signal(false);
|
|
945
952
|
filterText = signal('');
|
|
946
953
|
focusedIndex = signal(-1);
|
|
947
954
|
_cvaValues = signal([]);
|
|
948
|
-
_cvaActive = false;
|
|
955
|
+
_cvaActive = signal(false);
|
|
949
956
|
_onChange = () => { };
|
|
950
957
|
_onTouched = () => { };
|
|
951
958
|
el = inject(ElementRef);
|
|
952
|
-
_activeValues = computed(() => this._cvaActive ? this._cvaValues() : this.values());
|
|
959
|
+
_activeValues = computed(() => this._cvaActive() ? this._cvaValues() : this.values());
|
|
953
960
|
displayValues = computed(() => this._activeValues()
|
|
954
961
|
.slice(0, this.maxTags() === Infinity ? undefined : this.maxTags())
|
|
955
962
|
.map(v => ({ value: v, label: this.options().find(o => o.value === v)?.label ?? String(v) })));
|
|
@@ -1004,7 +1011,7 @@ class MultiSelectComponent {
|
|
|
1004
1011
|
}
|
|
1005
1012
|
// ControlValueAccessor
|
|
1006
1013
|
writeValue(val) {
|
|
1007
|
-
this._cvaActive
|
|
1014
|
+
this._cvaActive.set(true);
|
|
1008
1015
|
this._cvaValues.set(Array.isArray(val) ? val : []);
|
|
1009
1016
|
}
|
|
1010
1017
|
registerOnChange(fn) {
|
|
@@ -1024,12 +1031,20 @@ class MultiSelectComponent {
|
|
|
1024
1031
|
multi: true,
|
|
1025
1032
|
},
|
|
1026
1033
|
], ngImport: i0, template: `
|
|
1027
|
-
<div class="ngx-multi-select" [class.open]="isOpen()" [class.disabled]="disabled()"
|
|
1034
|
+
<div class="ngx-multi-select" [class.open]="isOpen()" [class.disabled]="disabled()">
|
|
1028
1035
|
@if (label()) {
|
|
1029
1036
|
<label class="ms-label">{{ label() }}</label>
|
|
1030
1037
|
}
|
|
1031
1038
|
<!-- Trigger -->
|
|
1032
|
-
<div
|
|
1039
|
+
<div
|
|
1040
|
+
class="ms-trigger"
|
|
1041
|
+
tabindex="0"
|
|
1042
|
+
(click)="toggle()"
|
|
1043
|
+
(keydown)="onTriggerKey($event)"
|
|
1044
|
+
role="combobox"
|
|
1045
|
+
aria-haspopup="listbox"
|
|
1046
|
+
[attr.aria-expanded]="isOpen()"
|
|
1047
|
+
>
|
|
1033
1048
|
<div class="ms-tags">
|
|
1034
1049
|
@for (val of displayValues(); track val.value) {
|
|
1035
1050
|
<span class="ms-tag">
|
|
@@ -1038,7 +1053,7 @@ class MultiSelectComponent {
|
|
|
1038
1053
|
</span>
|
|
1039
1054
|
}
|
|
1040
1055
|
@if (displayValues().length === 0) {
|
|
1041
|
-
<span class="ms-placeholder">{{
|
|
1056
|
+
<span class="ms-placeholder">{{ effectivePlaceholder() }}</span>
|
|
1042
1057
|
}
|
|
1043
1058
|
</div>
|
|
1044
1059
|
<span class="ms-arrow" [class.open]="isOpen()">▼</span>
|
|
@@ -1051,7 +1066,7 @@ class MultiSelectComponent {
|
|
|
1051
1066
|
<div class="ms-search">
|
|
1052
1067
|
<input
|
|
1053
1068
|
class="ms-search-input"
|
|
1054
|
-
placeholder="
|
|
1069
|
+
[placeholder]="i18n.multiSelect.searchPlaceholder"
|
|
1055
1070
|
[value]="filterText()"
|
|
1056
1071
|
(input)="filterText.set($any($event.target).value)"
|
|
1057
1072
|
(click)="$event.stopPropagation()"
|
|
@@ -1067,7 +1082,7 @@ class MultiSelectComponent {
|
|
|
1067
1082
|
[indeterminate]="someSelected() && !allSelected()"
|
|
1068
1083
|
(change)="toggleAll()"
|
|
1069
1084
|
/>
|
|
1070
|
-
<span>
|
|
1085
|
+
<span>{{ allSelected() ? i18n.multiSelect.deselectAll : i18n.multiSelect.selectAll }}</span>
|
|
1071
1086
|
</label>
|
|
1072
1087
|
<div class="ms-divider"></div>
|
|
1073
1088
|
@for (opt of filteredOptions(); track opt.value; let i = $index) {
|
|
@@ -1089,7 +1104,7 @@ class MultiSelectComponent {
|
|
|
1089
1104
|
</label>
|
|
1090
1105
|
}
|
|
1091
1106
|
@if (filteredOptions().length === 0) {
|
|
1092
|
-
<div class="ms-empty">
|
|
1107
|
+
<div class="ms-empty">{{ i18n.dropdown.noResults }}</div>
|
|
1093
1108
|
}
|
|
1094
1109
|
</div>
|
|
1095
1110
|
</div>
|
|
@@ -1106,12 +1121,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1106
1121
|
multi: true,
|
|
1107
1122
|
},
|
|
1108
1123
|
], template: `
|
|
1109
|
-
<div class="ngx-multi-select" [class.open]="isOpen()" [class.disabled]="disabled()"
|
|
1124
|
+
<div class="ngx-multi-select" [class.open]="isOpen()" [class.disabled]="disabled()">
|
|
1110
1125
|
@if (label()) {
|
|
1111
1126
|
<label class="ms-label">{{ label() }}</label>
|
|
1112
1127
|
}
|
|
1113
1128
|
<!-- Trigger -->
|
|
1114
|
-
<div
|
|
1129
|
+
<div
|
|
1130
|
+
class="ms-trigger"
|
|
1131
|
+
tabindex="0"
|
|
1132
|
+
(click)="toggle()"
|
|
1133
|
+
(keydown)="onTriggerKey($event)"
|
|
1134
|
+
role="combobox"
|
|
1135
|
+
aria-haspopup="listbox"
|
|
1136
|
+
[attr.aria-expanded]="isOpen()"
|
|
1137
|
+
>
|
|
1115
1138
|
<div class="ms-tags">
|
|
1116
1139
|
@for (val of displayValues(); track val.value) {
|
|
1117
1140
|
<span class="ms-tag">
|
|
@@ -1120,7 +1143,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1120
1143
|
</span>
|
|
1121
1144
|
}
|
|
1122
1145
|
@if (displayValues().length === 0) {
|
|
1123
|
-
<span class="ms-placeholder">{{
|
|
1146
|
+
<span class="ms-placeholder">{{ effectivePlaceholder() }}</span>
|
|
1124
1147
|
}
|
|
1125
1148
|
</div>
|
|
1126
1149
|
<span class="ms-arrow" [class.open]="isOpen()">▼</span>
|
|
@@ -1133,7 +1156,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1133
1156
|
<div class="ms-search">
|
|
1134
1157
|
<input
|
|
1135
1158
|
class="ms-search-input"
|
|
1136
|
-
placeholder="
|
|
1159
|
+
[placeholder]="i18n.multiSelect.searchPlaceholder"
|
|
1137
1160
|
[value]="filterText()"
|
|
1138
1161
|
(input)="filterText.set($any($event.target).value)"
|
|
1139
1162
|
(click)="$event.stopPropagation()"
|
|
@@ -1149,7 +1172,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1149
1172
|
[indeterminate]="someSelected() && !allSelected()"
|
|
1150
1173
|
(change)="toggleAll()"
|
|
1151
1174
|
/>
|
|
1152
|
-
<span>
|
|
1175
|
+
<span>{{ allSelected() ? i18n.multiSelect.deselectAll : i18n.multiSelect.selectAll }}</span>
|
|
1153
1176
|
</label>
|
|
1154
1177
|
<div class="ms-divider"></div>
|
|
1155
1178
|
@for (opt of filteredOptions(); track opt.value; let i = $index) {
|
|
@@ -1171,7 +1194,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1171
1194
|
</label>
|
|
1172
1195
|
}
|
|
1173
1196
|
@if (filteredOptions().length === 0) {
|
|
1174
|
-
<div class="ms-empty">
|
|
1197
|
+
<div class="ms-empty">{{ i18n.dropdown.noResults }}</div>
|
|
1175
1198
|
}
|
|
1176
1199
|
</div>
|
|
1177
1200
|
</div>
|
|
@@ -1186,11 +1209,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1186
1209
|
class AutocompleteComponent {
|
|
1187
1210
|
options = input([]);
|
|
1188
1211
|
label = input('');
|
|
1189
|
-
placeholder = input(
|
|
1212
|
+
placeholder = input(null);
|
|
1190
1213
|
disabled = input(false);
|
|
1191
1214
|
error = input('');
|
|
1192
1215
|
minLength = input(1);
|
|
1193
1216
|
valueChange = output();
|
|
1217
|
+
i18n = inject(NGX_CORE_I18N);
|
|
1218
|
+
effectivePlaceholder = computed(() => this.placeholder() ?? this.i18n.common.search);
|
|
1194
1219
|
_inputText = signal('');
|
|
1195
1220
|
_selectedValue = signal(null);
|
|
1196
1221
|
isOpen = signal(false);
|
|
@@ -1308,7 +1333,7 @@ class AutocompleteComponent {
|
|
|
1308
1333
|
<div class="ngx-ac-wrap">
|
|
1309
1334
|
<input
|
|
1310
1335
|
class="ngx-ac-input"
|
|
1311
|
-
[placeholder]="
|
|
1336
|
+
[placeholder]="effectivePlaceholder()"
|
|
1312
1337
|
[disabled]="disabled()"
|
|
1313
1338
|
[value]="_inputText()"
|
|
1314
1339
|
(input)="onInput($event)"
|
|
@@ -1321,13 +1346,13 @@ class AutocompleteComponent {
|
|
|
1321
1346
|
aria-haspopup="listbox"
|
|
1322
1347
|
/>
|
|
1323
1348
|
@if (_inputText()) {
|
|
1324
|
-
<button class="ngx-ac-clear" (click)="clear()" aria-label="
|
|
1349
|
+
<button class="ngx-ac-clear" (click)="clear()" [attr.aria-label]="i18n.autocomplete.clearSelection">✕</button>
|
|
1325
1350
|
}
|
|
1326
1351
|
</div>
|
|
1327
1352
|
|
|
1328
1353
|
<!-- Suggestion panel — floats above DOM via absolute positioning -->
|
|
1329
|
-
@if (isOpen()
|
|
1330
|
-
<div class="ngx-ac-panel" role="listbox">
|
|
1354
|
+
@if (isOpen()) {
|
|
1355
|
+
<div class="ngx-ac-panel" role="listbox" aria-live="polite">
|
|
1331
1356
|
@for (opt of filteredOptions(); track opt.value; let i = $index) {
|
|
1332
1357
|
<div
|
|
1333
1358
|
class="ngx-ac-item"
|
|
@@ -1339,6 +1364,11 @@ class AutocompleteComponent {
|
|
|
1339
1364
|
(mouseenter)="focusedIndex.set(i)"
|
|
1340
1365
|
>{{ opt.label }}</div>
|
|
1341
1366
|
}
|
|
1367
|
+
@if (filteredOptions().length === 0) {
|
|
1368
|
+
<div class="ngx-ac-empty" role="status" style="padding: 12px; text-align: center; color: #767b83; font-size: 13px;">
|
|
1369
|
+
{{ i18n.autocomplete.noResults }}
|
|
1370
|
+
</div>
|
|
1371
|
+
}
|
|
1342
1372
|
</div>
|
|
1343
1373
|
}
|
|
1344
1374
|
|
|
@@ -1346,7 +1376,7 @@ class AutocompleteComponent {
|
|
|
1346
1376
|
<div class="ngx-ac-error">{{ error() }}</div>
|
|
1347
1377
|
}
|
|
1348
1378
|
</div>
|
|
1349
|
-
`, isInline: true, styles: [":host{display:block}.ngx-autocomplete{position:relative;font-family:inherit}.ngx-ac-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500}.ngx-ac-wrap{display:flex;align-items:center;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 4px);background:var(--ngx-input-bg, #fff);transition:border-color .15s,box-shadow .15s}.focused .ngx-ac-wrap{border-color:var(--ngx-input-focus, #4a90d9);box-shadow:0 0 0 2px #4a90d92e}.has-error .ngx-ac-wrap{border-color:var(--ngx-input-error, #e74c3c)}.disabled .ngx-ac-wrap{background:#f8f9fa}.ngx-ac-input{flex:1;padding:8px 12px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #212529);font-family:inherit}.ngx-ac-input:disabled{cursor:not-allowed;color
|
|
1379
|
+
`, isInline: true, styles: [":host{display:block}.ngx-autocomplete{position:relative;font-family:inherit}.ngx-ac-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500}.ngx-ac-wrap{display:flex;align-items:center;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 4px);background:var(--ngx-input-bg, #fff);transition:border-color .15s,box-shadow .15s}.focused .ngx-ac-wrap{border-color:var(--ngx-input-focus, #4a90d9);box-shadow:0 0 0 2px #4a90d92e}.has-error .ngx-ac-wrap{border-color:var(--ngx-input-error, #e74c3c)}.disabled .ngx-ac-wrap{background:#f8f9fa}.ngx-ac-input{flex:1;padding:8px 12px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #212529);font-family:inherit}.ngx-ac-input:disabled{cursor:not-allowed;color:var(--ngx-color-text-disabled, #767b83)}.ngx-ac-clear{padding:0 10px;background:none;border:none;cursor:pointer;color:var(--ngx-color-text-disabled, #767b83);font-size:14px;line-height:1}.ngx-ac-panel{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:1000;background:var(--ngx-input-bg, #fff);border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 4px);box-shadow:0 4px 16px #0000001f;max-height:240px;overflow-y:auto}.ngx-ac-item{padding:8px 12px;font-size:14px;cursor:pointer;color:var(--ngx-input-text, #212529);transition:background .1s}.ngx-ac-item:hover,.ngx-ac-item.focused{background:var(--ngx-input-hover-bg, #f1f3f5)}.ngx-ac-item.disabled{color:var(--ngx-color-text-disabled, #767b83);cursor:not-allowed;pointer-events:none}.ngx-ac-error{font-size:12px;color:var(--ngx-input-error, #e74c3c);margin-top:4px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1350
1380
|
}
|
|
1351
1381
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
1352
1382
|
type: Component,
|
|
@@ -1370,7 +1400,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1370
1400
|
<div class="ngx-ac-wrap">
|
|
1371
1401
|
<input
|
|
1372
1402
|
class="ngx-ac-input"
|
|
1373
|
-
[placeholder]="
|
|
1403
|
+
[placeholder]="effectivePlaceholder()"
|
|
1374
1404
|
[disabled]="disabled()"
|
|
1375
1405
|
[value]="_inputText()"
|
|
1376
1406
|
(input)="onInput($event)"
|
|
@@ -1383,13 +1413,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1383
1413
|
aria-haspopup="listbox"
|
|
1384
1414
|
/>
|
|
1385
1415
|
@if (_inputText()) {
|
|
1386
|
-
<button class="ngx-ac-clear" (click)="clear()" aria-label="
|
|
1416
|
+
<button class="ngx-ac-clear" (click)="clear()" [attr.aria-label]="i18n.autocomplete.clearSelection">✕</button>
|
|
1387
1417
|
}
|
|
1388
1418
|
</div>
|
|
1389
1419
|
|
|
1390
1420
|
<!-- Suggestion panel — floats above DOM via absolute positioning -->
|
|
1391
|
-
@if (isOpen()
|
|
1392
|
-
<div class="ngx-ac-panel" role="listbox">
|
|
1421
|
+
@if (isOpen()) {
|
|
1422
|
+
<div class="ngx-ac-panel" role="listbox" aria-live="polite">
|
|
1393
1423
|
@for (opt of filteredOptions(); track opt.value; let i = $index) {
|
|
1394
1424
|
<div
|
|
1395
1425
|
class="ngx-ac-item"
|
|
@@ -1401,6 +1431,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1401
1431
|
(mouseenter)="focusedIndex.set(i)"
|
|
1402
1432
|
>{{ opt.label }}</div>
|
|
1403
1433
|
}
|
|
1434
|
+
@if (filteredOptions().length === 0) {
|
|
1435
|
+
<div class="ngx-ac-empty" role="status" style="padding: 12px; text-align: center; color: #767b83; font-size: 13px;">
|
|
1436
|
+
{{ i18n.autocomplete.noResults }}
|
|
1437
|
+
</div>
|
|
1438
|
+
}
|
|
1404
1439
|
</div>
|
|
1405
1440
|
}
|
|
1406
1441
|
|
|
@@ -1408,7 +1443,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1408
1443
|
<div class="ngx-ac-error">{{ error() }}</div>
|
|
1409
1444
|
}
|
|
1410
1445
|
</div>
|
|
1411
|
-
`, styles: [":host{display:block}.ngx-autocomplete{position:relative;font-family:inherit}.ngx-ac-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500}.ngx-ac-wrap{display:flex;align-items:center;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 4px);background:var(--ngx-input-bg, #fff);transition:border-color .15s,box-shadow .15s}.focused .ngx-ac-wrap{border-color:var(--ngx-input-focus, #4a90d9);box-shadow:0 0 0 2px #4a90d92e}.has-error .ngx-ac-wrap{border-color:var(--ngx-input-error, #e74c3c)}.disabled .ngx-ac-wrap{background:#f8f9fa}.ngx-ac-input{flex:1;padding:8px 12px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #212529);font-family:inherit}.ngx-ac-input:disabled{cursor:not-allowed;color
|
|
1446
|
+
`, styles: [":host{display:block}.ngx-autocomplete{position:relative;font-family:inherit}.ngx-ac-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500}.ngx-ac-wrap{display:flex;align-items:center;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 4px);background:var(--ngx-input-bg, #fff);transition:border-color .15s,box-shadow .15s}.focused .ngx-ac-wrap{border-color:var(--ngx-input-focus, #4a90d9);box-shadow:0 0 0 2px #4a90d92e}.has-error .ngx-ac-wrap{border-color:var(--ngx-input-error, #e74c3c)}.disabled .ngx-ac-wrap{background:#f8f9fa}.ngx-ac-input{flex:1;padding:8px 12px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #212529);font-family:inherit}.ngx-ac-input:disabled{cursor:not-allowed;color:var(--ngx-color-text-disabled, #767b83)}.ngx-ac-clear{padding:0 10px;background:none;border:none;cursor:pointer;color:var(--ngx-color-text-disabled, #767b83);font-size:14px;line-height:1}.ngx-ac-panel{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:1000;background:var(--ngx-input-bg, #fff);border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 4px);box-shadow:0 4px 16px #0000001f;max-height:240px;overflow-y:auto}.ngx-ac-item{padding:8px 12px;font-size:14px;cursor:pointer;color:var(--ngx-input-text, #212529);transition:background .1s}.ngx-ac-item:hover,.ngx-ac-item.focused{background:var(--ngx-input-hover-bg, #f1f3f5)}.ngx-ac-item.disabled{color:var(--ngx-color-text-disabled, #767b83);cursor:not-allowed;pointer-events:none}.ngx-ac-error{font-size:12px;color:var(--ngx-input-error, #e74c3c);margin-top:4px}\n"] }]
|
|
1412
1447
|
}], propDecorators: { onDocClick: [{
|
|
1413
1448
|
type: HostListener,
|
|
1414
1449
|
args: ['document:click', ['$event']]
|
|
@@ -1417,31 +1452,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1417
1452
|
class DatePickerComponent {
|
|
1418
1453
|
value = input(null);
|
|
1419
1454
|
label = input('');
|
|
1420
|
-
placeholder = input(
|
|
1455
|
+
placeholder = input(null);
|
|
1421
1456
|
disabled = input(false);
|
|
1422
1457
|
min = input(null);
|
|
1423
1458
|
max = input(null);
|
|
1424
1459
|
format = input('MM/dd/yyyy');
|
|
1425
1460
|
valueChange = output();
|
|
1426
|
-
|
|
1461
|
+
i18n = inject(NGX_CORE_I18N);
|
|
1462
|
+
effectivePlaceholder = computed(() => this.placeholder() ?? 'Select date...');
|
|
1427
1463
|
isOpen = signal(false);
|
|
1428
1464
|
viewYear = signal(new Date().getFullYear());
|
|
1429
1465
|
viewMonth = signal(new Date().getMonth());
|
|
1430
1466
|
_cvaValue = signal(null);
|
|
1431
|
-
_cvaActive = false;
|
|
1467
|
+
_cvaActive = signal(false);
|
|
1432
1468
|
_onChange = () => { };
|
|
1433
1469
|
_onTouched = () => { };
|
|
1434
1470
|
el = inject(ElementRef);
|
|
1435
|
-
_activeValue = computed(() => this._cvaActive ? this._cvaValue() : this.value());
|
|
1471
|
+
_activeValue = computed(() => this._cvaActive() ? this._cvaValue() : this.value());
|
|
1436
1472
|
displayValue = computed(() => {
|
|
1437
1473
|
const v = this._activeValue();
|
|
1438
1474
|
if (!v)
|
|
1439
1475
|
return '';
|
|
1440
|
-
|
|
1476
|
+
const m = String(v.getMonth() + 1).padStart(2, '0');
|
|
1477
|
+
const d = String(v.getDate()).padStart(2, '0');
|
|
1478
|
+
const y = v.getFullYear();
|
|
1479
|
+
return `${m}/${d}/${y}`;
|
|
1441
1480
|
});
|
|
1442
1481
|
monthTitle = computed(() => {
|
|
1443
|
-
const
|
|
1444
|
-
|
|
1482
|
+
const mName = this.i18n.datePicker.months[this.viewMonth()];
|
|
1483
|
+
const y = this.viewYear();
|
|
1484
|
+
return `${mName} ${y}`;
|
|
1445
1485
|
});
|
|
1446
1486
|
calendarDays = computed(() => {
|
|
1447
1487
|
const y = this.viewYear(), m = this.viewMonth();
|
|
@@ -1512,6 +1552,18 @@ class DatePickerComponent {
|
|
|
1512
1552
|
else
|
|
1513
1553
|
this.viewMonth.update(m => m + 1);
|
|
1514
1554
|
}
|
|
1555
|
+
onInputKeyDown(event) {
|
|
1556
|
+
if (this.disabled())
|
|
1557
|
+
return;
|
|
1558
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
1559
|
+
event.preventDefault();
|
|
1560
|
+
this.toggle();
|
|
1561
|
+
}
|
|
1562
|
+
else if (event.key === 'Escape') {
|
|
1563
|
+
event.preventDefault();
|
|
1564
|
+
this.isOpen.set(false);
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1515
1567
|
selectDay(date) {
|
|
1516
1568
|
if (!date)
|
|
1517
1569
|
return;
|
|
@@ -1532,9 +1584,8 @@ class DatePickerComponent {
|
|
|
1532
1584
|
if (!this.el.nativeElement.contains(e.target))
|
|
1533
1585
|
this.isOpen.set(false);
|
|
1534
1586
|
}
|
|
1535
|
-
// ControlValueAccessor
|
|
1536
1587
|
writeValue(val) {
|
|
1537
|
-
this._cvaActive
|
|
1588
|
+
this._cvaActive.set(true);
|
|
1538
1589
|
this._cvaValue.set(val instanceof Date ? val : null);
|
|
1539
1590
|
}
|
|
1540
1591
|
registerOnChange(fn) {
|
|
@@ -1559,13 +1610,22 @@ class DatePickerComponent {
|
|
|
1559
1610
|
<label class="dp-label">{{ label() }}</label>
|
|
1560
1611
|
}
|
|
1561
1612
|
<!-- Input trigger -->
|
|
1562
|
-
<div
|
|
1613
|
+
<div
|
|
1614
|
+
class="dp-input-wrap"
|
|
1615
|
+
(click)="toggle()"
|
|
1616
|
+
(keydown)="onInputKeyDown($event)"
|
|
1617
|
+
[attr.tabindex]="disabled() ? -1 : 0"
|
|
1618
|
+
role="combobox"
|
|
1619
|
+
[attr.aria-expanded]="isOpen()"
|
|
1620
|
+
aria-haspopup="grid"
|
|
1621
|
+
>
|
|
1563
1622
|
<input
|
|
1564
1623
|
class="dp-input"
|
|
1565
1624
|
readonly
|
|
1566
1625
|
[value]="displayValue()"
|
|
1567
|
-
[placeholder]="
|
|
1626
|
+
[placeholder]="effectivePlaceholder()"
|
|
1568
1627
|
[disabled]="disabled()"
|
|
1628
|
+
tabindex="-1"
|
|
1569
1629
|
/>
|
|
1570
1630
|
<span class="dp-icon">📅</span>
|
|
1571
1631
|
</div>
|
|
@@ -1575,18 +1635,18 @@ class DatePickerComponent {
|
|
|
1575
1635
|
<div class="dp-popup" (click)="$event.stopPropagation()">
|
|
1576
1636
|
<!-- Month/Year nav -->
|
|
1577
1637
|
<div class="dp-nav">
|
|
1578
|
-
<button class="dp-nav-btn" (click)="prevMonth()">‹</button>
|
|
1579
|
-
<span class="dp-nav-title">{{ monthTitle() }}</span>
|
|
1580
|
-
<button class="dp-nav-btn" (click)="nextMonth()">›</button>
|
|
1638
|
+
<button class="dp-nav-btn" (click)="prevMonth()" aria-label="Previous month">‹</button>
|
|
1639
|
+
<span class="dp-nav-title" aria-live="polite">{{ monthTitle() }}</span>
|
|
1640
|
+
<button class="dp-nav-btn" (click)="nextMonth()" aria-label="Next month">›</button>
|
|
1581
1641
|
</div>
|
|
1582
1642
|
<!-- Weekday headers -->
|
|
1583
1643
|
<div class="dp-weekdays">
|
|
1584
|
-
@for (d of
|
|
1644
|
+
@for (d of i18n.datePicker.shortWeekdays; track d) {
|
|
1585
1645
|
<span class="dp-wd">{{ d }}</span>
|
|
1586
1646
|
}
|
|
1587
1647
|
</div>
|
|
1588
1648
|
<!-- Days grid -->
|
|
1589
|
-
<div class="dp-days">
|
|
1649
|
+
<div class="dp-days" role="grid">
|
|
1590
1650
|
@for (day of calendarDays(); track day.date?.getTime() ?? $index) {
|
|
1591
1651
|
<button
|
|
1592
1652
|
class="dp-day"
|
|
@@ -1601,13 +1661,13 @@ class DatePickerComponent {
|
|
|
1601
1661
|
</div>
|
|
1602
1662
|
<!-- Footer -->
|
|
1603
1663
|
<div class="dp-footer">
|
|
1604
|
-
<button class="dp-today-btn" (click)="selectToday()">
|
|
1605
|
-
<button class="dp-clear-btn" (click)="clearValue()">
|
|
1664
|
+
<button class="dp-today-btn" (click)="selectToday()">{{ i18n.datePicker.today }}</button>
|
|
1665
|
+
<button class="dp-clear-btn" (click)="clearValue()">{{ i18n.datePicker.clear }}</button>
|
|
1606
1666
|
</div>
|
|
1607
1667
|
</div>
|
|
1608
1668
|
}
|
|
1609
1669
|
</div>
|
|
1610
|
-
`, isInline: true, styles: [":host{display:block}.ngx-date-picker{position:relative;font-family:inherit}.dp-label{display:block;font-size:12px;font-weight:600;color:var(--ngx-input-label, #475569);margin-bottom:6px}.dp-input-wrap{display:flex;align-items:center;border:1px solid var(--ngx-input-border, #cbd5e1);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg, #fff);cursor:pointer;transition:border-color .2s,box-shadow .2s}.dp-input-wrap:hover{border-color:var(--primary-color, #4f46e5)}.open .dp-input-wrap{border-color:var(--primary-color, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15))}.disabled .dp-input-wrap{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed;opacity:.7}.dp-input{flex:1;padding:10px 14px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #0f172a);cursor:pointer;font-family:inherit}.dp-input:disabled{cursor:not-allowed;color
|
|
1670
|
+
`, isInline: true, styles: [":host{display:block}.ngx-date-picker{position:relative;font-family:inherit}.dp-label{display:block;font-size:12px;font-weight:600;color:var(--ngx-input-label, #475569);margin-bottom:6px}.dp-input-wrap{display:flex;align-items:center;border:1px solid var(--ngx-input-border, #cbd5e1);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg, #fff);cursor:pointer;transition:border-color .2s,box-shadow .2s;outline:none}.dp-input-wrap:focus-visible{border-color:var(--primary-color, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15))}.dp-input-wrap:hover{border-color:var(--primary-color, #4f46e5)}.open .dp-input-wrap{border-color:var(--primary-color, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15))}.disabled .dp-input-wrap{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed;opacity:.7}.dp-input{flex:1;padding:10px 14px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #0f172a);cursor:pointer;font-family:inherit}.dp-input:disabled{cursor:not-allowed;color:var(--ngx-color-text-disabled, #767b83)}.dp-icon{padding:0 12px;color:#64748b;font-size:14px}.dp-popup{position:absolute;top:calc(100% + 6px);left:0;z-index:1000;background:var(--bg-secondary, #fff);border:1px solid var(--border-color, #e2e8f0);border-radius:var(--ngx-input-radius, 12px);box-shadow:var(--shadow-lg, 0 10px 25px rgba(0,0,0,.08));padding:16px;width:280px}.dp-nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.dp-nav-btn{background:none;border:none;cursor:pointer;font-size:20px;color:#64748b;padding:2px 8px;border-radius:6px;line-height:1;transition:background .15s}.dp-nav-btn:hover{background:var(--border-light, #f1f5f9);color:var(--text-primary, #0f172a)}.dp-nav-title{font-size:14px;font-weight:750;color:var(--text-primary, #0f172a);font-family:var(--ngx-heading-font-family, inherit)}.dp-weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-bottom:6px}.dp-wd{text-align:center;font-size:11px;color:var(--ngx-color-text-secondary, #657080);font-weight:700;padding:4px 0;text-transform:uppercase;letter-spacing:.5px}.dp-days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}.dp-day{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:500;border:none;background:none;cursor:pointer;border-radius:50%;color:var(--text-primary, #0f172a);transition:all .15s}.dp-day:hover:not(.disabled):not(.selected){background:var(--border-light, #f1f5f9)}.dp-day.other-month{color:var(--ngx-color-text-disabled, #767b83)}.dp-day.today{font-weight:700;color:var(--primary-color, #4f46e5);border:1.5px solid var(--primary-color, #4f46e5)}.dp-day.selected{background:var(--primary-gradient, linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%));color:#fff;font-weight:600;box-shadow:0 3px 8px #4f46e54d}.dp-day.disabled{color:var(--ngx-color-text-disabled, #767b83);cursor:not-allowed;text-decoration:line-through}.dp-footer{display:flex;justify-content:space-between;margin-top:12px;padding-top:10px;border-top:1px solid var(--border-color, #e2e8f0)}.dp-today-btn,.dp-clear-btn{background:none;border:none;cursor:pointer;font-size:12px;font-weight:700;color:var(--primary-color, #4f46e5);padding:6px 12px;border-radius:6px;font-family:inherit;transition:background .15s}.dp-today-btn:hover{background:var(--primary-glow, rgba(79, 70, 229, .08))}.dp-clear-btn{color:var(--text-secondary, #64748b)}.dp-clear-btn:hover{background:var(--border-light, #f1f5f9)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1611
1671
|
}
|
|
1612
1672
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DatePickerComponent, decorators: [{
|
|
1613
1673
|
type: Component,
|
|
@@ -1623,13 +1683,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1623
1683
|
<label class="dp-label">{{ label() }}</label>
|
|
1624
1684
|
}
|
|
1625
1685
|
<!-- Input trigger -->
|
|
1626
|
-
<div
|
|
1686
|
+
<div
|
|
1687
|
+
class="dp-input-wrap"
|
|
1688
|
+
(click)="toggle()"
|
|
1689
|
+
(keydown)="onInputKeyDown($event)"
|
|
1690
|
+
[attr.tabindex]="disabled() ? -1 : 0"
|
|
1691
|
+
role="combobox"
|
|
1692
|
+
[attr.aria-expanded]="isOpen()"
|
|
1693
|
+
aria-haspopup="grid"
|
|
1694
|
+
>
|
|
1627
1695
|
<input
|
|
1628
1696
|
class="dp-input"
|
|
1629
1697
|
readonly
|
|
1630
1698
|
[value]="displayValue()"
|
|
1631
|
-
[placeholder]="
|
|
1699
|
+
[placeholder]="effectivePlaceholder()"
|
|
1632
1700
|
[disabled]="disabled()"
|
|
1701
|
+
tabindex="-1"
|
|
1633
1702
|
/>
|
|
1634
1703
|
<span class="dp-icon">📅</span>
|
|
1635
1704
|
</div>
|
|
@@ -1639,18 +1708,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1639
1708
|
<div class="dp-popup" (click)="$event.stopPropagation()">
|
|
1640
1709
|
<!-- Month/Year nav -->
|
|
1641
1710
|
<div class="dp-nav">
|
|
1642
|
-
<button class="dp-nav-btn" (click)="prevMonth()">‹</button>
|
|
1643
|
-
<span class="dp-nav-title">{{ monthTitle() }}</span>
|
|
1644
|
-
<button class="dp-nav-btn" (click)="nextMonth()">›</button>
|
|
1711
|
+
<button class="dp-nav-btn" (click)="prevMonth()" aria-label="Previous month">‹</button>
|
|
1712
|
+
<span class="dp-nav-title" aria-live="polite">{{ monthTitle() }}</span>
|
|
1713
|
+
<button class="dp-nav-btn" (click)="nextMonth()" aria-label="Next month">›</button>
|
|
1645
1714
|
</div>
|
|
1646
1715
|
<!-- Weekday headers -->
|
|
1647
1716
|
<div class="dp-weekdays">
|
|
1648
|
-
@for (d of
|
|
1717
|
+
@for (d of i18n.datePicker.shortWeekdays; track d) {
|
|
1649
1718
|
<span class="dp-wd">{{ d }}</span>
|
|
1650
1719
|
}
|
|
1651
1720
|
</div>
|
|
1652
1721
|
<!-- Days grid -->
|
|
1653
|
-
<div class="dp-days">
|
|
1722
|
+
<div class="dp-days" role="grid">
|
|
1654
1723
|
@for (day of calendarDays(); track day.date?.getTime() ?? $index) {
|
|
1655
1724
|
<button
|
|
1656
1725
|
class="dp-day"
|
|
@@ -1665,13 +1734,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1665
1734
|
</div>
|
|
1666
1735
|
<!-- Footer -->
|
|
1667
1736
|
<div class="dp-footer">
|
|
1668
|
-
<button class="dp-today-btn" (click)="selectToday()">
|
|
1669
|
-
<button class="dp-clear-btn" (click)="clearValue()">
|
|
1737
|
+
<button class="dp-today-btn" (click)="selectToday()">{{ i18n.datePicker.today }}</button>
|
|
1738
|
+
<button class="dp-clear-btn" (click)="clearValue()">{{ i18n.datePicker.clear }}</button>
|
|
1670
1739
|
</div>
|
|
1671
1740
|
</div>
|
|
1672
1741
|
}
|
|
1673
1742
|
</div>
|
|
1674
|
-
`, styles: [":host{display:block}.ngx-date-picker{position:relative;font-family:inherit}.dp-label{display:block;font-size:12px;font-weight:600;color:var(--ngx-input-label, #475569);margin-bottom:6px}.dp-input-wrap{display:flex;align-items:center;border:1px solid var(--ngx-input-border, #cbd5e1);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg, #fff);cursor:pointer;transition:border-color .2s,box-shadow .2s}.dp-input-wrap:hover{border-color:var(--primary-color, #4f46e5)}.open .dp-input-wrap{border-color:var(--primary-color, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15))}.disabled .dp-input-wrap{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed;opacity:.7}.dp-input{flex:1;padding:10px 14px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #0f172a);cursor:pointer;font-family:inherit}.dp-input:disabled{cursor:not-allowed;color
|
|
1743
|
+
`, styles: [":host{display:block}.ngx-date-picker{position:relative;font-family:inherit}.dp-label{display:block;font-size:12px;font-weight:600;color:var(--ngx-input-label, #475569);margin-bottom:6px}.dp-input-wrap{display:flex;align-items:center;border:1px solid var(--ngx-input-border, #cbd5e1);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg, #fff);cursor:pointer;transition:border-color .2s,box-shadow .2s;outline:none}.dp-input-wrap:focus-visible{border-color:var(--primary-color, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15))}.dp-input-wrap:hover{border-color:var(--primary-color, #4f46e5)}.open .dp-input-wrap{border-color:var(--primary-color, #4f46e5);box-shadow:0 0 0 3px var(--primary-glow, rgba(79, 70, 229, .15))}.disabled .dp-input-wrap{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed;opacity:.7}.dp-input{flex:1;padding:10px 14px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #0f172a);cursor:pointer;font-family:inherit}.dp-input:disabled{cursor:not-allowed;color:var(--ngx-color-text-disabled, #767b83)}.dp-icon{padding:0 12px;color:#64748b;font-size:14px}.dp-popup{position:absolute;top:calc(100% + 6px);left:0;z-index:1000;background:var(--bg-secondary, #fff);border:1px solid var(--border-color, #e2e8f0);border-radius:var(--ngx-input-radius, 12px);box-shadow:var(--shadow-lg, 0 10px 25px rgba(0,0,0,.08));padding:16px;width:280px}.dp-nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.dp-nav-btn{background:none;border:none;cursor:pointer;font-size:20px;color:#64748b;padding:2px 8px;border-radius:6px;line-height:1;transition:background .15s}.dp-nav-btn:hover{background:var(--border-light, #f1f5f9);color:var(--text-primary, #0f172a)}.dp-nav-title{font-size:14px;font-weight:750;color:var(--text-primary, #0f172a);font-family:var(--ngx-heading-font-family, inherit)}.dp-weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-bottom:6px}.dp-wd{text-align:center;font-size:11px;color:var(--ngx-color-text-secondary, #657080);font-weight:700;padding:4px 0;text-transform:uppercase;letter-spacing:.5px}.dp-days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}.dp-day{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:500;border:none;background:none;cursor:pointer;border-radius:50%;color:var(--text-primary, #0f172a);transition:all .15s}.dp-day:hover:not(.disabled):not(.selected){background:var(--border-light, #f1f5f9)}.dp-day.other-month{color:var(--ngx-color-text-disabled, #767b83)}.dp-day.today{font-weight:700;color:var(--primary-color, #4f46e5);border:1.5px solid var(--primary-color, #4f46e5)}.dp-day.selected{background:var(--primary-gradient, linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%));color:#fff;font-weight:600;box-shadow:0 3px 8px #4f46e54d}.dp-day.disabled{color:var(--ngx-color-text-disabled, #767b83);cursor:not-allowed;text-decoration:line-through}.dp-footer{display:flex;justify-content:space-between;margin-top:12px;padding-top:10px;border-top:1px solid var(--border-color, #e2e8f0)}.dp-today-btn,.dp-clear-btn{background:none;border:none;cursor:pointer;font-size:12px;font-weight:700;color:var(--primary-color, #4f46e5);padding:6px 12px;border-radius:6px;font-family:inherit;transition:background .15s}.dp-today-btn:hover{background:var(--primary-glow, rgba(79, 70, 229, .08))}.dp-clear-btn{color:var(--text-secondary, #64748b)}.dp-clear-btn:hover{background:var(--border-light, #f1f5f9)}\n"] }]
|
|
1675
1744
|
}], propDecorators: { onDocClick: [{
|
|
1676
1745
|
type: HostListener,
|
|
1677
1746
|
args: ['document:click', ['$event']]
|
|
@@ -3044,6 +3113,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
3044
3113
|
}] });
|
|
3045
3114
|
|
|
3046
3115
|
class FileUploadComponent {
|
|
3116
|
+
i18n = inject(NGX_CORE_I18N);
|
|
3047
3117
|
// Inputs
|
|
3048
3118
|
multiple = input(false);
|
|
3049
3119
|
accept = input(''); // comma separated file rules
|
|
@@ -3151,7 +3221,7 @@ class FileUploadComponent {
|
|
|
3151
3221
|
// 1. Max Size check
|
|
3152
3222
|
const maxLimit = this.maxSize();
|
|
3153
3223
|
if (maxLimit > 0 && file.size > maxLimit) {
|
|
3154
|
-
return
|
|
3224
|
+
return `${this.i18n.fileUpload.maxSizeError} (${this.formatBytes(maxLimit)})`;
|
|
3155
3225
|
}
|
|
3156
3226
|
// 2. Type/Accept format check
|
|
3157
3227
|
const acceptRule = this.accept();
|
|
@@ -3172,7 +3242,7 @@ class FileUploadComponent {
|
|
|
3172
3242
|
}
|
|
3173
3243
|
});
|
|
3174
3244
|
if (!isAllowed) {
|
|
3175
|
-
return
|
|
3245
|
+
return `${this.i18n.fileUpload.invalidTypeError} ("${acceptRule}")`;
|
|
3176
3246
|
}
|
|
3177
3247
|
}
|
|
3178
3248
|
return null;
|
|
@@ -3290,7 +3360,7 @@ class FileUploadComponent {
|
|
|
3290
3360
|
</svg>
|
|
3291
3361
|
</div>
|
|
3292
3362
|
<div class="upload-headline">
|
|
3293
|
-
<span class="highlight">
|
|
3363
|
+
<span class="highlight">{{ i18n.fileUpload.browse }}</span> {{ i18n.fileUpload.dragDrop }}
|
|
3294
3364
|
</div>
|
|
3295
3365
|
<div class="upload-subtext">
|
|
3296
3366
|
{{ getHelperText() }}
|
|
@@ -3303,7 +3373,7 @@ class FileUploadComponent {
|
|
|
3303
3373
|
<div class="file-queue-list">
|
|
3304
3374
|
<div class="queue-header">
|
|
3305
3375
|
<h4>Files Queue ({{ fileQueue().length }})</h4>
|
|
3306
|
-
<button class="clear-all-btn" (click)="clearAll()" [disabled]="disabled()">
|
|
3376
|
+
<button class="clear-all-btn" (click)="clearAll()" [disabled]="disabled()">{{ i18n.datePicker.clear }} All</button>
|
|
3307
3377
|
</div>
|
|
3308
3378
|
|
|
3309
3379
|
<div class="queue-items">
|
|
@@ -3352,7 +3422,7 @@ class FileUploadComponent {
|
|
|
3352
3422
|
🔄
|
|
3353
3423
|
</button>
|
|
3354
3424
|
}
|
|
3355
|
-
<button class="action-btn remove-btn" (click)="removeFile(item)" title="
|
|
3425
|
+
<button class="action-btn remove-btn" (click)="removeFile(item)" [title]="i18n.fileUpload.removeFile" [disabled]="disabled()">
|
|
3356
3426
|
✕
|
|
3357
3427
|
</button>
|
|
3358
3428
|
</div>
|
|
@@ -3405,7 +3475,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
3405
3475
|
</svg>
|
|
3406
3476
|
</div>
|
|
3407
3477
|
<div class="upload-headline">
|
|
3408
|
-
<span class="highlight">
|
|
3478
|
+
<span class="highlight">{{ i18n.fileUpload.browse }}</span> {{ i18n.fileUpload.dragDrop }}
|
|
3409
3479
|
</div>
|
|
3410
3480
|
<div class="upload-subtext">
|
|
3411
3481
|
{{ getHelperText() }}
|
|
@@ -3418,7 +3488,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
3418
3488
|
<div class="file-queue-list">
|
|
3419
3489
|
<div class="queue-header">
|
|
3420
3490
|
<h4>Files Queue ({{ fileQueue().length }})</h4>
|
|
3421
|
-
<button class="clear-all-btn" (click)="clearAll()" [disabled]="disabled()">
|
|
3491
|
+
<button class="clear-all-btn" (click)="clearAll()" [disabled]="disabled()">{{ i18n.datePicker.clear }} All</button>
|
|
3422
3492
|
</div>
|
|
3423
3493
|
|
|
3424
3494
|
<div class="queue-items">
|
|
@@ -3467,7 +3537,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
3467
3537
|
🔄
|
|
3468
3538
|
</button>
|
|
3469
3539
|
}
|
|
3470
|
-
<button class="action-btn remove-btn" (click)="removeFile(item)" title="
|
|
3540
|
+
<button class="action-btn remove-btn" (click)="removeFile(item)" [title]="i18n.fileUpload.removeFile" [disabled]="disabled()">
|
|
3471
3541
|
✕
|
|
3472
3542
|
</button>
|
|
3473
3543
|
</div>
|