@oslokommune/punkt-elements 12.2.0 → 12.3.0

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.
Files changed (91) hide show
  1. package/README.md +30 -0
  2. package/dist/alert.d.ts +1 -0
  3. package/dist/calendar.d.ts +1 -0
  4. package/dist/card.d.ts +1 -0
  5. package/dist/class-map-CA8wadiN.cjs +5 -0
  6. package/dist/class-map-DiT0qP3E.js +34 -0
  7. package/dist/component-template.d.ts +1 -0
  8. package/dist/converters-DNCwIFwr.js +17 -0
  9. package/dist/converters-DhM11VlY.cjs +1 -0
  10. package/dist/datepicker.d.ts +1 -0
  11. package/dist/directive-19_ixLKS.cjs +9 -0
  12. package/dist/directive-DA0-wdk7.js +38 -0
  13. package/dist/element.d.ts +1 -0
  14. package/dist/icon.d.ts +1 -0
  15. package/dist/index-BHzxfdBK.js +807 -0
  16. package/dist/index-BJ_4AGO3.cjs +23 -0
  17. package/dist/index-BlHnvy7v.js +82 -0
  18. package/dist/index-CPvZ03uX.js +577 -0
  19. package/dist/index-DSplpVWQ.cjs +9 -0
  20. package/dist/index-DkGcZra2.cjs +90 -0
  21. package/dist/index.d.ts +393 -3
  22. package/dist/input-wrapper.d.ts +1 -0
  23. package/dist/link.d.ts +1 -0
  24. package/dist/messagebox.d.ts +1 -0
  25. package/dist/pkt-alert.cjs +27 -0
  26. package/dist/pkt-alert.js +86 -0
  27. package/dist/pkt-calendar.cjs +1 -0
  28. package/dist/pkt-calendar.js +10 -0
  29. package/dist/pkt-card.cjs +23 -0
  30. package/dist/pkt-card.js +177 -0
  31. package/dist/pkt-component-template.cjs +29 -0
  32. package/dist/{pkt-el-component-template.js → pkt-component-template.js} +25 -26
  33. package/dist/pkt-datepicker.cjs +140 -0
  34. package/dist/pkt-datepicker.js +1769 -0
  35. package/dist/pkt-element.cjs +1 -0
  36. package/dist/pkt-element.js +5 -0
  37. package/dist/pkt-icon.cjs +1 -0
  38. package/dist/pkt-icon.js +6 -0
  39. package/dist/pkt-index.cjs +1 -0
  40. package/dist/pkt-index.js +20 -0
  41. package/dist/pkt-input-wrapper.cjs +59 -0
  42. package/dist/pkt-input-wrapper.js +293 -0
  43. package/dist/pkt-link.cjs +3 -0
  44. package/dist/pkt-link.js +90 -0
  45. package/dist/pkt-messagebox.cjs +12 -0
  46. package/dist/pkt-messagebox.js +62 -0
  47. package/dist/pkt-tag.cjs +17 -0
  48. package/dist/pkt-tag.js +151 -0
  49. package/dist/ref-Bk590hog.cjs +13 -0
  50. package/dist/ref-Co_S0Cgj.js +173 -0
  51. package/dist/state-BRgFbJX9.js +12 -0
  52. package/dist/state-D2tUtTi6.cjs +5 -0
  53. package/dist/tag.d.ts +1 -0
  54. package/package.json +10 -7
  55. package/src/components/alert/index.ts +86 -0
  56. package/src/components/calendar/index.ts +391 -143
  57. package/src/components/card/index.ts +78 -0
  58. package/src/components/component-template/index.ts +25 -9
  59. package/src/components/datepicker/index.ts +546 -0
  60. package/src/components/element/index.ts +181 -8
  61. package/src/components/icon/index.ts +44 -49
  62. package/src/components/index.ts +7 -1
  63. package/src/components/input-wrapper/index.ts +260 -0
  64. package/src/components/link/index.ts +51 -0
  65. package/src/components/messagebox/index.ts +63 -0
  66. package/src/components/tag/index.ts +110 -0
  67. package/dist/components/calendar/index.d.ts +0 -59
  68. package/dist/components/component-template/index.d.ts +0 -34
  69. package/dist/components/element/index.d.ts +0 -24
  70. package/dist/components/icon/index.d.ts +0 -29
  71. package/dist/components/index.d.ts +0 -3
  72. package/dist/controllers/pkt-slot-controller.d.ts +0 -11
  73. package/dist/converters-Bi8tmNvQ.cjs +0 -5
  74. package/dist/converters-DMveycvc.js +0 -100
  75. package/dist/directive-C7mkmyiy.js +0 -573
  76. package/dist/directive-DfhMJ1ie.cjs +0 -23
  77. package/dist/helpers/converters.d.ts +0 -3
  78. package/dist/index-0PZgk9Oc.js +0 -159
  79. package/dist/index-xoVy6sfy.cjs +0 -13
  80. package/dist/pkt-el-calendar.cjs +0 -60
  81. package/dist/pkt-el-calendar.js +0 -1496
  82. package/dist/pkt-el-component-template.cjs +0 -29
  83. package/dist/pkt-el-element.cjs +0 -1
  84. package/dist/pkt-el-element.js +0 -5
  85. package/dist/pkt-el-icon.cjs +0 -9
  86. package/dist/pkt-el-icon.js +0 -98
  87. package/dist/pkt-el-index.cjs +0 -1
  88. package/dist/pkt-el-index.js +0 -8
  89. package/dist/property-BBVRv-DT.js +0 -47
  90. package/dist/property-CK6SFc5B.cjs +0 -9
  91. package/dist/src/translations/no.json.d.ts +0 -43
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ ## Bruk av punkt-elements
2
+
3
+ <a href="https://www.npmjs.com/package/@oslokommune/punkt-elements" target="_blank"><img src="https://img.shields.io/npm/v/@oslokommune/punkt-elements?logo=webcomponentsdotorg&label=customelements&style=for-the-badge&color=bf4080" alt="Custom elements" /></a>
4
+
5
+ Denne pakken inneholder custom elements for Punkts komponentbibliotek. Foreløpig høyst eksperimentell.
6
+
7
+ ## 🚀 Kom i gang - npm
8
+
9
+ ```sh
10
+ npm add @oslokommune/punkt-css
11
+ npm add @oslokommune/punkt-elements
12
+ ```
13
+
14
+ ```js
15
+ import '@oslokommune/punkt-elements/dist/pkt-card.js'
16
+ import '@oslokommune/punkt-elements/dist/pkt-datepicker.js'
17
+ import '@oslokommune/punkt-elements/dist/pkt-link.js'
18
+ ```
19
+
20
+ Se dokumentasjon for punkt-css for instrukser for bruk av CSS-pakken.
21
+
22
+ ## 🏎️ Kom i gang - cdn
23
+
24
+ ```html
25
+ <link href="https://punkt-cdn.oslo.kommune.no/latest/css/pkt.min.css" rel="stylesheet" />
26
+ <!-- importer elementene du vil bruke -->
27
+ <script src="https://punkt-cdn.oslo.kommune.no/latest/elements/pkt-card.js"></script>
28
+ <script src="https://punkt-cdn.oslo.kommune.no/latest/elements/pkt-datepicker.js"></script>
29
+ <script src="https://punkt-cdn.oslo.kommune.no/latest/elements/pkt-link.js"></script>
30
+ ```
@@ -0,0 +1 @@
1
+ export { }
@@ -0,0 +1 @@
1
+ export { }
package/dist/card.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { }
@@ -0,0 +1,5 @@
1
+ "use strict";const a=require("./index-BJ_4AGO3.cjs"),n=require("./directive-19_ixLKS.cjs");/**
2
+ * @license
3
+ * Copyright 2018 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const c=n.e(class extends n.i{constructor(e){var s;if(super(e),e.type!==n.t$1.ATTRIBUTE||e.name!=="class"||((s=e.strings)==null?void 0:s.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(s=>e[s]).join(" ")+" "}update(e,[s]){var r,o;if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(t=>t!=="")));for(const t in s)s[t]&&!((r=this.nt)!=null&&r.has(t))&&this.st.add(t);return this.render(s)}const i=e.element.classList;for(const t of this.st)t in s||(i.remove(t),this.st.delete(t));for(const t in s){const h=!!s[t];h===this.st.has(t)||(o=this.nt)!=null&&o.has(t)||(h?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return a.R}});exports.Rt=c;
@@ -0,0 +1,34 @@
1
+ import { R as a } from "./index-BHzxfdBK.js";
2
+ import { e as h, i as d, a as c } from "./directive-DA0-wdk7.js";
3
+ /**
4
+ * @license
5
+ * Copyright 2018 Google LLC
6
+ * SPDX-License-Identifier: BSD-3-Clause
7
+ */
8
+ const u = h(class extends d {
9
+ constructor(s) {
10
+ var e;
11
+ if (super(s), s.type !== c.ATTRIBUTE || s.name !== "class" || ((e = s.strings) == null ? void 0 : e.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
12
+ }
13
+ render(s) {
14
+ return " " + Object.keys(s).filter((e) => s[e]).join(" ") + " ";
15
+ }
16
+ update(s, [e]) {
17
+ var r, n;
18
+ if (this.st === void 0) {
19
+ this.st = /* @__PURE__ */ new Set(), s.strings !== void 0 && (this.nt = new Set(s.strings.join(" ").split(/\s/).filter((t) => t !== "")));
20
+ for (const t in e) e[t] && !((r = this.nt) != null && r.has(t)) && this.st.add(t);
21
+ return this.render(e);
22
+ }
23
+ const i = s.element.classList;
24
+ for (const t of this.st) t in e || (i.remove(t), this.st.delete(t));
25
+ for (const t in e) {
26
+ const o = !!e[t];
27
+ o === this.st.has(t) || (n = this.nt) != null && n.has(t) || (o ? (i.add(t), this.st.add(t)) : (i.remove(t), this.st.delete(t)));
28
+ }
29
+ return a;
30
+ }
31
+ });
32
+ export {
33
+ u as R
34
+ };
@@ -0,0 +1 @@
1
+ export { }
@@ -0,0 +1,17 @@
1
+ const n = (r) => {
2
+ if (Array.isArray(r)) return r;
3
+ if (typeof r == "string") return r.split(",");
4
+ }, s = (r) => r ? new Date(r) : null, e = (r) => {
5
+ if (typeof r == "string")
6
+ return r.split(",").map((t) => new Date(t));
7
+ if (Array.isArray(r))
8
+ return r.map((t) => new Date(t));
9
+ }, i = {
10
+ csvToArray: n,
11
+ stringToDate: s,
12
+ stringsToDate: e
13
+ };
14
+ export {
15
+ i as a,
16
+ n as c
17
+ };
@@ -0,0 +1 @@
1
+ "use strict";const n=r=>{if(Array.isArray(r))return r;if(typeof r=="string")return r.split(",")},s=r=>r?new Date(r):null,e=r=>{if(typeof r=="string")return r.split(",").map(t=>new Date(t));if(Array.isArray(r))return r.map(t=>new Date(t))},i={csvToArray:n,stringToDate:s,stringsToDate:e};exports.converters=i;exports.csvToArray=n;
@@ -0,0 +1 @@
1
+ export { }
@@ -0,0 +1,9 @@
1
+ "use strict";/**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const r=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};/**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */const n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},E=i=>(...t)=>({_$litDirective$:i,values:t});class u{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this.t=t,this._$AM=e,this.i=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}exports.e=E;exports.i=u;exports.t=r;exports.t$1=n;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ const r = (s) => (t, e) => {
7
+ e !== void 0 ? e.addInitializer(() => {
8
+ customElements.define(s, t);
9
+ }) : customElements.define(s, t);
10
+ };
11
+ /**
12
+ * @license
13
+ * Copyright 2017 Google LLC
14
+ * SPDX-License-Identifier: BSD-3-Clause
15
+ */
16
+ const n = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, E = (s) => (...t) => ({ _$litDirective$: s, values: t });
17
+ class T {
18
+ constructor(t) {
19
+ }
20
+ get _$AU() {
21
+ return this._$AM._$AU;
22
+ }
23
+ _$AT(t, e, i) {
24
+ this.t = t, this._$AM = e, this.i = i;
25
+ }
26
+ _$AS(t, e) {
27
+ return this.update(t, e);
28
+ }
29
+ update(t, e) {
30
+ return this.render(...e);
31
+ }
32
+ }
33
+ export {
34
+ n as a,
35
+ E as e,
36
+ T as i,
37
+ r as t
38
+ };
@@ -0,0 +1 @@
1
+ export { }
package/dist/icon.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { }