@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.
- package/mtds/_virtual/_rolldown/runtime.js +17 -0
- package/mtds/ai/card.stories.tsx +54 -77
- package/mtds/ai/layout.mdx +37 -1
- package/mtds/ai/layout.stories.tsx +126 -1
- package/mtds/ai/print.mdx +1 -1
- package/mtds/ai/print.stories.tsx +1 -2
- package/mtds/alert/alert.js +16 -11
- package/mtds/alert/alert.js.map +1 -1
- package/mtds/analytics/analytics.js +118 -118
- package/mtds/analytics/analytics.js.map +1 -1
- package/mtds/app/app-observer.js +31 -36
- package/mtds/app/app-observer.js.map +1 -1
- package/mtds/app/app-toggle.js +12 -26
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js +6 -11
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.js +66 -60
- package/mtds/app/app.js.map +1 -1
- package/mtds/atlas/atlas-element.js +83 -93
- package/mtds/atlas/atlas-element.js.map +1 -1
- package/mtds/atlas/atlas-marker.js +63 -52
- package/mtds/atlas/atlas-marker.js.map +1 -1
- package/mtds/atlas/atlas-matgeo.js +67 -61
- package/mtds/atlas/atlas-matgeo.js.map +1 -1
- package/mtds/atlas/atlas-wms.js +33 -28
- package/mtds/atlas/atlas-wms.js.map +1 -1
- package/mtds/atlas/atlas.js +6 -38
- package/mtds/atlas/atlas.js.map +1 -1
- package/mtds/atlas/atlas2.js +39 -0
- package/mtds/atlas/atlas2.js.map +1 -0
- package/mtds/atlas/cluster.js +759 -1149
- package/mtds/atlas/cluster.js.map +1 -1
- package/mtds/atlas.iife.js +3 -4
- package/mtds/atlas.js +6 -14
- package/mtds/avatar/avatar.js +14 -10
- package/mtds/avatar/avatar.js.map +1 -1
- package/mtds/badge/badge.js +15 -10
- package/mtds/badge/badge.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs.js +15 -19
- package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
- package/mtds/button/button.js +18 -20
- package/mtds/button/button.js.map +1 -1
- package/mtds/card/card.js +22 -15
- package/mtds/card/card.js.map +1 -1
- package/mtds/chart/chart-axis.js +33 -21
- package/mtds/chart/chart-axis.js.map +1 -1
- package/mtds/chart/chart-bars.js +23 -21
- package/mtds/chart/chart-bars.js.map +1 -1
- package/mtds/chart/chart-element.js +94 -88
- package/mtds/chart/chart-element.js.map +1 -1
- package/mtds/chart/chart-lines.js +35 -37
- package/mtds/chart/chart-lines.js.map +1 -1
- package/mtds/chart/chart-pies.js +17 -17
- package/mtds/chart/chart-pies.js.map +1 -1
- package/mtds/chart/chart.js +6 -52
- package/mtds/chart/chart.js.map +1 -1
- package/mtds/chart/chart2.js +21 -0
- package/mtds/chart/chart2.js.map +1 -0
- package/mtds/chip/chip.js +15 -11
- package/mtds/chip/chip.js.map +1 -1
- package/mtds/deprecations.js +76 -158
- package/mtds/deprecations.js.map +1 -1
- package/mtds/details/details.js +21 -24
- package/mtds/details/details.js.map +1 -1
- package/mtds/dialog/dialog.js +17 -21
- package/mtds/dialog/dialog.js.map +1 -1
- package/mtds/divider/divider.js +15 -20
- package/mtds/divider/divider.js.map +1 -1
- package/mtds/errorsummary/errorsummary.js +14 -16
- package/mtds/errorsummary/errorsummary.js.map +1 -1
- package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js +22 -25
- package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -1
- package/mtds/external/@turf/helpers/dist/esm/index.js +21 -24
- package/mtds/external/@turf/helpers/dist/esm/index.js.map +1 -1
- package/mtds/external/@turf/invariant/dist/esm/index.js +15 -19
- package/mtds/external/@turf/invariant/dist/esm/index.js.map +1 -1
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js +270 -297
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +1 -1
- package/mtds/external/@u-elements/u-details/dist/u-details.js +75 -101
- package/mtds/external/@u-elements/u-details/dist/u-details.js.map +1 -1
- package/mtds/external/leaflet/dist/leaflet-src.js +4257 -6151
- package/mtds/external/leaflet/dist/leaflet-src.js.map +1 -1
- package/mtds/external/leaflet/dist/leaflet.css.js +5 -606
- package/mtds/external/leaflet/dist/leaflet.css.js.map +1 -1
- package/mtds/external/point-in-polygon-hao/dist/esm/index.js +24 -25
- package/mtds/external/point-in-polygon-hao/dist/esm/index.js.map +1 -1
- package/mtds/external/robust-predicates/esm/incircle.js +5 -0
- package/mtds/external/robust-predicates/esm/incircle.js.map +1 -0
- package/mtds/external/robust-predicates/esm/insphere.js +5 -0
- package/mtds/external/robust-predicates/esm/insphere.js.map +1 -0
- package/mtds/external/robust-predicates/esm/orient2d.js +20 -22
- package/mtds/external/robust-predicates/esm/orient2d.js.map +1 -1
- package/mtds/external/robust-predicates/esm/orient3d.js +5 -0
- package/mtds/external/robust-predicates/esm/orient3d.js.map +1 -0
- package/mtds/external/robust-predicates/esm/util.js +20 -28
- package/mtds/external/robust-predicates/esm/util.js.map +1 -1
- package/mtds/external/robust-predicates/index.js +5 -0
- package/mtds/field/field.js +167 -214
- package/mtds/field/field.js.map +1 -1
- package/mtds/fieldset/fieldset.js +32 -30
- package/mtds/fieldset/fieldset.js.map +1 -1
- package/mtds/fileupload/fileupload.js +16 -13
- package/mtds/fileupload/fileupload.js.map +1 -1
- package/mtds/helptext/helptext.js +25 -27
- package/mtds/helptext/helptext.js.map +1 -1
- package/mtds/identitet/illustrasjons-generator/illustrasjons-generator.d.ts +1 -0
- package/mtds/identitet/illustrasjons-generator/index-old-1.d.ts +1 -0
- package/mtds/identitet/infografikk-generator/infografikk-generator.d.ts +1 -0
- package/mtds/index.iife.js +21 -21
- package/mtds/index.js +38 -31
- package/mtds/index.js.map +1 -1
- package/mtds/input/input.js +33 -47
- package/mtds/input/input.js.map +1 -1
- package/mtds/law/law-helper.js +106 -95
- package/mtds/law/law-helper.js.map +1 -1
- package/mtds/law/law.js +15 -10
- package/mtds/law/law.js.map +1 -1
- package/mtds/layout/layout.js +21 -13
- package/mtds/layout/layout.js.map +1 -1
- package/mtds/layout/layout.stories.d.ts +1 -0
- package/mtds/link/link.js +15 -10
- package/mtds/link/link.js.map +1 -1
- package/mtds/logo/logo-observer.js +18 -18
- package/mtds/logo/logo-observer.js.map +1 -1
- package/mtds/logo/logo.js +18 -18
- package/mtds/logo/logo.js.map +1 -1
- package/mtds/package.js +6 -0
- package/mtds/package.js.map +1 -0
- package/mtds/package.json.d.ts +112 -0
- package/mtds/pagination/pagination.js +46 -60
- package/mtds/pagination/pagination.js.map +1 -1
- package/mtds/popover/popover-observer.js +15 -15
- package/mtds/popover/popover-observer.js.map +1 -1
- package/mtds/popover/popover.js +18 -20
- package/mtds/popover/popover.js.map +1 -1
- package/mtds/print/print.js +15 -10
- package/mtds/print/print.js.map +1 -1
- package/mtds/print/print.stories.d.ts +0 -1
- package/mtds/profilering/epost.d.ts +1 -0
- package/mtds/progress/progress.js +15 -13
- package/mtds/progress/progress.js.map +1 -1
- package/mtds/react-atlas.js +7 -16
- package/mtds/react.js +36 -84
- package/mtds/skeleton/skeleton.js +15 -11
- package/mtds/skeleton/skeleton.js.map +1 -1
- package/mtds/spinner/spinner.js +16 -13
- package/mtds/spinner/spinner.js.map +1 -1
- package/mtds/steps/steps.js +15 -10
- package/mtds/steps/steps.js.map +1 -1
- package/mtds/styles.css +2 -1
- package/mtds/styles.module.js +122 -0
- package/mtds/styles.module.js.map +1 -0
- package/mtds/table/table-observer.js +23 -28
- package/mtds/table/table-observer.js.map +1 -1
- package/mtds/table/table.js +88 -60
- package/mtds/table/table.js.map +1 -1
- package/mtds/tabs/tabs.js +32 -27
- package/mtds/tabs/tabs.js.map +1 -1
- package/mtds/tag/tag.js +16 -19
- package/mtds/tag/tag.js.map +1 -1
- package/mtds/tailwind.css +0 -4
- package/mtds/toast/toast-helper.js +45 -25
- package/mtds/toast/toast-helper.js.map +1 -1
- package/mtds/toast/toast-observer.js +18 -18
- package/mtds/toast/toast-observer.js.map +1 -1
- package/mtds/toast/toast.js +67 -54
- package/mtds/toast/toast.js.map +1 -1
- package/mtds/togglegroup/togglegroup.js +31 -40
- package/mtds/togglegroup/togglegroup.js.map +1 -1
- package/mtds/tooltip/tooltip-element.js +12 -25
- package/mtds/tooltip/tooltip-element.js.map +1 -1
- package/mtds/typography/typography.js +38 -21
- package/mtds/typography/typography.js.map +1 -1
- package/mtds/utils.js +53 -70
- package/mtds/utils.js.map +1 -1
- package/mtds/validation/validation-observer.js +40 -47
- package/mtds/validation/validation-observer.js.map +1 -1
- package/mtds/validation/validation.js +17 -21
- package/mtds/validation/validation.js.map +1 -1
- package/package.json +9 -9
- package/mtds/atlas/atlas.css.js +0 -138
- package/mtds/atlas/atlas.css.js.map +0 -1
- package/mtds/atlas.js.map +0 -1
- package/mtds/chart/chart.css.js +0 -187
- package/mtds/chart/chart.css.js.map +0 -1
- package/mtds/package.json.js +0 -5
- package/mtds/package.json.js.map +0 -1
- package/mtds/react-atlas.js.map +0 -1
- package/mtds/react.js.map +0 -1
- package/mtds/styles.module.css.js +0 -118
- package/mtds/styles.module.css.js.map +0 -1
package/mtds/atlas.js
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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 };
|
package/mtds/avatar/avatar.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import e from "../styles.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
10
|
-
|
|
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"],"
|
|
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"}
|
package/mtds/badge/badge.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=badge.js.map
|
|
13
|
+
//#endregion
|
|
14
|
+
export { i as Badge };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=badge.js.map
|
package/mtds/badge/badge.js.map
CHANGED
|
@@ -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"],"
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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"],"
|
|
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"}
|
package/mtds/button/button.js
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
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"],"
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=card.js.map
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i as Card, a as Group };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=card.js.map
|
package/mtds/card/card.js.map
CHANGED
|
@@ -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"],"
|
|
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"}
|
package/mtds/chart/chart-axis.js
CHANGED
|
@@ -1,22 +1,34 @@
|
|
|
1
|
-
import { tag as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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"],"
|
|
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"}
|
package/mtds/chart/chart-bars.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { tag as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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"],"
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { toAxis as
|
|
5
|
-
import { toBars as
|
|
6
|
-
import { toLines as
|
|
7
|
-
import { toPies as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|