wimui 0.64.11 → 0.64.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/_internal/VisualUppercase.cjs +2 -0
- package/dist/components/_internal/VisualUppercase.d.ts +18 -0
- package/dist/components/_internal/VisualUppercase.js +15 -0
- package/dist/components/_internal/visual-uppercase.module.cjs +2 -0
- package/dist/components/_internal/visual-uppercase.module.js +5 -0
- package/dist/components/ai/CodeBlock/code-block.module.cjs +1 -1
- package/dist/components/ai/CodeBlock/code-block.module.js +1 -1
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.cjs +1 -1
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.js +2 -2
- package/dist/components/data-display/JsonViewer/JsonViewer.cjs +1 -1
- package/dist/components/data-display/JsonViewer/JsonViewer.js +119 -118
- package/dist/components/data-display/JsonViewer/json-viewer.module.cjs +1 -1
- package/dist/components/data-display/JsonViewer/json-viewer.module.js +3 -3
- package/dist/components/form/Select/Select.cjs +1 -1
- package/dist/components/form/Select/Select.js +108 -107
- package/dist/components/form/Select/select.module.cjs +1 -1
- package/dist/components/form/Select/select.module.js +1 -1
- package/dist/components/navigation/CommandPalette/CommandPalette.cjs +1 -1
- package/dist/components/navigation/CommandPalette/CommandPalette.js +10 -14
- package/dist/components/navigation/KeyboardShortcuts/KeyboardShortcuts.cjs +1 -1
- package/dist/components/navigation/KeyboardShortcuts/KeyboardShortcuts.js +34 -33
- package/dist/components/navigation/KeyboardShortcuts/keyboard-shortcuts.module.cjs +1 -1
- package/dist/components/navigation/KeyboardShortcuts/keyboard-shortcuts.module.js +1 -1
- package/dist/components/overlay/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/components/overlay/ContextMenu/ContextMenu.js +12 -16
- package/dist/components/overlay/ContextMenu/context-menu.module.cjs +1 -1
- package/dist/components/overlay/ContextMenu/context-menu.module.js +1 -1
- package/dist/components/overlay/Menu/Menu.cjs +1 -1
- package/dist/components/overlay/Menu/Menu.js +14 -18
- package/dist/llms-full.txt +1 -1
- package/dist/llms.txt +1 -1
- package/dist/styles.css +1 -1
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +2 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const e=require("../layout/VisuallyHidden/VisuallyHidden.cjs"),t=require("./visual-uppercase.module.cjs");let n=require("react/jsx-runtime");var r=({children:r})=>typeof r!=`string`&&typeof r!=`number`?(0,n.jsx)(`span`,{className:t.default.root,children:r}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`span`,{"aria-hidden":`true`,className:t.default.root,children:r}),(0,n.jsx)(e.VisuallyHidden,{children:r})]});exports.VisualUppercase=r;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 見た目だけ大文字にした文字。支援技術には元の大小のまま渡す。
|
|
4
|
+
*
|
|
5
|
+
* `text-transform: uppercase` は見た目の指定だが、Chrome は大文字に変えたあとの文字を名前として
|
|
6
|
+
* 支援技術に渡す(2026-10-31 に実測: Select のグループ見出し「Fruits」が「FRUITS」)。読み上げ
|
|
7
|
+
* ソフトによっては、全部大文字の語を略語とみなして 1 文字ずつ読む。大文字の文字は `aria-hidden` に
|
|
8
|
+
* し、元の文字を隣の `VisuallyHidden` で読ませる。
|
|
9
|
+
*
|
|
10
|
+
* 大文字は、この部品の中の文字だけに当てる。親に `text-transform` を付けると、`VisuallyHidden` の
|
|
11
|
+
* 文字まで大文字になって、元の大小が失われる。
|
|
12
|
+
*
|
|
13
|
+
* 文字列でない中身(要素)は 2 回描かない(id の重複や、操作要素が 2 つになるため)。その場合は
|
|
14
|
+
* 大文字の見た目だけを当て、支援技術にも大文字のまま渡る(以前と同じ)。
|
|
15
|
+
*/
|
|
16
|
+
export declare const VisualUppercase: ({ children }: {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}) => import('react').JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { VisuallyHidden as e } from "../layout/VisuallyHidden/VisuallyHidden.js";
|
|
3
|
+
import t from "./visual-uppercase.module.js";
|
|
4
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/_internal/VisualUppercase.tsx
|
|
6
|
+
var a = ({ children: a }) => typeof a != "string" && typeof a != "number" ? /* @__PURE__ */ r("span", {
|
|
7
|
+
className: t.root,
|
|
8
|
+
children: a
|
|
9
|
+
}) : /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("span", {
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
className: t.root,
|
|
12
|
+
children: a
|
|
13
|
+
}), /* @__PURE__ */ r(e, { children: a })] });
|
|
14
|
+
//#endregion
|
|
15
|
+
export { a as VisualUppercase };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_7316o_29`,t=`_header_7316o_47`,n=`_lang_7316o_55`,r=`_headerActions_7316o_68`,i=`_iconButton_7316o_73`,a=`_copied_7316o_97`,o=`_chevron_7316o_103`,s=`_chevronUp_7316o_106`,c=`_body_7316o_109`,l=`_collapsed_7316o_112`,u=`_pre_7316o_39`,d=`_code_7316o_153`,f=`_line_7316o_156`,p=`_lineNumber_7316o_159`,m=`_lineContent_7316o_168`,h={root:e,header:t,lang:n,headerActions:r,iconButton:i,copied:a,chevron:o,chevronUp:s,body:c,collapsed:l,pre:u,code:d,line:f,lineNumber:p,lineContent:m};exports.body=c,exports.chevron=o,exports.chevronUp=s,exports.code=d,exports.collapsed=l,exports.copied=a,exports.default=h,exports.header=t,exports.headerActions=r,exports.iconButton=i,exports.lang=n,exports.line=f,exports.lineContent=m,exports.lineNumber=p,exports.pre=u,exports.root=e;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/ai/CodeBlock/code-block.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_7316o_29", t = "_header_7316o_47", n = "_lang_7316o_55", r = "_headerActions_7316o_68", i = "_iconButton_7316o_73", a = "_copied_7316o_97", o = "_chevron_7316o_103", s = "_chevronUp_7316o_106", c = "_body_7316o_109", l = "_collapsed_7316o_112", u = "_pre_7316o_39", d = "_code_7316o_153", f = "_line_7316o_156", p = "_lineNumber_7316o_159", m = "_lineContent_7316o_168", h = {
|
|
4
4
|
root: e,
|
|
5
5
|
header: t,
|
|
6
6
|
lang: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_eltqp_29`,t=`_header_eltqp_45`,n=`_headerLeft_eltqp_55`,r=`_filename_eltqp_61`,i=`_viewToggle_eltqp_69`,a=`_viewBtn_eltqp_75`,o=`_active_eltqp_87`,s=`_headerActions_eltqp_101`,c=`_iconButton_eltqp_107`,l=`_copied_eltqp_131`,u=`_actionButton_eltqp_137`,d=`_applyButton_eltqp_157`,f=`_applying_eltqp_166`,p=`_applied_eltqp_170`,m=`_spin_eltqp_179`,h=`_rejectButton_eltqp_187`,g=`_body_eltqp_196`,_=`_unified_eltqp_201`,v=`_row_eltqp_206`,y=`_added_eltqp_209`,b=`_removed_eltqp_212`,x=`_split_eltqp_219`,S=`_splitPane_eltqp_223`,C=`_splitDivider_eltqp_228`,w=`_splitCell_eltqp_233`,T=`_empty_eltqp_243`,E=`_lineNum_eltqp_253`,D=`_prefix_eltqp_268`,O=`_lineContent_eltqp_283`,k={root:e,header:t,headerLeft:n,filename:r,viewToggle:i,viewBtn:a,active:o,headerActions:s,iconButton:c,copied:l,actionButton:u,applyButton:d,applying:f,applied:p,spin:m,"code-spin":`_code-spin_eltqp_1`,rejectButton:h,body:g,unified:_,row:v,added:y,removed:b,split:x,splitPane:S,splitDivider:C,splitCell:w,empty:T,lineNum:E,prefix:D,lineContent:O};exports.actionButton=u,exports.active=o,exports.added=y,exports.applied=p,exports.applyButton=d,exports.applying=f,exports.body=g,exports.copied=l,exports.default=k,exports.empty=T,exports.filename=r,exports.header=t,exports.headerActions=s,exports.headerLeft=n,exports.iconButton=c,exports.lineContent=O,exports.lineNum=E,exports.prefix=D,exports.rejectButton=h,exports.removed=b,exports.root=e,exports.row=v,exports.spin=m,exports.split=x,exports.splitCell=w,exports.splitDivider=C,exports.splitPane=S,exports.unified=_,exports.viewBtn=a,exports.viewToggle=i;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/ai/CodeDiffViewer/code-diff-viewer.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_eltqp_29", t = "_header_eltqp_45", n = "_headerLeft_eltqp_55", r = "_filename_eltqp_61", i = "_viewToggle_eltqp_69", a = "_viewBtn_eltqp_75", o = "_active_eltqp_87", s = "_headerActions_eltqp_101", c = "_iconButton_eltqp_107", l = "_copied_eltqp_131", u = "_actionButton_eltqp_137", d = "_applyButton_eltqp_157", f = "_applying_eltqp_166", p = "_applied_eltqp_170", m = "_spin_eltqp_179", h = "_rejectButton_eltqp_187", g = "_body_eltqp_196", _ = "_unified_eltqp_201", v = "_row_eltqp_206", y = "_added_eltqp_209", b = "_removed_eltqp_212", x = "_split_eltqp_219", S = "_splitPane_eltqp_223", C = "_splitDivider_eltqp_228", w = "_splitCell_eltqp_233", T = "_empty_eltqp_243", E = "_lineNum_eltqp_253", D = "_prefix_eltqp_268", O = "_lineContent_eltqp_283", k = {
|
|
4
4
|
root: e,
|
|
5
5
|
header: t,
|
|
6
6
|
headerLeft: n,
|
|
@@ -16,7 +16,7 @@ var e = "_root_ykmne_29", t = "_header_ykmne_45", n = "_headerLeft_ykmne_55", r
|
|
|
16
16
|
applying: f,
|
|
17
17
|
applied: p,
|
|
18
18
|
spin: m,
|
|
19
|
-
"code-spin": "_code-
|
|
19
|
+
"code-spin": "_code-spin_eltqp_1",
|
|
20
20
|
rejectButton: h,
|
|
21
21
|
body: g,
|
|
22
22
|
unified: _,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../../../icon/chevron-down.cjs"),i=require("../../../icon/chevron-right.cjs"),a=require("../../../icon/plus.cjs"),o=require("../../../icon/trash.cjs"),s=require("../../media/Icon/Icon.cjs"),c=require("../../form/IconButton/IconButton.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../../../icon/chevron-down.cjs"),i=require("../../../icon/chevron-right.cjs"),a=require("../../../icon/plus.cjs"),o=require("../../../icon/trash.cjs"),s=require("../../media/Icon/Icon.cjs"),c=require("../../_internal/VisualUppercase.cjs"),l=require("../../form/IconButton/IconButton.cjs"),u=require("./json-viewer.module.cjs");let d=require("react");d=e.__toESM(d,1);let f=require("classnames");f=e.__toESM(f,1);let p=require("react/jsx-runtime");var m=(e,t,n)=>{if(t.length===0)return n;let[r,...i]=t;if(Array.isArray(e)){let t=[...e];return t[r]=m(e[r],i,n),t}return typeof e==`object`&&e?{...e,[r]:m(e[r],i,n)}:e},h=(e,t)=>{if(t.length===0)return e;let[n,...r]=t;if(t.length===1){if(Array.isArray(e))return e.filter((e,t)=>t!==n);if(typeof e==`object`&&e){let t={...e};return delete t[n],t}return e}if(Array.isArray(e)){let t=[...e];return t[n]=h(e[n],r),t}return typeof e==`object`&&e?{...e,[n]:h(e[n],r)}:e},g=(e,t,n)=>{if(t.length===0)return Array.isArray(e)?[...e,``]:typeof e==`object`&&e?{...e,[n||`new_key`]:``}:e;let[r,...i]=t;if(Array.isArray(e)){let t=[...e];return t[r]=g(e[r],i,n),t}return typeof e==`object`&&e?{...e,[r]:g(e[r],i,n)}:e},_=({value:e,onSave:t,className:n})=>{let[r,i]=(0,d.useState)(!1),[a,o]=(0,d.useState)(String(e)),s=d.default.useRef(null);d.default.useEffect(()=>{r&&s.current&&s.current.focus()},[r]);let c=()=>{i(!1);let n=a;typeof e==`number`&&(n=Number(a)),typeof e==`boolean`&&(n=a===`true`),a===`null`&&(n=null),t(n)};return r?(0,p.jsx)(`input`,{ref:s,className:u.default.input,value:a,onChange:e=>o(e.target.value),onBlur:c,onKeyDown:e=>{e.key===`Enter`&&c(),e.key===`Escape`&&i(!1)}}):(0,p.jsx)(`span`,{role:`button`,tabIndex:0,className:(0,f.default)(u.default.value,n,u.default.editable),onClick:()=>i(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i(!0))},children:typeof e==`string`?`"${e}"`:String(e)})},v=({label:e,value:c,depth:l,currentDepth:m,path:h,editable:g,onUpdate:y,onDelete:b,onAdd:x})=>{let{t:S}=t.useWimTranslation(n.commonNs),[C,w]=(0,d.useState)(m<l),T=typeof c==`object`&&!!c,E=Array.isArray(c),D=()=>w(!C),O=()=>g?(0,p.jsxs)(`div`,{className:u.default.actions,children:[T&&(0,p.jsx)(`button`,{type:`button`,className:u.default.nodeAction,onClick:e=>{e.stopPropagation(),x(h)},title:S(`jsonViewer.addItem`),"aria-label":S(`jsonViewer.addItem`),children:(0,p.jsx)(s.Icon,{component:a.default,size:`xs`})}),m>0&&(0,p.jsx)(`button`,{type:`button`,className:(0,f.default)(u.default.nodeAction,u.default.delete),onClick:e=>{e.stopPropagation(),b(h)},title:S(`jsonViewer.deleteItem`),"aria-label":S(`jsonViewer.deleteItem`),children:(0,p.jsx)(s.Icon,{component:o.default,size:`xs`})})]}):null;if(!T)return(0,p.jsxs)(`div`,{className:u.default.node,children:[e&&(0,p.jsxs)(`span`,{className:u.default.key,children:[e,`:`]}),g?(0,p.jsx)(_,{value:c,onSave:e=>y(h,e),className:u.default[c===null?`null`:typeof c]}):(0,p.jsx)(`span`,{className:(0,f.default)(u.default.value,u.default[c===null?`null`:typeof c]),children:typeof c==`string`?`"${c}"`:String(c)}),O()]});let k=E?c.length===0:Object.keys(c).length===0;return(0,p.jsxs)(`div`,{className:u.default.node,children:[(0,p.jsxs)(`div`,{className:u.default.headerRow,children:[(0,p.jsxs)(`div`,{role:`button`,tabIndex:k?-1:0,className:(0,f.default)(u.default.header,!k&&u.default.collapsible),onClick:k?void 0:D,onKeyDown:e=>{!k&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),D())},children:[!k&&(0,p.jsx)(s.Icon,{component:C?r.default:i.default,size:`sm`,className:u.default.toggle}),e&&(0,p.jsxs)(`span`,{className:u.default.key,children:[e,`:`]}),(0,p.jsx)(`span`,{className:u.default.bracket,children:E?`[`:`{`}),!C&&!k&&(0,p.jsx)(`span`,{className:u.default.ellipsis,children:`...`}),!C&&(0,p.jsx)(`span`,{className:u.default.bracket,children:E?`]`:`}`}),C&&(0,p.jsx)(`span`,{className:u.default.count,children:E?`${c.length} items`:`${Object.keys(c).length} keys`})]}),O()]}),C&&!k&&(0,p.jsx)(`div`,{className:u.default.children,children:E?c.map((e,t)=>(0,p.jsx)(v,{value:e,depth:l,currentDepth:m+1,path:[...h,t],editable:g,onUpdate:y,onDelete:b,onAdd:x},t)):Object.entries(c).map(([e,t])=>(0,p.jsx)(v,{label:e,value:t,depth:l,currentDepth:m+1,path:[...h,e],editable:g,onUpdate:y,onDelete:b,onAdd:x},e))}),C&&(0,p.jsx)(`div`,{className:u.default.footer,children:(0,p.jsx)(`span`,{className:u.default.bracket,children:E?`]`:`}`})})]})},y=d.default.forwardRef(({data:e,expandDepth:r=1,showCopy:i=!0,showToolbar:a=!0,editable:o=!1,onChange:s,className:_,...y},b)=>{let{t:x}=t.useWimTranslation(n.commonNs),[S,C]=(0,d.useState)(e),[w,T]=(0,d.useState)(e),E=(0,d.useId)();e!==w&&(C(e),T(e));let D=(0,d.useCallback)((e,t)=>{C(n=>{let r=m(n,e,t);return s?.(r),r})},[s]),O=(0,d.useCallback)(e=>{C(t=>{let n=h(t,e);return s?.(n),n})},[s]),k=(0,d.useCallback)(e=>{C(t=>{let n=g(t,e);return s?.(n),n})},[s]),A=()=>{navigator.clipboard.writeText(JSON.stringify(S,null,2))};return(0,p.jsxs)(`div`,{ref:b,className:(0,f.default)(`wim-json-viewer`,u.default.root,_),role:a?`group`:void 0,"aria-labelledby":a?E:void 0,...y,children:[a&&(0,p.jsxs)(`div`,{className:u.default.toolbar,children:[(0,p.jsx)(`span`,{id:E,className:u.default.title,children:(0,p.jsx)(c.VisualUppercase,{children:x(o?`jsonViewer.edit`:`jsonViewer.title`)})}),i&&(0,p.jsx)(l.IconButton,{iconName:`CopyIcon`,variant:`ghost`,size:`sm`,onClick:A,"aria-label":x(`jsonViewer.copy`)})]}),(0,p.jsx)(`div`,{className:u.default.tree,children:(0,p.jsx)(v,{value:S,depth:r,currentDepth:0,path:[],editable:o,onUpdate:D,onDelete:O,onAdd:k})})]})});y.displayName=`JsonViewer`,exports.JsonViewer=y;
|
|
@@ -6,24 +6,25 @@ import r from "../../../icon/chevron-right.js";
|
|
|
6
6
|
import i from "../../../icon/plus.js";
|
|
7
7
|
import a from "../../../icon/trash.js";
|
|
8
8
|
import { Icon as o } from "../../media/Icon/Icon.js";
|
|
9
|
-
import {
|
|
10
|
-
import c from "
|
|
11
|
-
import l
|
|
12
|
-
import p from "
|
|
13
|
-
import
|
|
9
|
+
import { VisualUppercase as s } from "../../_internal/VisualUppercase.js";
|
|
10
|
+
import { IconButton as c } from "../../form/IconButton/IconButton.js";
|
|
11
|
+
import l from "./json-viewer.module.js";
|
|
12
|
+
import u, { useCallback as d, useId as f, useState as p } from "react";
|
|
13
|
+
import m from "classnames";
|
|
14
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
14
15
|
//#region src/components/data-display/JsonViewer/JsonViewer.tsx
|
|
15
|
-
var
|
|
16
|
+
var _ = (e, t, n) => {
|
|
16
17
|
if (t.length === 0) return n;
|
|
17
18
|
let [r, ...i] = t;
|
|
18
19
|
if (Array.isArray(e)) {
|
|
19
20
|
let t = [...e];
|
|
20
|
-
return t[r] =
|
|
21
|
+
return t[r] = _(e[r], i, n), t;
|
|
21
22
|
}
|
|
22
23
|
return typeof e == "object" && e ? {
|
|
23
24
|
...e,
|
|
24
|
-
[r]:
|
|
25
|
+
[r]: _(e[r], i, n)
|
|
25
26
|
} : e;
|
|
26
|
-
},
|
|
27
|
+
}, v = (e, t) => {
|
|
27
28
|
if (t.length === 0) return e;
|
|
28
29
|
let [n, ...r] = t;
|
|
29
30
|
if (t.length === 1) {
|
|
@@ -36,13 +37,13 @@ var g = (e, t, n) => {
|
|
|
36
37
|
}
|
|
37
38
|
if (Array.isArray(e)) {
|
|
38
39
|
let t = [...e];
|
|
39
|
-
return t[n] =
|
|
40
|
+
return t[n] = v(e[n], r), t;
|
|
40
41
|
}
|
|
41
42
|
return typeof e == "object" && e ? {
|
|
42
43
|
...e,
|
|
43
|
-
[n]:
|
|
44
|
+
[n]: v(e[n], r)
|
|
44
45
|
} : e;
|
|
45
|
-
},
|
|
46
|
+
}, y = (e, t, n) => {
|
|
46
47
|
if (t.length === 0) return Array.isArray(e) ? [...e, ""] : typeof e == "object" && e ? {
|
|
47
48
|
...e,
|
|
48
49
|
[n || "new_key"]: ""
|
|
@@ -50,218 +51,218 @@ var g = (e, t, n) => {
|
|
|
50
51
|
let [r, ...i] = t;
|
|
51
52
|
if (Array.isArray(e)) {
|
|
52
53
|
let t = [...e];
|
|
53
|
-
return t[r] =
|
|
54
|
+
return t[r] = y(e[r], i, n), t;
|
|
54
55
|
}
|
|
55
56
|
return typeof e == "object" && e ? {
|
|
56
57
|
...e,
|
|
57
|
-
[r]:
|
|
58
|
+
[r]: y(e[r], i, n)
|
|
58
59
|
} : e;
|
|
59
|
-
},
|
|
60
|
-
let [r, i] =
|
|
61
|
-
|
|
60
|
+
}, b = ({ value: e, onSave: t, className: n }) => {
|
|
61
|
+
let [r, i] = p(!1), [a, o] = p(String(e)), s = u.useRef(null);
|
|
62
|
+
u.useEffect(() => {
|
|
62
63
|
r && s.current && s.current.focus();
|
|
63
64
|
}, [r]);
|
|
64
|
-
let
|
|
65
|
+
let c = () => {
|
|
65
66
|
i(!1);
|
|
66
67
|
let n = a;
|
|
67
68
|
typeof e == "number" && (n = Number(a)), typeof e == "boolean" && (n = a === "true"), a === "null" && (n = null), t(n);
|
|
68
69
|
};
|
|
69
|
-
return r ? /* @__PURE__ */
|
|
70
|
+
return r ? /* @__PURE__ */ h("input", {
|
|
70
71
|
ref: s,
|
|
71
|
-
className:
|
|
72
|
+
className: l.input,
|
|
72
73
|
value: a,
|
|
73
74
|
onChange: (e) => o(e.target.value),
|
|
74
|
-
onBlur:
|
|
75
|
+
onBlur: c,
|
|
75
76
|
onKeyDown: (e) => {
|
|
76
|
-
e.key === "Enter" &&
|
|
77
|
+
e.key === "Enter" && c(), e.key === "Escape" && i(!1);
|
|
77
78
|
}
|
|
78
|
-
}) : /* @__PURE__ */
|
|
79
|
+
}) : /* @__PURE__ */ h("span", {
|
|
79
80
|
role: "button",
|
|
80
81
|
tabIndex: 0,
|
|
81
|
-
className:
|
|
82
|
+
className: m(l.value, n, l.editable),
|
|
82
83
|
onClick: () => i(!0),
|
|
83
84
|
onKeyDown: (e) => {
|
|
84
85
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i(!0));
|
|
85
86
|
},
|
|
86
87
|
children: typeof e == "string" ? `"${e}"` : String(e)
|
|
87
88
|
});
|
|
88
|
-
},
|
|
89
|
-
let { t: C } = e(t), [w, T] =
|
|
90
|
-
className:
|
|
91
|
-
children: [E && /* @__PURE__ */
|
|
89
|
+
}, x = ({ label: s, value: c, depth: u, currentDepth: d, path: f, editable: _, onUpdate: v, onDelete: y, onAdd: S }) => {
|
|
90
|
+
let { t: C } = e(t), [w, T] = p(d < u), E = typeof c == "object" && !!c, D = Array.isArray(c), O = () => T(!w), k = () => _ ? /* @__PURE__ */ g("div", {
|
|
91
|
+
className: l.actions,
|
|
92
|
+
children: [E && /* @__PURE__ */ h("button", {
|
|
92
93
|
type: "button",
|
|
93
|
-
className:
|
|
94
|
+
className: l.nodeAction,
|
|
94
95
|
onClick: (e) => {
|
|
95
|
-
e.stopPropagation(), S(
|
|
96
|
+
e.stopPropagation(), S(f);
|
|
96
97
|
},
|
|
97
98
|
title: C("jsonViewer.addItem"),
|
|
98
99
|
"aria-label": C("jsonViewer.addItem"),
|
|
99
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ h(o, {
|
|
100
101
|
component: i,
|
|
101
102
|
size: "xs"
|
|
102
103
|
})
|
|
103
|
-
}), d > 0 && /* @__PURE__ */
|
|
104
|
+
}), d > 0 && /* @__PURE__ */ h("button", {
|
|
104
105
|
type: "button",
|
|
105
|
-
className:
|
|
106
|
+
className: m(l.nodeAction, l.delete),
|
|
106
107
|
onClick: (e) => {
|
|
107
|
-
e.stopPropagation(),
|
|
108
|
+
e.stopPropagation(), y(f);
|
|
108
109
|
},
|
|
109
110
|
title: C("jsonViewer.deleteItem"),
|
|
110
111
|
"aria-label": C("jsonViewer.deleteItem"),
|
|
111
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ h(o, {
|
|
112
113
|
component: a,
|
|
113
114
|
size: "xs"
|
|
114
115
|
})
|
|
115
116
|
})]
|
|
116
117
|
}) : null;
|
|
117
|
-
if (!E) return /* @__PURE__ */
|
|
118
|
-
className:
|
|
118
|
+
if (!E) return /* @__PURE__ */ g("div", {
|
|
119
|
+
className: l.node,
|
|
119
120
|
children: [
|
|
120
|
-
s && /* @__PURE__ */
|
|
121
|
-
className:
|
|
121
|
+
s && /* @__PURE__ */ g("span", {
|
|
122
|
+
className: l.key,
|
|
122
123
|
children: [s, ":"]
|
|
123
124
|
}),
|
|
124
|
-
_ ? /* @__PURE__ */
|
|
125
|
-
value:
|
|
126
|
-
onSave: (e) => v(
|
|
127
|
-
className: c
|
|
128
|
-
}) : /* @__PURE__ */
|
|
129
|
-
className:
|
|
130
|
-
children: typeof
|
|
125
|
+
_ ? /* @__PURE__ */ h(b, {
|
|
126
|
+
value: c,
|
|
127
|
+
onSave: (e) => v(f, e),
|
|
128
|
+
className: l[c === null ? "null" : typeof c]
|
|
129
|
+
}) : /* @__PURE__ */ h("span", {
|
|
130
|
+
className: m(l.value, l[c === null ? "null" : typeof c]),
|
|
131
|
+
children: typeof c == "string" ? `"${c}"` : String(c)
|
|
131
132
|
}),
|
|
132
133
|
k()
|
|
133
134
|
]
|
|
134
135
|
});
|
|
135
|
-
let A = D ?
|
|
136
|
-
return /* @__PURE__ */
|
|
137
|
-
className:
|
|
136
|
+
let A = D ? c.length === 0 : Object.keys(c).length === 0;
|
|
137
|
+
return /* @__PURE__ */ g("div", {
|
|
138
|
+
className: l.node,
|
|
138
139
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
className:
|
|
141
|
-
children: [/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ g("div", {
|
|
141
|
+
className: l.headerRow,
|
|
142
|
+
children: [/* @__PURE__ */ g("div", {
|
|
142
143
|
role: "button",
|
|
143
144
|
tabIndex: A ? -1 : 0,
|
|
144
|
-
className:
|
|
145
|
+
className: m(l.header, !A && l.collapsible),
|
|
145
146
|
onClick: A ? void 0 : O,
|
|
146
147
|
onKeyDown: (e) => {
|
|
147
148
|
!A && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), O());
|
|
148
149
|
},
|
|
149
150
|
children: [
|
|
150
|
-
!A && /* @__PURE__ */
|
|
151
|
+
!A && /* @__PURE__ */ h(o, {
|
|
151
152
|
component: w ? n : r,
|
|
152
153
|
size: "sm",
|
|
153
|
-
className:
|
|
154
|
+
className: l.toggle
|
|
154
155
|
}),
|
|
155
|
-
s && /* @__PURE__ */
|
|
156
|
-
className:
|
|
156
|
+
s && /* @__PURE__ */ g("span", {
|
|
157
|
+
className: l.key,
|
|
157
158
|
children: [s, ":"]
|
|
158
159
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
className:
|
|
160
|
+
/* @__PURE__ */ h("span", {
|
|
161
|
+
className: l.bracket,
|
|
161
162
|
children: D ? "[" : "{"
|
|
162
163
|
}),
|
|
163
|
-
!w && !A && /* @__PURE__ */
|
|
164
|
-
className:
|
|
164
|
+
!w && !A && /* @__PURE__ */ h("span", {
|
|
165
|
+
className: l.ellipsis,
|
|
165
166
|
children: "..."
|
|
166
167
|
}),
|
|
167
|
-
!w && /* @__PURE__ */
|
|
168
|
-
className:
|
|
168
|
+
!w && /* @__PURE__ */ h("span", {
|
|
169
|
+
className: l.bracket,
|
|
169
170
|
children: D ? "]" : "}"
|
|
170
171
|
}),
|
|
171
|
-
w && /* @__PURE__ */
|
|
172
|
-
className:
|
|
173
|
-
children: D ? `${
|
|
172
|
+
w && /* @__PURE__ */ h("span", {
|
|
173
|
+
className: l.count,
|
|
174
|
+
children: D ? `${c.length} items` : `${Object.keys(c).length} keys`
|
|
174
175
|
})
|
|
175
176
|
]
|
|
176
177
|
}), k()]
|
|
177
178
|
}),
|
|
178
|
-
w && !A && /* @__PURE__ */
|
|
179
|
-
className:
|
|
180
|
-
children: D ?
|
|
179
|
+
w && !A && /* @__PURE__ */ h("div", {
|
|
180
|
+
className: l.children,
|
|
181
|
+
children: D ? c.map((e, t) => /* @__PURE__ */ h(x, {
|
|
181
182
|
value: e,
|
|
182
183
|
depth: u,
|
|
183
184
|
currentDepth: d + 1,
|
|
184
|
-
path: [...
|
|
185
|
+
path: [...f, t],
|
|
185
186
|
editable: _,
|
|
186
187
|
onUpdate: v,
|
|
187
|
-
onDelete:
|
|
188
|
+
onDelete: y,
|
|
188
189
|
onAdd: S
|
|
189
|
-
}, t)) : Object.entries(
|
|
190
|
+
}, t)) : Object.entries(c).map(([e, t]) => /* @__PURE__ */ h(x, {
|
|
190
191
|
label: e,
|
|
191
192
|
value: t,
|
|
192
193
|
depth: u,
|
|
193
194
|
currentDepth: d + 1,
|
|
194
|
-
path: [...
|
|
195
|
+
path: [...f, e],
|
|
195
196
|
editable: _,
|
|
196
197
|
onUpdate: v,
|
|
197
|
-
onDelete:
|
|
198
|
+
onDelete: y,
|
|
198
199
|
onAdd: S
|
|
199
200
|
}, e))
|
|
200
201
|
}),
|
|
201
|
-
w && /* @__PURE__ */
|
|
202
|
-
className:
|
|
203
|
-
children: /* @__PURE__ */
|
|
204
|
-
className:
|
|
202
|
+
w && /* @__PURE__ */ h("div", {
|
|
203
|
+
className: l.footer,
|
|
204
|
+
children: /* @__PURE__ */ h("span", {
|
|
205
|
+
className: l.bracket,
|
|
205
206
|
children: D ? "]" : "}"
|
|
206
207
|
})
|
|
207
208
|
})
|
|
208
209
|
]
|
|
209
210
|
});
|
|
210
|
-
},
|
|
211
|
-
let { t:
|
|
212
|
-
n !==
|
|
213
|
-
let
|
|
214
|
-
|
|
215
|
-
let r =
|
|
216
|
-
return
|
|
211
|
+
}, S = u.forwardRef(({ data: n, expandDepth: r = 1, showCopy: i = !0, showToolbar: a = !0, editable: o = !1, onChange: u, className: b, ...S }, C) => {
|
|
212
|
+
let { t: w } = e(t), [T, E] = p(n), [D, O] = p(n), k = f();
|
|
213
|
+
n !== D && (E(n), O(n));
|
|
214
|
+
let A = d((e, t) => {
|
|
215
|
+
E((n) => {
|
|
216
|
+
let r = _(n, e, t);
|
|
217
|
+
return u?.(r), r;
|
|
217
218
|
});
|
|
218
|
-
}, [
|
|
219
|
-
|
|
220
|
-
let n = _(t, e);
|
|
221
|
-
return l?.(n), n;
|
|
222
|
-
});
|
|
223
|
-
}, [l]), j = u((e) => {
|
|
224
|
-
T((t) => {
|
|
219
|
+
}, [u]), j = d((e) => {
|
|
220
|
+
E((t) => {
|
|
225
221
|
let n = v(t, e);
|
|
226
|
-
return
|
|
222
|
+
return u?.(n), n;
|
|
223
|
+
});
|
|
224
|
+
}, [u]), M = d((e) => {
|
|
225
|
+
E((t) => {
|
|
226
|
+
let n = y(t, e);
|
|
227
|
+
return u?.(n), n;
|
|
227
228
|
});
|
|
228
|
-
}, [
|
|
229
|
-
navigator.clipboard.writeText(JSON.stringify(
|
|
229
|
+
}, [u]), N = () => {
|
|
230
|
+
navigator.clipboard.writeText(JSON.stringify(T, null, 2));
|
|
230
231
|
};
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
ref:
|
|
233
|
-
className:
|
|
232
|
+
return /* @__PURE__ */ g("div", {
|
|
233
|
+
ref: C,
|
|
234
|
+
className: m("wim-json-viewer", l.root, b),
|
|
234
235
|
role: a ? "group" : void 0,
|
|
235
|
-
"aria-labelledby": a ?
|
|
236
|
-
...
|
|
237
|
-
children: [a && /* @__PURE__ */
|
|
238
|
-
className:
|
|
239
|
-
children: [/* @__PURE__ */
|
|
240
|
-
id:
|
|
241
|
-
className:
|
|
242
|
-
children:
|
|
243
|
-
}), i && /* @__PURE__ */
|
|
236
|
+
"aria-labelledby": a ? k : void 0,
|
|
237
|
+
...S,
|
|
238
|
+
children: [a && /* @__PURE__ */ g("div", {
|
|
239
|
+
className: l.toolbar,
|
|
240
|
+
children: [/* @__PURE__ */ h("span", {
|
|
241
|
+
id: k,
|
|
242
|
+
className: l.title,
|
|
243
|
+
children: /* @__PURE__ */ h(s, { children: w(o ? "jsonViewer.edit" : "jsonViewer.title") })
|
|
244
|
+
}), i && /* @__PURE__ */ h(c, {
|
|
244
245
|
iconName: "CopyIcon",
|
|
245
246
|
variant: "ghost",
|
|
246
247
|
size: "sm",
|
|
247
|
-
onClick:
|
|
248
|
-
"aria-label":
|
|
248
|
+
onClick: N,
|
|
249
|
+
"aria-label": w("jsonViewer.copy")
|
|
249
250
|
})]
|
|
250
|
-
}), /* @__PURE__ */
|
|
251
|
-
className:
|
|
252
|
-
children: /* @__PURE__ */
|
|
253
|
-
value:
|
|
251
|
+
}), /* @__PURE__ */ h("div", {
|
|
252
|
+
className: l.tree,
|
|
253
|
+
children: /* @__PURE__ */ h(x, {
|
|
254
|
+
value: T,
|
|
254
255
|
depth: r,
|
|
255
256
|
currentDepth: 0,
|
|
256
257
|
path: [],
|
|
257
258
|
editable: o,
|
|
258
|
-
onUpdate:
|
|
259
|
-
onDelete:
|
|
260
|
-
onAdd:
|
|
259
|
+
onUpdate: A,
|
|
260
|
+
onDelete: j,
|
|
261
|
+
onAdd: M
|
|
261
262
|
})
|
|
262
263
|
})]
|
|
263
264
|
});
|
|
264
265
|
});
|
|
265
|
-
|
|
266
|
+
S.displayName = "JsonViewer";
|
|
266
267
|
//#endregion
|
|
267
|
-
export {
|
|
268
|
+
export { S as JsonViewer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_tsq15_29`,t=`_toolbar_tsq15_43`,n=`_title_tsq15_51`,r=`_tree_tsq15_57`,i=`_node_tsq15_62`,a=`_actions_tsq15_68`,o=`_headerRow_tsq15_68`,s=`_header_tsq15_68`,c=`_collapsible_tsq15_86`,l=`_toggle_tsq15_89`,u=`_nodeAction_tsq15_103`,d=`_input_tsq15_129`,f=`_keyInput_tsq15_140`,p=`_children_tsq15_147`,m=`_footer_tsq15_151`,h=`_key_tsq15_140`,g=`_value_tsq15_158`,_=`_string_tsq15_158`,v=`_number_tsq15_161`,y=`_boolean_tsq15_164`,b=`_editable_tsq15_171`,x=`_bracket_tsq15_191`,S=`_count_tsq15_195`,C=`_ellipsis_tsq15_200`,w={root:e,toolbar:t,title:n,tree:r,node:i,actions:a,headerRow:o,header:s,collapsible:c,toggle:l,nodeAction:u,delete:`_delete_tsq15_125`,input:d,keyInput:f,children:p,footer:m,key:h,value:g,string:_,number:v,boolean:y,null:`_null_tsq15_167`,editable:b,bracket:x,count:S,ellipsis:C};exports.actions=a,exports.boolean=y,exports.bracket=x,exports.children=p,exports.collapsible=c,exports.count=S,exports.default=w,exports.editable=b,exports.ellipsis=C,exports.footer=m,exports.header=s,exports.headerRow=o,exports.input=d,exports.key=h,exports.keyInput=f,exports.node=i,exports.nodeAction=u,exports.number=v,exports.root=e,exports.string=_,exports.title=n,exports.toggle=l,exports.toolbar=t,exports.tree=r,exports.value=g;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/data-display/JsonViewer/json-viewer.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_tsq15_29", t = "_toolbar_tsq15_43", n = "_title_tsq15_51", r = "_tree_tsq15_57", i = "_node_tsq15_62", a = "_actions_tsq15_68", o = "_headerRow_tsq15_68", s = "_header_tsq15_68", c = "_collapsible_tsq15_86", l = "_toggle_tsq15_89", u = "_nodeAction_tsq15_103", d = "_input_tsq15_129", f = "_keyInput_tsq15_140", p = "_children_tsq15_147", m = "_footer_tsq15_151", h = "_key_tsq15_140", g = "_value_tsq15_158", _ = "_string_tsq15_158", v = "_number_tsq15_161", y = "_boolean_tsq15_164", b = "_editable_tsq15_171", x = "_bracket_tsq15_191", S = "_count_tsq15_195", C = "_ellipsis_tsq15_200", w = {
|
|
4
4
|
root: e,
|
|
5
5
|
toolbar: t,
|
|
6
6
|
title: n,
|
|
@@ -12,7 +12,7 @@ var e = "_root_9em6h_29", t = "_toolbar_9em6h_43", n = "_title_9em6h_51", r = "_
|
|
|
12
12
|
collapsible: c,
|
|
13
13
|
toggle: l,
|
|
14
14
|
nodeAction: u,
|
|
15
|
-
delete: "
|
|
15
|
+
delete: "_delete_tsq15_125",
|
|
16
16
|
input: d,
|
|
17
17
|
keyInput: f,
|
|
18
18
|
children: p,
|
|
@@ -22,7 +22,7 @@ var e = "_root_9em6h_29", t = "_toolbar_9em6h_43", n = "_title_9em6h_51", r = "_
|
|
|
22
22
|
string: _,
|
|
23
23
|
number: v,
|
|
24
24
|
boolean: y,
|
|
25
|
-
null: "
|
|
25
|
+
null: "_null_tsq15_167",
|
|
26
26
|
editable: b,
|
|
27
27
|
bracket: x,
|
|
28
28
|
count: S,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../_internal/BaseListItem/BaseListItem.cjs"),a=require("../InputBase/InputBase.cjs"),o=require("../../_internal/useInlineFloating.cjs"),s=require("../../../i18n/generated/form.cjs"),c=require("../FieldTemplate/FieldTemplate.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../_internal/BaseListItem/BaseListItem.cjs"),a=require("../InputBase/InputBase.cjs"),o=require("../../_internal/useInlineFloating.cjs"),s=require("../../../i18n/generated/form.cjs"),c=require("../FieldTemplate/FieldTemplate.cjs"),l=require("../../_internal/mergeRefs.cjs"),u=require("./select.module.cjs"),ee=require("./useSelect.cjs"),d=require("../../_internal/VisualUppercase.cjs");let f=require("react");f=e.__toESM(f,1);let p=require("classnames");p=e.__toESM(p,1);let m=require("react/jsx-runtime");var h=(0,f.forwardRef)(({options:e=[],value:h,onChange:g,placeholder:_,label:v,error:y,required:b,layout:te,className:x,disabled:S=!1,defaultValue:ne,searchable:C=!1,searchPlaceholder:w,filterOption:T,grouped:E=!1,allowClear:re=!1,fullWidth:D=!1,intent:ie=`default`,id:ae,noOptionsFoundLabel:oe,width:se,styles:O,asChild:ce=!1,children:le,...ue},k)=>{let{t:de}=n.useWimTranslation(s.formNs),fe=(0,f.useId)(),A=ae||`wim-select-${fe}`,j=v?`${A}-label`:void 0,M=y?`${A}-error`:void 0,N=`${A}-list`,P=`${A}-trigger`,F=y?`danger`:ie,{isOpen:I,searchValue:L,setSearchValue:R,focusedIndex:z,setFocusedIndex:B,isKeyboardNavigating:pe,setIsKeyboardNavigating:me,containerRef:V,triggerRef:he,searchInputRef:ge,listItemsRef:H,currentValue:U,filteredOptions:W,selectedOption:G,focusedOption:K,handleToggle:_e,handleSelect:q,handleClear:ve,handleKeyDown:J}=ee.useSelect({options:e,value:h,onChange:g,defaultValue:ne,searchable:C,grouped:E,disabled:S,filterOption:T}),{setReference:Y,setFloating:X,floatingProps:ye}=o.useInlineFloating({open:I&&!S}),be=(0,f.useMemo)(()=>l.mergeRefs(V,k,Y),[V,k,Y]),xe=()=>{let t=0;return E&&e.length>0&&`options`in e[0]?e.map((e,n)=>{let r=e.options.filter(e=>e.type===`separator`||!L||(T||((e,t)=>(typeof e.label==`string`?e.label:``).toLowerCase().includes(t.toLowerCase())))(e,L));return r.length===0?null:(0,m.jsxs)(f.default.Fragment,{children:[(0,m.jsx)(`li`,{className:(0,p.default)(u.default.groupLabel,O?.groupLabel),role:`presentation`,children:(0,m.jsx)(d.VisualUppercase,{children:e.label})}),r.map((e,r)=>{let a=t++;if(e.type===`separator`)return(0,m.jsx)(`li`,{className:(0,p.default)(u.default.separator,O?.separator),role:`presentation`},`sep-${n}-${r}`);let o=a===z,s=U===e.value,c=`wim-select-option-${A}-${e.value}`;return(0,m.jsx)(i.BaseListItem,{asChild:!0,id:c,ref:e=>{H.current[a]=e},active:o,disabled:e.disabled,className:(0,p.default)(u.default.option,s&&u.default.selected,O?.option),onClick:t=>{t.stopPropagation(),q(e)},onMouseEnter:()=>B(a),role:`option`,"aria-selected":s,children:(0,m.jsx)(`li`,{children:e.label})},e.value)})]},n)}):W.map((e,n)=>{let r=t++;if(e.type===`separator`)return(0,m.jsx)(`li`,{className:(0,p.default)(u.default.separator,O?.separator),role:`presentation`},`sep-${n}`);let a=r===z,o=U===e.value,s=`wim-select-option-${A}-${e.value}`;return(0,m.jsx)(i.BaseListItem,{asChild:!0,id:s,ref:e=>{H.current[r]=e},active:a,disabled:e.disabled,className:(0,p.default)(u.default.option,o&&u.default.selected,O?.option),onClick:t=>{t.stopPropagation(),q(e)},onMouseEnter:()=>B(r),role:`option`,"aria-selected":o,children:(0,m.jsx)(`li`,{children:e.label})},e.value)})},Z=K&&K.type!==`separator`?`wim-select-option-${A}-${K.value}`:void 0,{"aria-label":Q,"aria-labelledby":$,"aria-describedby":Se,...Ce}=ue;return(0,m.jsx)(c.FieldTemplate,{label:v,error:y,required:b,layout:te,labelId:j,htmlFor:P,errorId:M,className:x,children:(0,m.jsxs)(ce?t.Root:`div`,{className:(0,p.default)(`wim-select`,u.default.root,D&&u.default.fullWidth,O?.root),ref:be,onMouseMove:()=>me(!1),"data-keyboard-nav":pe,...Ce,children:[(0,m.jsx)(a.InputBase,{disabled:S,allowClear:re,hasValue:!!U,onClear:ve,intent:F,rightIcons:[{name:`ChevronDownIcon`,rotated:I}],width:se,fullWidth:D,styles:O?.inputBase,children:(0,m.jsx)(`div`,{id:P,className:(0,p.default)(u.default.trigger,I&&u.default.open,S&&u.default.disabled,O?.trigger),onClick:_e,onKeyDown:J,tabIndex:S?-1:0,role:`combobox`,"aria-expanded":I,"aria-haspopup":`listbox`,"aria-controls":I?N:void 0,"aria-disabled":S,"aria-labelledby":j||$,"aria-label":v?void 0:typeof Q==`string`?Q:typeof _==`string`?_:void 0,"aria-describedby":M||Se,"aria-required":b?`true`:void 0,"aria-invalid":F===`danger`?`true`:`false`,"aria-activedescendant":I?Z:void 0,ref:he,children:(0,m.jsx)(`div`,{className:(0,p.default)(u.default.value,!G&&u.default.placeholder,O?.value),children:G?G.label:_})})}),(0,m.jsxs)(r.Transition,{show:I&&!S,preset:`fade`,className:(0,p.default)(u.default.dropdown,O?.dropdown),ref:X,...ye,children:[C&&(0,m.jsx)(`div`,{className:(0,p.default)(u.default.search,O?.search),children:(0,m.jsx)(`input`,{ref:ge,type:`text`,className:(0,p.default)(u.default.searchInput,O?.searchInput),placeholder:w,value:L,onChange:e=>{R(e.target.value),B(-1)},onClick:e=>e.stopPropagation(),onKeyDown:J,"aria-label":w,"aria-controls":N,"aria-activedescendant":Z})}),(0,m.jsx)(`ul`,{id:N,className:(0,p.default)(u.default.list,O?.list),role:`listbox`,"aria-labelledby":v?j:$||void 0,children:W.length===0?(0,m.jsx)(`li`,{className:(0,p.default)(u.default.empty,O?.empty),role:`option`,"aria-selected":`false`,children:oe??de(`select.no_options`)}):xe()})]}),(0,m.jsx)(t.Slottable,{children:le})]})})});h.displayName=`Select`,exports.Select=h,exports.default=h;
|