@mattilsynet/design 3.3.10 → 3.4.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.
Files changed (191) hide show
  1. package/mtds/_virtual/_rolldown/runtime.js +17 -0
  2. package/mtds/ai/card.stories.tsx +54 -77
  3. package/mtds/ai/layout.mdx +37 -1
  4. package/mtds/ai/layout.stories.tsx +126 -1
  5. package/mtds/ai/print.mdx +1 -1
  6. package/mtds/ai/print.stories.tsx +1 -2
  7. package/mtds/alert/alert.js +16 -11
  8. package/mtds/alert/alert.js.map +1 -1
  9. package/mtds/analytics/analytics.js +118 -118
  10. package/mtds/analytics/analytics.js.map +1 -1
  11. package/mtds/app/app-observer.js +31 -36
  12. package/mtds/app/app-observer.js.map +1 -1
  13. package/mtds/app/app-toggle.js +12 -26
  14. package/mtds/app/app-toggle.js.map +1 -1
  15. package/mtds/app/app-toggle2.js +6 -11
  16. package/mtds/app/app-toggle2.js.map +1 -1
  17. package/mtds/app/app.js +66 -60
  18. package/mtds/app/app.js.map +1 -1
  19. package/mtds/atlas/atlas-element.js +83 -93
  20. package/mtds/atlas/atlas-element.js.map +1 -1
  21. package/mtds/atlas/atlas-marker.js +63 -52
  22. package/mtds/atlas/atlas-marker.js.map +1 -1
  23. package/mtds/atlas/atlas-matgeo.js +67 -61
  24. package/mtds/atlas/atlas-matgeo.js.map +1 -1
  25. package/mtds/atlas/atlas-wms.js +33 -28
  26. package/mtds/atlas/atlas-wms.js.map +1 -1
  27. package/mtds/atlas/atlas.js +6 -38
  28. package/mtds/atlas/atlas.js.map +1 -1
  29. package/mtds/atlas/atlas2.js +39 -0
  30. package/mtds/atlas/atlas2.js.map +1 -0
  31. package/mtds/atlas/cluster.js +759 -1149
  32. package/mtds/atlas/cluster.js.map +1 -1
  33. package/mtds/atlas.iife.js +3 -4
  34. package/mtds/atlas.js +6 -14
  35. package/mtds/avatar/avatar.js +14 -10
  36. package/mtds/avatar/avatar.js.map +1 -1
  37. package/mtds/badge/badge.js +15 -10
  38. package/mtds/badge/badge.js.map +1 -1
  39. package/mtds/breadcrumbs/breadcrumbs.js +15 -19
  40. package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
  41. package/mtds/button/button.js +18 -20
  42. package/mtds/button/button.js.map +1 -1
  43. package/mtds/card/card.js +22 -15
  44. package/mtds/card/card.js.map +1 -1
  45. package/mtds/chart/chart-axis.js +33 -21
  46. package/mtds/chart/chart-axis.js.map +1 -1
  47. package/mtds/chart/chart-bars.js +23 -21
  48. package/mtds/chart/chart-bars.js.map +1 -1
  49. package/mtds/chart/chart-element.js +94 -88
  50. package/mtds/chart/chart-element.js.map +1 -1
  51. package/mtds/chart/chart-lines.js +35 -37
  52. package/mtds/chart/chart-lines.js.map +1 -1
  53. package/mtds/chart/chart-pies.js +17 -17
  54. package/mtds/chart/chart-pies.js.map +1 -1
  55. package/mtds/chart/chart.js +6 -52
  56. package/mtds/chart/chart.js.map +1 -1
  57. package/mtds/chart/chart2.js +21 -0
  58. package/mtds/chart/chart2.js.map +1 -0
  59. package/mtds/chip/chip.js +15 -11
  60. package/mtds/chip/chip.js.map +1 -1
  61. package/mtds/deprecations.js +76 -158
  62. package/mtds/deprecations.js.map +1 -1
  63. package/mtds/details/details.js +21 -24
  64. package/mtds/details/details.js.map +1 -1
  65. package/mtds/dialog/dialog.js +17 -21
  66. package/mtds/dialog/dialog.js.map +1 -1
  67. package/mtds/divider/divider.js +15 -20
  68. package/mtds/divider/divider.js.map +1 -1
  69. package/mtds/errorsummary/errorsummary.js +14 -16
  70. package/mtds/errorsummary/errorsummary.js.map +1 -1
  71. package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js +22 -25
  72. package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -1
  73. package/mtds/external/@turf/helpers/dist/esm/index.js +21 -24
  74. package/mtds/external/@turf/helpers/dist/esm/index.js.map +1 -1
  75. package/mtds/external/@turf/invariant/dist/esm/index.js +15 -19
  76. package/mtds/external/@turf/invariant/dist/esm/index.js.map +1 -1
  77. package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js +270 -297
  78. package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +1 -1
  79. package/mtds/external/@u-elements/u-details/dist/u-details.js +75 -101
  80. package/mtds/external/@u-elements/u-details/dist/u-details.js.map +1 -1
  81. package/mtds/external/leaflet/dist/leaflet-src.js +4257 -6151
  82. package/mtds/external/leaflet/dist/leaflet-src.js.map +1 -1
  83. package/mtds/external/leaflet/dist/leaflet.css.js +5 -606
  84. package/mtds/external/leaflet/dist/leaflet.css.js.map +1 -1
  85. package/mtds/external/point-in-polygon-hao/dist/esm/index.js +24 -25
  86. package/mtds/external/point-in-polygon-hao/dist/esm/index.js.map +1 -1
  87. package/mtds/external/robust-predicates/esm/incircle.js +5 -0
  88. package/mtds/external/robust-predicates/esm/incircle.js.map +1 -0
  89. package/mtds/external/robust-predicates/esm/insphere.js +5 -0
  90. package/mtds/external/robust-predicates/esm/insphere.js.map +1 -0
  91. package/mtds/external/robust-predicates/esm/orient2d.js +20 -22
  92. package/mtds/external/robust-predicates/esm/orient2d.js.map +1 -1
  93. package/mtds/external/robust-predicates/esm/orient3d.js +5 -0
  94. package/mtds/external/robust-predicates/esm/orient3d.js.map +1 -0
  95. package/mtds/external/robust-predicates/esm/util.js +20 -28
  96. package/mtds/external/robust-predicates/esm/util.js.map +1 -1
  97. package/mtds/external/robust-predicates/index.js +5 -0
  98. package/mtds/field/field.js +167 -214
  99. package/mtds/field/field.js.map +1 -1
  100. package/mtds/fieldset/fieldset.js +32 -30
  101. package/mtds/fieldset/fieldset.js.map +1 -1
  102. package/mtds/fileupload/fileupload.js +16 -13
  103. package/mtds/fileupload/fileupload.js.map +1 -1
  104. package/mtds/helptext/helptext.js +25 -27
  105. package/mtds/helptext/helptext.js.map +1 -1
  106. package/mtds/identitet/illustrasjons-generator/illustrasjons-generator.d.ts +1 -0
  107. package/mtds/identitet/illustrasjons-generator/index-old-1.d.ts +1 -0
  108. package/mtds/identitet/infografikk-generator/infografikk-generator.d.ts +1 -0
  109. package/mtds/index.iife.js +21 -21
  110. package/mtds/index.js +38 -31
  111. package/mtds/index.js.map +1 -1
  112. package/mtds/input/input.js +33 -47
  113. package/mtds/input/input.js.map +1 -1
  114. package/mtds/law/law-helper.js +106 -95
  115. package/mtds/law/law-helper.js.map +1 -1
  116. package/mtds/law/law.js +15 -10
  117. package/mtds/law/law.js.map +1 -1
  118. package/mtds/layout/layout.js +21 -13
  119. package/mtds/layout/layout.js.map +1 -1
  120. package/mtds/layout/layout.stories.d.ts +1 -0
  121. package/mtds/link/link.js +15 -10
  122. package/mtds/link/link.js.map +1 -1
  123. package/mtds/logo/logo-observer.js +18 -18
  124. package/mtds/logo/logo-observer.js.map +1 -1
  125. package/mtds/logo/logo.js +18 -18
  126. package/mtds/logo/logo.js.map +1 -1
  127. package/mtds/package.js +6 -0
  128. package/mtds/package.js.map +1 -0
  129. package/mtds/package.json.d.ts +112 -0
  130. package/mtds/pagination/pagination.js +46 -60
  131. package/mtds/pagination/pagination.js.map +1 -1
  132. package/mtds/popover/popover-observer.js +15 -15
  133. package/mtds/popover/popover-observer.js.map +1 -1
  134. package/mtds/popover/popover.js +18 -20
  135. package/mtds/popover/popover.js.map +1 -1
  136. package/mtds/print/print.js +15 -10
  137. package/mtds/print/print.js.map +1 -1
  138. package/mtds/print/print.stories.d.ts +0 -1
  139. package/mtds/profilering/epost.d.ts +1 -0
  140. package/mtds/progress/progress.js +15 -13
  141. package/mtds/progress/progress.js.map +1 -1
  142. package/mtds/react-atlas.js +7 -16
  143. package/mtds/react.js +36 -84
  144. package/mtds/skeleton/skeleton.js +15 -11
  145. package/mtds/skeleton/skeleton.js.map +1 -1
  146. package/mtds/spinner/spinner.js +16 -13
  147. package/mtds/spinner/spinner.js.map +1 -1
  148. package/mtds/steps/steps.js +15 -10
  149. package/mtds/steps/steps.js.map +1 -1
  150. package/mtds/styles.css +2 -1
  151. package/mtds/styles.module.js +122 -0
  152. package/mtds/styles.module.js.map +1 -0
  153. package/mtds/table/table-observer.js +23 -28
  154. package/mtds/table/table-observer.js.map +1 -1
  155. package/mtds/table/table.js +88 -60
  156. package/mtds/table/table.js.map +1 -1
  157. package/mtds/tabs/tabs.js +32 -27
  158. package/mtds/tabs/tabs.js.map +1 -1
  159. package/mtds/tag/tag.js +16 -19
  160. package/mtds/tag/tag.js.map +1 -1
  161. package/mtds/tailwind.css +0 -4
  162. package/mtds/toast/toast-helper.js +45 -25
  163. package/mtds/toast/toast-helper.js.map +1 -1
  164. package/mtds/toast/toast-observer.js +18 -18
  165. package/mtds/toast/toast-observer.js.map +1 -1
  166. package/mtds/toast/toast.js +67 -54
  167. package/mtds/toast/toast.js.map +1 -1
  168. package/mtds/togglegroup/togglegroup.js +31 -40
  169. package/mtds/togglegroup/togglegroup.js.map +1 -1
  170. package/mtds/tooltip/tooltip-element.js +12 -25
  171. package/mtds/tooltip/tooltip-element.js.map +1 -1
  172. package/mtds/typography/typography.js +38 -21
  173. package/mtds/typography/typography.js.map +1 -1
  174. package/mtds/utils.js +53 -70
  175. package/mtds/utils.js.map +1 -1
  176. package/mtds/validation/validation-observer.js +40 -47
  177. package/mtds/validation/validation-observer.js.map +1 -1
  178. package/mtds/validation/validation.js +17 -21
  179. package/mtds/validation/validation.js.map +1 -1
  180. package/package.json +9 -9
  181. package/mtds/atlas/atlas.css.js +0 -138
  182. package/mtds/atlas/atlas.css.js.map +0 -1
  183. package/mtds/atlas.js.map +0 -1
  184. package/mtds/chart/chart.css.js +0 -187
  185. package/mtds/chart/chart.css.js.map +0 -1
  186. package/mtds/package.json.js +0 -5
  187. package/mtds/package.json.js.map +0 -1
  188. package/mtds/react-atlas.js.map +0 -1
  189. package/mtds/react.js.map +0 -1
  190. package/mtds/styles.module.css.js +0 -118
  191. package/mtds/styles.module.css.js.map +0 -1
