@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/daracl.form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @daracl/form v0.0.
|
|
2
|
+
* @daracl/form v0.0.4
|
|
3
3
|
* Copyright 2023-2024 darainfo and other contributors;
|
|
4
4
|
* Licensed MIT
|
|
5
5
|
*/
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
else if(typeof define === 'function' && define.amd)
|
|
10
10
|
define([], factory);
|
|
11
11
|
else if(typeof exports === 'object')
|
|
12
|
-
exports["
|
|
12
|
+
exports["Daracl"] = factory();
|
|
13
13
|
else
|
|
14
|
-
root["
|
|
14
|
+
root["Daracl"] = root["Daracl"] || {}, root["Daracl"]["form"] = factory();
|
|
15
15
|
})(self, () => {
|
|
16
16
|
return /******/ (() => { // webpackBootstrap
|
|
17
17
|
/******/ "use strict";
|
|
@@ -718,6 +718,7 @@ var init_DateTimePicker = __esm({
|
|
|
718
718
|
mode: "date" /* date */,
|
|
719
719
|
enableTodayBtn: true,
|
|
720
720
|
showMonthAfterYear: false,
|
|
721
|
+
isPositionFixed: false,
|
|
721
722
|
format: "",
|
|
722
723
|
zIndex: 1e3,
|
|
723
724
|
minDate: "",
|
|
@@ -820,7 +821,7 @@ var init_DateTimePicker = __esm({
|
|
|
820
821
|
this.initTimeEvent();
|
|
821
822
|
}
|
|
822
823
|
static {
|
|
823
|
-
this.VERSION = `${"0.0.
|
|
824
|
+
this.VERSION = `${"0.0.4"}`;
|
|
824
825
|
}
|
|
825
826
|
static {
|
|
826
827
|
this.format = format_default;
|
|
@@ -1072,14 +1073,21 @@ var init_DateTimePicker = __esm({
|
|
|
1072
1073
|
const rect = this.targetElement.getBoundingClientRect();
|
|
1073
1074
|
const scrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
1074
1075
|
const scrollLeft = window.scrollX || document.documentElement.scrollLeft;
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
top =
|
|
1076
|
+
const elementHeight = this.datetimeElement.offsetHeight;
|
|
1077
|
+
const targetElementHeight = this.targetElement.offsetHeight + 2;
|
|
1078
|
+
let left = rect.left + scrollLeft;
|
|
1079
|
+
let top = 0;
|
|
1080
|
+
if (this.options.isPositionFixed) {
|
|
1081
|
+
top = rect.top + targetElementHeight;
|
|
1082
|
+
left = rect.left;
|
|
1083
|
+
} else {
|
|
1084
|
+
if (rect.top + targetElementHeight + elementHeight > docSize.clientHeight && rect.top >= elementHeight) {
|
|
1085
|
+
top = scrollTop + rect.top - elementHeight - 2;
|
|
1086
|
+
} else {
|
|
1087
|
+
top = scrollTop + rect.top + targetElementHeight;
|
|
1088
|
+
}
|
|
1081
1089
|
}
|
|
1082
|
-
this.datetimeElement.setAttribute("style",
|
|
1090
|
+
this.datetimeElement.setAttribute("style", `${this.options.isPositionFixed ? "position:fixed;" : ""}top:${top}px;left:${left}px;z-index:${this.options.zIndex}`);
|
|
1083
1091
|
document.addEventListener("click", this._documentClickEvent);
|
|
1084
1092
|
}
|
|
1085
1093
|
/**
|
|
@@ -1816,7 +1824,7 @@ class DaraForm {
|
|
|
1816
1824
|
return this.fieldInfoMap;
|
|
1817
1825
|
}
|
|
1818
1826
|
}
|
|
1819
|
-
DaraForm.VERSION = `${"0.0.
|
|
1827
|
+
DaraForm.VERSION = `${"0.0.4"}`;
|
|
1820
1828
|
DaraForm.validator = {
|
|
1821
1829
|
string: (value, field) => {
|
|
1822
1830
|
return (0, stringValidator_1.stringValidator)(value, field);
|