ryzen-ui 0.2.15 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ryzen-ui.mjs +23 -41
- package/fesm2022/ryzen-ui.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2022/ryzen-ui.mjs
CHANGED
|
@@ -139,18 +139,7 @@ class DatePickerComponent {
|
|
|
139
139
|
_monthName = computed(() => this._monthNames[this._viewDate().getMonth()], ...(ngDevMode ? [{ debugName: "_monthName" }] : []));
|
|
140
140
|
_year = computed(() => this._viewDate().getFullYear(), ...(ngDevMode ? [{ debugName: "_year" }] : []));
|
|
141
141
|
_decadeLabel = computed(() => `${this._decade()} - ${this._decade() + 9}`, ...(ngDevMode ? [{ debugName: "_decadeLabel" }] : []));
|
|
142
|
-
_appendToParent = computed(() => {
|
|
143
|
-
const a = this.appendTo();
|
|
144
|
-
if (a)
|
|
145
|
-
return a === 'body';
|
|
146
|
-
const cb = this.config().appendToBody;
|
|
147
|
-
if (cb !== undefined)
|
|
148
|
-
return cb;
|
|
149
|
-
const cp = this.config().appendToParent;
|
|
150
|
-
if (cp !== undefined)
|
|
151
|
-
return !cp;
|
|
152
|
-
return true;
|
|
153
|
-
}, ...(ngDevMode ? [{ debugName: "_appendToParent" }] : []));
|
|
142
|
+
_appendToParent = computed(() => true, ...(ngDevMode ? [{ debugName: "_appendToParent" }] : []));
|
|
154
143
|
_panelFixed = computed(() => this._isOpen() && this._appendToParent() ? 'fixed' : null, ...(ngDevMode ? [{ debugName: "_panelFixed" }] : []));
|
|
155
144
|
_showTodayBtn = computed(() => this.config().showTodayButton !== false, ...(ngDevMode ? [{ debugName: "_showTodayBtn" }] : []));
|
|
156
145
|
_showYearNav = computed(() => this.config().showYearNavigation !== false, ...(ngDevMode ? [{ debugName: "_showYearNav" }] : []));
|
|
@@ -439,18 +428,7 @@ class DropDownComponent {
|
|
|
439
428
|
_panelWidth = signal(0, ...(ngDevMode ? [{ debugName: "_panelWidth" }] : []));
|
|
440
429
|
_panelEl = null;
|
|
441
430
|
_searchQuery = signal('', ...(ngDevMode ? [{ debugName: "_searchQuery" }] : []));
|
|
442
|
-
_appendToParent = computed(() => {
|
|
443
|
-
const a = this.appendTo();
|
|
444
|
-
if (a)
|
|
445
|
-
return a === 'body';
|
|
446
|
-
const cb = this.config().appendToBody;
|
|
447
|
-
if (cb !== undefined)
|
|
448
|
-
return cb;
|
|
449
|
-
const cp = this.config().appendToParent;
|
|
450
|
-
if (cp !== undefined)
|
|
451
|
-
return !cp;
|
|
452
|
-
return true;
|
|
453
|
-
}, ...(ngDevMode ? [{ debugName: "_appendToParent" }] : []));
|
|
431
|
+
_appendToParent = computed(() => true, ...(ngDevMode ? [{ debugName: "_appendToParent" }] : []));
|
|
454
432
|
_panelFixed = computed(() => this._isOpen() && this._appendToParent() ? 'fixed' : null, ...(ngDevMode ? [{ debugName: "_panelFixed" }] : []));
|
|
455
433
|
_maxHeight = computed(() => this.config().maxHeight ?? '256px', ...(ngDevMode ? [{ debugName: "_maxHeight" }] : []));
|
|
456
434
|
_selectedLabel = computed(() => {
|
|
@@ -549,9 +527,20 @@ class DropDownComponent {
|
|
|
549
527
|
this.value.set(null);
|
|
550
528
|
}
|
|
551
529
|
_onWindowScroll() {
|
|
552
|
-
if (this._isOpen()
|
|
553
|
-
|
|
530
|
+
if (!this._isOpen() || !this._appendToParent())
|
|
531
|
+
return;
|
|
532
|
+
const rect = this._elementRef.nativeElement.getBoundingClientRect();
|
|
533
|
+
const dir = this._direction();
|
|
534
|
+
if (dir === 'up' || dir === 'down') {
|
|
535
|
+
this._panelDirection.set(dir);
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
const panelH = Math.min(320, parseInt(this._maxHeight()));
|
|
539
|
+
this._panelDirection.set(window.innerHeight - rect.bottom >= panelH + 60 ? 'down' : 'up');
|
|
554
540
|
}
|
|
541
|
+
this._panelX.set(rect.left);
|
|
542
|
+
this._panelY.set(this._panelDirection() === 'down' ? rect.bottom : rect.top);
|
|
543
|
+
this._panelWidth.set(rect.width);
|
|
555
544
|
}
|
|
556
545
|
_onDocClick(event) {
|
|
557
546
|
if (!this._isOpen())
|
|
@@ -718,18 +707,7 @@ class MultiSelectComponent {
|
|
|
718
707
|
_panelWidth = signal(0, ...(ngDevMode ? [{ debugName: "_panelWidth" }] : []));
|
|
719
708
|
_panelEl = null;
|
|
720
709
|
_searchQuery = signal('', ...(ngDevMode ? [{ debugName: "_searchQuery" }] : []));
|
|
721
|
-
_appendToParent = computed(() => {
|
|
722
|
-
const a = this.appendTo();
|
|
723
|
-
if (a)
|
|
724
|
-
return a === 'body';
|
|
725
|
-
const cb = this.config().appendToBody;
|
|
726
|
-
if (cb !== undefined)
|
|
727
|
-
return cb;
|
|
728
|
-
const cp = this.config().appendToParent;
|
|
729
|
-
if (cp !== undefined)
|
|
730
|
-
return !cp;
|
|
731
|
-
return true;
|
|
732
|
-
}, ...(ngDevMode ? [{ debugName: "_appendToParent" }] : []));
|
|
710
|
+
_appendToParent = computed(() => true, ...(ngDevMode ? [{ debugName: "_appendToParent" }] : []));
|
|
733
711
|
_panelFixed = computed(() => this._isOpen() && this._appendToParent() ? 'fixed' : null, ...(ngDevMode ? [{ debugName: "_panelFixed" }] : []));
|
|
734
712
|
_maxHeight = computed(() => this.config().maxHeight ?? '256px', ...(ngDevMode ? [{ debugName: "_maxHeight" }] : []));
|
|
735
713
|
_selectedLabels = computed(() => {
|
|
@@ -869,9 +847,13 @@ class MultiSelectComponent {
|
|
|
869
847
|
this.value.set([]);
|
|
870
848
|
}
|
|
871
849
|
_onWindowScroll() {
|
|
872
|
-
if (this._isOpen()
|
|
873
|
-
|
|
874
|
-
|
|
850
|
+
if (!this._isOpen() || !this._appendToParent())
|
|
851
|
+
return;
|
|
852
|
+
const rect = this._elementRef.nativeElement.getBoundingClientRect();
|
|
853
|
+
this._panelDirection.set(window.innerHeight - rect.bottom >= 320 ? 'down' : 'up');
|
|
854
|
+
this._panelX.set(rect.left);
|
|
855
|
+
this._panelY.set(this._panelDirection() === 'down' ? rect.bottom : rect.top);
|
|
856
|
+
this._panelWidth.set(rect.width);
|
|
875
857
|
}
|
|
876
858
|
_onDocClick(event) {
|
|
877
859
|
if (!this._isOpen())
|