package/mtds/atlas.js CHANGED
@@ -1,14 +1,6 @@
1
- import { MATGEO_URL as r, MTDSAtlasElement as o } from "./atlas/atlas-element.js";
2
- import { default as m } from "./external/leaflet/dist/leaflet-src.js";
3
- import { MTDSAtlasMarkerElement as M } from "./atlas/atlas-marker.js";
4
- import { MTDSAtlasMatgeoElement as p } from "./atlas/atlas-matgeo.js";
5
- import { MTDSAtlasWMSElement as x } from "./atlas/atlas-wms.js";
6
- export {
7
- m as L,
8
- r as MATGEO_URL,
9
- o as MTDSAtlasElement,
10
- M as MTDSAtlasMarkerElement,
11
- p as MTDSAtlasMatgeoElement,
12
- x as MTDSAtlasWMSElement
13
- };
14
- //# sourceMappingURL=atlas.js.map
1
+ import e from "./external/leaflet/dist/leaflet-src.js";
2
+ import { MTDSAtlasMarkerElement as t } from "./atlas/atlas-marker.js";
3
+ import { MTDSAtlasMatgeoElement as n } from "./atlas/atlas-matgeo.js";
4
+ import { MTDSAtlasWMSElement as r } from "./atlas/atlas-wms.js";
5
+ import { MATGEO_URL as i, MTDSAtlasElement as a } from "./atlas/atlas-element.js";
6
+ export { e as L, i as MATGEO_URL, a as MTDSAtlasElement, t as MTDSAtlasMarkerElement, n as MTDSAtlasMatgeoElement, r as MTDSAtlasWMSElement };
@@ -1,12 +1,16 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import s from "clsx";
1
+ import e from "../styles.module.js";
2
+ import t from "clsx";
3
3
  import { forwardRef as n } from "react";
