@wernfried/daterangepicker 5.4.1 → 5.4.2
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/README.md +8 -8
- package/dist/cjs/daterangepicker.cjs +6 -2
- package/dist/cjs/daterangepicker.cjs.map +1 -1
- package/dist/cjs/daterangepicker.min.cjs +1 -1
- package/dist/cjs/daterangepicker.min.cjs.map +1 -1
- package/dist/esm/daterangepicker.js +6 -2
- package/dist/esm/daterangepicker.js.map +1 -1
- package/dist/esm/daterangepicker.min.js +1 -1
- package/dist/esm/daterangepicker.min.js.map +1 -1
- package/dist/global/daterangepicker.js +6 -2
- package/dist/global/daterangepicker.js.map +1 -1
- package/dist/global/daterangepicker.min.js +1 -1
- package/dist/global/daterangepicker.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ var DateRangePicker = (function(exports, luxon2) {
|
|
|
6
6
|
constructor(element, options, cb) {
|
|
7
7
|
if (typeof element === "string" && document.querySelectorAll(element).length > 1)
|
|
8
8
|
throw new RangeError(`Option 'element' must match to one element only`);
|
|
9
|
-
this.parentEl = "body";
|
|
9
|
+
this.parentEl = document.querySelector("body");
|
|
10
10
|
this.element = element instanceof HTMLElement ? element : document.querySelector(element);
|
|
11
11
|
this.isInputText = this.element instanceof HTMLInputElement && this.element.type === "text";
|
|
12
12
|
this.button = null;
|
|
@@ -161,7 +161,11 @@ var DateRangePicker = (function(exports, luxon2) {
|
|
|
161
161
|
options.template = template.join("");
|
|
162
162
|
this.container = createElementFromHTML(options.template);
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
if (options.parentEl instanceof HTMLElement) {
|
|
165
|
+
this.parentEl = options.parentEl;
|
|
166
|
+
} else if (typeof options.parentEl === "string") {
|
|
167
|
+
this.parentEl = document.querySelector(options.parentEl) ?? this.parentEl;
|
|
168
|
+
}
|
|
165
169
|
this.parentEl.appendChild(this.container);
|
|
166
170
|
if (typeof options.timePicker === "boolean")
|
|
167
171
|
this.timePicker = options.timePicker;
|