wimui 0.58.0 → 0.58.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.
|
@@ -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("../FieldTemplate/FieldTemplate.cjs"),i=require("../Input/Input.cjs"),a=require("../IconButton/IconButton.cjs"),o=require("./inline-edit.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=s.default.forwardRef(({value:e,defaultValue:u,onChange:d,onSave:f,onCancel:p,onEdit:m,placeholder:h,disabled:g=!1,fullWidth:_=!1,label:v,className:y,"aria-label":b,"aria-labelledby":x,"aria-describedby":S,...C},w)=>{let{t:T}=t.useWimTranslation(n.commonNs),[E,D]=(0,s.useState)(!1),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../FieldTemplate/FieldTemplate.cjs"),i=require("../Input/Input.cjs"),a=require("../IconButton/IconButton.cjs"),o=require("./inline-edit.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=s.default.forwardRef(({value:e,defaultValue:u,onChange:d,onSave:f,onCancel:p,onEdit:m,placeholder:h,disabled:g=!1,fullWidth:_=!1,label:v,className:y,"aria-label":b,"aria-labelledby":x,"aria-describedby":S,...C},w)=>{let{t:T}=t.useWimTranslation(n.commonNs),[E,D]=(0,s.useState)(!1),O=(0,s.useId)(),k=v?`wim-inline-edit-${O}-label`:void 0,A=`wim-inline-edit-${O}-text`,[j,M]=(0,s.useState)(u??``),[N,P]=(0,s.useState)(u??``),F=(0,s.useRef)(null),I=e!==void 0,L=I?e:N,R=()=>{g||(I||P(j),D(!0),m?.())},z=()=>{g||(I||M(L),D(!1),f?.(L))},B=()=>{g||(I||P(j),D(!1),p?.())},V=e=>{let t=e.target.value;I||P(t),d?.(t)},H=e=>{e.key===`Enter`?(e.preventDefault(),z()):e.key===`Escape`&&(e.preventDefault(),B())};return(0,s.useEffect)(()=>{E&&F.current&&F.current.focus()},[E]),(0,l.jsx)(r.FieldTemplate,{label:v,labelId:k,className:y,children:(0,l.jsx)(`div`,{ref:w,className:(0,c.default)(`wim-inline-edit`,o.default.root,_&&o.default.fullWidth,g&&o.default.disabled),...C,children:E?(0,l.jsxs)(`div`,{className:o.default.editWrapper,children:[(0,l.jsx)(i.Input,{ref:F,value:L,onChange:V,onKeyDown:H,disabled:g,placeholder:h,"aria-label":k?void 0:b,"aria-labelledby":k??x,"aria-describedby":S,fullWidth:_,className:o.default.input}),(0,l.jsxs)(`div`,{className:o.default.editActions,children:[(0,l.jsx)(a.IconButton,{iconName:`CheckIcon`,intent:`success`,variant:`outline`,"aria-label":T(`action.save`),onClick:z,disabled:g}),(0,l.jsx)(a.IconButton,{iconName:`CloseIcon`,intent:`default`,variant:`outline`,"aria-label":T(`action.cancel`),onClick:B,disabled:g})]})]}):(0,l.jsxs)(`div`,{className:o.default.preview,onClick:R,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),R())},tabIndex:g?-1:0,role:`button`,"aria-label":k?void 0:b,"aria-labelledby":k?`${k} ${A}`:x,"aria-describedby":S,"aria-disabled":g,children:[(0,l.jsx)(`span`,{id:A,className:(0,c.default)(o.default.text,!L&&o.default.placeholder),children:L||h||`\xA0`}),(0,l.jsx)(`span`,{className:o.default.editIconWrapper,children:(0,l.jsx)(a.IconButton,{iconName:`EditIcon`,variant:`ghost`,size:`sm`,tabIndex:-1,"aria-label":T(`action.edit`),"aria-hidden":`true`,asChild:!0,children:(0,l.jsx)(`span`,{})})})]})})})});u.displayName=`InlineEdit`,exports.InlineEdit=u;
|
|
@@ -5,96 +5,98 @@ import { FieldTemplate as n } from "../FieldTemplate/FieldTemplate.js";
|
|
|
5
5
|
import { Input as r } from "../Input/Input.js";
|
|
6
6
|
import { IconButton as i } from "../IconButton/IconButton.js";
|
|
7
7
|
import a from "./inline-edit.module.js";
|
|
8
|
-
import o, { useEffect as s,
|
|
9
|
-
import
|
|
10
|
-
import { jsx as
|
|
8
|
+
import o, { useEffect as s, useId as c, useRef as l, useState as u } from "react";
|
|
9
|
+
import d from "classnames";
|
|
10
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/form/InlineEdit/InlineEdit.tsx
|
|
12
|
-
var
|
|
13
|
-
let { t:
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
},
|
|
12
|
+
var m = o.forwardRef(({ value: o, defaultValue: m, onChange: h, onSave: g, onCancel: _, onEdit: v, placeholder: y, disabled: b = !1, fullWidth: x = !1, label: S, className: C, "aria-label": w, "aria-labelledby": T, "aria-describedby": E, ...D }, O) => {
|
|
13
|
+
let { t: k } = e(t), [A, j] = u(!1), M = c(), N = S ? `wim-inline-edit-${M}-label` : void 0, P = `wim-inline-edit-${M}-text`, [F, I] = u(m ?? ""), [L, R] = u(m ?? ""), z = l(null), B = o !== void 0, V = B ? o : L, H = () => {
|
|
14
|
+
b || (B || R(F), j(!0), v?.());
|
|
15
|
+
}, U = () => {
|
|
16
|
+
b || (B || I(V), j(!1), g?.(V));
|
|
17
|
+
}, W = () => {
|
|
18
|
+
b || (B || R(F), j(!1), _?.());
|
|
19
|
+
}, G = (e) => {
|
|
20
20
|
let t = e.target.value;
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
e.key === "Enter" ? (e.preventDefault(),
|
|
21
|
+
B || R(t), h?.(t);
|
|
22
|
+
}, K = (e) => {
|
|
23
|
+
e.key === "Enter" ? (e.preventDefault(), U()) : e.key === "Escape" && (e.preventDefault(), W());
|
|
24
24
|
};
|
|
25
25
|
return s(() => {
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
label:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
A && z.current && z.current.focus();
|
|
27
|
+
}, [A]), /* @__PURE__ */ f(n, {
|
|
28
|
+
label: S,
|
|
29
|
+
labelId: N,
|
|
30
|
+
className: C,
|
|
31
|
+
children: /* @__PURE__ */ f("div", {
|
|
32
|
+
ref: O,
|
|
33
|
+
className: d("wim-inline-edit", a.root, x && a.fullWidth, b && a.disabled),
|
|
34
|
+
...D,
|
|
35
|
+
children: A ? /* @__PURE__ */ p("div", {
|
|
35
36
|
className: a.editWrapper,
|
|
36
|
-
children: [/* @__PURE__ */
|
|
37
|
-
ref:
|
|
38
|
-
value:
|
|
39
|
-
onChange:
|
|
40
|
-
onKeyDown:
|
|
41
|
-
disabled:
|
|
42
|
-
placeholder:
|
|
43
|
-
"aria-label":
|
|
44
|
-
"aria-labelledby":
|
|
45
|
-
"aria-describedby":
|
|
46
|
-
fullWidth:
|
|
37
|
+
children: [/* @__PURE__ */ f(r, {
|
|
38
|
+
ref: z,
|
|
39
|
+
value: V,
|
|
40
|
+
onChange: G,
|
|
41
|
+
onKeyDown: K,
|
|
42
|
+
disabled: b,
|
|
43
|
+
placeholder: y,
|
|
44
|
+
"aria-label": N ? void 0 : w,
|
|
45
|
+
"aria-labelledby": N ?? T,
|
|
46
|
+
"aria-describedby": E,
|
|
47
|
+
fullWidth: x,
|
|
47
48
|
className: a.input
|
|
48
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ p("div", {
|
|
49
50
|
className: a.editActions,
|
|
50
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ f(i, {
|
|
51
52
|
iconName: "CheckIcon",
|
|
52
53
|
intent: "success",
|
|
53
54
|
variant: "outline",
|
|
54
|
-
"aria-label":
|
|
55
|
-
onClick:
|
|
56
|
-
disabled:
|
|
57
|
-
}), /* @__PURE__ */
|
|
55
|
+
"aria-label": k("action.save"),
|
|
56
|
+
onClick: U,
|
|
57
|
+
disabled: b
|
|
58
|
+
}), /* @__PURE__ */ f(i, {
|
|
58
59
|
iconName: "CloseIcon",
|
|
59
60
|
intent: "default",
|
|
60
61
|
variant: "outline",
|
|
61
|
-
"aria-label":
|
|
62
|
-
onClick:
|
|
63
|
-
disabled:
|
|
62
|
+
"aria-label": k("action.cancel"),
|
|
63
|
+
onClick: W,
|
|
64
|
+
disabled: b
|
|
64
65
|
})]
|
|
65
66
|
})]
|
|
66
|
-
}) : /* @__PURE__ */
|
|
67
|
+
}) : /* @__PURE__ */ p("div", {
|
|
67
68
|
className: a.preview,
|
|
68
|
-
onClick:
|
|
69
|
+
onClick: H,
|
|
69
70
|
onKeyDown: (e) => {
|
|
70
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
71
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), H());
|
|
71
72
|
},
|
|
72
|
-
tabIndex:
|
|
73
|
+
tabIndex: b ? -1 : 0,
|
|
73
74
|
role: "button",
|
|
74
|
-
"aria-label":
|
|
75
|
-
"aria-labelledby":
|
|
76
|
-
"aria-describedby":
|
|
77
|
-
"aria-disabled":
|
|
78
|
-
children: [/* @__PURE__ */
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
"aria-label": N ? void 0 : w,
|
|
76
|
+
"aria-labelledby": N ? `${N} ${P}` : T,
|
|
77
|
+
"aria-describedby": E,
|
|
78
|
+
"aria-disabled": b,
|
|
79
|
+
children: [/* @__PURE__ */ f("span", {
|
|
80
|
+
id: P,
|
|
81
|
+
className: d(a.text, !V && a.placeholder),
|
|
82
|
+
children: V || y || "\xA0"
|
|
83
|
+
}), /* @__PURE__ */ f("span", {
|
|
82
84
|
className: a.editIconWrapper,
|
|
83
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ f(i, {
|
|
84
86
|
iconName: "EditIcon",
|
|
85
87
|
variant: "ghost",
|
|
86
88
|
size: "sm",
|
|
87
89
|
tabIndex: -1,
|
|
88
|
-
"aria-label":
|
|
90
|
+
"aria-label": k("action.edit"),
|
|
89
91
|
"aria-hidden": "true",
|
|
90
92
|
asChild: !0,
|
|
91
|
-
children: /* @__PURE__ */
|
|
93
|
+
children: /* @__PURE__ */ f("span", {})
|
|
92
94
|
})
|
|
93
95
|
})]
|
|
94
96
|
})
|
|
95
97
|
})
|
|
96
98
|
});
|
|
97
99
|
});
|
|
98
|
-
|
|
100
|
+
m.displayName = "InlineEdit";
|
|
99
101
|
//#endregion
|
|
100
|
-
export {
|
|
102
|
+
export { m as InlineEdit };
|
package/dist/llms-full.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.58.
|
|
7
|
+
**wimui** v0.58.1 — a React 19 component library: 228 documented components across 10 categories, with design tokens, dark mode, i18n (en/ja/pt-BR) and WAI-ARIA compliant a11y. Peer deps: react ^19, react-dom ^19 (plus optional peers for specific components — see package.json).
|
|
8
8
|
|
|
9
9
|
## Install & required setup
|
|
10
10
|
|
package/dist/llms.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.58.
|
|
7
|
+
**wimui** v0.58.1 — a React 19 component library: 228 documented components across 10 categories, with design tokens, dark mode, i18n (en/ja/pt-BR) and WAI-ARIA compliant a11y. Peer deps: react ^19, react-dom ^19 (plus optional peers for specific components — see package.json).
|
|
8
8
|
|
|
9
9
|
## Install & required setup
|
|
10
10
|
|