4
- import p from "../styles.module.css.js";
5
- const x = n(function({ as: a, className: o, ...r }, t) {
6
- const m = a || (r.href ? "a" : "span");
7
- return /* @__PURE__ */ f(m, { className: s(p.avatar, o), ref: t, ...r });
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region designsystem/avatar/avatar.tsx
6
+ var i = n(function({ as: n, className: i, ...a }, o) {
7
+ return /* @__PURE__ */ r(n || (a.href ? "a" : "span"), {
8
+ className: t(e.avatar, i),
9
+ ref: o,
10
+ ...a
11
+ });
8
12
  });
9
- export {
10
- x as Avatar
11
- };
12
- //# sourceMappingURL=avatar.js.map
13
+ //#endregion
14
+ export { i as Avatar };
15
+
16
+ //# sourceMappingURL=avatar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","sources":["../../designsystem/avatar/avatar.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\ntype AvatarBaseProps<Href> = {\n\thref?: Href;\n};\n\nexport type AvatarProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n> = PolymorphicComponentPropWithRef<As, AvatarBaseProps<Href>>;\n\ntype AvatarComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>(\n\tprops: AvatarProps<Href, As>,\n) => JSX.Element;\n\nexport const Avatar: AvatarComponent = forwardRef<null>(function Avatar<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>({ as, className, ...rest }: AvatarProps<Href, As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || (rest.href ? \"a\" : \"span\");\n\n\treturn <Tag className={clsx(styles.avatar, className)} ref={ref} {...rest} />;\n}) as AvatarComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Avatar","forwardRef","as","className","rest","ref","Tag","jsx","clsx","styles"],"mappings":";;;;AAwBO,MAAMA,IAA0BC,EAAiB,SAGtD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAA+BC,GAA0B;AAC9E,QAAMC,IAAMJ,MAAOE,EAAK,OAAO,MAAM;AAErC,SAAO,gBAAAG,EAACD,GAAA,EAAI,WAAWE,EAAKC,EAAO,QAAQN,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC5E,CAAC;"}
1
+ {"version":3,"file":"avatar.js","names":[],"sources":["../../designsystem/avatar/avatar.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\ntype AvatarBaseProps<Href> = {\n\thref?: Href;\n};\n\nexport type AvatarProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n> = PolymorphicComponentPropWithRef<As, AvatarBaseProps<Href>>;\n\ntype AvatarComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>(\n\tprops: AvatarProps<Href, As>,\n) => JSX.Element;\n\nexport const Avatar: AvatarComponent = forwardRef<null>(function Avatar<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"span\",\n>({ as, className, ...rest }: AvatarProps<Href, As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || (rest.href ? \"a\" : \"span\");\n\n\treturn <Tag className={clsx(styles.avatar, className)} ref={ref} {...rest} />;\n}) as AvatarComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"mappings":";;;;;AAwBA,IAAa,IAA0B,EAAiB,SAGtD,EAAE,OAAI,cAAW,GAAG,KAA+B,GAA0B;CAG9E,OAAO,kBAFK,MAAO,EAAK,OAAO,MAAM,SAE9B;EAAK,WAAW,EAAK,EAAO,QAAQ,CAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAC7E,CAAC"}
@@ -1,11 +1,16 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import e from "clsx";
3
- import { forwardRef as s } from "react";
4
- import a from "../styles.module.css.js";
5
- const d = s(function({ className: r, ...o }, m) {
6
- return /* @__PURE__ */ t("span", { className: e(a.badge, r), ref: m, ...o });
1
+ import e from "../styles.module.js";
2
+ import t from "clsx";
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region designsystem/badge/badge.tsx
6
+ var i = n(function({ className: n, ...i }, a) {
7
+ return /* @__PURE__ */ r("span", {
8
+ className: t(e.badge, n),
9
+ ref: a,
10
+ ...i
11
+ });
7
12
  });
8
- export {
9
- d as Badge
10
- };
11
- //# sourceMappingURL=badge.js.map
13
+ //#endregion
14
+ export { i as Badge };
15
+
16
+ //# sourceMappingURL=badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"badge.js","sources":["../../designsystem/badge/badge.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type BadgeProps = React.ComponentPropsWithoutRef<\"span\"> & {\n\t\"data-badge\"?: string | number | boolean;\n};\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn <span className={clsx(styles.badge, className)} ref={ref} {...rest} />;\n});\n"],"names":["Badge","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAQO,MAAMA,IAAQC,EAAwC,SAC5D,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAChBC,GACC;AACD,SAAO,gBAAAC,EAAC,QAAA,EAAK,WAAWC,EAAKC,EAAO,OAAOL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC5E,CAAC;"}
1
+ {"version":3,"file":"badge.js","names":[],"sources":["../../designsystem/badge/badge.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type BadgeProps = React.ComponentPropsWithoutRef<\"span\"> & {\n\t\"data-badge\"?: string | number | boolean;\n};\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn <span className={clsx(styles.badge, className)} ref={ref} {...rest} />;\n});\n"],"mappings":";;;;;AAQA,IAAa,IAAQ,EAAwC,SAC5D,EAAE,cAAW,GAAG,KAChB,GACC;CACD,OAAO,kBAAC,QAAD;EAAM,WAAW,EAAK,EAAO,OAAO,CAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAC7E,CAAC"}
@@ -1,19 +1,15 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { forwardRef as t } from "react";
3
- import s from "../styles.module.css.js";
4
- import { toCustomElementProps as e } from "../utils.js";
5
- const p = t(
6
- function(r, o) {
7
- return /* @__PURE__ */ m(
8
- "ds-breadcrumbs",
9
- {
10
- ref: o,
11
- ...e(r, s.breadcrumbs)
12
- }
13
- );
14
- }
15
- );
16
- export {
17
- p as Breadcrumbs
18
- };
19
- //# sourceMappingURL=breadcrumbs.js.map
1
+ import e from "../styles.module.js";
2
+ import { toCustomElementProps as t } from "../utils.js";
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region designsystem/breadcrumbs/breadcrumbs.tsx
6
+ var i = n(function(n, i) {
7
+ return /* @__PURE__ */ r("ds-breadcrumbs", {
8
+ ref: i,
9
+ ...t(n, e.breadcrumbs)
10
+ });
11
+ });
12
+ //#endregion
13
+ export { i as Breadcrumbs };
14
+
15
+ //# sourceMappingURL=breadcrumbs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumbs.js","sources":["../../designsystem/breadcrumbs/breadcrumbs.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { DSBreadcrumbsElement } from \"..\";\nimport type { CustomReactElementProps } from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type BreadcrumbsProps = CustomReactElementProps<DSBreadcrumbsElement> & {\n\t/**\n\t * @deprecated `as` prop is no longer supported.\n\t */\n\tas?: never; // Remove `as` prop support\n};\n\nexport const Breadcrumbs = forwardRef<DSBreadcrumbsElement, BreadcrumbsProps>(\n\tfunction Breadcrumbs(rest, ref) {\n\t\treturn (\n\t\t\t<ds-breadcrumbs\n\t\t\t\tref={ref}\n\t\t\t\t{...toCustomElementProps(rest, styles.breadcrumbs)}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"names":["Breadcrumbs","forwardRef","rest","ref","jsx","toCustomElementProps","styles"],"mappings":";;;;AAaO,MAAMA,IAAcC;AAAA,EAC1B,SAAqBC,GAAMC,GAAK;AAC/B,WACC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,KAAAD;AAAA,QACC,GAAGE,EAAqBH,GAAMI,EAAO,WAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAGpD;AACD;"}
1
+ {"version":3,"file":"breadcrumbs.js","names":[],"sources":["../../designsystem/breadcrumbs/breadcrumbs.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { DSBreadcrumbsElement } from \"..\";\nimport type { CustomReactElementProps } from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type BreadcrumbsProps = CustomReactElementProps<DSBreadcrumbsElement> & {\n\t/**\n\t * @deprecated `as` prop is no longer supported.\n\t */\n\tas?: never; // Remove `as` prop support\n};\n\nexport const Breadcrumbs = forwardRef<DSBreadcrumbsElement, BreadcrumbsProps>(\n\tfunction Breadcrumbs(rest, ref) {\n\t\treturn (\n\t\t\t<ds-breadcrumbs\n\t\t\t\tref={ref}\n\t\t\t\t{...toCustomElementProps(rest, styles.breadcrumbs)}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"mappings":";;;;;AAaA,IAAa,IAAc,EAC1B,SAAqB,GAAM,GAAK;CAC/B,OACC,kBAAC,kBAAD;EACM;EACL,GAAI,EAAqB,GAAM,EAAO,WAAW;CACjD,CAAA;AAEH,CACD"}
@@ -1,21 +1,19 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import s from "clsx";
3
- import { forwardRef as f } from "react";
4
- import m from "../styles.module.css.js";
5
- const l = f(function({ as: r, className: n, type: u, ...t }, i) {
6
- const o = r || (t.href ? "a" : "button");
7
- return o === "button" && t["aria-busy"] && (t.disabled = !0), /* @__PURE__ */ a(
8
- o,
9
- {
10
- suppressHydrationWarning: !0,
11
- className: s(m.button, n),
12
- type: u ?? (o === "button" ? o : void 0),
13
- ref: i,
14
- ...t
15
- }
16
- );
1
+ import e from "../styles.module.js";
2
+ import t from "clsx";
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region designsystem/button/button.tsx
6
+ var i = n(function({ as: n, className: i, type: a, ...o }, s) {
7
+ let c = n || (o.href ? "a" : "button");
8
+ return c === "button" && o["aria-busy"] && (o.disabled = !0), /* @__PURE__ */ r(c, {
9
+ suppressHydrationWarning: !0,
10
+ className: t(e.button, i),
11
+ type: a ?? (c === "button" ? c : void 0),
12
+ ref: s,
13
+ ...o
14
+ });
17
15
  });
18
- export {
19
- l as Button
20
- };
21
- //# sourceMappingURL=button.js.map
16
+ //#endregion
17
+ export { i as Button };
18
+
19
+ //# sourceMappingURL=button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sources":["../../designsystem/button/button.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type { FlexProps } from \"../react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\ntype ButtonBaseProps<Href> = {\n\t\"data-arrow\"?: \"left\" | \"right\" | true;\n\t\"data-justify\"?: \"start\" | \"center\" | \"end\" | \"right\" | \"left\";\n\t\"data-nowrap\"?: boolean;\n\t\"data-variant\"?: \"primary\" | \"secondary\" | \"tertiary\";\n\t\"data-self\"?: FlexProps[\"data-items\"];\n\t/**\n\t * @deprecated Use 'command' and 'commandfor' instead\n\t */\n\t\"data-command\"?: string;\n\tcommand?: string;\n\tcommandfor?: string;\n\thref?: Href;\n\tpopovertarget?: string;\n\tpopovertargetaction?: string;\n};\n\nexport type ButtonProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"button\",\n> = PolymorphicComponentPropWithRef<As, ButtonBaseProps<Href>>;\n\ntype ButtonElement = ButtonProps<null, \"button\">;\ntype ButtonComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"button\",\n>(\n\tprops: ButtonProps<Href, As>,\n) => JSX.Element;\n\nexport const Button: ButtonComponent = forwardRef<null>(function Button<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"button\",\n>(\n\t{ as, className, type, ...rest }: ButtonProps<Href, As>,\n\tref?: PolymorphicRef<As>,\n) {\n\tconst Tag = as || (rest.href ? \"a\" : \"button\");\n\n\tif (Tag === \"button\" && (rest as ButtonElement)[\"aria-busy\"])\n\t\t(rest as ButtonElement).disabled = true; // Automatically disable button if aria-busy is set\n\n\treturn (\n\t\t<Tag\n\t\t\tsuppressHydrationWarning // aria-label might change on client when using data-tooltip\n\t\t\tclassName={clsx(styles.button, className)}\n\t\t\ttype={type ?? (Tag === \"button\" ? Tag : undefined)} // Default to type=\"button\" if not set and tag is button\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}) as ButtonComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Button","forwardRef","as","className","type","rest","ref","Tag","jsx","clsx","styles"],"mappings":";;;;AAuCO,MAAMA,IAA0BC,EAAiB,SAIvD,EAAE,IAAAC,GAAI,WAAAC,GAAW,MAAAC,GAAM,GAAGC,EAAA,GAC1BC,GACC;AACD,QAAMC,IAAML,MAAOG,EAAK,OAAO,MAAM;AAErC,SAAIE,MAAQ,YAAaF,EAAuB,WAAW,MACzDA,EAAuB,WAAW,KAGnC,gBAAAG;AAAA,IAACD;AAAA,IAAA;AAAA,MACA,0BAAwB;AAAA,MACxB,WAAWE,EAAKC,EAAO,QAAQP,CAAS;AAAA,MACxC,MAAMC,MAASG,MAAQ,WAAWA,IAAM;AAAA,MACxC,KAAAD;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
1
+ {"version":3,"file":"button.js","names":[],"sources":["../../designsystem/button/button.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type { FlexProps } from \"../react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\ntype ButtonBaseProps<Href> = {\n\t\"data-arrow\"?: \"left\" | \"right\" | true;\n\t\"data-justify\"?: \"start\" | \"center\" | \"end\" | \"right\" | \"left\";\n\t\"data-nowrap\"?: boolean;\n\t\"data-variant\"?: \"primary\" | \"secondary\" | \"tertiary\";\n\t\"data-self\"?: FlexProps[\"data-items\"];\n\t/**\n\t * @deprecated Use 'command' and 'commandfor' instead\n\t */\n\t\"data-command\"?: string;\n\tcommand?: string;\n\tcommandfor?: string;\n\thref?: Href;\n\tpopovertarget?: string;\n\tpopovertargetaction?: string;\n};\n\nexport type ButtonProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"button\",\n> = PolymorphicComponentPropWithRef<As, ButtonBaseProps<Href>>;\n\ntype ButtonElement = ButtonProps<null, \"button\">;\ntype ButtonComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"button\",\n>(\n\tprops: ButtonProps<Href, As>,\n) => JSX.Element;\n\nexport const Button: ButtonComponent = forwardRef<null>(function Button<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"button\",\n>(\n\t{ as, className, type, ...rest }: ButtonProps<Href, As>,\n\tref?: PolymorphicRef<As>,\n) {\n\tconst Tag = as || (rest.href ? \"a\" : \"button\");\n\n\tif (Tag === \"button\" && (rest as ButtonElement)[\"aria-busy\"])\n\t\t(rest as ButtonElement).disabled = true; // Automatically disable button if aria-busy is set\n\n\treturn (\n\t\t<Tag\n\t\t\tsuppressHydrationWarning // aria-label might change on client when using data-tooltip\n\t\t\tclassName={clsx(styles.button, className)}\n\t\t\ttype={type ?? (Tag === \"button\" ? Tag : undefined)} // Default to type=\"button\" if not set and tag is button\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}) as ButtonComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"mappings":";;;;;AAuCA,IAAa,IAA0B,EAAiB,SAIvD,EAAE,OAAI,cAAW,SAAM,GAAG,KAC1B,GACC;CACD,IAAM,IAAM,MAAO,EAAK,OAAO,MAAM;CAKrC,OAHI,MAAQ,YAAa,EAAuB,iBAC/C,EAAwB,WAAW,KAGnC,kBAAC,GAAD;EACC,0BAAA;EACA,WAAW,EAAK,EAAO,QAAQ,CAAS;EACxC,MAAM,MAAS,MAAQ,WAAW,IAAM,KAAA;EACnC;EACL,GAAI;CACJ,CAAA;AAEH,CAAC"}
package/mtds/card/card.js CHANGED
@@ -1,16 +1,23 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import s from "clsx";
3
- import { forwardRef as f } from "react";
4
- import i from "../styles.module.css.js";
5
- const g = f(function({ as: t, className: n, ...o }, a) {
6
- const r = t || (o.href ? "a" : "div");
7
- return /* @__PURE__ */ c(r, { className: s(i.card, n), ref: a, ...o });
8
- }), l = f(function({ as: t, className: n, ...o }, a) {
9
- const r = t || "div";
10
- return r === "button" && !o.type && Object.assign(o, { type: "button" }), /* @__PURE__ */ c(r, { className: s(i.group, n), ref: a, ...o });
1
+ import e from "../styles.module.js";
2
+ import t from "clsx";
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region designsystem/card/card.tsx
6
+ var i = n(function({ as: n, className: i, ...a }, o) {
7
+ return /* @__PURE__ */ r(n || (a.href ? "a" : "div"), {
8
+ className: t(e.card, i),
9
+ ref: o,
10
+ ...a
11
+ });
12
+ }), a = n(function({ as: n, className: i, ...a }, o) {
13
+ let s = n || "div";
14
+ return s === "button" && !a.type && Object.assign(a, { type: "button" }), /* @__PURE__ */ r(s, {
15
+ className: t(e.group, i),
16
+ ref: o,
17
+ ...a
18
+ });
11
19
  });
12
- export {
13
- g as Card,
14
- l as Group
15
- };
16
- //# sourceMappingURL=card.js.map
20
+ //#endregion
21
+ export { i as Card, a as Group };
22
+
23
+ //# sourceMappingURL=card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","sources":["../../designsystem/card/card.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n\tSizes,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\nexport type CardProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"div\",\n> = PolymorphicComponentPropWithRef<\n\tAs,\n\t{\n\t\t\"data-pad\"?: Sizes | `${Sizes}-${Sizes}`;\n\t\t\"data-radius\"?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n\t\t\"data-clickdelegatefor\"?: string;\n\t\thref?: Href;\n\t}\n>;\n\ntype CardComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"div\",\n>(\n\tprops: CardProps<Href, As>,\n) => JSX.Element;\n\nexport const Card: CardComponent = forwardRef<null>(function Card<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"div\",\n>({ as, className, ...rest }: CardProps<Href, As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || (rest.href ? \"a\" : \"div\");\n\n\treturn <Tag className={clsx(styles.card, className)} ref={ref} {...rest} />;\n}) as CardComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type GroupProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{\n\t\t\t\"data-pad\"?: Sizes | `${Sizes}-${Sizes}`;\n\t\t\t\"data-radius\"?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n\t\t}\n\t>;\n\ntype GroupComponent = <As extends React.ElementType = \"div\">(\n\tprops: GroupProps<As>,\n) => JSX.Element;\n\nexport const Group: GroupComponent = forwardRef<null>(function Group<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: GroupProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\tif (Tag === \"button\" && !rest.type) Object.assign(rest, { type: \"button\" }); // Default type for button to avoid accidental submits\n\treturn <Tag className={clsx(styles.group, className)} ref={ref} {...rest} />;\n}) as GroupComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Card","forwardRef","as","className","rest","ref","Tag","jsx","clsx","styles","Group"],"mappings":";;;;AA6BO,MAAMA,IAAsBC,EAAiB,SAGlD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAA6BC,GAA0B;AAC5E,QAAMC,IAAMJ,MAAOE,EAAK,OAAO,MAAM;AAErC,SAAO,gBAAAG,EAACD,GAAA,EAAI,WAAWE,EAAKC,EAAO,MAAMN,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC1E,CAAC,GAeYM,IAAwBT,EAAiB,SAEpD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAwBC,GAA0B;AACvE,QAAMC,IAAMJ,KAAM;AAClB,SAAII,MAAQ,YAAY,CAACF,EAAK,QAAM,OAAO,OAAOA,GAAM,EAAE,MAAM,SAAA,CAAU,GACnE,gBAAAG,EAACD,GAAA,EAAI,WAAWE,EAAKC,EAAO,OAAON,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC3E,CAAC;"}
1
+ {"version":3,"file":"card.js","names":[],"sources":["../../designsystem/card/card.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n\tSizes,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\nexport type CardProps<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"div\",\n> = PolymorphicComponentPropWithRef<\n\tAs,\n\t{\n\t\t\"data-pad\"?: Sizes | `${Sizes}-${Sizes}`;\n\t\t\"data-radius\"?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n\t\t\"data-clickdelegatefor\"?: string;\n\t\thref?: Href;\n\t}\n>;\n\ntype CardComponent = <\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"div\",\n>(\n\tprops: CardProps<Href, As>,\n) => JSX.Element;\n\nexport const Card: CardComponent = forwardRef<null>(function Card<\n\tHref,\n\tAs extends React.ElementType = Href extends string ? \"a\" : \"div\",\n>({ as, className, ...rest }: CardProps<Href, As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || (rest.href ? \"a\" : \"div\");\n\n\treturn <Tag className={clsx(styles.card, className)} ref={ref} {...rest} />;\n}) as CardComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type GroupProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\t{\n\t\t\t\"data-pad\"?: Sizes | `${Sizes}-${Sizes}`;\n\t\t\t\"data-radius\"?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n\t\t}\n\t>;\n\ntype GroupComponent = <As extends React.ElementType = \"div\">(\n\tprops: GroupProps<As>,\n) => JSX.Element;\n\nexport const Group: GroupComponent = forwardRef<null>(function Group<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: GroupProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\tif (Tag === \"button\" && !rest.type) Object.assign(rest, { type: \"button\" }); // Default type for button to avoid accidental submits\n\treturn <Tag className={clsx(styles.group, className)} ref={ref} {...rest} />;\n}) as GroupComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"mappings":";;;;;AA6BA,IAAa,IAAsB,EAAiB,SAGlD,EAAE,OAAI,cAAW,GAAG,KAA6B,GAA0B;CAG5E,OAAO,kBAFK,MAAO,EAAK,OAAO,MAAM,QAE9B;EAAK,WAAW,EAAK,EAAO,MAAM,CAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAC3E,CAAC,GAeY,IAAwB,EAAiB,SAEpD,EAAE,OAAI,cAAW,GAAG,KAAwB,GAA0B;CACvE,IAAM,IAAM,KAAM;CAElB,OADI,MAAQ,YAAY,CAAC,EAAK,QAAM,OAAO,OAAO,GAAM,EAAE,MAAM,SAAS,CAAC,GACnE,kBAAC,GAAD;EAAK,WAAW,EAAK,EAAO,OAAO,CAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAC5E,CAAC"}
@@ -1,22 +1,34 @@
1
- import { tag as r } from "../utils.js";
2
- const S = [0.1, 0.2, 0.25, 0.5, 1];
3
- function M(e, { aspect: c, type: d }) {
4
- const g = d === "stacked", l = e[0].reduce((s, u, f) => {
5
- const m = e.map((a) => a[f].number), k = m.reduce((a, v) => a + v, 0);
6
- return Math.max(s, ...g ? [k] : m);
7
- }, 0), i = l / 10, p = 10 ** `${Math.round(i)}`.length, h = i / p, o = (S.find((s) => s > h) || 1) * p, n = Math.ceil(l / o) * o, t = r("div", {
8
- "aria-label": e[0][0].value || null,
9
- class: "axis",
10
- role: "figure"
11
- });
12
- c && t.style.setProperty("--mtdsc-chart-aspect", c), t.style.setProperty("--bars", `${e[0]?.length - 1}`), t.style.setProperty("--groups", `${e.length - 1}`), t.style.setProperty("--total", `${n}`);
13
- const x = t.appendChild(r("div", { class: "axisSteps" })), y = t.appendChild(r("div", { class: "axisGroups" }));
14
- return Array.from({ length: n / o + 1 }, (s, u) => b(o * u)).reverse().map(
15
- (s) => x.append(r("div", { class: "axisStep", "data-label": s }))
16
- ), { total: n, groups: y, axis: t };
1
+ import { tag as e } from "../utils.js";
2
+ //#region designsystem/chart/chart-axis.ts
3
+ var t = [
4
+ .1,
5
+ .2,
6
+ .25,
7
+ .5,
8
+ 1
9
+ ];
10
+ function n(n, { aspect: i, type: a }) {
11
+ let o = a === "stacked", s = n[0].reduce((e, t, r) => {
12
+ let i = n.map((e) => e[r].number), a = i.reduce((e, t) => e + t, 0);
13
+ return Math.max(e, ...o ? [a] : i);
14
+ }, 0), c = s / 10, l = 10 ** `${Math.round(c)}`.length, u = c / l, d = (t.find((e) => e > u) || 1) * l, f = Math.ceil(s / d) * d, p = e("div", {
15
+ "aria-label": n[0][0].value || null,
16
+ class: "axis",
17
+ role: "figure"
18
+ });
19
+ i && p.style.setProperty("--mtdsc-chart-aspect", i), p.style.setProperty("--bars", `${n[0]?.length - 1}`), p.style.setProperty("--groups", `${n.length - 1}`), p.style.setProperty("--total", `${f}`);
20
+ let m = p.appendChild(e("div", { class: "axisSteps" })), h = p.appendChild(e("div", { class: "axisGroups" }));
21
+ return Array.from({ length: f / d + 1 }, (e, t) => r(d * t)).reverse().map((t) => m.append(e("div", {
22
+ class: "axisStep",
23
+ "data-label": t
24
+ }))), {
25
+ total: f,
26
+ groups: h,
27
+ axis: p
28
+ };
17
29
  }
18
- const b = new Intl.NumberFormat().format;
19
- export {
20
- M as toAxis
21
- };
22
- //# sourceMappingURL=chart-axis.js.map
30
+ var r = new Intl.NumberFormat().format;
31
+ //#endregion
32
+ export { n as toAxis };
33
+
34
+ //# sourceMappingURL=chart-axis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-axis.js","sources":["../../designsystem/chart/chart-axis.ts"],"sourcesContent":["import { tag } from \"../utils\";\nimport type { ChartData } from \"./chart-element\";\n\ntype Config = { type: string; aspect?: string };\n\nconst STEPS = [0.1, 0.2, 0.25, 0.5, 1];\n\nexport function toAxis(data: ChartData, { aspect, type }: Config) {\n\tconst totalTicks = 10;\n\tconst isStacked = type === \"stacked\";\n\tconst max = data[0].reduce((acc, _, index) => {\n\t\tconst all = data.map((row) => row[index].number);\n\t\tconst sum = all.reduce((acc, num) => acc + num, 0);\n\t\treturn Math.max(acc, ...(isStacked ? [sum] : all));\n\t}, 0);\n\n\tconst tickRange = max / totalTicks;\n\tconst tickDigits = 10 ** `${Math.round(tickRange)}`.length; // Get amount of digits in total number and use as exponent for 10x\n\tconst tickSize = tickRange / tickDigits; // Get amount of digits in total number and use as exponent for 10\n\tconst step = (STEPS.find((current) => current > tickSize) || 1) * tickDigits; // Find closest step larger than tick\n\tconst total = Math.ceil(max / step) * step;\n\tconst axis = tag(\"div\", {\n\t\t\"aria-label\": data[0][0].value || null,\n\t\tclass: \"axis\",\n\t\trole: \"figure\",\n\t});\n\tif (aspect) axis.style.setProperty(\"--mtdsc-chart-aspect\", aspect);\n\taxis.style.setProperty(\"--bars\", `${data[0]?.length - 1}`);\n\taxis.style.setProperty(\"--groups\", `${data.length - 1}`);\n\taxis.style.setProperty(\"--total\", `${total}`);\n\tconst steps = axis.appendChild(tag(\"div\", { class: \"axisSteps\" }));\n\tconst groups = axis.appendChild(tag(\"div\", { class: \"axisGroups\" }));\n\n\tArray.from({ length: total / step + 1 }, (_, i) => getNum(step * i))\n\t\t.reverse()\n\t\t.map((num) =>\n\t\t\tsteps.append(tag(\"div\", { class: \"axisStep\", \"data-label\": num })),\n\t\t);\n\n\treturn { total, groups, axis };\n}\n\nconst getNum = new Intl.NumberFormat().format;\n"],"names":["STEPS","toAxis","data","aspect","type","isStacked","max","acc","_","index","all","row","sum","num","tickRange","tickDigits","tickSize","step","current","total","axis","tag","steps","groups","i","getNum"],"mappings":";AAKA,MAAMA,IAAQ,CAAC,KAAK,KAAK,MAAM,KAAK,CAAC;AAE9B,SAASC,EAAOC,GAAiB,EAAE,QAAAC,GAAQ,MAAAC,KAAgB;AAEjE,QAAMC,IAAYD,MAAS,WACrBE,IAAMJ,EAAK,CAAC,EAAE,OAAO,CAACK,GAAKC,GAAGC,MAAU;AAC7C,UAAMC,IAAMR,EAAK,IAAI,CAACS,MAAQA,EAAIF,CAAK,EAAE,MAAM,GACzCG,IAAMF,EAAI,OAAO,CAACH,GAAKM,MAAQN,IAAMM,GAAK,CAAC;AACjD,WAAO,KAAK,IAAIN,GAAK,GAAIF,IAAY,CAACO,CAAG,IAAIF,CAAI;AAAA,EAClD,GAAG,CAAC,GAEEI,IAAYR,IAAM,IAClBS,IAAa,MAAM,GAAG,KAAK,MAAMD,CAAS,CAAC,GAAG,QAC9CE,IAAWF,IAAYC,GACvBE,KAAQjB,EAAM,KAAK,CAACkB,MAAYA,IAAUF,CAAQ,KAAK,KAAKD,GAC5DI,IAAQ,KAAK,KAAKb,IAAMW,CAAI,IAAIA,GAChCG,IAAOC,EAAI,OAAO;AAAA,IACvB,cAAcnB,EAAK,CAAC,EAAE,CAAC,EAAE,SAAS;AAAA,IAClC,OAAO;AAAA,IACP,MAAM;AAAA,EAAA,CACN;AACD,EAAIC,KAAQiB,EAAK,MAAM,YAAY,wBAAwBjB,CAAM,GACjEiB,EAAK,MAAM,YAAY,UAAU,GAAGlB,EAAK,CAAC,GAAG,SAAS,CAAC,EAAE,GACzDkB,EAAK,MAAM,YAAY,YAAY,GAAGlB,EAAK,SAAS,CAAC,EAAE,GACvDkB,EAAK,MAAM,YAAY,WAAW,GAAGD,CAAK,EAAE;AAC5C,QAAMG,IAAQF,EAAK,YAAYC,EAAI,OAAO,EAAE,OAAO,YAAA,CAAa,CAAC,GAC3DE,IAASH,EAAK,YAAYC,EAAI,OAAO,EAAE,OAAO,aAAA,CAAc,CAAC;AAEnE,eAAM,KAAK,EAAE,QAAQF,IAAQF,IAAO,KAAK,CAACT,GAAGgB,MAAMC,EAAOR,IAAOO,CAAC,CAAC,EACjE,UACA;AAAA,IAAI,CAACX,MACLS,EAAM,OAAOD,EAAI,OAAO,EAAE,OAAO,YAAY,cAAcR,GAAK,CAAC;AAAA,EAAA,GAG5D,EAAE,OAAAM,GAAO,QAAAI,GAAQ,MAAAH,EAAA;AACzB;AAEA,MAAMK,IAAS,IAAI,KAAK,aAAA,EAAe;"}
1
+ {"version":3,"file":"chart-axis.js","names":[],"sources":["../../designsystem/chart/chart-axis.ts"],"sourcesContent":["import { tag } from \"../utils\";\nimport type { ChartData } from \"./chart-element\";\n\ntype Config = { type: string; aspect?: string };\n\nconst STEPS = [0.1, 0.2, 0.25, 0.5, 1];\n\nexport function toAxis(data: ChartData, { aspect, type }: Config) {\n\tconst totalTicks = 10;\n\tconst isStacked = type === \"stacked\";\n\tconst max = data[0].reduce((acc, _, index) => {\n\t\tconst all = data.map((row) => row[index].number);\n\t\tconst sum = all.reduce((acc, num) => acc + num, 0);\n\t\treturn Math.max(acc, ...(isStacked ? [sum] : all));\n\t}, 0);\n\n\tconst tickRange = max / totalTicks;\n\tconst tickDigits = 10 ** `${Math.round(tickRange)}`.length; // Get amount of digits in total number and use as exponent for 10x\n\tconst tickSize = tickRange / tickDigits; // Get amount of digits in total number and use as exponent for 10\n\tconst step = (STEPS.find((current) => current > tickSize) || 1) * tickDigits; // Find closest step larger than tick\n\tconst total = Math.ceil(max / step) * step;\n\tconst axis = tag(\"div\", {\n\t\t\"aria-label\": data[0][0].value || null,\n\t\tclass: \"axis\",\n\t\trole: \"figure\",\n\t});\n\tif (aspect) axis.style.setProperty(\"--mtdsc-chart-aspect\", aspect);\n\taxis.style.setProperty(\"--bars\", `${data[0]?.length - 1}`);\n\taxis.style.setProperty(\"--groups\", `${data.length - 1}`);\n\taxis.style.setProperty(\"--total\", `${total}`);\n\tconst steps = axis.appendChild(tag(\"div\", { class: \"axisSteps\" }));\n\tconst groups = axis.appendChild(tag(\"div\", { class: \"axisGroups\" }));\n\n\tArray.from({ length: total / step + 1 }, (_, i) => getNum(step * i))\n\t\t.reverse()\n\t\t.map((num) =>\n\t\t\tsteps.append(tag(\"div\", { class: \"axisStep\", \"data-label\": num })),\n\t\t);\n\n\treturn { total, groups, axis };\n}\n\nconst getNum = new Intl.NumberFormat().format;\n"],"mappings":";;AAKA,IAAM,IAAQ;CAAC;CAAK;CAAK;CAAM;CAAK;AAAC;AAErC,SAAgB,EAAO,GAAiB,EAAE,WAAQ,WAAgB;CACjE,IACM,IAAY,MAAS,WACrB,IAAM,EAAK,EAAE,CAAC,QAAQ,GAAK,GAAG,MAAU;EAC7C,IAAM,IAAM,EAAK,KAAK,MAAQ,EAAI,EAAM,CAAC,MAAM,GACzC,IAAM,EAAI,QAAQ,GAAK,MAAQ,IAAM,GAAK,CAAC;EACjD,OAAO,KAAK,IAAI,GAAK,GAAI,IAAY,CAAC,CAAG,IAAI,CAAI;CAClD,GAAG,CAAC,GAEE,IAAY,IAAM,IAClB,IAAa,MAAM,GAAG,KAAK,MAAM,CAAS,IAAI,QAC9C,IAAW,IAAY,GACvB,KAAQ,EAAM,MAAM,MAAY,IAAU,CAAQ,KAAK,KAAK,GAC5D,IAAQ,KAAK,KAAK,IAAM,CAAI,IAAI,GAChC,IAAO,EAAI,OAAO;EACvB,cAAc,EAAK,EAAE,CAAC,EAAE,CAAC,SAAS;EAClC,OAAO;EACP,MAAM;CACP,CAAC;CAID,AAHI,KAAQ,EAAK,MAAM,YAAY,wBAAwB,CAAM,GACjE,EAAK,MAAM,YAAY,UAAU,GAAG,EAAK,EAAE,EAAE,SAAS,GAAG,GACzD,EAAK,MAAM,YAAY,YAAY,GAAG,EAAK,SAAS,GAAG,GACvD,EAAK,MAAM,YAAY,WAAW,GAAG,GAAO;CAC5C,IAAM,IAAQ,EAAK,YAAY,EAAI,OAAO,EAAE,OAAO,YAAY,CAAC,CAAC,GAC3D,IAAS,EAAK,YAAY,EAAI,OAAO,EAAE,OAAO,aAAa,CAAC,CAAC;CAQnE,OANA,MAAM,KAAK,EAAE,QAAQ,IAAQ,IAAO,EAAE,IAAI,GAAG,MAAM,EAAO,IAAO,CAAC,CAAC,CAAC,CAClE,QAAQ,CAAC,CACT,KAAK,MACL,EAAM,OAAO,EAAI,OAAO;EAAE,OAAO;EAAY,cAAc;CAAI,CAAC,CAAC,CAClE,GAEM;EAAE;EAAO;EAAQ;CAAK;AAC9B;AAEA,IAAM,IAAS,IAAI,KAAK,aAAa,CAAC,CAAC"}
@@ -1,22 +1,24 @@
1
- import { tag as a } from "../utils.js";
2
- function u(r) {
3
- return r[0].slice(1).map(({ value: s, event: l }, n) => {
4
- const o = a("div", { class: "axisGroup", "data-label": s }), i = o.appendChild(
5
- a("div", { class: "axisGroupContent" })
6
- );
7
- return r.slice(1).map((e) => e[n + 1]).map(({ tooltip: e, color: p, number: c }) => {
8
- const t = a("div", {
9
- "aria-label": e,
10
- "data-event": l,
11
- class: "bar",
12
- role: "img",
13
- tabindex: "0"
14
- });
15
- return t.style.setProperty("--color", p), t.style.setProperty("--value", `${c}`), i.appendChild(t);
16
- }), o;
17
- });
1
+ import { tag as e } from "../utils.js";
2
+ //#region designsystem/chart/chart-bars.ts
3
+ function t(t) {
4
+ return t[0].slice(1).map(({ value: n, event: r }, i) => {
5
+ let a = e("div", {
6
+ class: "axisGroup",
7
+ "data-label": n
8
+ }), o = a.appendChild(e("div", { class: "axisGroupContent" }));
9
+ return t.slice(1).map((e) => e[i + 1]).map(({ tooltip: t, color: n, number: i }) => {
10
+ let a = e("div", {
11
+ "aria-label": t,
12
+ "data-event": r,
13
+ class: "bar",
14
+ role: "img",
15
+ tabindex: "0"
16
+ });
17
+ return a.style.setProperty("--color", n), a.style.setProperty("--value", `${i}`), o.appendChild(a);
18
+ }), a;
19
+ });
18
20
  }
19
- export {
20
- u as toBars
21
- };
22
- //# sourceMappingURL=chart-bars.js.map
21
+ //#endregion
22
+ export { t as toBars };
23
+
24
+ //# sourceMappingURL=chart-bars.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-bars.js","sources":["../../designsystem/chart/chart-bars.ts"],"sourcesContent":["import { tag } from \"../utils\";\nimport type { ChartData } from \"./chart-element\";\n\nexport function toBars(data: ChartData) {\n\treturn data[0].slice(1).map(({ value, event }, index) => {\n\t\tconst group = tag(\"div\", { class: \"axisGroup\", \"data-label\": value });\n\t\tconst content = group.appendChild(\n\t\t\ttag(\"div\", { class: \"axisGroupContent\" }),\n\t\t);\n\n\t\tdata\n\t\t\t.slice(1)\n\t\t\t.map((values) => values[index + 1])\n\t\t\t.map(({ tooltip, color, number }) => {\n\t\t\t\tconst el = tag(\"div\", {\n\t\t\t\t\t\"aria-label\": tooltip,\n\t\t\t\t\t\"data-event\": event,\n\t\t\t\t\tclass: \"bar\",\n\t\t\t\t\trole: \"img\",\n\t\t\t\t\ttabindex: \"0\",\n\t\t\t\t});\n\t\t\t\tel.style.setProperty(\"--color\", color);\n\t\t\t\tel.style.setProperty(\"--value\", `${number}`);\n\t\t\t\treturn content.appendChild(el);\n\t\t\t});\n\t\treturn group;\n\t});\n}\n"],"names":["toBars","data","value","event","index","group","tag","content","values","tooltip","color","number","el"],"mappings":";AAGO,SAASA,EAAOC,GAAiB;AACvC,SAAOA,EAAK,CAAC,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,OAAAC,GAAO,OAAAC,EAAA,GAASC,MAAU;AACxD,UAAMC,IAAQC,EAAI,OAAO,EAAE,OAAO,aAAa,cAAcJ,GAAO,GAC9DK,IAAUF,EAAM;AAAA,MACrBC,EAAI,OAAO,EAAE,OAAO,oBAAoB;AAAA,IAAA;AAGzC,WAAAL,EACE,MAAM,CAAC,EACP,IAAI,CAACO,MAAWA,EAAOJ,IAAQ,CAAC,CAAC,EACjC,IAAI,CAAC,EAAE,SAAAK,GAAS,OAAAC,GAAO,QAAAC,QAAa;AACpC,YAAMC,IAAKN,EAAI,OAAO;AAAA,QACrB,cAAcG;AAAA,QACd,cAAcN;AAAA,QACd,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,MAAA,CACV;AACD,aAAAS,EAAG,MAAM,YAAY,WAAWF,CAAK,GACrCE,EAAG,MAAM,YAAY,WAAW,GAAGD,CAAM,EAAE,GACpCJ,EAAQ,YAAYK,CAAE;AAAA,IAC9B,CAAC,GACKP;AAAA,EACR,CAAC;AACF;"}
1
+ {"version":3,"file":"chart-bars.js","names":[],"sources":["../../designsystem/chart/chart-bars.ts"],"sourcesContent":["import { tag } from \"../utils\";\nimport type { ChartData } from \"./chart-element\";\n\nexport function toBars(data: ChartData) {\n\treturn data[0].slice(1).map(({ value, event }, index) => {\n\t\tconst group = tag(\"div\", { class: \"axisGroup\", \"data-label\": value });\n\t\tconst content = group.appendChild(\n\t\t\ttag(\"div\", { class: \"axisGroupContent\" }),\n\t\t);\n\n\t\tdata\n\t\t\t.slice(1)\n\t\t\t.map((values) => values[index + 1])\n\t\t\t.map(({ tooltip, color, number }) => {\n\t\t\t\tconst el = tag(\"div\", {\n\t\t\t\t\t\"aria-label\": tooltip,\n\t\t\t\t\t\"data-event\": event,\n\t\t\t\t\tclass: \"bar\",\n\t\t\t\t\trole: \"img\",\n\t\t\t\t\ttabindex: \"0\",\n\t\t\t\t});\n\t\t\t\tel.style.setProperty(\"--color\", color);\n\t\t\t\tel.style.setProperty(\"--value\", `${number}`);\n\t\t\t\treturn content.appendChild(el);\n\t\t\t});\n\t\treturn group;\n\t});\n}\n"],"mappings":";;AAGA,SAAgB,EAAO,GAAiB;CACvC,OAAO,EAAK,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,UAAO,YAAS,MAAU;EACxD,IAAM,IAAQ,EAAI,OAAO;GAAE,OAAO;GAAa,cAAc;EAAM,CAAC,GAC9D,IAAU,EAAM,YACrB,EAAI,OAAO,EAAE,OAAO,mBAAmB,CAAC,CACzC;EAiBA,OAfA,EACE,MAAM,CAAC,CAAC,CACR,KAAK,MAAW,EAAO,IAAQ,EAAE,CAAC,CAClC,KAAK,EAAE,YAAS,UAAO,gBAAa;GACpC,IAAM,IAAK,EAAI,OAAO;IACrB,cAAc;IACd,cAAc;IACd,OAAO;IACP,MAAM;IACN,UAAU;GACX,CAAC;GAGD,OAFA,EAAG,MAAM,YAAY,WAAW,CAAK,GACrC,EAAG,MAAM,YAAY,WAAW,GAAG,GAAQ,GACpC,EAAQ,YAAY,CAAE;EAC9B,CAAC,GACK;CACR,CAAC;AACF"}
@@ -1,90 +1,96 @@
1
- import v from "../styles.module.css.js";
2
- import { isBrowser as C, tag as p, defineElement as E, MTDSElement as $, onMutation as k, on as T, off as w, attr as d, attachStyle as S, debounce as x } from "../utils.js";
3
- import A from "./chart.css.js";
4
- import { toAxis as L } from "./chart-axis.js";
5
- import { toBars as O } from "./chart-bars.js";
6
- import { toLines as P } from "./chart-lines.js";
7
- import { toPies as R } from "./chart-pies.js";
8
- const u = "click keydown mousemove mouseout", f = "mtds-chart-tooltip", i = C() ? document.getElementById(f) || p("div", {
9
- "aria-hidden": "true",
10
- class: v._tooltip,
11
- hidden: "",
12
- id: f
13
- }) : null;
14
- class q extends $ {
15
- #t;
16
- #e;
17
- static get observedAttributes() {
18
- return ["data-variant", "data-aspect"];
19
- }
20
- constructor() {
21
- super(), this.attachShadow({ mode: "open" });
22
- }
23
- connectedCallback() {
24
- const e = x(() => this.attributeChangedCallback(), 100), t = new ResizeObserver(() => this.handleResize());
25
- t.observe(this), this.#e = () => t.disconnect(), this.#t = k(this, e, {
26
- attributeFilter: ["data-tooltip"],
27
- attributes: !0,
28
- characterData: !0,
29
- childList: !0,
30
- subtree: !0
31
- }), requestAnimationFrame(() => this.attributeChangedCallback()), T(this, u, this);
32
- }
33
- disconnectedCallback() {
34
- i && (i.hidden = !0), w(this, u, this), this.#e?.(), this.#t?.(), this.#t = this.#e = void 0;
35
- }
36
- attributeChangedCallback() {
37
- const e = H(this.querySelector("table"));
38
- if (!e[0]) return;
39
- Array.from(this.shadowRoot?.children || []).map((l) => l.remove());
40
- const [t, r] = (d(this, "data-variant") || "column").split("-"), s = d(this, "data-aspect") || void 0, a = p("div", {
41
- "aria-hidden": "hidden",
42
- class: "legends",
43
- role: "group"
44
- });
45
- e.slice(1).forEach(([{ value: l, color: y }]) => {
46
- const g = p("div", { class: "legend" }, l);
47
- a.appendChild(g).style.setProperty("--color", y);
48
- });
49
- const { axis: h, groups: n, total: c } = L(e, { aspect: s, type: r });
50
- (t === "column" || t === "bar") && n.append(...O(e)), (t === "line" || t === "area") && n.append(P(e, { total: c, variant: t, type: r })), (t === "doughnut" || t === "pie") && this.shadowRoot?.append(R(e, { aspect: s, variant: t })), this.shadowRoot?.append(h, a), S(this, A);
51
- }
52
- handleEvent(e) {
53
- e.type === "click" || e.type === "keydown" ? z(e, this) : D(e);
54
- }
55
- handleResize() {
56
- const e = this.shadowRoot?.firstElementChild, t = e?.firstElementChild;
57
- e?.classList.toggle("axisStepsYHalf", (t?.offsetHeight || 0) < 400), e?.classList.toggle("axisStepsXHalf", (t?.offsetWidth || 0) < 500);
58
- }
59
- }
60
- function z(o, e) {
61
- if (o instanceof KeyboardEvent && o.key !== "Enter") return;
62
- const t = o.composedPath()[0], r = e.querySelector("table"), [s, a] = t instanceof Element && d(t, "data-event")?.split("-").map(Number) || [];
63
- r?.rows[s]?.cells[a]?.querySelector("a,button")?.click?.();
1
+ import e from "../styles.module.js";
2
+ import { MTDSElement as t, attachStyle as n, attr as r, debounce as i, defineElement as a, isBrowser as o, off as s, on as c, onMutation as l, tag as u } from "../utils.js";
3
+ import d from "./chart.js";
4
+ import { toAxis as f } from "./chart-axis.js";
5
+ import { toBars as p } from "./chart-bars.js";
6
+ import { toLines as m } from "./chart-lines.js";
7
+ import { toPies as h } from "./chart-pies.js";
8
+ //#region designsystem/chart/chart-element.ts
9
+ var g = "click keydown mousemove mouseout", _ = "mtds-chart-tooltip", v = o() ? document.getElementById(_) || u("div", {
10
+ "aria-hidden": "true",
11
+ class: e._tooltip,
12
+ hidden: "",
13
+ id: _
14
+ }) : null, y = class extends t {
15
+ #e;
16
+ #t;
17
+ static get observedAttributes() {
18
+ return ["data-variant", "data-aspect"];
19
+ }
20
+ constructor() {
21
+ super(), this.attachShadow({ mode: "open" });
22
+ }
23
+ connectedCallback() {
24
+ let e = i(() => this.attributeChangedCallback(), 100), t = new ResizeObserver(() => this.handleResize());
25
+ t.observe(this), this.#t = () => t.disconnect(), this.#e = l(this, e, {
26
+ attributeFilter: ["data-tooltip"],
27
+ attributes: !0,
28
+ characterData: !0,
29
+ childList: !0,
30
+ subtree: !0
31
+ }), requestAnimationFrame(() => this.attributeChangedCallback()), c(this, g, this);
32
+ }
33
+ disconnectedCallback() {
34
+ v && (v.hidden = !0), s(this, g, this), this.#t?.(), this.#e?.(), this.#e = this.#t = void 0;
35
+ }
36
+ attributeChangedCallback() {
37
+ let e = w(this.querySelector("table"));
38
+ if (!e[0]) return;
39
+ Array.from(this.shadowRoot?.children || []).map((e) => e.remove());
40
+ let [t, i] = (r(this, "data-variant") || "column").split("-"), a = r(this, "data-aspect") || void 0, o = u("div", {
41
+ "aria-hidden": "hidden",
42
+ class: "legends",
43
+ role: "group"
44
+ });
45
+ e.slice(1).forEach(([{ value: e, color: t }]) => {
46
+ let n = u("div", { class: "legend" }, e);
47
+ o.appendChild(n).style.setProperty("--color", t);
48
+ });
49
+ let { axis: s, groups: c, total: l } = f(e, {
50
+ aspect: a,
51
+ type: i
52
+ });
53
+ (t === "column" || t === "bar") && c.append(...p(e)), (t === "line" || t === "area") && c.append(m(e, {
54
+ total: l,
55
+ variant: t,
56
+ type: i
57
+ })), (t === "doughnut" || t === "pie") && this.shadowRoot?.append(h(e, {
58
+ aspect: a,
59
+ variant: t
60
+ })), this.shadowRoot?.append(s, o), n(this, d);
61
+ }
62
+ handleEvent(e) {
63
+ e.type === "click" || e.type === "keydown" ? b(e, this) : S(e);
64
+ }
65
+ handleResize() {
66
+ let e = this.shadowRoot?.firstElementChild, t = e?.firstElementChild;
67
+ e?.classList.toggle("axisStepsYHalf", (t?.offsetHeight || 0) < 400), e?.classList.toggle("axisStepsXHalf", (t?.offsetWidth || 0) < 500);
68
+ }
69
+ };
70
+ function b(e, t) {
71
+ if (e instanceof KeyboardEvent && e.key !== "Enter") return;
72
+ let n = e.composedPath()[0], i = t.querySelector("table"), [a, o] = n instanceof Element && r(n, "data-event")?.split("-").map(Number) || [];
73
+ i?.rows[a]?.cells[o]?.querySelector("a,button")?.click?.();
64
74
  }
65
- let b = "";
66
- function D(o) {
67
- if (!i) return;
68
- i?.isConnected || document.body.append(i);
69
- const e = o.composedPath()[0], t = e instanceof Element && e.getAttribute("aria-label") || "";
70
- t && (i.style.transform = `translate(${Math.min(o.clientX, window.innerWidth)}px, ${o.clientY}px)`), t !== b && (t && (i.textContent = t), b = t, i.hidden = !t);
75
+ var x = "";
76
+ function S(e) {
77
+ if (!v) return;
78
+ v?.isConnected || document.body.append(v);
79
+ let t = e.composedPath()[0], n = t instanceof Element && t.getAttribute("aria-label") || "";
80
+ n && (v.style.transform = `translate(${Math.min(e.clientX, window.innerWidth)}px, ${e.clientY}px)`), n !== x && (n && (v.textContent = n), x = n, v.hidden = !n);
71
81
  }
72
- const m = (o) => o?.textContent?.trim() || "", H = (o) => Array.from(o?.rows || []).map(
73
- (e, t, { length: r }) => Array.from(e.cells, (s, a) => {
74
- const h = m(e.cells[0]), n = m(o?.rows[0].cells[a]), c = m(s), l = r === 2 ? `${n}: ${c}` : `${h}: ${c}${n ? ` (${n})` : ""}`;
75
- return d(s, "tabindex", "-1"), {
76
- number: a && t && Number.parseFloat(c) || 0,
77
- // First row and column is not a number
78
- event: s.querySelector("a,button") && `${t}-${a}`,
79
- // Reference to proxy events
80
- color: `var(--mtdsc-chart-color-${t}-${a}, var(--mtdsc-chart-color-${t}, var(--mtdsc-chart-color-base)))`,
81
- value: c,
82
- tooltip: d(s, "data-tooltip") || l
83
- };
84
- })
85
- );
86
- E("mtds-chart", q);
87
- export {
88
- q as MTDSChartElement
89
- };
90
- //# sourceMappingURL=chart-element.js.map
82
+ var C = (e) => e?.textContent?.trim() || "", w = (e) => Array.from(e?.rows || []).map((t, n, { length: i }) => Array.from(t.cells, (a, o) => {
83
+ let s = C(t.cells[0]), c = C(e?.rows[0].cells[o]), l = C(a), u = i === 2 ? `${c}: ${l}` : `${s}: ${l}${c ? ` (${c})` : ""}`;
84
+ return r(a, "tabindex", "-1"), {
85
+ number: o && n && Number.parseFloat(l) || 0,
86
+ event: a.querySelector("a,button") && `${n}-${o}`,
87
+ color: `var(--mtdsc-chart-color-${n}-${o}, var(--mtdsc-chart-color-${n}, var(--mtdsc-chart-color-base)))`,
88
+ value: l,
89
+ tooltip: r(a, "data-tooltip") || u
90
+ };
91
+ }));
92
+ a("mtds-chart", y);
93
+ //#endregion
94
+ export { y as MTDSChartElement };
95
+
96
+ //# sourceMappingURL=chart-element.js.map