@daracl/form 0.0.2 → 0.0.4
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/dist/daracl.form.js +20 -12
- package/dist/daracl.form.js.map +1 -1
- package/dist/daracl.form.min.css +1 -1
- package/dist/daracl.form.min.css.map +1 -1
- package/dist/daracl.form.min.js +2 -2
- package/dist/daracl.form.min.js.LICENSE.txt +1 -1
- package/dist/daracl.form.min.js.map +1 -1
- package/dist/index.cjs +15 -7
- package/dist/index.cjs.map +2 -2
- package/dist/index.html +4 -4
- package/dist/index.js +15 -7
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2324,6 +2324,7 @@ var init_DateTimePicker = __esm({
|
|
|
2324
2324
|
mode: "date",
|
|
2325
2325
|
enableTodayBtn: true,
|
|
2326
2326
|
showMonthAfterYear: false,
|
|
2327
|
+
isPositionFixed: false,
|
|
2327
2328
|
format: "",
|
|
2328
2329
|
zIndex: 1e3,
|
|
2329
2330
|
minDate: "",
|
|
@@ -2672,14 +2673,21 @@ var init_DateTimePicker = __esm({
|
|
|
2672
2673
|
const rect = this.targetElement.getBoundingClientRect();
|
|
2673
2674
|
const scrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
2674
2675
|
const scrollLeft = window.scrollX || document.documentElement.scrollLeft;
|
|
2675
|
-
const
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
top =
|
|
2676
|
+
const elementHeight = this.datetimeElement.offsetHeight;
|
|
2677
|
+
const targetElementHeight = this.targetElement.offsetHeight + 2;
|
|
2678
|
+
let left = rect.left + scrollLeft;
|
|
2679
|
+
let top = 0;
|
|
2680
|
+
if (this.options.isPositionFixed) {
|
|
2681
|
+
top = rect.top + targetElementHeight;
|
|
2682
|
+
left = rect.left;
|
|
2683
|
+
} else {
|
|
2684
|
+
if (rect.top + targetElementHeight + elementHeight > docSize.clientHeight && rect.top >= elementHeight) {
|
|
2685
|
+
top = scrollTop + rect.top - elementHeight - 2;
|
|
2686
|
+
} else {
|
|
2687
|
+
top = scrollTop + rect.top + targetElementHeight;
|
|
2688
|
+
}
|
|
2681
2689
|
}
|
|
2682
|
-
this.datetimeElement.setAttribute("style",
|
|
2690
|
+
this.datetimeElement.setAttribute("style", `${this.options.isPositionFixed ? "position:fixed;" : ""}top:${top}px;left:${left}px;z-index:${this.options.zIndex}`);
|
|
2683
2691
|
document.addEventListener("click", this._documentClickEvent);
|
|
2684
2692
|
}
|
|
2685
2693
|
/**
|