@mattilsynet/design 2.2.6 → 2.2.7
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/alert/alert.js +1 -1
- package/mtds/app/app.d.ts +1 -1
- package/mtds/app/app.js +10 -41
- package/mtds/app/app.js.map +1 -1
- package/mtds/avatar/avatar.js +1 -1
- package/mtds/badge/badge.js +1 -1
- package/mtds/breadcrumbs/breadcrumbs.js +1 -1
- package/mtds/button/button.js +1 -1
- package/mtds/card/card.js +1 -1
- package/mtds/chart/chart-element.d.ts +1 -1
- package/mtds/chart/chart-element.js +4 -4
- package/mtds/chart/chart-element.js.map +1 -1
- package/mtds/chip/chip.js +1 -1
- package/mtds/details/details.d.ts +2 -0
- package/mtds/details/details.js.map +1 -1
- package/mtds/dialog/dialog.js +1 -1
- package/mtds/divider/divider.js +1 -1
- package/mtds/errorsummary/errorsummary.js +1 -1
- package/mtds/field/field-observer.js +3 -3
- package/mtds/field/field.d.ts +3 -5
- package/mtds/field/field.js +69 -99
- package/mtds/field/field.js.map +1 -1
- package/mtds/fieldset/fieldset.js +1 -1
- package/mtds/helptext/helptext.js +1 -1
- package/mtds/index.iife.js +7 -8
- package/mtds/index.js +5 -5
- package/mtds/input/input.js +1 -1
- package/mtds/layout/layout.js +1 -1
- package/mtds/link/link.js +1 -1
- package/mtds/logo/logo.js +1 -1
- package/mtds/map/map-element.d.ts +43 -0
- package/mtds/map/map-element.js +66 -0
- package/mtds/map/map-element.js.map +1 -0
- package/mtds/map/map.css.js +22 -0
- package/mtds/map/map.css.js.map +1 -0
- package/mtds/map.d.ts +1 -0
- package/mtds/map.iife.js +683 -0
- package/mtds/map.js +6 -0
- package/mtds/map.js.map +1 -0
- package/mtds/package.json.js +1 -1
- package/mtds/pagination/pagination.d.ts +1 -1
- package/mtds/pagination/pagination.js +20 -51
- package/mtds/pagination/pagination.js.map +1 -1
- package/mtds/popover/popover-observer.js +1 -1
- package/mtds/popover/popover.d.ts +2 -2
- package/mtds/popover/popover.js +1 -1
- package/mtds/popover/popover.js.map +1 -1
- package/mtds/react-types.d.ts +2 -3
- package/mtds/skeleton/skeleton.js +1 -1
- package/mtds/spinner/spinner.js +1 -1
- package/mtds/steps/steps.js +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +20 -20
- package/mtds/styles.module.css.js +41 -41
- package/mtds/table/table.js +1 -1
- package/mtds/tag/tag.js +1 -1
- package/mtds/toast/toast-helper.js +1 -1
- package/mtds/toast/toast.js +1 -1
- package/mtds/togglegroup/togglegroup.js +1 -1
- package/mtds/tooltip/tooltip-observer.js +1 -1
- package/mtds/typography/typography.js +1 -1
- package/mtds/utils.js +2 -2
- package/mtds/validation/validation.js +1 -1
- package/package.json +15 -9
- package/mtds/external/@floating-ui/core/dist/floating-ui.core.js +0 -342
- package/mtds/external/@floating-ui/core/dist/floating-ui.core.js.map +0 -1
- package/mtds/external/@floating-ui/dom/dist/floating-ui.dom.js +0 -399
- package/mtds/external/@floating-ui/dom/dist/floating-ui.dom.js.map +0 -1
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -137
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +0 -1
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.js +0 -130
- package/mtds/external/@floating-ui/utils/dist/floating-ui.utils.js.map +0 -1
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js +0 -266
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +0 -1
- package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js +0 -231
- package/mtds/external/@u-elements/u-datalist/dist/u-datalist.js.map +0 -1
- package/mtds/external/@u-elements/u-details/dist/u-details.js +0 -89
- package/mtds/external/@u-elements/u-details/dist/u-details.js.map +0 -1
- package/mtds/external/@u-elements/u-progress/dist/u-progress.js +0 -94
- package/mtds/external/@u-elements/u-progress/dist/u-progress.js.map +0 -1
- package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js +0 -186
- package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js.map +0 -1
- package/mtds/external/clsx/dist/clsx.js +0 -18
- package/mtds/external/clsx/dist/clsx.js.map +0 -1
- package/mtds/map/map.d.ts +0 -14
package/mtds/alert/alert.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import f from "clsx";
|
|
3
3
|
import { forwardRef as s } from "react";
|
|
4
4
|
import a from "../styles.module.css.js";
|
|
5
5
|
const x = s(function({ as: t, className: e, ...o }, l) {
|
package/mtds/app/app.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
import { ButtonProps } from '../
|
|
2
|
+
import { ButtonProps } from '../button/button';
|
|
3
3
|
import { PolymorphicComponentPropWithRef } from '../react-types';
|
|
4
4
|
export type AppHeaderProps = React.ComponentPropsWithoutRef<"header">;
|
|
5
5
|
export type AppSidebarProps = React.ComponentPropsWithoutRef<"dialog">;
|
package/mtds/app/app.js
CHANGED
|
@@ -1,45 +1,14 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import a from "clsx";
|
|
3
3
|
import { forwardRef as p } from "react";
|
|
4
|
-
import "../alert/alert.js";
|
|
5
|
-
import "../avatar/avatar.js";
|
|
6
|
-
import "../badge/badge.js";
|
|
7
|
-
import "../breadcrumbs/breadcrumbs.js";
|
|
8
4
|
import { Button as s } from "../button/button.js";
|
|
9
|
-
import "../
|
|
10
|
-
import "../chart/chart.js";
|
|
11
|
-
import "../chip/chip.js";
|
|
12
|
-
import "../details/details.js";
|
|
13
|
-
import "../dialog/dialog.js";
|
|
14
|
-
import "../divider/divider.js";
|
|
15
|
-
import "../errorsummary/errorsummary.js";
|
|
16
|
-
import "../field/field.js";
|
|
17
|
-
import "../fieldset/fieldset.js";
|
|
18
|
-
import "../helptext/helptext.js";
|
|
19
|
-
import "../input/input.js";
|
|
20
|
-
import "../layout/layout.js";
|
|
21
|
-
import "../link/link.js";
|
|
22
|
-
import "../logo/logo.js";
|
|
23
|
-
import "../pagination/pagination.js";
|
|
24
|
-
import "../popover/popover.js";
|
|
25
|
-
import "../progress/progress.js";
|
|
26
|
-
import "../skeleton/skeleton.js";
|
|
27
|
-
import "../spinner/spinner.js";
|
|
28
|
-
import "../steps/steps.js";
|
|
29
|
-
import "../table/table.js";
|
|
30
|
-
import "../tabs/tabs.js";
|
|
31
|
-
import "../tag/tag.js";
|
|
32
|
-
import "../toast/toast.js";
|
|
33
|
-
import "../togglegroup/togglegroup.js";
|
|
34
|
-
import "../typography/typography.js";
|
|
35
|
-
import "../validation/validation.js";
|
|
36
|
-
import a from "../styles.module.css.js";
|
|
5
|
+
import c from "../styles.module.css.js";
|
|
37
6
|
import d from "./app-toggle.js";
|
|
38
|
-
const f = p(function({ as: t, className: r, ...
|
|
39
|
-
return /* @__PURE__ */ o(t || "div", { className:
|
|
40
|
-
}), u = p(function({ as: t, className: r, ...
|
|
41
|
-
return /* @__PURE__ */ o(t || "div", { className:
|
|
42
|
-
}),
|
|
7
|
+
const f = p(function({ as: t, className: r, ...i }, e) {
|
|
8
|
+
return /* @__PURE__ */ o(t || "div", { className: a(c.app, r), ref: e, ...i });
|
|
9
|
+
}), u = p(function({ as: t, className: r, ...i }, e) {
|
|
10
|
+
return /* @__PURE__ */ o(t || "div", { className: a(c.sticky, r), ref: e, ...i });
|
|
11
|
+
}), k = Object.assign(f, {
|
|
43
12
|
Header: p(
|
|
44
13
|
function(t, r) {
|
|
45
14
|
return /* @__PURE__ */ o("header", { ref: r, ...t });
|
|
@@ -52,13 +21,13 @@ const f = p(function({ as: t, className: r, ...m }, n) {
|
|
|
52
21
|
),
|
|
53
22
|
Sticky: u,
|
|
54
23
|
Toggle: p(
|
|
55
|
-
function({ children: t, ...r },
|
|
24
|
+
function({ children: t, ...r }, i) {
|
|
56
25
|
return /* @__PURE__ */ o(
|
|
57
26
|
s,
|
|
58
27
|
{
|
|
59
28
|
"data-command": "toggle-app-expanded",
|
|
60
29
|
"data-tooltip": "Vis meny",
|
|
61
|
-
ref:
|
|
30
|
+
ref: i,
|
|
62
31
|
...r,
|
|
63
32
|
children: t ?? "Skjul meny"
|
|
64
33
|
}
|
|
@@ -77,6 +46,6 @@ const f = p(function({ as: t, className: r, ...m }, n) {
|
|
|
77
46
|
Script: () => /* @__PURE__ */ o("script", { id: "mtds-app-script", children: d })
|
|
78
47
|
});
|
|
79
48
|
export {
|
|
80
|
-
|
|
49
|
+
k as App
|
|
81
50
|
};
|
|
82
51
|
//# sourceMappingURL=app.js.map
|
package/mtds/app/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sources":["../../designsystem/app/app.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport { Button, type ButtonProps } from \"../
|
|
1
|
+
{"version":3,"file":"app.js","sources":["../../designsystem/app/app.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport script from \"./app-toggle.js?raw\";\n\nexport type AppHeaderProps = React.ComponentPropsWithoutRef<\"header\">;\nexport type AppSidebarProps = React.ComponentPropsWithoutRef<\"dialog\">;\nexport type AppStickyProps = React.ComponentPropsWithoutRef<\"div\">;\nexport type AppMainProps = React.ComponentPropsWithoutRef<\"main\">;\nexport type AppFooterProps = React.ComponentPropsWithoutRef<\"footer\">;\nexport type AppProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype AppComponent = <As extends React.ElementType = \"div\">(\n\tprops: AppProps<As>,\n) => JSX.Element;\n\nconst AppComp = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.app, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nconst AppSticky = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.sticky, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport const App = Object.assign(AppComp, {\n\tHeader: forwardRef<HTMLElement, AppHeaderProps>(\n\t\tfunction AppHeader(rest, ref) {\n\t\t\treturn <header ref={ref} {...rest} />;\n\t\t},\n\t),\n\tSidebar: forwardRef<HTMLDialogElement, AppSidebarProps>(\n\t\tfunction AppSidebar(rest, ref) {\n\t\t\treturn <dialog role=\"navigation\" ref={ref} {...rest} />;\n\t\t},\n\t),\n\tSticky: AppSticky,\n\tToggle: forwardRef<HTMLButtonElement, ButtonProps<\"button\">>(\n\t\tfunction AppToggle({ children, ...rest }: ButtonProps<\"button\">, ref) {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tdata-command=\"toggle-app-expanded\"\n\t\t\t\t\tdata-tooltip=\"Vis meny\"\n\t\t\t\t\tref={ref as React.Ref<HTMLAnchorElement>}\n\t\t\t\t\t{...rest}\n\t\t\t\t>\n\t\t\t\t\t{children ?? \"Skjul meny\"}\n\t\t\t\t</Button>\n\t\t\t);\n\t\t},\n\t),\n\tMain: forwardRef<HTMLElement, AppMainProps>(function AppMain(rest, ref) {\n\t\treturn <main ref={ref} {...rest} />;\n\t}),\n\tFooter: forwardRef<HTMLElement, AppFooterProps>(\n\t\tfunction AppFooter(rest, ref) {\n\t\t\treturn <footer ref={ref} {...rest} />;\n\t\t},\n\t),\n\t// Needed to avoid flash of unstyled content and still be Next.js hydration compatible\n\tScript: () => <script id=\"mtds-app-script\">{script}</script>,\n});\n"],"names":["AppComp","forwardRef","as","className","rest","ref","jsx","clsx","styles","AppSticky","App","children","Button","script"],"mappings":";;;;;;AAsBA,MAAMA,IAAUC,EAAiB,SAE/B,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAsBC,GAA0B;AAGrE,SAAO,gBAAAC,EAFKJ,KAAM,OAEV,EAAI,WAAWK,EAAKC,EAAO,KAAKL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AACzE,CAAC,GAEKK,IAAYR,EAAiB,SAEjC,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAsBC,GAA0B;AAGrE,SAAO,gBAAAC,EAFKJ,KAAM,OAEV,EAAI,WAAWK,EAAKC,EAAO,QAAQL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC5E,CAAC,GAEYM,IAAM,OAAO,OAAOV,GAAS;AAAA,EACzC,QAAQC;AAAA,IACP,SAAmBG,GAAMC,GAAK;AAC7B,aAAO,gBAAAC,EAAC,UAAA,EAAO,KAAAD,GAAW,GAAGD,EAAA,CAAM;AAAA,IACpC;AAAA,EAAA;AAAA,EAED,SAASH;AAAA,IACR,SAAoBG,GAAMC,GAAK;AAC9B,+BAAQ,UAAA,EAAO,MAAK,cAAa,KAAAA,GAAW,GAAGD,GAAM;AAAA,IACtD;AAAA,EAAA;AAAA,EAED,QAAQK;AAAA,EACR,QAAQR;AAAA,IACP,SAAmB,EAAE,UAAAU,GAAU,GAAGP,EAAA,GAA+BC,GAAK;AACrE,aACC,gBAAAC;AAAA,QAACM;AAAA,QAAA;AAAA,UACA,gBAAa;AAAA,UACb,gBAAa;AAAA,UACb,KAAAP;AAAA,UACC,GAAGD;AAAA,UAEH,UAAAO,KAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IAGhB;AAAA,EAAA;AAAA,EAED,MAAMV,EAAsC,SAAiBG,GAAMC,GAAK;AACvE,WAAO,gBAAAC,EAAC,QAAA,EAAK,KAAAD,GAAW,GAAGD,EAAA,CAAM;AAAA,EAClC,CAAC;AAAA,EACD,QAAQH;AAAA,IACP,SAAmBG,GAAMC,GAAK;AAC7B,aAAO,gBAAAC,EAAC,UAAA,EAAO,KAAAD,GAAW,GAAGD,EAAA,CAAM;AAAA,IACpC;AAAA,EAAA;AAAA;AAAA,EAGD,QAAQ,MAAM,gBAAAE,EAAC,UAAA,EAAO,IAAG,mBAAmB,UAAAO,EAAA,CAAO;AACpD,CAAC;"}
|
package/mtds/avatar/avatar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import s from "clsx";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import p from "../styles.module.css.js";
|
|
5
5
|
const x = n(function({ as: a, className: o, ...r }, t) {
|
package/mtds/badge/badge.js
CHANGED
package/mtds/button/button.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import m from "clsx";
|
|
3
3
|
import { forwardRef as a } from "react";
|
|
4
4
|
import s from "../styles.module.css.js";
|
|
5
5
|
const l = a(function({ as: r, className: n, type: u, ...t }, f) {
|
package/mtds/card/card.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import m from "clsx";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import f from "../styles.module.css.js";
|
|
5
5
|
const g = n(function({ as: o, className: t, ...r }, a) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MTDSElement } from '../utils';
|
|
2
2
|
export type ChartData = ReturnType<typeof toData>;
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class MTDSChartElement extends MTDSElement {
|
|
4
4
|
_observer?: MutationObserver;
|
|
5
5
|
static get observedAttributes(): string[];
|
|
6
6
|
constructor();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import g from "../styles.module.css.js";
|
|
2
|
-
import { IS_BROWSER as b, tag as c, MTDSElement as
|
|
2
|
+
import { IS_BROWSER as b, tag as c, MTDSElement as E, on as C, off as k, attr as d } from "../utils.js";
|
|
3
3
|
import T from "./chart.css.js";
|
|
4
4
|
import { toAxis as w } from "./chart-axis.js";
|
|
5
5
|
import { toBars as S } from "./chart-bars.js";
|
|
6
6
|
import { toLines as _ } from "./chart-lines.js";
|
|
7
7
|
import { toPies as O } from "./chart-pies.js";
|
|
8
8
|
const h = "click,keydown,mousemove,mouseout", p = "mtds-chart-tooltip", a = b ? document.getElementById(p) || c("div", { class: g._tooltip, id: p, hidden: "" }) : null;
|
|
9
|
-
class $ extends
|
|
9
|
+
class $ extends E {
|
|
10
10
|
_observer;
|
|
11
11
|
// Using underscore instead of # for backwards compatibility
|
|
12
12
|
static get observedAttributes() {
|
|
@@ -24,7 +24,7 @@ class $ extends C {
|
|
|
24
24
|
characterData: !0,
|
|
25
25
|
childList: !0,
|
|
26
26
|
subtree: !0
|
|
27
|
-
}), this.attributeChangedCallback(),
|
|
27
|
+
}), this.attributeChangedCallback(), C(this, h, this);
|
|
28
28
|
}
|
|
29
29
|
disconnectedCallback() {
|
|
30
30
|
a && (a.hidden = !0), k(this, h, this), this._observer?.disconnect(), this._observer = void 0;
|
|
@@ -68,6 +68,6 @@ const i = (o) => o?.textContent?.trim() || "", x = (o) => Array.from(
|
|
|
68
68
|
);
|
|
69
69
|
b && !window.customElements.get("mtds-chart") && window.customElements.define("mtds-chart", $);
|
|
70
70
|
export {
|
|
71
|
-
$ as
|
|
71
|
+
$ as MTDSChartElement
|
|
72
72
|
};
|
|
73
73
|
//# sourceMappingURL=chart-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-element.js","sources":["../../designsystem/chart/chart-element.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { attr, IS_BROWSER, MTDSElement, off, on, tag } from \"../utils\";\nimport css from \"./chart.css?raw\";\nimport { toAxis } from \"./chart-axis\";\nimport { toBars } from \"./chart-bars\";\nimport { toLines } from \"./chart-lines\";\nimport { toPies } from \"./chart-pies\";\n\nexport type ChartData = ReturnType<typeof toData>;\n\nconst EVENTS = \"click,keydown,mousemove,mouseout\";\nconst TOOLTIP_ID = \"mtds-chart-tooltip\";\nconst TOOLTIP = IS_BROWSER\n\t? document.getElementById(TOOLTIP_ID) ||\n\t\ttag(\"div\", { class: styles._tooltip, id: TOOLTIP_ID, hidden: \"\" })\n\t: null;\nexport class
|
|
1
|
+
{"version":3,"file":"chart-element.js","sources":["../../designsystem/chart/chart-element.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { attr, IS_BROWSER, MTDSElement, off, on, tag } from \"../utils\";\nimport css from \"./chart.css?raw\";\nimport { toAxis } from \"./chart-axis\";\nimport { toBars } from \"./chart-bars\";\nimport { toLines } from \"./chart-lines\";\nimport { toPies } from \"./chart-pies\";\n\nexport type ChartData = ReturnType<typeof toData>;\n\nconst EVENTS = \"click,keydown,mousemove,mouseout\";\nconst TOOLTIP_ID = \"mtds-chart-tooltip\";\nconst TOOLTIP = IS_BROWSER\n\t? document.getElementById(TOOLTIP_ID) ||\n\t\ttag(\"div\", { class: styles._tooltip, id: TOOLTIP_ID, hidden: \"\" })\n\t: null;\n\nexport class MTDSChartElement extends MTDSElement {\n\t_observer?: MutationObserver; // Using underscore instead of # for backwards compatibility\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-variant\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: \"open\" });\n\t}\n\tconnectedCallback() {\n\t\tthis._observer = new MutationObserver(\n\t\t\tthis.attributeChangedCallback.bind(this),\n\t\t);\n\t\tthis._observer.observe(this, {\n\t\t\tattributeFilter: [\"data-tooltip\"],\n\t\t\tattributes: true,\n\t\t\tcharacterData: true,\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t});\n\t\tthis.attributeChangedCallback(); // Initial setup\n\t\ton(this, EVENTS, this);\n\t}\n\tdisconnectedCallback() {\n\t\tif (TOOLTIP) TOOLTIP.hidden = true;\n\t\toff(this, EVENTS, this);\n\t\tthis._observer?.disconnect();\n\t\tthis._observer = undefined;\n\t}\n\tattributeChangedCallback() {\n\t\tArray.from(this.shadowRoot?.children || []).map((el) => el.remove()); // Clear shadowRoot\n\n\t\tconst data = toData(this.querySelector(\"table\"));\n\t\tconst [variant, type] = (attr(this, \"data-variant\") || \"bar\").split(\"-\");\n\t\tconst style = tag(\"style\", {}, css);\n\t\tconst legend = tag(\"div\", { class: \"legends\" });\n\t\tdata.slice(1).forEach(([{ value, style }]) => {\n\t\t\tlegend.appendChild(tag(\"div\", { class: \"legend\", style }, value));\n\t\t});\n\n\t\tconst { axis, groups, total } = toAxis(data, { type });\n\t\tif (variant === \"bar\" || variant === \"column\")\n\t\t\tgroups.append(...toBars(data));\n\t\tif (variant === \"line\" || variant === \"area\")\n\t\t\tgroups.append(toLines(data, { total, variant, type }));\n\t\tif (variant === \"doughnut\" || variant === \"pie\")\n\t\t\tthis.shadowRoot?.append(toPies(data, { variant }));\n\n\t\tthis.shadowRoot?.append(style, axis, legend);\n\t}\n\thandleEvent(e: Event) {\n\t\tif (e.type === \"click\" || e.type === \"keydown\") onClick(e, this);\n\t\telse onMoveTooltip(e as MouseEvent);\n\t}\n}\n\nfunction onClick(event: Event, self: MTDSChartElement) {\n\tif (event instanceof KeyboardEvent && event.key !== \"Enter\") return; // Only handle enter key\n\tconst el = event.composedPath()[0];\n\tconst table = self.querySelector(\"table\");\n\tconst [tr, td] =\n\t\t(el instanceof Element && attr(el, \"data-event\")?.split(\"-\").map(Number)) ||\n\t\t[];\n\n\ttable?.rows[tr]?.cells[td]?.querySelector<HTMLElement>(\"a,button\")?.click?.();\n}\n\nlet TOOLTIP_TEXT = \"\";\nfunction onMoveTooltip(event: MouseEvent) {\n\tif (!TOOLTIP) return;\n\tif (!TOOLTIP?.isConnected) document.body.append(TOOLTIP); // Ensure connected\n\n\tconst el = event.composedPath()[0];\n\tconst tip = (el instanceof Element && el.getAttribute(\"aria-label\")) || \"\";\n\n\tif (tip)\n\t\tTOOLTIP.style.transform = `translate(${event.pageX}px, ${event.pageY}px)`;\n\tif (tip !== TOOLTIP_TEXT) {\n\t\tif (tip) TOOLTIP.textContent = tip;\n\t\tTOOLTIP_TEXT = tip;\n\t\tTOOLTIP.hidden = !tip;\n\t}\n}\n\nconst text = (el?: Element | null) => el?.textContent?.trim() || \"\"; // Helper to get trimmed text\nconst toData = (table?: HTMLTableElement | null) =>\n\tArray.from(table?.rows || [], (row, rowIndex) =>\n\t\tArray.from(row.cells, (cell, cellIndex) => ({\n\t\t\tnumber: (cellIndex && rowIndex && Number.parseFloat(text(cell))) || 0, // First row and column is not a number\n\t\t\tevent: cell.querySelector(\"a,button\") && `${rowIndex}-${cellIndex}`, // Reference to proxy events\n\t\t\tstyle: `--color: var(--mtdsc-chart-color-${rowIndex}, var(--mtdsc-chart-color-base))`,\n\t\t\tvalue: text(cell),\n\t\t\ttooltip:\n\t\t\t\tattr(cell, \"data-tooltip\") ||\n\t\t\t\t`${text(row.cells[0])}: ${text(cell)} (${text(table?.rows[0].cells[cellIndex])})`,\n\t\t})),\n\t);\n\nif (IS_BROWSER && !window.customElements.get(\"mtds-chart\"))\n\twindow.customElements.define(\"mtds-chart\", MTDSChartElement);\n"],"names":["EVENTS","TOOLTIP_ID","TOOLTIP","IS_BROWSER","tag","styles","MTDSChartElement","MTDSElement","on","off","el","data","toData","variant","type","attr","style","css","legend","value","axis","groups","total","toAxis","toBars","toLines","toPies","onClick","event","self","table","tr","td","TOOLTIP_TEXT","onMoveTooltip","tip","text","row","rowIndex","cell","cellIndex"],"mappings":";;;;;;;AAUA,MAAMA,IAAS,oCACTC,IAAa,sBACbC,IAAUC,IACb,SAAS,eAAeF,CAAU,KACnCG,EAAI,OAAO,EAAE,OAAOC,EAAO,UAAU,IAAIJ,GAAY,QAAQ,GAAA,CAAI,IAChE;AAEI,MAAMK,UAAyBC,EAAY;AAAA,EACjD;AAAA;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC,cAAc;AAAA,EACvB;AAAA,EACA,cAAc;AACb,UAAA,GACA,KAAK,aAAa,EAAE,MAAM,OAAA,CAAQ;AAAA,EACnC;AAAA,EACA,oBAAoB;AACnB,SAAK,YAAY,IAAI;AAAA,MACpB,KAAK,yBAAyB,KAAK,IAAI;AAAA,IAAA,GAExC,KAAK,UAAU,QAAQ,MAAM;AAAA,MAC5B,iBAAiB,CAAC,cAAc;AAAA,MAChC,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,WAAW;AAAA,MACX,SAAS;AAAA,IAAA,CACT,GACD,KAAK,yBAAA,GACLC,EAAG,MAAMR,GAAQ,IAAI;AAAA,EACtB;AAAA,EACA,uBAAuB;AACtB,IAAIE,QAAiB,SAAS,KAC9BO,EAAI,MAAMT,GAAQ,IAAI,GACtB,KAAK,WAAW,WAAA,GAChB,KAAK,YAAY;AAAA,EAClB;AAAA,EACA,2BAA2B;AAC1B,UAAM,KAAK,KAAK,YAAY,YAAY,CAAA,CAAE,EAAE,IAAI,CAACU,MAAOA,EAAG,OAAA,CAAQ;AAEnE,UAAMC,IAAOC,EAAO,KAAK,cAAc,OAAO,CAAC,GACzC,CAACC,GAASC,CAAI,KAAKC,EAAK,MAAM,cAAc,KAAK,OAAO,MAAM,GAAG,GACjEC,IAAQZ,EAAI,SAAS,CAAA,GAAIa,CAAG,GAC5BC,IAASd,EAAI,OAAO,EAAE,OAAO,WAAW;AAC9C,IAAAO,EAAK,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,OAAAQ,GAAO,OAAAH,EAAAA,CAAO,MAAM;AAC7C,MAAAE,EAAO,YAAYd,EAAI,OAAO,EAAE,OAAO,UAAU,OAAAY,KAASG,CAAK,CAAC;AAAA,IACjE,CAAC;AAED,UAAM,EAAE,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,EAAA,IAAUC,EAAOZ,GAAM,EAAE,MAAAG,GAAM;AACrD,KAAID,MAAY,SAASA,MAAY,aACpCQ,EAAO,OAAO,GAAGG,EAAOb,CAAI,CAAC,IAC1BE,MAAY,UAAUA,MAAY,WACrCQ,EAAO,OAAOI,EAAQd,GAAM,EAAE,OAAAW,GAAO,SAAAT,EAAc,CAAC,CAAC,IAClDA,MAAY,cAAcA,MAAY,UACzC,KAAK,YAAY,OAAOa,EAAOf,GAAM,EAAE,SAAAE,EAAA,CAAS,CAAC,GAElD,KAAK,YAAY,OAAOG,GAAOI,GAAMF,CAAM;AAAA,EAC5C;AAAA,EACA,YAAY,GAAU;AACrB,IAAI,EAAE,SAAS,WAAW,EAAE,SAAS,YAAWS,EAAQ,GAAG,IAAI,MAC5C,CAAe;AAAA,EACnC;AACD;AAEA,SAASA,EAAQC,GAAcC,GAAwB;AACtD,MAAID,aAAiB,iBAAiBA,EAAM,QAAQ,QAAS;AAC7D,QAAMlB,IAAKkB,EAAM,aAAA,EAAe,CAAC,GAC3BE,IAAQD,EAAK,cAAc,OAAO,GAClC,CAACE,GAAIC,CAAE,IACXtB,aAAc,WAAWK,EAAKL,GAAI,YAAY,GAAG,MAAM,GAAG,EAAE,IAAI,MAAM,KACvE,CAAA;AAED,EAAAoB,GAAO,KAAKC,CAAE,GAAG,MAAMC,CAAE,GAAG,cAA2B,UAAU,GAAG,QAAA;AACrE;AAEA,IAAIC,IAAe;AACnB,SAASC,EAAcN,GAAmB;AACzC,MAAI,CAAC1B,EAAS;AACd,EAAKA,GAAS,eAAa,SAAS,KAAK,OAAOA,CAAO;AAEvD,QAAMQ,IAAKkB,EAAM,aAAA,EAAe,CAAC,GAC3BO,IAAOzB,aAAc,WAAWA,EAAG,aAAa,YAAY,KAAM;AAExE,EAAIyB,MACHjC,EAAQ,MAAM,YAAY,aAAa0B,EAAM,KAAK,OAAOA,EAAM,KAAK,QACjEO,MAAQF,MACPE,QAAa,cAAcA,IAC/BF,IAAeE,GACfjC,EAAQ,SAAS,CAACiC;AAEpB;AAEA,MAAMC,IAAO,CAAC1B,MAAwBA,GAAI,aAAa,UAAU,IAC3DE,IAAS,CAACkB,MACf,MAAM;AAAA,EAAKA,GAAO,QAAQ,CAAA;AAAA,EAAI,CAACO,GAAKC,MACnC,MAAM,KAAKD,EAAI,OAAO,CAACE,GAAMC,OAAe;AAAA,IAC3C,QAASA,KAAaF,KAAY,OAAO,WAAWF,EAAKG,CAAI,CAAC,KAAM;AAAA;AAAA,IACpE,OAAOA,EAAK,cAAc,UAAU,KAAK,GAAGD,CAAQ,IAAIE,CAAS;AAAA;AAAA,IACjE,OAAO,oCAAoCF,CAAQ;AAAA,IACnD,OAAOF,EAAKG,CAAI;AAAA,IAChB,SACCxB,EAAKwB,GAAM,cAAc,KACzB,GAAGH,EAAKC,EAAI,MAAM,CAAC,CAAC,CAAC,KAAKD,EAAKG,CAAI,CAAC,KAAKH,EAAKN,GAAO,KAAK,CAAC,EAAE,MAAMU,CAAS,CAAC,CAAC;AAAA,EAAA,EAC9E;AACH;AAEGrC,KAAc,CAAC,OAAO,eAAe,IAAI,YAAY,KACxD,OAAO,eAAe,OAAO,cAAcG,CAAgB;"}
|
package/mtds/chip/chip.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import p from "clsx";
|
|
3
3
|
import { forwardRef as e } from "react";
|
|
4
4
|
import f from "../styles.module.css.js";
|
|
5
5
|
const h = e(function({ as: r, className: t, ...o }, m) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export type DetailsProps = React.ComponentPropsWithoutRef<"details"> & {
|
|
2
|
+
"data-align"?: "start" | "center";
|
|
2
3
|
"data-variant"?: "default" | "card";
|
|
3
4
|
};
|
|
4
5
|
export type SummaryProps = React.ComponentPropsWithoutRef<"summary">;
|
|
5
6
|
export declare const Details: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>, "ref"> & {
|
|
7
|
+
"data-align"?: "start" | "center";
|
|
6
8
|
"data-variant"?: "default" | "card";
|
|
7
9
|
} & React.RefAttributes<HTMLDetailsElement>> & {
|
|
8
10
|
Summary: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"details.js","sources":["../../designsystem/details/details.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type DetailsProps = React.ComponentPropsWithoutRef<\"details\"> & {\n\t\"data-variant\"?: \"default\" | \"card\";\n};\nconst DetailsComp = forwardRef<HTMLDetailsElement, DetailsProps>(\n\tfunction Details(props, ref) {\n\t\treturn (\n\t\t\t<u-details ref={ref} {...toCustomElementProps(props, styles.details)} />\n\t\t);\n\t},\n);\n\nexport type SummaryProps = React.ComponentPropsWithoutRef<\"summary\">;\nconst DetailsSummary = forwardRef<HTMLElement, SummaryProps>(\n\tfunction DetailsSummary(props, ref) {\n\t\treturn <u-summary ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport const Details = Object.assign(DetailsComp, { Summary: DetailsSummary });\n"],"names":["DetailsComp","forwardRef","props","ref","jsx","toCustomElementProps","styles","DetailsSummary","Details"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"details.js","sources":["../../designsystem/details/details.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type DetailsProps = React.ComponentPropsWithoutRef<\"details\"> & {\n\t\"data-align\"?: \"start\" | \"center\";\n\t\"data-variant\"?: \"default\" | \"card\";\n};\nconst DetailsComp = forwardRef<HTMLDetailsElement, DetailsProps>(\n\tfunction Details(props, ref) {\n\t\treturn (\n\t\t\t<u-details ref={ref} {...toCustomElementProps(props, styles.details)} />\n\t\t);\n\t},\n);\n\nexport type SummaryProps = React.ComponentPropsWithoutRef<\"summary\">;\nconst DetailsSummary = forwardRef<HTMLElement, SummaryProps>(\n\tfunction DetailsSummary(props, ref) {\n\t\treturn <u-summary ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport const Details = Object.assign(DetailsComp, { Summary: DetailsSummary });\n"],"names":["DetailsComp","forwardRef","props","ref","jsx","toCustomElementProps","styles","DetailsSummary","Details"],"mappings":";;;;AAQA,MAAMA,IAAcC;AAAA,EACnB,SAAiBC,GAAOC,GAAK;AAC5B,WACC,gBAAAC,EAAC,eAAU,KAAAD,GAAW,GAAGE,EAAqBH,GAAOI,EAAO,OAAO,GAAG;AAAA,EAExE;AACD,GAGMC,IAAiBN;AAAA,EACtB,SAAwBC,GAAOC,GAAK;AACnC,6BAAQ,aAAA,EAAU,KAAAA,GAAW,GAAGE,EAAqBH,CAAK,GAAG;AAAA,EAC9D;AACD,GAEaM,IAAU,OAAO,OAAOR,GAAa,EAAE,SAASO,GAAgB;"}
|
package/mtds/dialog/dialog.js
CHANGED
package/mtds/divider/divider.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { flip as C, shift as E, size as I } from "
|
|
2
|
-
import { UHTMLComboboxElement as M } from "
|
|
3
|
-
import { UHTMLDataListElement as A } from "
|
|
1
|
+
import { flip as C, shift as E, size as I } from "@floating-ui/dom";
|
|
2
|
+
import { UHTMLComboboxElement as M } from "@u-elements/u-combobox";
|
|
3
|
+
import { UHTMLDataListElement as A } from "@u-elements/u-datalist";
|
|
4
4
|
import h from "../styles.module.css.js";
|
|
5
5
|
import { onLoaded as H, onMutation as $, on as m, QUICK_EVENT as b, isInputLike as v, attr as a, useId as u, anchorPosition as g } from "../utils.js";
|
|
6
6
|
const p = h.field.split(" ")[0], x = h.validation.split(" "), w = x[0], l = (t, o) => t.getPropertyValue(`--mtds-text-${o}`)?.slice(1, -1) || "";
|
package/mtds/field/field.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Placement } from '@floating-ui/dom';
|
|
2
2
|
import { ReactUcombobox, UHTMLComboboxElement } from '@u-elements/u-combobox';
|
|
3
3
|
import { JSX } from 'react';
|
|
4
|
-
import { InputProps } from '../
|
|
4
|
+
import { InputProps } from '../input/input';
|
|
5
5
|
import { PolymorphicComponentPropWithRef } from '../react-types';
|
|
6
6
|
type FieldBaseProps = {
|
|
7
7
|
count?: number;
|
|
@@ -15,8 +15,6 @@ type FieldBaseProps = {
|
|
|
15
15
|
readOnly?: boolean;
|
|
16
16
|
suffix?: string;
|
|
17
17
|
validation?: React.ReactNode;
|
|
18
|
-
value?: React.ComponentPropsWithRef<"input">["value"];
|
|
19
|
-
onInput?: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
|
|
20
18
|
};
|
|
21
19
|
export type FieldProps<As extends React.ElementType = "div"> = PolymorphicComponentPropWithRef<As, FieldBaseProps>;
|
|
22
20
|
type FieldComponent = <As extends React.ElementType = "div">(props: FieldProps<As>) => JSX.Element;
|
|
@@ -32,7 +30,7 @@ export type FieldComboboxSelected = {
|
|
|
32
30
|
value: string;
|
|
33
31
|
children?: React.ReactNode;
|
|
34
32
|
}[];
|
|
35
|
-
export type FieldComboboxProps = ReactUcombobox & {
|
|
33
|
+
export type FieldComboboxProps = Omit<ReactUcombobox, "onChange" | "onInput"> & {
|
|
36
34
|
"data-creatable"?: boolean;
|
|
37
35
|
"data-multiple"?: boolean;
|
|
38
36
|
onAfterChange?: (e: CustomEvent<HTMLDataElement>) => void;
|
|
@@ -43,7 +41,7 @@ export type FieldComboboxProps = ReactUcombobox & {
|
|
|
43
41
|
onSelectedChange?: (selected: FieldComboboxSelected) => void;
|
|
44
42
|
options?: FieldComboboxSelected;
|
|
45
43
|
selected?: FieldComboboxSelected;
|
|
46
|
-
} & Pick<InputProps, "disabled" | "
|
|
44
|
+
} & Pick<InputProps, "disabled" | "name" | "onChange" | "onInput" | "placeholder" | "readOnly" | "type" | "value"> & // Allow input props to be passed down
|
|
47
45
|
Pick<FieldDatalistProps, "data-position" | "data-nofilter">;
|
|
48
46
|
export type FieldLabelProps = React.ComponentPropsWithoutRef<"label">;
|
|
49
47
|
export declare const Field: FieldComponent & {
|
package/mtds/field/field.js
CHANGED
|
@@ -1,47 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import "../alert/alert.js";
|
|
6
|
-
import "../app/app.js";
|
|
7
|
-
import "../avatar/avatar.js";
|
|
8
|
-
import "../badge/badge.js";
|
|
9
|
-
import "../breadcrumbs/breadcrumbs.js";
|
|
10
|
-
import "../button/button.js";
|
|
11
|
-
import "../card/card.js";
|
|
12
|
-
import "../chart/chart.js";
|
|
13
|
-
import "../chip/chip.js";
|
|
14
|
-
import "../details/details.js";
|
|
15
|
-
import "../dialog/dialog.js";
|
|
16
|
-
import "../divider/divider.js";
|
|
17
|
-
import "../errorsummary/errorsummary.js";
|
|
18
|
-
import "../fieldset/fieldset.js";
|
|
2
|
+
import { jsx as e, Fragment as I, jsxs as j } from "react/jsx-runtime";
|
|
3
|
+
import k from "clsx";
|
|
4
|
+
import { forwardRef as p, useRef as z, useImperativeHandle as K, useEffect as M } from "react";
|
|
19
5
|
import { HelpText as Q } from "../helptext/helptext.js";
|
|
20
6
|
import { Input as U } from "../input/input.js";
|
|
21
|
-
import "../layout/layout.js";
|
|
22
|
-
import "../link/link.js";
|
|
23
|
-
import "../logo/logo.js";
|
|
24
|
-
import "../pagination/pagination.js";
|
|
25
|
-
import "../popover/popover.js";
|
|
26
|
-
import "../progress/progress.js";
|
|
27
|
-
import "../skeleton/skeleton.js";
|
|
28
|
-
import "../spinner/spinner.js";
|
|
29
|
-
import "../steps/steps.js";
|
|
30
|
-
import "../table/table.js";
|
|
31
|
-
import "../tabs/tabs.js";
|
|
32
|
-
import "../tag/tag.js";
|
|
33
|
-
import "../toast/toast.js";
|
|
34
|
-
import "../togglegroup/togglegroup.js";
|
|
35
|
-
import "../typography/typography.js";
|
|
36
|
-
import "../validation/validation.js";
|
|
37
7
|
import g from "../styles.module.css.js";
|
|
38
8
|
import { toCustomElementProps as N } from "../utils.js";
|
|
39
|
-
const P = (
|
|
40
|
-
"data-size":
|
|
41
|
-
as:
|
|
9
|
+
const P = (o) => typeof o == "string" ? { label: o, value: o } : o, V = p(function({
|
|
10
|
+
"data-size": t,
|
|
11
|
+
as: n,
|
|
42
12
|
className: a,
|
|
43
|
-
count:
|
|
44
|
-
description:
|
|
13
|
+
count: u,
|
|
14
|
+
description: m,
|
|
45
15
|
error: F,
|
|
46
16
|
helpText: y,
|
|
47
17
|
helpTextLabel: H,
|
|
@@ -50,71 +20,71 @@ const P = (i) => typeof i == "string" ? { label: i, value: i } : i, V = m(functi
|
|
|
50
20
|
style: D,
|
|
51
21
|
suffix: h,
|
|
52
22
|
validation: C,
|
|
53
|
-
...
|
|
23
|
+
...i
|
|
54
24
|
}, v) {
|
|
55
|
-
const
|
|
56
|
-
"data-size":
|
|
25
|
+
const l = n || "div", E = !!h || !!b, W = C || F, O = {
|
|
26
|
+
"data-size": t,
|
|
57
27
|
className: k(g.field, a),
|
|
58
28
|
style: D
|
|
59
29
|
};
|
|
60
|
-
return
|
|
30
|
+
return n === "select" && !i.children && Object.assign(i, {
|
|
61
31
|
options: void 0,
|
|
62
32
|
// Ensure options is not passed to DOM
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
-
}),
|
|
65
|
-
!!f && /* @__PURE__ */
|
|
66
|
-
!!y && /* @__PURE__ */
|
|
67
|
-
!!
|
|
33
|
+
children: /* @__PURE__ */ e(I, { children: i.options?.map(P).map(({ label: x, value: d }) => /* @__PURE__ */ e("option", { value: d, children: x }, d)) })
|
|
34
|
+
}), n ? /* @__PURE__ */ j("div", { ...O, children: [
|
|
35
|
+
!!f && /* @__PURE__ */ e("label", { suppressHydrationWarning: !0, children: f }),
|
|
36
|
+
!!y && /* @__PURE__ */ e(Q, { "aria-label": H, children: y }),
|
|
37
|
+
!!m && /* @__PURE__ */ e("p", { suppressHydrationWarning: !0, children: m }),
|
|
68
38
|
E ? /* @__PURE__ */ j(S, { children: [
|
|
69
|
-
!!b && /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
39
|
+
!!b && /* @__PURE__ */ e("span", { children: b }),
|
|
40
|
+
/* @__PURE__ */ e(
|
|
41
|
+
l,
|
|
72
42
|
{
|
|
73
43
|
className: g.input,
|
|
74
44
|
suppressHydrationWarning: !0,
|
|
75
45
|
ref: v,
|
|
76
|
-
...
|
|
46
|
+
...i
|
|
77
47
|
}
|
|
78
48
|
),
|
|
79
|
-
!!h && /* @__PURE__ */
|
|
80
|
-
] }) : /* @__PURE__ */
|
|
81
|
-
|
|
49
|
+
!!h && /* @__PURE__ */ e("span", { children: h })
|
|
50
|
+
] }) : /* @__PURE__ */ e(
|
|
51
|
+
l,
|
|
82
52
|
{
|
|
83
|
-
className: typeof
|
|
53
|
+
className: typeof n == "string" ? g.input : void 0,
|
|
84
54
|
suppressHydrationWarning: !0,
|
|
85
55
|
ref: v,
|
|
86
|
-
...
|
|
56
|
+
...i
|
|
87
57
|
}
|
|
88
58
|
),
|
|
89
|
-
!!W && /* @__PURE__ */
|
|
90
|
-
!!
|
|
91
|
-
] }) : /* @__PURE__ */
|
|
92
|
-
}), S =
|
|
93
|
-
function({ className:
|
|
94
|
-
return /* @__PURE__ */
|
|
59
|
+
!!W && /* @__PURE__ */ e("div", { suppressHydrationWarning: !0, className: g.validation, children: W }),
|
|
60
|
+
!!u && /* @__PURE__ */ e("p", { suppressHydrationWarning: !0, "data-count": u })
|
|
61
|
+
] }) : /* @__PURE__ */ e("div", { ref: v, ...O, ...i });
|
|
62
|
+
}), S = p(
|
|
63
|
+
function({ className: t, ...n }, a) {
|
|
64
|
+
return /* @__PURE__ */ e("div", { className: k(g.affixes, t), ref: a, ...n });
|
|
95
65
|
}
|
|
96
|
-
), T =
|
|
97
|
-
function({ "data-nofilter":
|
|
98
|
-
return /* @__PURE__ */
|
|
66
|
+
), T = p(
|
|
67
|
+
function({ "data-nofilter": t, ...n }, a) {
|
|
68
|
+
return /* @__PURE__ */ e(
|
|
99
69
|
"u-datalist",
|
|
100
70
|
{
|
|
101
|
-
"data-nofilter": !!
|
|
71
|
+
"data-nofilter": !!t || void 0,
|
|
102
72
|
ref: a,
|
|
103
|
-
...N(
|
|
73
|
+
...N(n)
|
|
104
74
|
}
|
|
105
75
|
);
|
|
106
76
|
}
|
|
107
|
-
), q =
|
|
108
|
-
function(
|
|
109
|
-
return /* @__PURE__ */
|
|
77
|
+
), q = p(
|
|
78
|
+
function(t, n) {
|
|
79
|
+
return /* @__PURE__ */ e("u-option", { ref: n, ...N(t) });
|
|
110
80
|
}
|
|
111
|
-
), X =
|
|
81
|
+
), X = p(
|
|
112
82
|
function({
|
|
113
|
-
"data-multiple":
|
|
114
|
-
"data-nofilter":
|
|
83
|
+
"data-multiple": t,
|
|
84
|
+
"data-nofilter": n,
|
|
115
85
|
"data-position": a,
|
|
116
|
-
onAfterChange:
|
|
117
|
-
onAfterSelect:
|
|
86
|
+
onAfterChange: u,
|
|
87
|
+
onAfterSelect: m,
|
|
118
88
|
onBeforeChange: F,
|
|
119
89
|
onBeforeMatch: y,
|
|
120
90
|
onBeforeSelect: H,
|
|
@@ -123,70 +93,70 @@ const P = (i) => typeof i == "string" ? { label: i, value: i } : i, V = m(functi
|
|
|
123
93
|
disabled: D,
|
|
124
94
|
name: h,
|
|
125
95
|
options: C,
|
|
126
|
-
placeholder:
|
|
96
|
+
placeholder: i,
|
|
127
97
|
readOnly: v,
|
|
128
|
-
selected:
|
|
98
|
+
selected: l,
|
|
129
99
|
type: E,
|
|
130
100
|
...W
|
|
131
101
|
}, O) {
|
|
132
|
-
const x = z(null),
|
|
133
|
-
return
|
|
102
|
+
const x = z(null), d = z(f);
|
|
103
|
+
return d.current = f, u && (m = u, console.warn(
|
|
134
104
|
"Combobox onAfterChange is deprecated, use onAfterSelect instead."
|
|
135
105
|
)), F && (H = F, console.warn(
|
|
136
106
|
"Combobox onBeforeChange is deprecated, use onBeforeSelect instead."
|
|
137
107
|
)), K(O, () => x.current), M(() => {
|
|
138
|
-
const
|
|
139
|
-
const L =
|
|
140
|
-
if (!
|
|
141
|
-
|
|
142
|
-
const { isConnected: B, textContent: G, value: w } =
|
|
143
|
-
L?.(B ? R.filter((J) => J.value !== w) :
|
|
108
|
+
const c = x.current, s = (r) => {
|
|
109
|
+
const L = d.current;
|
|
110
|
+
if (!d) return;
|
|
111
|
+
r.preventDefault();
|
|
112
|
+
const { isConnected: B, textContent: G, value: w } = r.detail, A = G?.trim() || "", R = l || [];
|
|
113
|
+
L?.(B ? R.filter((J) => J.value !== w) : t ? [...R, { value: w, label: A }] : [{ value: w, label: A }]);
|
|
144
114
|
};
|
|
145
|
-
return
|
|
146
|
-
}, [
|
|
115
|
+
return c?.addEventListener("comboboxbeforeselect", s), () => c?.removeEventListener("comboboxbeforeselect", s);
|
|
116
|
+
}, [t, l]), /* @__PURE__ */ j(
|
|
147
117
|
"u-combobox",
|
|
148
118
|
{
|
|
149
|
-
"data-multiple":
|
|
119
|
+
"data-multiple": t || void 0,
|
|
150
120
|
...N({
|
|
151
121
|
oncomboboxbeforeselect: H,
|
|
152
122
|
oncomboboxbeforematch: y,
|
|
153
|
-
oncomboboxafterselect:
|
|
123
|
+
oncomboboxafterselect: m,
|
|
154
124
|
ref: x,
|
|
155
125
|
...W
|
|
156
126
|
}),
|
|
157
127
|
children: [
|
|
158
|
-
|
|
128
|
+
l?.map(({ children: c, label: s, value: r }) => /* @__PURE__ */ e("data", { value: r, suppressHydrationWarning: !0, children: c ?? s }, r)),
|
|
159
129
|
b || /* @__PURE__ */ j(I, { children: [
|
|
160
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ e(
|
|
161
131
|
U,
|
|
162
132
|
{
|
|
163
133
|
name: h,
|
|
164
134
|
type: E,
|
|
165
135
|
disabled: D,
|
|
166
136
|
readOnly: v,
|
|
167
|
-
placeholder:
|
|
137
|
+
placeholder: i
|
|
168
138
|
}
|
|
169
139
|
),
|
|
170
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ e("del", { ...N({ "aria-label": "Fjern tekst" }) })
|
|
171
141
|
] }),
|
|
172
|
-
!!C && /* @__PURE__ */
|
|
142
|
+
!!C && /* @__PURE__ */ e(T, { "data-nofilter": n, "data-position": a, children: C.map(P).map(({ children: c, label: s, value: r }) => /* @__PURE__ */ e(q, { value: r, label: s, children: c ?? s }, r)) })
|
|
173
143
|
]
|
|
174
144
|
}
|
|
175
145
|
);
|
|
176
146
|
}
|
|
177
|
-
),
|
|
147
|
+
), oe = Object.assign(V, {
|
|
178
148
|
Affixes: S,
|
|
179
149
|
Combobox: X,
|
|
180
150
|
Datalist: T,
|
|
181
151
|
Option: q,
|
|
182
|
-
Label:
|
|
183
|
-
function(
|
|
184
|
-
return /* @__PURE__ */
|
|
152
|
+
Label: p(
|
|
153
|
+
function(t, n) {
|
|
154
|
+
return /* @__PURE__ */ e("label", { suppressHydrationWarning: !0, ref: n, ...t });
|
|
185
155
|
}
|
|
186
156
|
)
|
|
187
157
|
});
|
|
188
158
|
export {
|
|
189
|
-
|
|
159
|
+
oe as Field,
|
|
190
160
|
V as FieldComp
|
|
191
161
|
};
|
|
192
162
|
//# sourceMappingURL=field.js.map
|