@oslokommune/punkt-elements 12.11.2 → 12.11.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/{class-map-DpN1m5lh.js → class-map-BQ3-MseA.js} +1 -1
- package/dist/{class-map-B9m-NycN.cjs → class-map-DLFPHEre.cjs} +1 -1
- package/dist/{helptext-B0Frb38k.js → helptext-D-5_-HAW.js} +3 -3
- package/dist/{helptext-0fI9cWEe.cjs → helptext-WCq0-Dq8.cjs} +1 -1
- package/dist/{index-Dw-V4--g.js → index-BQ9BMXel.js} +31 -27
- package/dist/{index-DmedytuY.js → index-BR7EVgX9.js} +3 -3
- package/dist/{index-CBFF6OHE.cjs → index-BVbNUNAa.cjs} +5 -5
- package/dist/{index-DkLa0YLm.js → index-BfUPq43a.js} +1 -1
- package/dist/{index-CqWQt14b.cjs → index-DYiD-o1w.cjs} +1 -1
- package/dist/{index-aLVFdclF.cjs → index-DyL6sqFY.cjs} +1 -1
- package/dist/index.d.ts +3 -14
- package/dist/{modal-FnkYHLoK.cjs → modal-BXKX0dxk.cjs} +1 -1
- package/dist/{modal-D6J8TqCp.js → modal-CYx_wrz1.js} +4 -4
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +4 -4
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +4 -4
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +4 -4
- package/dist/pkt-component-template.cjs +1 -1
- package/dist/pkt-component-template.js +3 -3
- package/dist/pkt-datepicker.cjs +42 -37
- package/dist/pkt-datepicker.js +194 -173
- package/dist/pkt-element.cjs +1 -1
- package/dist/pkt-element.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -2
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +4 -4
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +5 -5
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +4 -4
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +4 -4
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +4 -4
- package/dist/{ref-D5FOI49b.js → ref-BjO0bKwt.js} +1 -1
- package/dist/{ref-3QXuhm6y.cjs → ref-CIjJrMxp.cjs} +1 -1
- package/package.json +3 -3
- package/src/components/datepicker/index.ts +42 -23
package/dist/pkt-datepicker.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { T as
|
|
1
|
+
import { T as A, r as P, a as L, x as v, E as b, n as d } from "./index-BQ9BMXel.js";
|
|
2
2
|
import { e as j, i as F, a as q, t as H } from "./custom-element-CWfU4dcr.js";
|
|
3
|
-
import { p as U, v as y, r as
|
|
4
|
-
import { e as
|
|
5
|
-
import { a as
|
|
6
|
-
import { n as
|
|
3
|
+
import { p as U, v as y, r as w, M as _, m as N, e as R, n as $ } from "./ref-BjO0bKwt.js";
|
|
4
|
+
import { e as x } from "./class-map-BQ3-MseA.js";
|
|
5
|
+
import { a as V } from "./converters-DNCwIFwr.js";
|
|
6
|
+
import { n as T, f as D, a as W, b as M } from "./index-BR7EVgX9.js";
|
|
7
7
|
import "./pkt-input-wrapper.js";
|
|
8
|
-
import "./index-
|
|
8
|
+
import "./index-BfUPq43a.js";
|
|
9
9
|
import "./pkt-tag.js";
|
|
10
10
|
/**
|
|
11
11
|
* @license
|
|
12
12
|
* Copyright 2017 Google LLC
|
|
13
13
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
14
14
|
*/
|
|
15
|
-
const E = (e, t,
|
|
16
|
-
const
|
|
17
|
-
for (let i = t; i <=
|
|
18
|
-
return
|
|
19
|
-
},
|
|
15
|
+
const E = (e, t, s) => {
|
|
16
|
+
const a = /* @__PURE__ */ new Map();
|
|
17
|
+
for (let i = t; i <= s; i++) a.set(e[i], i);
|
|
18
|
+
return a;
|
|
19
|
+
}, K = j(class extends F {
|
|
20
20
|
constructor(e) {
|
|
21
21
|
if (super(e), e.type !== q.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
22
22
|
}
|
|
23
|
-
dt(e, t,
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
const i = [],
|
|
27
|
-
let
|
|
28
|
-
for (const f of e) i[
|
|
29
|
-
return { values:
|
|
23
|
+
dt(e, t, s) {
|
|
24
|
+
let a;
|
|
25
|
+
s === void 0 ? s = t : t !== void 0 && (a = t);
|
|
26
|
+
const i = [], r = [];
|
|
27
|
+
let n = 0;
|
|
28
|
+
for (const f of e) i[n] = a ? a(f, n) : n, r[n] = s(f, n), n++;
|
|
29
|
+
return { values: r, keys: i };
|
|
30
30
|
}
|
|
31
|
-
render(e, t,
|
|
32
|
-
return this.dt(e, t,
|
|
31
|
+
render(e, t, s) {
|
|
32
|
+
return this.dt(e, t, s).values;
|
|
33
33
|
}
|
|
34
|
-
update(e, [t,
|
|
35
|
-
const i = U(e), { values:
|
|
36
|
-
if (!Array.isArray(i)) return this.ut =
|
|
34
|
+
update(e, [t, s, a]) {
|
|
35
|
+
const i = U(e), { values: r, keys: n } = this.dt(t, s, a);
|
|
36
|
+
if (!Array.isArray(i)) return this.ut = n, r;
|
|
37
37
|
const f = this.ut ?? (this.ut = []), m = [];
|
|
38
|
-
let
|
|
39
|
-
for (;
|
|
38
|
+
let C, I, p = 0, h = i.length - 1, u = 0, c = r.length - 1;
|
|
39
|
+
for (; p <= h && u <= c; ) if (i[p] === null) p++;
|
|
40
40
|
else if (i[h] === null) h--;
|
|
41
|
-
else if (f[
|
|
42
|
-
else if (f[h] ===
|
|
43
|
-
else if (f[
|
|
44
|
-
else if (f[h] ===
|
|
45
|
-
else if (
|
|
46
|
-
const g =
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
y(
|
|
50
|
-
} else m[
|
|
51
|
-
|
|
52
|
-
} else
|
|
53
|
-
else
|
|
54
|
-
for (;
|
|
55
|
-
const g =
|
|
56
|
-
y(g,
|
|
41
|
+
else if (f[p] === n[u]) m[u] = y(i[p], r[u]), p++, u++;
|
|
42
|
+
else if (f[h] === n[c]) m[c] = y(i[h], r[c]), h--, c--;
|
|
43
|
+
else if (f[p] === n[c]) m[c] = y(i[p], r[c]), w(e, m[c + 1], i[p]), p++, c--;
|
|
44
|
+
else if (f[h] === n[u]) m[u] = y(i[h], r[u]), w(e, i[p], i[h]), h--, u++;
|
|
45
|
+
else if (C === void 0 && (C = E(n, u, c), I = E(f, p, h)), C.has(f[p])) if (C.has(f[h])) {
|
|
46
|
+
const g = I.get(n[u]), S = g !== void 0 ? i[g] : null;
|
|
47
|
+
if (S === null) {
|
|
48
|
+
const O = w(e, i[p]);
|
|
49
|
+
y(O, r[u]), m[u] = O;
|
|
50
|
+
} else m[u] = y(S, r[u]), w(e, i[p], S), i[g] = null;
|
|
51
|
+
u++;
|
|
52
|
+
} else _(i[h]), h--;
|
|
53
|
+
else _(i[p]), p++;
|
|
54
|
+
for (; u <= c; ) {
|
|
55
|
+
const g = w(e, m[c + 1]);
|
|
56
|
+
y(g, r[u]), m[u++] = g;
|
|
57
57
|
}
|
|
58
|
-
for (;
|
|
59
|
-
const g = i[
|
|
60
|
-
g !== null &&
|
|
58
|
+
for (; p <= h; ) {
|
|
59
|
+
const g = i[p++];
|
|
60
|
+
g !== null && _(g);
|
|
61
61
|
}
|
|
62
|
-
return this.ut =
|
|
62
|
+
return this.ut = n, N(e, m), A;
|
|
63
63
|
}
|
|
64
|
-
}),
|
|
64
|
+
}), z = "pkt-datepicker", G = !0, J = {
|
|
65
65
|
name: {
|
|
66
66
|
type: "string",
|
|
67
67
|
name: "Navn",
|
|
@@ -229,7 +229,7 @@ const E = (e, t, a) => {
|
|
|
229
229
|
name: "ID",
|
|
230
230
|
description: "Unik identifikasjon for datovelgeren"
|
|
231
231
|
}
|
|
232
|
-
},
|
|
232
|
+
}, Q = {
|
|
233
233
|
change: {
|
|
234
234
|
type: "Event",
|
|
235
235
|
description: "Returnerer valgt dato som streng i ISO-format"
|
|
@@ -242,35 +242,26 @@ const E = (e, t, a) => {
|
|
|
242
242
|
type: "CustomEvent",
|
|
243
243
|
description: "Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes"
|
|
244
244
|
}
|
|
245
|
-
},
|
|
246
|
-
name:
|
|
245
|
+
}, k = {
|
|
246
|
+
name: z,
|
|
247
247
|
"css-class": "pkt-datepicker",
|
|
248
|
-
isElement:
|
|
249
|
-
props:
|
|
250
|
-
events:
|
|
248
|
+
isElement: G,
|
|
249
|
+
props: J,
|
|
250
|
+
events: Q
|
|
251
251
|
};
|
|
252
|
-
var
|
|
253
|
-
for (var i =
|
|
254
|
-
(
|
|
255
|
-
return
|
|
252
|
+
var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, o = (e, t, s, a) => {
|
|
253
|
+
for (var i = a > 1 ? void 0 : a ? Y(t, s) : t, r = e.length - 1, n; r >= 0; r--)
|
|
254
|
+
(n = e[r]) && (i = (a ? n(t, s, i) : n(i)) || i);
|
|
255
|
+
return a && i && X(t, s, i), i;
|
|
256
256
|
};
|
|
257
257
|
const B = (e) => new Promise((t) => setTimeout(t, e));
|
|
258
|
-
let l = class extends
|
|
258
|
+
let l = class extends L {
|
|
259
259
|
constructor() {
|
|
260
|
-
super(...arguments), this.value = "", this._value = this.value ? Array.isArray(this.value) ? this.value : this.value.split(",") : [], this.label = "Datovelger", this.dateformat =
|
|
261
|
-
"pkt-input": !0,
|
|
262
|
-
"pkt-datepicker__input": !0,
|
|
263
|
-
"pkt-input--fullwidth": this.fullwidth
|
|
264
|
-
}, this.buttonClasses = {
|
|
265
|
-
"pkt-input-icon": !0,
|
|
266
|
-
"pkt-btn": !0,
|
|
267
|
-
"pkt-btn--icon-only": !0,
|
|
268
|
-
"pkt-btn--tertiary": !0
|
|
269
|
-
}, this.addToSelected = (e) => {
|
|
260
|
+
super(...arguments), this.value = "", this._value = this.value ? Array.isArray(this.value) ? this.value : this.value.split(",") : [], this.label = "Datovelger", this.dateformat = k.props.dateformat.default, this.multiple = k.props.multiple.default, this.maxlength = k.props.maxlength.default, this.range = k.props.range.default, this.showRangeLabels = !1, this.min = null, this.max = null, this.weeknumbers = k.props.weeknumbers.default, this.withcontrols = k.props.withcontrols.default, this.fullwidth = !1, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.useWrapper = !0, this.calendarOpen = !1, this.timezone = "Europe/Oslo", this.inputClasses = {}, this.buttonClasses = {}, this.inputRef = R(), this.inputRefTo = R(), this.btnRef = R(), this.calRef = R(), this.popupRef = R(), this.addToSelected = (e) => {
|
|
270
261
|
const t = e.target;
|
|
271
262
|
if (!t.value) return;
|
|
272
|
-
const
|
|
273
|
-
i && !isNaN(i.getTime()) && (!
|
|
263
|
+
const s = this.min ? T(this.min) : null, a = this.max ? T(this.max) : null, i = T(t.value.split(",")[0]);
|
|
264
|
+
i && !isNaN(i.getTime()) && (!s || i >= s) && (!a || i <= a) && this.calRef.value && this.calRef.value.handleDateSelect(i), t.value = "";
|
|
274
265
|
};
|
|
275
266
|
}
|
|
276
267
|
/**
|
|
@@ -278,18 +269,18 @@ let l = class extends A {
|
|
|
278
269
|
*/
|
|
279
270
|
async connectedCallback() {
|
|
280
271
|
super.connectedCallback(), this.isMobileSafari = /iP(ad|od|hone)/i.test(window.navigator.userAgent) && !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/), this.inputType = this.isMobileSafari ? "text" : "date", document && document.body.addEventListener("click", (e) => {
|
|
281
|
-
var t,
|
|
282
|
-
(t = this.inputRef) != null && t.value && ((
|
|
283
|
-
}), this.value.length && this._value.length === 0 && (this._value = Array.isArray(this.value) ? this.value : this.value.split(",")), this.min = this.min ||
|
|
272
|
+
var t, s;
|
|
273
|
+
(t = this.inputRef) != null && t.value && ((s = this.btnRef) != null && s.value) && !this.inputRef.value.contains(e.target) && !(this.inputRefTo.value && this.inputRefTo.value.contains(e.target)) && !this.btnRef.value.contains(e.target) && !e.target.closest(".pkt-calendar-popup") && this.calendarOpen && (this.onBlur(), this.hideCalendar());
|
|
274
|
+
}), this.value.length && this._value.length === 0 && (this._value = Array.isArray(this.value) ? this.value : this.value.split(",")), this.min = this.min || k.props.min.default, this.max = this.max || k.props.max.default, typeof this.excludedates == "string" && (this.excludedates = this.excludedates.split(",")), typeof this.excludeweekdays == "string" && (this.excludeweekdays = this.excludeweekdays.split(",")), (this.multiple || this.range) && this.name && !this.name.endsWith("[]") && (this.name = this.name + "[]"), this.calendarOpen && (await B(20), this.handleCalendarPosition());
|
|
284
275
|
}
|
|
285
276
|
disconnectedCallback() {
|
|
286
277
|
super.disconnectedCallback(), document && document.body.removeEventListener("click", (e) => {
|
|
287
|
-
var t,
|
|
288
|
-
(t = this.inputRef) != null && t.value && ((
|
|
278
|
+
var t, s;
|
|
279
|
+
(t = this.inputRef) != null && t.value && ((s = this.btnRef) != null && s.value) && !this.inputRef.value.contains(e.target) && !this.btnRef.value.contains(e.target) && this.hideCalendar();
|
|
289
280
|
});
|
|
290
281
|
}
|
|
291
|
-
attributeChangedCallback(e, t,
|
|
292
|
-
e === "value" && this.valueChanged(this.value, t), e === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = (
|
|
282
|
+
attributeChangedCallback(e, t, s) {
|
|
283
|
+
e === "value" && this.valueChanged(this.value, t), e === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = (s == null ? void 0 : s.split(",")) ?? []), e === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = (s == null ? void 0 : s.split(",")) ?? []), super.attributeChangedCallback(e, t, s);
|
|
293
284
|
}
|
|
294
285
|
firstUpdated(e) {
|
|
295
286
|
super.firstUpdated(e);
|
|
@@ -304,9 +295,9 @@ let l = class extends A {
|
|
|
304
295
|
* Rendering
|
|
305
296
|
*/
|
|
306
297
|
renderInput() {
|
|
307
|
-
return
|
|
298
|
+
return v`
|
|
308
299
|
<input
|
|
309
|
-
class="${
|
|
300
|
+
class="${x(this.inputClasses)}"
|
|
310
301
|
.type=${this.inputType}
|
|
311
302
|
id="${this.id}-input"
|
|
312
303
|
.value=${this._value[0] ?? ""}
|
|
@@ -338,98 +329,105 @@ let l = class extends A {
|
|
|
338
329
|
`;
|
|
339
330
|
}
|
|
340
331
|
renderRangeInput() {
|
|
341
|
-
|
|
342
|
-
|
|
332
|
+
const e = {
|
|
333
|
+
"pkt-input-prefix": this.showRangeLabels,
|
|
334
|
+
"pkt-hide": !this.showRangeLabels
|
|
335
|
+
};
|
|
336
|
+
return v`
|
|
337
|
+
${this.showRangeLabels ? v` <div class="pkt-input-prefix">${this.strings.generic.from}</div> ` : b}
|
|
343
338
|
<input
|
|
344
|
-
class=${
|
|
339
|
+
class=${x(this.inputClasses)}
|
|
345
340
|
.type=${this.inputType}
|
|
346
341
|
id="${this.id}-input"
|
|
347
342
|
.value=${this._value[0] ?? ""}
|
|
348
343
|
min=${this.min}
|
|
349
344
|
max=${this.max}
|
|
350
|
-
@click=${(
|
|
351
|
-
|
|
345
|
+
@click=${(t) => {
|
|
346
|
+
t.preventDefault(), this.showCalendar();
|
|
352
347
|
}}
|
|
353
348
|
?disabled=${this.disabled}
|
|
354
|
-
@keydown=${(
|
|
355
|
-
var
|
|
356
|
-
(
|
|
349
|
+
@keydown=${(t) => {
|
|
350
|
+
var s;
|
|
351
|
+
(t.key === "," || t.key === "Enter") && ((s = this.inputRef.value) == null || s.blur()), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
|
|
357
352
|
}}
|
|
358
|
-
@input=${(
|
|
359
|
-
this.onInput(),
|
|
353
|
+
@input=${(t) => {
|
|
354
|
+
this.onInput(), t.stopImmediatePropagation();
|
|
360
355
|
}}
|
|
361
356
|
@focus=${() => {
|
|
362
357
|
this.onFocus(), this.isMobileSafari && this.showCalendar();
|
|
363
358
|
}}
|
|
364
|
-
@blur=${(
|
|
365
|
-
var
|
|
366
|
-
if (
|
|
367
|
-
this.manageValidity(
|
|
368
|
-
const
|
|
369
|
-
|
|
359
|
+
@blur=${(t) => {
|
|
360
|
+
var s, a;
|
|
361
|
+
if (t.target.value) {
|
|
362
|
+
this.manageValidity(t.target);
|
|
363
|
+
const i = D(t.target.value);
|
|
364
|
+
i && this._value[0] !== t.target.value && this._value[1] && (this.clearInputValue(), (a = (s = this.calRef) == null ? void 0 : s.value) == null || a.handleDateSelect(i));
|
|
370
365
|
} else this._value[0] && this.clearInputValue();
|
|
371
366
|
}}
|
|
372
|
-
@change=${(
|
|
373
|
-
|
|
367
|
+
@change=${(t) => {
|
|
368
|
+
t.stopImmediatePropagation();
|
|
374
369
|
}}
|
|
375
370
|
${$(this.inputRef)}
|
|
376
371
|
/>
|
|
377
|
-
<div class="
|
|
372
|
+
<div class="${x(e)}" id="${this.id}-to-label">
|
|
373
|
+
${this.strings.generic.to}
|
|
374
|
+
</div>
|
|
375
|
+
${this.showRangeLabels ? b : v` <div class="pkt-input-separator">–</div> `}
|
|
378
376
|
<input
|
|
379
|
-
class=${
|
|
377
|
+
class=${x(this.inputClasses)}
|
|
380
378
|
.type=${this.inputType}
|
|
381
379
|
id="${this.id}-to"
|
|
382
380
|
aria-labelledby="${this.id}-to-label"
|
|
383
381
|
.value=${this._value[1] ?? ""}
|
|
384
382
|
min=${this.min}
|
|
385
383
|
max=${this.max}
|
|
386
|
-
@click=${(
|
|
387
|
-
|
|
384
|
+
@click=${(t) => {
|
|
385
|
+
t.preventDefault(), this.showCalendar();
|
|
388
386
|
}}
|
|
389
387
|
?disabled=${this.disabled}
|
|
390
|
-
@keydown=${(
|
|
391
|
-
var
|
|
392
|
-
(
|
|
388
|
+
@keydown=${(t) => {
|
|
389
|
+
var s;
|
|
390
|
+
(t.key === "," || t.key === "Enter") && ((s = this.inputRefTo.value) == null || s.blur()), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
|
|
393
391
|
}}
|
|
394
|
-
@input=${(
|
|
395
|
-
this.onInput(),
|
|
392
|
+
@input=${(t) => {
|
|
393
|
+
this.onInput(), t.stopImmediatePropagation();
|
|
396
394
|
}}
|
|
397
395
|
@focus=${() => {
|
|
398
396
|
this.onFocus(), this.isMobileSafari && this.showCalendar();
|
|
399
397
|
}}
|
|
400
|
-
@blur=${(
|
|
401
|
-
var
|
|
402
|
-
if ((
|
|
403
|
-
this.manageValidity(
|
|
404
|
-
const
|
|
405
|
-
this.min && this.min >
|
|
398
|
+
@blur=${(t) => {
|
|
399
|
+
var s, a, i;
|
|
400
|
+
if ((s = this.calRef.value) != null && s.contains(t.relatedTarget) || this.onBlur(), t.target.value) {
|
|
401
|
+
this.manageValidity(t.target);
|
|
402
|
+
const r = t.target.value;
|
|
403
|
+
this.min && this.min > r ? this.internals.setValidity(
|
|
406
404
|
{ rangeUnderflow: !0 },
|
|
407
405
|
this.strings.forms.messages.rangeUnderflow,
|
|
408
|
-
|
|
409
|
-
) : this.max && this.max <
|
|
406
|
+
t.target
|
|
407
|
+
) : this.max && this.max < r && this.internals.setValidity(
|
|
410
408
|
{ rangeOverflow: !0 },
|
|
411
409
|
this.strings.forms.messages.rangeOverflow,
|
|
412
|
-
|
|
410
|
+
t.target
|
|
413
411
|
);
|
|
414
|
-
const n =
|
|
415
|
-
n && this._value[1] !==
|
|
412
|
+
const n = D(t.target.value);
|
|
413
|
+
n && this._value[1] !== W(n) && ((i = (a = this.calRef) == null ? void 0 : a.value) == null || i.handleDateSelect(n));
|
|
416
414
|
}
|
|
417
415
|
}}
|
|
418
|
-
@change=${(
|
|
419
|
-
|
|
416
|
+
@change=${(t) => {
|
|
417
|
+
t.stopImmediatePropagation();
|
|
420
418
|
}}
|
|
421
419
|
${$(this.inputRefTo)}
|
|
422
420
|
/>
|
|
423
421
|
`;
|
|
424
422
|
}
|
|
425
423
|
renderMultipleInput() {
|
|
426
|
-
return
|
|
424
|
+
return console.log("renderMultipleInput", this.inputClasses, this.multiple), v`
|
|
427
425
|
<input
|
|
428
|
-
class=${
|
|
426
|
+
class=${x(this.inputClasses)}
|
|
429
427
|
.type=${this.inputType}
|
|
430
428
|
id="${this.id}-input"
|
|
431
|
-
min=${this.min}
|
|
432
|
-
max=${this.max}
|
|
429
|
+
.min=${this.min || b}
|
|
430
|
+
.max=${this.max || b}
|
|
433
431
|
@click=${(e) => {
|
|
434
432
|
e.preventDefault(), this.showCalendar();
|
|
435
433
|
}}
|
|
@@ -455,12 +453,12 @@ let l = class extends A {
|
|
|
455
453
|
`;
|
|
456
454
|
}
|
|
457
455
|
renderTags() {
|
|
458
|
-
return
|
|
456
|
+
return v`
|
|
459
457
|
<div class="pkt-datepicker__tags" aria-live="polite">
|
|
460
|
-
${this._value[0] ?
|
|
458
|
+
${this._value[0] ? K(
|
|
461
459
|
this._value ?? [],
|
|
462
460
|
(e) => e,
|
|
463
|
-
(e) =>
|
|
461
|
+
(e) => v`
|
|
464
462
|
<pkt-tag
|
|
465
463
|
.id="${this.id + e + "-tag"}"
|
|
466
464
|
closeTag
|
|
@@ -470,17 +468,17 @@ let l = class extends A {
|
|
|
470
468
|
)}"
|
|
471
469
|
@close=${() => {
|
|
472
470
|
var t;
|
|
473
|
-
return (t = this.calRef.value) == null ? void 0 : t.handleDateSelect(
|
|
471
|
+
return (t = this.calRef.value) == null ? void 0 : t.handleDateSelect(D(e));
|
|
474
472
|
}}
|
|
475
473
|
>${M(e, this.dateformat)}</pkt-tag
|
|
476
474
|
>
|
|
477
475
|
`
|
|
478
|
-
) :
|
|
476
|
+
) : b}
|
|
479
477
|
</div>
|
|
480
478
|
`;
|
|
481
479
|
}
|
|
482
480
|
renderCalendar() {
|
|
483
|
-
return
|
|
481
|
+
return v`<div
|
|
484
482
|
class="pkt-calendar-popup pkt-${this.calendarOpen ? "show" : "hide"}"
|
|
485
483
|
@focusout=${(e) => {
|
|
486
484
|
this.calendarOpen && this.handleFocusOut(e);
|
|
@@ -500,7 +498,7 @@ let l = class extends A {
|
|
|
500
498
|
.latest=${this.max}
|
|
501
499
|
.excludedates=${Array.isArray(this.excludedates) ? this.excludedates : this.excludedates.split(",")}
|
|
502
500
|
.excludeweekdays=${this.excludeweekdays}
|
|
503
|
-
.currentmonth=${this.currentmonth ?
|
|
501
|
+
.currentmonth=${this.currentmonth ? T(this.currentmonth) : null}
|
|
504
502
|
@date-selected=${(e) => {
|
|
505
503
|
this.value = !this.multiple && !this.range ? e.detail[0] : e.detail, this._value = e.detail, this.inputRef.value && (this.range && this.inputRefTo.value ? (this.inputRef.value.value = this._value[0] ?? "", this.inputRefTo.value.value = this._value[1] ?? "") : this.multiple || (this.inputRef.value.value = this._value.length ? this._value[0] : ""));
|
|
506
504
|
}}
|
|
@@ -512,7 +510,19 @@ let l = class extends A {
|
|
|
512
510
|
</div>`;
|
|
513
511
|
}
|
|
514
512
|
render() {
|
|
515
|
-
return
|
|
513
|
+
return this.inputClasses = {
|
|
514
|
+
"pkt-input": !0,
|
|
515
|
+
"pkt-datepicker__input": !0,
|
|
516
|
+
"pkt-input--fullwidth": this.fullwidth,
|
|
517
|
+
"pkt-datepicker--hasrangelabels": this.showRangeLabels,
|
|
518
|
+
"pkt-datepicker--multiple": this.multiple,
|
|
519
|
+
"pkt-datepicker--range": this.range
|
|
520
|
+
}, this.buttonClasses = {
|
|
521
|
+
"pkt-input-icon": !0,
|
|
522
|
+
"pkt-btn": !0,
|
|
523
|
+
"pkt-btn--icon-only": !0,
|
|
524
|
+
"pkt-btn--tertiary": !0
|
|
525
|
+
}, v`
|
|
516
526
|
<pkt-input-wrapper
|
|
517
527
|
label="${this.label}"
|
|
518
528
|
forId="${this.id}-input"
|
|
@@ -533,12 +543,14 @@ let l = class extends A {
|
|
|
533
543
|
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
534
544
|
class="pkt-datepicker"
|
|
535
545
|
>
|
|
536
|
-
${this.multiple ? this.renderTags() :
|
|
537
|
-
<div
|
|
546
|
+
${this.multiple ? this.renderTags() : b}
|
|
547
|
+
<div
|
|
548
|
+
class="pkt-datepicker__inputs ${this.range && this.showRangeLabels ? "pkt-input__range-inputs" : ""}"
|
|
549
|
+
>
|
|
538
550
|
<div class="pkt-input__container">
|
|
539
551
|
${this.range ? this.renderRangeInput() : this.multiple ? this.renderMultipleInput() : this.renderInput()}
|
|
540
552
|
<button
|
|
541
|
-
class="${
|
|
553
|
+
class="${x(this.buttonClasses)}"
|
|
542
554
|
type="button"
|
|
543
555
|
@click=${this.toggleCalendar}
|
|
544
556
|
?disabled=${this.disabled}
|
|
@@ -559,9 +571,9 @@ let l = class extends A {
|
|
|
559
571
|
handleCalendarPosition() {
|
|
560
572
|
var e;
|
|
561
573
|
if (this.popupRef.value && this.inputRef.value) {
|
|
562
|
-
const t = this.multiple && !!this.maxlength,
|
|
563
|
-
let
|
|
564
|
-
|
|
574
|
+
const t = this.multiple && !!this.maxlength, s = ((e = this.inputRef.value.parentElement) == null ? void 0 : e.getBoundingClientRect()) || this.inputRef.value.getBoundingClientRect(), a = t ? s.height + 30 : s.height, i = this.popupRef.value.getBoundingClientRect().height;
|
|
575
|
+
let r = t ? "calc(100% - 30px)" : "100%";
|
|
576
|
+
s && s.top + i > window.innerHeight && s.top - i > 0 && (r = `calc(100% - ${a}px - ${i}px)`), this.popupRef.value.style.top = r;
|
|
565
577
|
}
|
|
566
578
|
}
|
|
567
579
|
handleFocusOut(e) {
|
|
@@ -578,61 +590,70 @@ let l = class extends A {
|
|
|
578
590
|
e.preventDefault(), this.calendarOpen ? this.hideCalendar() : this.showCalendar();
|
|
579
591
|
}
|
|
580
592
|
};
|
|
581
|
-
|
|
582
|
-
|
|
593
|
+
o([
|
|
594
|
+
d({ type: String, reflect: !0 })
|
|
583
595
|
], l.prototype, "value", 2);
|
|
584
|
-
|
|
585
|
-
|
|
596
|
+
o([
|
|
597
|
+
d({ type: Array })
|
|
586
598
|
], l.prototype, "_value", 2);
|
|
587
|
-
|
|
588
|
-
|
|
599
|
+
o([
|
|
600
|
+
d({ type: String })
|
|
589
601
|
], l.prototype, "label", 2);
|
|
590
|
-
|
|
591
|
-
|
|
602
|
+
o([
|
|
603
|
+
d({ type: String })
|
|
592
604
|
], l.prototype, "dateformat", 2);
|
|
593
|
-
|
|
594
|
-
|
|
605
|
+
o([
|
|
606
|
+
d({ type: Boolean, reflect: !0 })
|
|
595
607
|
], l.prototype, "multiple", 2);
|
|
596
|
-
|
|
597
|
-
|
|
608
|
+
o([
|
|
609
|
+
d({ type: Number })
|
|
598
610
|
], l.prototype, "maxlength", 2);
|
|
599
|
-
|
|
600
|
-
|
|
611
|
+
o([
|
|
612
|
+
d({ type: Boolean, reflect: !0 })
|
|
601
613
|
], l.prototype, "range", 2);
|
|
602
|
-
|
|
603
|
-
|
|
614
|
+
o([
|
|
615
|
+
d({ type: Boolean })
|
|
616
|
+
], l.prototype, "showRangeLabels", 2);
|
|
617
|
+
o([
|
|
618
|
+
d({ type: String })
|
|
604
619
|
], l.prototype, "min", 2);
|
|
605
|
-
|
|
606
|
-
|
|
620
|
+
o([
|
|
621
|
+
d({ type: String })
|
|
607
622
|
], l.prototype, "max", 2);
|
|
608
|
-
|
|
609
|
-
|
|
623
|
+
o([
|
|
624
|
+
d({ type: Boolean })
|
|
610
625
|
], l.prototype, "weeknumbers", 2);
|
|
611
|
-
|
|
612
|
-
|
|
626
|
+
o([
|
|
627
|
+
d({ type: Boolean })
|
|
613
628
|
], l.prototype, "withcontrols", 2);
|
|
614
|
-
|
|
615
|
-
|
|
629
|
+
o([
|
|
630
|
+
d({ type: Boolean })
|
|
616
631
|
], l.prototype, "fullwidth", 2);
|
|
617
|
-
|
|
618
|
-
|
|
632
|
+
o([
|
|
633
|
+
d({ converter: V.csvToArray })
|
|
619
634
|
], l.prototype, "excludedates", 2);
|
|
620
|
-
|
|
621
|
-
|
|
635
|
+
o([
|
|
636
|
+
d({ converter: V.csvToArray })
|
|
622
637
|
], l.prototype, "excludeweekdays", 2);
|
|
623
|
-
|
|
624
|
-
|
|
638
|
+
o([
|
|
639
|
+
d({ type: String })
|
|
625
640
|
], l.prototype, "currentmonth", 2);
|
|
626
|
-
|
|
627
|
-
|
|
641
|
+
o([
|
|
642
|
+
d({ type: Boolean })
|
|
628
643
|
], l.prototype, "useWrapper", 2);
|
|
629
|
-
|
|
630
|
-
|
|
644
|
+
o([
|
|
645
|
+
d({ type: Boolean, reflect: !0 })
|
|
631
646
|
], l.prototype, "calendarOpen", 2);
|
|
632
|
-
|
|
633
|
-
|
|
647
|
+
o([
|
|
648
|
+
d({ type: String })
|
|
634
649
|
], l.prototype, "timezone", 2);
|
|
635
|
-
|
|
650
|
+
o([
|
|
651
|
+
P()
|
|
652
|
+
], l.prototype, "inputClasses", 2);
|
|
653
|
+
o([
|
|
654
|
+
P()
|
|
655
|
+
], l.prototype, "buttonClasses", 2);
|
|
656
|
+
l = o([
|
|
636
657
|
H("pkt-datepicker")
|
|
637
658
|
], l);
|
|
638
659
|
export {
|
package/dist/pkt-element.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BVbNUNAa.cjs");exports.PktElement=e.PktElement;exports.PktInputElement=e.PktInputElement;
|
package/dist/pkt-element.js
CHANGED
package/dist/pkt-helptext.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./helptext-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./helptext-WCq0-Dq8.cjs"),t=e.PktHelptext;Object.defineProperty(exports,"PktHelptext",{enumerable:!0,get:()=>e.PktHelptext});exports.default=t;
|
package/dist/pkt-helptext.js
CHANGED
package/dist/pkt-icon.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-BVbNUNAa.cjs");require("./custom-element-B-TlBwRu.cjs");const e=require("./index-DYiD-o1w.cjs");Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>e.PktIcon});
|
package/dist/pkt-icon.js
CHANGED
package/dist/pkt-index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./pkt-alert.cjs"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./pkt-alert.cjs"),t=require("./index-DyL6sqFY.cjs"),r=require("./pkt-card.cjs"),n=require("./pkt-component-template.cjs"),o=require("./pkt-datepicker.cjs"),u=require("./helptext-WCq0-Dq8.cjs"),a=require("./index-DYiD-o1w.cjs"),P=require("./pkt-input-wrapper.cjs"),c=require("./pkt-link.cjs"),i=require("./pkt-messagebox.cjs"),p=require("./modal-BXKX0dxk.cjs"),k=require("./pkt-tag.cjs");Object.defineProperty(exports,"PktAlert",{enumerable:!0,get:()=>e.PktAlert});Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>t.PktCalendar});Object.defineProperty(exports,"PktCard",{enumerable:!0,get:()=>r.PktCard});Object.defineProperty(exports,"PktComponent",{enumerable:!0,get:()=>n.PktComponent});Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>o.PktDatepicker});Object.defineProperty(exports,"PktHelptext",{enumerable:!0,get:()=>u.PktHelptext});Object.defineProperty(exports,"PktIcon",{enumerable:!0,get:()=>a.PktIcon});Object.defineProperty(exports,"PktInputWrapper",{enumerable:!0,get:()=>P.PktInputWrapper});Object.defineProperty(exports,"PktLink",{enumerable:!0,get:()=>c.PktLink});Object.defineProperty(exports,"PktMessagebox",{enumerable:!0,get:()=>i.PktMessagebox});Object.defineProperty(exports,"PktModal",{enumerable:!0,get:()=>p.PktModal});Object.defineProperty(exports,"PktTag",{enumerable:!0,get:()=>k.PktTag});
|
package/dist/pkt-index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { PktAlert as o } from "./pkt-alert.js";
|
|
2
|
-
import { P as p } from "./index-
|
|
2
|
+
import { P as p } from "./index-BR7EVgX9.js";
|
|
3
3
|
import { PktCard as k } from "./pkt-card.js";
|
|
4
4
|
import { PktComponent as m } from "./pkt-component-template.js";
|
|
5
5
|
import { PktDatepicker as f } from "./pkt-datepicker.js";
|
|
6
|
-
import { P as s } from "./helptext-
|
|
7
|
-
import { P as d } from "./index-
|
|
6
|
+
import { P as s } from "./helptext-D-5_-HAW.js";
|
|
7
|
+
import { P as d } from "./index-BfUPq43a.js";
|
|
8
8
|
import { PktInputWrapper as c } from "./pkt-input-wrapper.js";
|
|
9
9
|
import { PktLink as i } from "./pkt-link.js";
|
|
10
10
|
import { PktMessagebox as M } from "./pkt-messagebox.js";
|
|
11
|
-
import { P as u } from "./modal-
|
|
11
|
+
import { P as u } from "./modal-CYx_wrz1.js";
|
|
12
12
|
import { PktTag as D } from "./pkt-tag.js";
|
|
13
13
|
export {
|
|
14
14
|
o as PktAlert,
|