@oslokommune/punkt-elements 12.26.2 → 12.27.1
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/{alert-MKb7NX3r.js → alert-BvN80UkI.js} +1 -1
- package/dist/{alert-3DZNN48_.cjs → alert-uNzcOJR9.cjs} +1 -1
- package/dist/alert.d.ts +7 -0
- package/dist/calendar.d.ts +7 -0
- package/dist/{card-CtipjQuP.cjs → card-BaxqXP-k.cjs} +1 -1
- package/dist/{card-ClWsCQfD.js → card-Br6A74Q1.js} +2 -2
- package/dist/card.d.ts +7 -0
- package/dist/{datepicker-B2W8ra1B.cjs → datepicker-BC0e34ws.cjs} +16 -15
- package/dist/{datepicker-BVI4szRk.js → datepicker-ONV4HuJt.js} +84 -82
- package/dist/datepicker.d.ts +7 -0
- package/dist/helptext-DHfBEO42.js +78 -0
- package/dist/helptext-xUdEGuNQ.cjs +24 -0
- package/dist/helptext.d.ts +7 -0
- package/dist/icon.d.ts +7 -0
- package/dist/index.d.ts +29 -8
- package/dist/input-wrapper-DeCY6nta.cjs +50 -0
- package/dist/input-wrapper-Df18_PvD.js +172 -0
- package/dist/input-wrapper.d.ts +7 -0
- package/dist/{link-B3PDtnXT.js → link-0N9wG5l8.js} +1 -1
- package/dist/{link-BnL83t0x.cjs → link-I_LKEBVK.cjs} +1 -1
- package/dist/link.d.ts +7 -0
- package/dist/{linkcard-C4q7HCwY.js → linkcard-BJeRbpq_.js} +1 -1
- package/dist/{linkcard-RyOjvpmF.cjs → linkcard-ClXGVwdJ.cjs} +1 -1
- package/dist/linkcard.d.ts +7 -0
- package/dist/{messagebox-BDfhozc3.js → messagebox-C5M56R8f.js} +1 -1
- package/dist/{messagebox-CuM1y2P_.cjs → messagebox-CC3j63Wp.cjs} +1 -1
- package/dist/messagebox.d.ts +7 -0
- package/dist/{modal-gLMGJSSY.cjs → modal-BkchlKkL.cjs} +1 -1
- package/dist/{modal-CYv8Qk0Y.js → modal-PKDnp91S.js} +1 -1
- package/dist/modal.d.ts +7 -0
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +14 -14
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-slot-controller-Clbye6cM.js +85 -0
- package/dist/pkt-slot-controller-Oc32unDk.cjs +1 -0
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/progressbar.d.ts +7 -0
- package/dist/radiobutton.d.ts +7 -0
- package/dist/select-DFlu7Eq6.cjs +48 -0
- package/dist/{select-BJr30hL7.js → select-DVyh7z8C.js} +60 -43
- package/dist/select.d.ts +7 -0
- package/dist/{tag-nAMwKi6B.cjs → tag-DGywzHJ5.cjs} +1 -1
- package/dist/{tag-CPLBzyiV.js → tag-W9Lf1doW.js} +1 -1
- package/dist/tag.d.ts +7 -0
- package/dist/{textarea-Da-bIu5d.js → textarea-80zuPTTD.js} +35 -33
- package/dist/textarea-WWRAA1LV.cjs +49 -0
- package/dist/textarea.d.ts +7 -0
- package/dist/{textinput-C9pkRR6S.cjs → textinput-CE5AzOur.cjs} +4 -3
- package/dist/{textinput-Buj2CAKl.js → textinput-CZIE3v3S.js} +44 -42
- package/dist/textinput.d.ts +7 -0
- package/package.json +4 -4
- package/src/components/datepicker/datepicker.ts +8 -0
- package/src/components/helptext/helptext.ts +41 -35
- package/src/components/icon/icon.ts +10 -3
- package/src/components/input-wrapper/input-wrapper.ts +28 -19
- package/src/components/select/select.ts +41 -8
- package/src/components/textarea/textarea.ts +9 -1
- package/src/components/textinput/textinput.ts +10 -1
- package/dist/helptext-CNgXo34f.js +0 -75
- package/dist/helptext-XPScYIkx.cjs +0 -23
- package/dist/input-wrapper-CWvzXs6X.js +0 -160
- package/dist/input-wrapper-nvacN4EY.cjs +0 -48
- package/dist/pkt-slot-controller-BEDVscvU.cjs +0 -1
- package/dist/pkt-slot-controller-DhwCJd_0.js +0 -67
- package/dist/select-B19JEWYw.cjs +0 -44
- package/dist/textarea-D7uvC79V.cjs +0 -48
|
@@ -2,59 +2,60 @@ import { e as x } from "./class-map-CQzsZCwS.js";
|
|
|
2
2
|
import { o as k } from "./if-defined-f3M1y6S-.js";
|
|
3
3
|
import { e as L, i as j, a as F, T as q, x as v, E as T, n as u, t as H } from "./element-BKrU5soj.js";
|
|
4
4
|
import { r as V } from "./state-C36ZmZgt.js";
|
|
5
|
-
import { n as
|
|
5
|
+
import { n as S, f as _, a as N, b as P, d as A } from "./calendar-DB_8j4en.js";
|
|
6
6
|
import { P as U } from "./input-element-URKBm_vS.js";
|
|
7
|
-
import { p as K, v as
|
|
7
|
+
import { p as K, v as $, r as R, M as I, m as W, e as w, n as y } from "./ref-D5qG7OFB.js";
|
|
8
8
|
import "./icon-Bsb0MB2h.js";
|
|
9
|
-
import "./input-wrapper-
|
|
10
|
-
import "./tag-
|
|
9
|
+
import "./input-wrapper-Df18_PvD.js";
|
|
10
|
+
import "./tag-W9Lf1doW.js";
|
|
11
|
+
import { P as z } from "./pkt-slot-controller-Clbye6cM.js";
|
|
11
12
|
/**
|
|
12
13
|
* @license
|
|
13
14
|
* Copyright 2017 Google LLC
|
|
14
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
16
|
*/
|
|
16
|
-
const
|
|
17
|
+
const E = (e, t, i) => {
|
|
17
18
|
const a = /* @__PURE__ */ new Map();
|
|
18
19
|
for (let s = t; s <= i; s++) a.set(e[s], s);
|
|
19
20
|
return a;
|
|
20
|
-
},
|
|
21
|
+
}, G = L(class extends j {
|
|
21
22
|
constructor(e) {
|
|
22
23
|
if (super(e), e.type !== F.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
23
24
|
}
|
|
24
25
|
dt(e, t, i) {
|
|
25
26
|
let a;
|
|
26
27
|
i === void 0 ? i = t : t !== void 0 && (a = t);
|
|
27
|
-
const s = [],
|
|
28
|
+
const s = [], l = [];
|
|
28
29
|
let n = 0;
|
|
29
|
-
for (const f of e) s[n] = a ? a(f, n) : n,
|
|
30
|
-
return { values:
|
|
30
|
+
for (const f of e) s[n] = a ? a(f, n) : n, l[n] = i(f, n), n++;
|
|
31
|
+
return { values: l, keys: s };
|
|
31
32
|
}
|
|
32
33
|
render(e, t, i) {
|
|
33
34
|
return this.dt(e, t, i).values;
|
|
34
35
|
}
|
|
35
36
|
update(e, [t, i, a]) {
|
|
36
|
-
const s = K(e), { values:
|
|
37
|
-
if (!Array.isArray(s)) return this.ut = n,
|
|
37
|
+
const s = K(e), { values: l, keys: n } = this.dt(t, i, a);
|
|
38
|
+
if (!Array.isArray(s)) return this.ut = n, l;
|
|
38
39
|
const f = this.ut ?? (this.ut = []), m = [];
|
|
39
|
-
let C, O, p = 0, h = s.length - 1, d = 0, c =
|
|
40
|
+
let C, O, p = 0, h = s.length - 1, d = 0, c = l.length - 1;
|
|
40
41
|
for (; p <= h && d <= c; ) if (s[p] === null) p++;
|
|
41
42
|
else if (s[h] === null) h--;
|
|
42
|
-
else if (f[p] === n[d]) m[d] =
|
|
43
|
-
else if (f[h] === n[c]) m[c] =
|
|
44
|
-
else if (f[p] === n[c]) m[c] =
|
|
45
|
-
else if (f[h] === n[d]) m[d] =
|
|
46
|
-
else if (C === void 0 && (C =
|
|
47
|
-
const g = O.get(n[d]),
|
|
48
|
-
if (
|
|
49
|
-
const M =
|
|
50
|
-
|
|
51
|
-
} else m[d] =
|
|
43
|
+
else if (f[p] === n[d]) m[d] = $(s[p], l[d]), p++, d++;
|
|
44
|
+
else if (f[h] === n[c]) m[c] = $(s[h], l[c]), h--, c--;
|
|
45
|
+
else if (f[p] === n[c]) m[c] = $(s[p], l[c]), R(e, m[c + 1], s[p]), p++, c--;
|
|
46
|
+
else if (f[h] === n[d]) m[d] = $(s[h], l[d]), R(e, s[p], s[h]), h--, d++;
|
|
47
|
+
else if (C === void 0 && (C = E(n, d, c), O = E(f, p, h)), C.has(f[p])) if (C.has(f[h])) {
|
|
48
|
+
const g = O.get(n[d]), D = g !== void 0 ? s[g] : null;
|
|
49
|
+
if (D === null) {
|
|
50
|
+
const M = R(e, s[p]);
|
|
51
|
+
$(M, l[d]), m[d] = M;
|
|
52
|
+
} else m[d] = $(D, l[d]), R(e, s[p], D), s[g] = null;
|
|
52
53
|
d++;
|
|
53
54
|
} else I(s[h]), h--;
|
|
54
55
|
else I(s[p]), p++;
|
|
55
56
|
for (; d <= c; ) {
|
|
56
|
-
const g =
|
|
57
|
-
|
|
57
|
+
const g = R(e, m[c + 1]);
|
|
58
|
+
$(g, l[d]), m[d++] = g;
|
|
58
59
|
}
|
|
59
60
|
for (; p <= h; ) {
|
|
60
61
|
const g = s[p++];
|
|
@@ -62,7 +63,7 @@ const B = (e, t, i) => {
|
|
|
62
63
|
}
|
|
63
64
|
return this.ut = n, W(e, m), q;
|
|
64
65
|
}
|
|
65
|
-
}),
|
|
66
|
+
}), J = "pkt-datepicker", Q = !0, X = {
|
|
66
67
|
name: {
|
|
67
68
|
type: "string",
|
|
68
69
|
name: "Navn",
|
|
@@ -231,7 +232,7 @@ const B = (e, t, i) => {
|
|
|
231
232
|
name: "ID",
|
|
232
233
|
description: "Unik identifikasjon for datovelgeren"
|
|
233
234
|
}
|
|
234
|
-
},
|
|
235
|
+
}, Y = {
|
|
235
236
|
change: {
|
|
236
237
|
type: "Event",
|
|
237
238
|
description: "Returnerer valgt dato som streng i ISO-format"
|
|
@@ -245,35 +246,35 @@ const B = (e, t, i) => {
|
|
|
245
246
|
description: "Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes"
|
|
246
247
|
}
|
|
247
248
|
}, b = {
|
|
248
|
-
name:
|
|
249
|
+
name: J,
|
|
249
250
|
"css-class": "pkt-datepicker",
|
|
250
|
-
isElement:
|
|
251
|
-
props:
|
|
252
|
-
events:
|
|
251
|
+
isElement: Q,
|
|
252
|
+
props: X,
|
|
253
|
+
events: Y
|
|
253
254
|
};
|
|
254
|
-
var
|
|
255
|
-
for (var s = a > 1 ? void 0 : a ?
|
|
256
|
-
(n = e[
|
|
257
|
-
return a && s &&
|
|
255
|
+
var Z = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, o = (e, t, i, a) => {
|
|
256
|
+
for (var s = a > 1 ? void 0 : a ? ee(t, i) : t, l = e.length - 1, n; l >= 0; l--)
|
|
257
|
+
(n = e[l]) && (s = (a ? n(t, i, s) : n(s)) || s);
|
|
258
|
+
return a && s && Z(t, i, s), s;
|
|
258
259
|
};
|
|
259
|
-
const
|
|
260
|
-
let
|
|
260
|
+
const B = (e) => new Promise((t) => setTimeout(t, e));
|
|
261
|
+
let r = class extends U {
|
|
262
|
+
/**
|
|
263
|
+
* Housekeeping / lifecycle methods
|
|
264
|
+
*/
|
|
261
265
|
constructor() {
|
|
262
|
-
super(
|
|
266
|
+
super(), this.value = "", this._value = this.value ? Array.isArray(this.value) ? this.value : this.value.split(",") : [], this.label = "Datovelger", this.dateformat = b.props.dateformat.default, this.multiple = b.props.multiple.default, this.maxlength = null, this.range = b.props.range.default, this.showRangeLabels = !1, this.min = null, this.max = null, this.weeknumbers = b.props.weeknumbers.default, this.withcontrols = b.props.withcontrols.default, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.calendarOpen = !1, this.timezone = "Europe/Oslo", this.inputClasses = {}, this.buttonClasses = {}, this.inputRef = w(), this.inputRefTo = w(), this.btnRef = w(), this.calRef = w(), this.popupRef = w(), this.helptextSlot = w(), this.addToSelected = (e) => {
|
|
263
267
|
const t = e.target;
|
|
264
268
|
if (!t.value) return;
|
|
265
|
-
const i = this.min ?
|
|
269
|
+
const i = this.min ? S(this.min) : null, a = this.max ? S(this.max) : null, s = S(t.value.split(",")[0]);
|
|
266
270
|
s && !isNaN(s.getTime()) && (!i || s >= i) && (!a || s <= a) && this.calRef.value && this.calRef.value.handleDateSelect(s), t.value = "";
|
|
267
|
-
};
|
|
271
|
+
}, this.slotController = new z(this, this.helptextSlot);
|
|
268
272
|
}
|
|
269
|
-
/**
|
|
270
|
-
* Housekeeping / lifecycle methods
|
|
271
|
-
*/
|
|
272
273
|
async connectedCallback() {
|
|
273
274
|
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) => {
|
|
274
275
|
var t, i;
|
|
275
276
|
(t = this.inputRef) != null && t.value && ((i = this.btnRef) != null && i.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());
|
|
276
|
-
}), this.value.length && this._value.length === 0 && (this._value = Array.isArray(this.value) ? this.value : this.value.split(",")), this.min = this.min || b.props.min.default, this.max = this.max || b.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
|
|
277
|
+
}), this.value.length && this._value.length === 0 && (this._value = Array.isArray(this.value) ? this.value : this.value.split(",")), this.min = this.min || b.props.min.default, this.max = this.max || b.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());
|
|
277
278
|
}
|
|
278
279
|
disconnectedCallback() {
|
|
279
280
|
super.disconnectedCallback(), document && document.body.removeEventListener("click", (e) => {
|
|
@@ -328,7 +329,7 @@ let l = class extends U {
|
|
|
328
329
|
@change=${(e) => {
|
|
329
330
|
e.stopImmediatePropagation();
|
|
330
331
|
}}
|
|
331
|
-
${
|
|
332
|
+
${y(this.inputRef)}
|
|
332
333
|
/>
|
|
333
334
|
`;
|
|
334
335
|
}
|
|
@@ -371,7 +372,7 @@ let l = class extends U {
|
|
|
371
372
|
@change=${(t) => {
|
|
372
373
|
t.stopImmediatePropagation();
|
|
373
374
|
}}
|
|
374
|
-
${
|
|
375
|
+
${y(this.inputRef)}
|
|
375
376
|
/>
|
|
376
377
|
<div class="${x(e)}" id="${this.id}-to-label">
|
|
377
378
|
${this.strings.generic.to}
|
|
@@ -403,12 +404,12 @@ let l = class extends U {
|
|
|
403
404
|
var i, a, s;
|
|
404
405
|
if ((i = this.calRef.value) != null && i.contains(t.relatedTarget) || this.onBlur(), t.target.value) {
|
|
405
406
|
this.manageValidity(t.target);
|
|
406
|
-
const
|
|
407
|
-
this.min && this.min >
|
|
407
|
+
const l = t.target.value;
|
|
408
|
+
this.min && this.min > l ? this.internals.setValidity(
|
|
408
409
|
{ rangeUnderflow: !0 },
|
|
409
410
|
this.strings.forms.messages.rangeUnderflow,
|
|
410
411
|
t.target
|
|
411
|
-
) : this.max && this.max <
|
|
412
|
+
) : this.max && this.max < l && this.internals.setValidity(
|
|
412
413
|
{ rangeOverflow: !0 },
|
|
413
414
|
this.strings.forms.messages.rangeOverflow,
|
|
414
415
|
t.target
|
|
@@ -420,7 +421,7 @@ let l = class extends U {
|
|
|
420
421
|
@change=${(t) => {
|
|
421
422
|
t.stopImmediatePropagation();
|
|
422
423
|
}}
|
|
423
|
-
${
|
|
424
|
+
${y(this.inputRefTo)}
|
|
424
425
|
/>
|
|
425
426
|
`;
|
|
426
427
|
}
|
|
@@ -452,21 +453,21 @@ let l = class extends U {
|
|
|
452
453
|
@change=${(e) => {
|
|
453
454
|
e.stopImmediatePropagation();
|
|
454
455
|
}}
|
|
455
|
-
${
|
|
456
|
+
${y(this.inputRef)}
|
|
456
457
|
/>
|
|
457
458
|
`;
|
|
458
459
|
}
|
|
459
460
|
renderTags() {
|
|
460
461
|
return v`
|
|
461
462
|
<div class="pkt-datepicker__tags" aria-live="polite">
|
|
462
|
-
${this._value[0] ?
|
|
463
|
+
${this._value[0] ? G(
|
|
463
464
|
this._value ?? [],
|
|
464
465
|
(e) => e,
|
|
465
466
|
(e) => v`
|
|
466
467
|
<pkt-tag
|
|
467
468
|
.id="${this.id + e + "-tag"}"
|
|
468
469
|
closeTag
|
|
469
|
-
ariaLabel="${this.strings.calendar.deleteDate} ${
|
|
470
|
+
ariaLabel="${this.strings.calendar.deleteDate} ${P(
|
|
470
471
|
e,
|
|
471
472
|
this.dateformat
|
|
472
473
|
)}"
|
|
@@ -474,7 +475,7 @@ let l = class extends U {
|
|
|
474
475
|
var t;
|
|
475
476
|
return (t = this.calRef.value) == null ? void 0 : t.handleDateSelect(_(e));
|
|
476
477
|
}}
|
|
477
|
-
><time datetime="${e}">${
|
|
478
|
+
><time datetime="${e}">${P(e, this.dateformat)}</time></pkt-tag
|
|
478
479
|
>
|
|
479
480
|
`
|
|
480
481
|
) : T}
|
|
@@ -488,7 +489,7 @@ let l = class extends U {
|
|
|
488
489
|
this.calendarOpen && this.handleFocusOut(e);
|
|
489
490
|
}}
|
|
490
491
|
id="${this.id}-popup"
|
|
491
|
-
${
|
|
492
|
+
${y(this.popupRef)}
|
|
492
493
|
>
|
|
493
494
|
<pkt-calendar
|
|
494
495
|
id="${this.id}-calendar"
|
|
@@ -502,14 +503,14 @@ let l = class extends U {
|
|
|
502
503
|
.latest=${this.max}
|
|
503
504
|
.excludedates=${Array.isArray(this.excludedates) ? this.excludedates : this.excludedates.split(",")}
|
|
504
505
|
.excludeweekdays=${this.excludeweekdays}
|
|
505
|
-
.currentmonth=${this.currentmonth ?
|
|
506
|
+
.currentmonth=${this.currentmonth ? S(this.currentmonth) : null}
|
|
506
507
|
@date-selected=${(e) => {
|
|
507
508
|
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] : ""));
|
|
508
509
|
}}
|
|
509
510
|
@close=${() => {
|
|
510
511
|
this.onBlur(), this.hideCalendar();
|
|
511
512
|
}}
|
|
512
|
-
${
|
|
513
|
+
${y(this.calRef)}
|
|
513
514
|
></pkt-calendar>
|
|
514
515
|
</div>`;
|
|
515
516
|
}
|
|
@@ -548,6 +549,7 @@ let l = class extends U {
|
|
|
548
549
|
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
549
550
|
class="pkt-datepicker"
|
|
550
551
|
>
|
|
552
|
+
<div class="pkt-contents" ${y(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
551
553
|
${this.multiple ? this.renderTags() : T}
|
|
552
554
|
<div
|
|
553
555
|
class="pkt-datepicker__inputs ${this.range && this.showRangeLabels ? "pkt-input__range-inputs" : ""}"
|
|
@@ -559,7 +561,7 @@ let l = class extends U {
|
|
|
559
561
|
type="button"
|
|
560
562
|
@click=${this.toggleCalendar}
|
|
561
563
|
?disabled=${this.disabled}
|
|
562
|
-
${
|
|
564
|
+
${y(this.btnRef)}
|
|
563
565
|
>
|
|
564
566
|
<pkt-icon name="calendar"></pkt-icon>
|
|
565
567
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
@@ -577,8 +579,8 @@ let l = class extends U {
|
|
|
577
579
|
var e;
|
|
578
580
|
if (this.popupRef.value && this.inputRef.value) {
|
|
579
581
|
const t = this.multiple && !!this.maxlength, i = ((e = this.inputRef.value.parentElement) == null ? void 0 : e.getBoundingClientRect()) || this.inputRef.value.getBoundingClientRect(), a = t ? i.height + 30 : i.height, s = this.popupRef.value.getBoundingClientRect().height;
|
|
580
|
-
let
|
|
581
|
-
i && i.top + s > window.innerHeight && i.top - s > 0 && (
|
|
582
|
+
let l = t ? "calc(100% - 30px)" : "100%";
|
|
583
|
+
i && i.top + s > window.innerHeight && i.top - s > 0 && (l = `calc(100% - ${a}px - ${s}px)`), this.popupRef.value.style.top = l;
|
|
582
584
|
}
|
|
583
585
|
}
|
|
584
586
|
handleFocusOut(e) {
|
|
@@ -586,7 +588,7 @@ let l = class extends U {
|
|
|
586
588
|
}
|
|
587
589
|
async showCalendar() {
|
|
588
590
|
var e;
|
|
589
|
-
this.calendarOpen = !0, await
|
|
591
|
+
this.calendarOpen = !0, await B(20), this.handleCalendarPosition(), this.isMobileSafari && ((e = this.calRef.value) == null || e.focusOnCurrentDate());
|
|
590
592
|
}
|
|
591
593
|
hideCalendar() {
|
|
592
594
|
this.calendarOpen = !1;
|
|
@@ -597,64 +599,64 @@ let l = class extends U {
|
|
|
597
599
|
};
|
|
598
600
|
o([
|
|
599
601
|
u({ type: String, reflect: !0 })
|
|
600
|
-
],
|
|
602
|
+
], r.prototype, "value", 2);
|
|
601
603
|
o([
|
|
602
604
|
u({ type: Array })
|
|
603
|
-
],
|
|
605
|
+
], r.prototype, "_value", 2);
|
|
604
606
|
o([
|
|
605
607
|
u({ type: String, reflect: !0 })
|
|
606
|
-
],
|
|
608
|
+
], r.prototype, "label", 2);
|
|
607
609
|
o([
|
|
608
610
|
u({ type: String })
|
|
609
|
-
],
|
|
611
|
+
], r.prototype, "dateformat", 2);
|
|
610
612
|
o([
|
|
611
613
|
u({ type: Boolean, reflect: !0 })
|
|
612
|
-
],
|
|
614
|
+
], r.prototype, "multiple", 2);
|
|
613
615
|
o([
|
|
614
616
|
u({ type: Number, reflect: !0 })
|
|
615
|
-
],
|
|
617
|
+
], r.prototype, "maxlength", 2);
|
|
616
618
|
o([
|
|
617
619
|
u({ type: Boolean, reflect: !0 })
|
|
618
|
-
],
|
|
620
|
+
], r.prototype, "range", 2);
|
|
619
621
|
o([
|
|
620
622
|
u({ type: Boolean })
|
|
621
|
-
],
|
|
623
|
+
], r.prototype, "showRangeLabels", 2);
|
|
622
624
|
o([
|
|
623
625
|
u({ type: String, reflect: !0 })
|
|
624
|
-
],
|
|
626
|
+
], r.prototype, "min", 2);
|
|
625
627
|
o([
|
|
626
628
|
u({ type: String, reflect: !0 })
|
|
627
|
-
],
|
|
629
|
+
], r.prototype, "max", 2);
|
|
628
630
|
o([
|
|
629
631
|
u({ type: Boolean })
|
|
630
|
-
],
|
|
632
|
+
], r.prototype, "weeknumbers", 2);
|
|
631
633
|
o([
|
|
632
634
|
u({ type: Boolean, reflect: !0 })
|
|
633
|
-
],
|
|
635
|
+
], r.prototype, "withcontrols", 2);
|
|
634
636
|
o([
|
|
635
637
|
u({ converter: A.csvToArray })
|
|
636
|
-
],
|
|
638
|
+
], r.prototype, "excludedates", 2);
|
|
637
639
|
o([
|
|
638
640
|
u({ converter: A.csvToArray })
|
|
639
|
-
],
|
|
641
|
+
], r.prototype, "excludeweekdays", 2);
|
|
640
642
|
o([
|
|
641
643
|
u({ type: String })
|
|
642
|
-
],
|
|
644
|
+
], r.prototype, "currentmonth", 2);
|
|
643
645
|
o([
|
|
644
646
|
u({ type: Boolean, reflect: !0 })
|
|
645
|
-
],
|
|
647
|
+
], r.prototype, "calendarOpen", 2);
|
|
646
648
|
o([
|
|
647
649
|
u({ type: String })
|
|
648
|
-
],
|
|
650
|
+
], r.prototype, "timezone", 2);
|
|
649
651
|
o([
|
|
650
652
|
V()
|
|
651
|
-
],
|
|
653
|
+
], r.prototype, "inputClasses", 2);
|
|
652
654
|
o([
|
|
653
655
|
V()
|
|
654
|
-
],
|
|
655
|
-
|
|
656
|
+
], r.prototype, "buttonClasses", 2);
|
|
657
|
+
r = o([
|
|
656
658
|
H("pkt-datepicker")
|
|
657
|
-
],
|
|
659
|
+
], r);
|
|
658
660
|
export {
|
|
659
|
-
|
|
661
|
+
r as P
|
|
660
662
|
};
|
package/dist/datepicker.d.ts
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { P as d, x as a, n as i, t as u, E as c } from "./element-BKrU5soj.js";
|
|
2
|
+
import { e as f, n as m } from "./ref-D5qG7OFB.js";
|
|
3
|
+
import { o as x } from "./icon-Bsb0MB2h.js";
|
|
4
|
+
import { e as v } from "./class-map-CQzsZCwS.js";
|
|
5
|
+
import { r as w } from "./state-C36ZmZgt.js";
|
|
6
|
+
import { u as _ } from "./stringutils-DJjRa8dG.js";
|
|
7
|
+
import { s as k } from "./input-wrapper-Bw9tARAD.js";
|
|
8
|
+
import { P as b } from "./pkt-slot-controller-Clbye6cM.js";
|
|
9
|
+
var D = Object.defineProperty, O = Object.getOwnPropertyDescriptor, n = (r, o, s, t) => {
|
|
10
|
+
for (var e = t > 1 ? void 0 : t ? O(o, s) : o, l = r.length - 1, h; l >= 0; l--)
|
|
11
|
+
(h = r[l]) && (e = (t ? h(o, s, e) : h(e)) || e);
|
|
12
|
+
return t && e && D(o, s, e), e;
|
|
13
|
+
};
|
|
14
|
+
let p = class extends d {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(), this.defaultSlot = f(), this.forId = _(), this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = k.props.helptextDropdownButton.default, this.isHelpTextOpen = !1, this.slotController = new b(this, this.defaultSlot);
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
const r = () => {
|
|
20
|
+
const t = !this.isHelpTextOpen;
|
|
21
|
+
this.isHelpTextOpen = t, this.dispatchEvent(
|
|
22
|
+
new CustomEvent("toggleHelpText", {
|
|
23
|
+
bubbles: !0,
|
|
24
|
+
detail: { isOpen: t }
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
}, o = () => this.helptextDropdown ? a`<div class="pkt-inputwrapper__helptext-expandable">
|
|
28
|
+
<button
|
|
29
|
+
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
30
|
+
type="button"
|
|
31
|
+
@click=${r}
|
|
32
|
+
>
|
|
33
|
+
<pkt-icon
|
|
34
|
+
class="pkt-btn__icon"
|
|
35
|
+
name="${this.isHelpTextOpen ? "chevron-thin-up" : "chevron-thin-down"}"
|
|
36
|
+
></pkt-icon>
|
|
37
|
+
<span class="pkt-btn__text">${x(this.helptextDropdownButton)}</span>
|
|
38
|
+
</button>
|
|
39
|
+
<div
|
|
40
|
+
class="${v({
|
|
41
|
+
"pkt-inputwrapper__helptext": !0,
|
|
42
|
+
"pkt-inputwrapper__helptext-expandable-open": this.isHelpTextOpen,
|
|
43
|
+
"pkt-inputwrapper__helptext-expandable-closed": !this.isHelpTextOpen
|
|
44
|
+
})}"
|
|
45
|
+
>
|
|
46
|
+
${x(this.helptextDropdown)}
|
|
47
|
+
</div>
|
|
48
|
+
</div>` : c;
|
|
49
|
+
return a`${a`<div>
|
|
50
|
+
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
51
|
+
<div class="pkt-contents" ${m(this.defaultSlot)} name="helptext"></div>
|
|
52
|
+
${this.helptext && x(this.helptext)}
|
|
53
|
+
</div>
|
|
54
|
+
${o()}
|
|
55
|
+
</div>`}`;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
n([
|
|
59
|
+
i({ type: String, reflect: !0 })
|
|
60
|
+
], p.prototype, "forId", 2);
|
|
61
|
+
n([
|
|
62
|
+
i({ type: String })
|
|
63
|
+
], p.prototype, "helptext", 2);
|
|
64
|
+
n([
|
|
65
|
+
i({ type: String })
|
|
66
|
+
], p.prototype, "helptextDropdown", 2);
|
|
67
|
+
n([
|
|
68
|
+
i({ type: String })
|
|
69
|
+
], p.prototype, "helptextDropdownButton", 2);
|
|
70
|
+
n([
|
|
71
|
+
w()
|
|
72
|
+
], p.prototype, "isHelpTextOpen", 2);
|
|
73
|
+
p = n([
|
|
74
|
+
u("pkt-helptext")
|
|
75
|
+
], p);
|
|
76
|
+
export {
|
|
77
|
+
p as P
|
|
78
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";const e=require("./element-B0UgldHm.cjs"),x=require("./ref-DDYBJ4EB.cjs"),h=require("./icon-PWn7rnfg.cjs"),u=require("./class-map-aeZWY44S.cjs"),c=require("./state-CG-binsl.cjs"),a=require("./stringutils-CkVRq4jP.cjs"),d=require("./input-wrapper-jPnKsfEC.cjs"),k=require("./pkt-slot-controller-Oc32unDk.cjs");var v=Object.defineProperty,w=Object.getOwnPropertyDescriptor,r=(o,p,l,n)=>{for(var t=n>1?void 0:n?w(p,l):p,s=o.length-1,i;s>=0;s--)(i=o[s])&&(t=(n?i(p,l,t):i(t))||t);return n&&t&&v(p,l,t),t};exports.PktHelptext=class extends e.PktElement{constructor(){super(),this.defaultSlot=x.e(),this.forId=a.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=d.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.slotController=new k.PktSlotController(this,this.defaultSlot)}render(){const p=()=>{const t=!this.isHelpTextOpen;this.isHelpTextOpen=t,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:t}}))},l=()=>this.helptextDropdown?e.x`<div class="pkt-inputwrapper__helptext-expandable">
|
|
2
|
+
<button
|
|
3
|
+
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
4
|
+
type="button"
|
|
5
|
+
@click=${p}
|
|
6
|
+
>
|
|
7
|
+
<pkt-icon
|
|
8
|
+
class="pkt-btn__icon"
|
|
9
|
+
name="${this.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down"}"
|
|
10
|
+
></pkt-icon>
|
|
11
|
+
<span class="pkt-btn__text">${h.o(this.helptextDropdownButton)}</span>
|
|
12
|
+
</button>
|
|
13
|
+
<div
|
|
14
|
+
class="${u.e({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
|
|
15
|
+
>
|
|
16
|
+
${h.o(this.helptextDropdown)}
|
|
17
|
+
</div>
|
|
18
|
+
</div>`:e.E,n=()=>e.x`<div>
|
|
19
|
+
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
20
|
+
<div class="pkt-contents" ${x.n(this.defaultSlot)} name="helptext"></div>
|
|
21
|
+
${this.helptext&&h.o(this.helptext)}
|
|
22
|
+
</div>
|
|
23
|
+
${l()}
|
|
24
|
+
</div>`;return e.x`${n()}`}};r([e.n({type:String,reflect:!0})],exports.PktHelptext.prototype,"forId",2);r([e.n({type:String})],exports.PktHelptext.prototype,"helptext",2);r([e.n({type:String})],exports.PktHelptext.prototype,"helptextDropdown",2);r([e.n({type:String})],exports.PktHelptext.prototype,"helptextDropdownButton",2);r([c.r()],exports.PktHelptext.prototype,"isHelpTextOpen",2);exports.PktHelptext=r([e.t("pkt-helptext")],exports.PktHelptext);
|
package/dist/helptext.d.ts
CHANGED