@octaviaflow/core 3.1.0-beta.63 → 3.1.0-beta.65
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/ActionsDrawer/ActionsDrawer.d.ts.map +1 -1
- package/dist/components/KeyValueEditor/KeyValueEditor.d.ts +12 -1
- package/dist/components/KeyValueEditor/KeyValueEditor.d.ts.map +1 -1
- package/dist/index.cjs +116 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +116 -57
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/ActionsDrawer/ActionsDrawer.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAIlB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAGf;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,CAAC;AAEvF,MAAM,WAAW,UAAU,CAAC,QAAQ,GAAG,OAAO;IAC5C,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;4EACwE;IACxE,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;0EACsE;IACtE,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW,CAAC,QA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AC;IACvD;oFACgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;mDAC+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAwCD,wBAAgB,aAAa,CAAC,QAAQ,GAAG,OAAO,EAAE,EAChD,MAAM,EACN,KAAK,EACL,IAAW,EACX,YAAY,EACZ,KAAW,EACX,UAAiB,EACjB,iBAAqC,EACrC,aAAkB,EAClB,KAAiB,EACjB,WAAW,EACX,UAAU,EACV,MAAM,EACN,cAAc,EACd,eAAe,EACf,YAAgC,EAChC,SAAgB,EAChB,SAAS,EACT,KAAK,GACN,EAAE,kBAAkB,CAAC,QAAQ,CAAC,2CAoK9B;
|
|
1
|
+
{"version":3,"file":"ActionsDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/ActionsDrawer/ActionsDrawer.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAIlB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAGf;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,CAAC;AAEvF,MAAM,WAAW,UAAU,CAAC,QAAQ,GAAG,OAAO;IAC5C,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;4EACwE;IACxE,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;0EACsE;IACtE,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,8DAA8D;IAC9D,KAAK,CAAC,EAA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I,CAAC;IACtD,yEAAyE;IACzE,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IACvD;oFACgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;mDAC+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAwCD,wBAAgB,aAAa,CAAC,QAAQ,GAAG,OAAO,EAAE,EAChD,MAAM,EACN,KAAK,EACL,IAAW,EACX,YAAY,EACZ,KAAW,EACX,UAAiB,EACjB,iBAAqC,EACrC,aAAkB,EAClB,KAAiB,EACjB,WAAW,EACX,UAAU,EACV,MAAM,EACN,cAAc,EACd,eAAe,EACf,YAAgC,EAChC,SAAgB,EAChB,SAAS,EACT,KAAK,GACN,EAAE,kBAAkB,CAAC,QAAQ,CAAC,2CAoK9B;AAgKD,eAAO,MAAM,oBAAoB,6BAAoB,CAAC"}
|
|
@@ -3,6 +3,11 @@ import { type ComboboxOption } from "../Combobox";
|
|
|
3
3
|
export interface KeyValuePair {
|
|
4
4
|
key: string;
|
|
5
5
|
value: string;
|
|
6
|
+
/** Per-row enable flag. Only meaningful when `rowToggle` is set; a missing
|
|
7
|
+
* value is treated as enabled (backward-compatible). */
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
/** Optional per-row description. Only rendered when `showDescription` is set. */
|
|
10
|
+
description?: string;
|
|
6
11
|
}
|
|
7
12
|
export interface KeyValueEditorProps {
|
|
8
13
|
pairs: KeyValuePair[];
|
|
@@ -11,11 +16,17 @@ export interface KeyValueEditorProps {
|
|
|
11
16
|
helperText?: ReactNode;
|
|
12
17
|
keyPlaceholder?: string;
|
|
13
18
|
valuePlaceholder?: string;
|
|
19
|
+
descriptionPlaceholder?: string;
|
|
14
20
|
addLabel?: ReactNode;
|
|
15
21
|
/** When set, the key field is a Combobox of these suggestions (free-type still allowed). */
|
|
16
22
|
keyOptions?: ComboboxOption[];
|
|
17
23
|
/** When set, the value field is a Combobox of these suggestions (free-type still allowed). */
|
|
18
24
|
valueOptions?: ComboboxOption[];
|
|
25
|
+
/** Render a per-row enable Checkbox; disabled rows dim and their fields go
|
|
26
|
+
* read-only (the toggle + remove stay active). New rows default to enabled. */
|
|
27
|
+
rowToggle?: boolean;
|
|
28
|
+
/** Render a third description column per row. */
|
|
29
|
+
showDescription?: boolean;
|
|
19
30
|
size?: "sm" | "md" | "lg";
|
|
20
31
|
disabled?: boolean;
|
|
21
32
|
error?: boolean;
|
|
@@ -31,7 +42,7 @@ export interface KeyValueEditorProps {
|
|
|
31
42
|
* field can become a Combobox (suggestions + free entry) by passing
|
|
32
43
|
* `keyOptions` / `valueOptions`; otherwise both are plain text inputs.
|
|
33
44
|
*/
|
|
34
|
-
export declare function KeyValueEditor({ pairs, onChange, label, helperText, keyPlaceholder, valuePlaceholder, addLabel, keyOptions, valueOptions, size, disabled, error, errorMessage, emptyLabel, maxRows, className, }: KeyValueEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare function KeyValueEditor({ pairs, onChange, label, helperText, keyPlaceholder, valuePlaceholder, descriptionPlaceholder, addLabel, keyOptions, valueOptions, rowToggle, showDescription, size, disabled, error, errorMessage, emptyLabel, maxRows, className, }: KeyValueEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
35
46
|
export declare namespace KeyValueEditor {
|
|
36
47
|
var displayName: string;
|
|
37
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueEditor.d.ts","sourceRoot":"","sources":["../../../src/components/KeyValueEditor/KeyValueEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"KeyValueEditor.d.ts","sourceRoot":"","sources":["../../../src/components/KeyValueEditor/KeyValueEditor.tsx"],"names":[],"mappings":"AAEA,O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,EACR,KAAK,EACL,UAAU,EACV,cAAsB,EACtB,gBAA0B,EAC1B,sBAAsC,EACtC,QAAgB,EAChB,UAAU,EACV,YAAY,EACZ,SAAiB,EACjB,eAAuB,EACvB,IAAW,EACX,QAAgB,EAChB,KAAa,EACb,YAAY,EACZ,UAAU,EACV,OAAO,EACP,SAAS,GACV,EAAE,mBAAmB,2CA0HrB;yBA9Ie,cAAc"}
|
package/dist/index.cjs
CHANGED
|
@@ -520,6 +520,28 @@ function ActionRow({
|
|
|
520
520
|
e.dataTransfer.setData(dragMimeType, JSON.stringify(payload));
|
|
521
521
|
e.dataTransfer.setData("text/plain", item.label);
|
|
522
522
|
e.dataTransfer.effectAllowed = "copy";
|
|
523
|
+
if (typeof document !== "undefined") {
|
|
524
|
+
const ghost = document.createElement("div");
|
|
525
|
+
ghost.textContent = item.label;
|
|
526
|
+
ghost.setAttribute("aria-hidden", "true");
|
|
527
|
+
const s = ghost.style;
|
|
528
|
+
s.position = "fixed";
|
|
529
|
+
s.top = "-1000px";
|
|
530
|
+
s.left = "-1000px";
|
|
531
|
+
s.padding = "6px 12px";
|
|
532
|
+
s.borderRadius = "6px";
|
|
533
|
+
s.background = "var(--ods-surface-canvas, #ffffff)";
|
|
534
|
+
s.color = "var(--ods-text-primary, #111827)";
|
|
535
|
+
s.border = "1px solid var(--ods-border-strong, #9ca3af)";
|
|
536
|
+
s.font = "500 13px var(--ods-font-family-sans, sans-serif)";
|
|
537
|
+
s.boxShadow = "0 4px 12px rgba(0,0,0,0.18)";
|
|
538
|
+
s.whiteSpace = "nowrap";
|
|
539
|
+
s.pointerEvents = "none";
|
|
540
|
+
s.zIndex = "9999";
|
|
541
|
+
document.body.appendChild(ghost);
|
|
542
|
+
e.dataTransfer.setDragImage(ghost, 12, 16);
|
|
543
|
+
window.setTimeout(() => ghost.remove(), 0);
|
|
544
|
+
}
|
|
523
545
|
onDragStart?.(item);
|
|
524
546
|
},
|
|
525
547
|
[item, dragMimeType, onDragStart]
|
|
@@ -9895,6 +9917,7 @@ FieldPicker.displayName = "FieldPicker";
|
|
|
9895
9917
|
// src/components/KeyValueEditor/KeyValueEditor.tsx
|
|
9896
9918
|
var import_icons12 = require("@octaviaflow/icons");
|
|
9897
9919
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
9920
|
+
var isRowEnabled = (pair) => pair.enabled !== false;
|
|
9898
9921
|
function KeyValueEditor({
|
|
9899
9922
|
pairs,
|
|
9900
9923
|
onChange,
|
|
@@ -9902,9 +9925,12 @@ function KeyValueEditor({
|
|
|
9902
9925
|
helperText,
|
|
9903
9926
|
keyPlaceholder = "key",
|
|
9904
9927
|
valuePlaceholder = "value",
|
|
9928
|
+
descriptionPlaceholder = "description",
|
|
9905
9929
|
addLabel = "Add",
|
|
9906
9930
|
keyOptions,
|
|
9907
9931
|
valueOptions,
|
|
9932
|
+
rowToggle = false,
|
|
9933
|
+
showDescription = false,
|
|
9908
9934
|
size = "md",
|
|
9909
9935
|
disabled = false,
|
|
9910
9936
|
error = false,
|
|
@@ -9915,7 +9941,7 @@ function KeyValueEditor({
|
|
|
9915
9941
|
}) {
|
|
9916
9942
|
const setAt = (i, patch) => onChange(pairs.map((p, j) => j === i ? { ...p, ...patch } : p));
|
|
9917
9943
|
const removeAt = (i) => onChange(pairs.filter((_, j) => j !== i));
|
|
9918
|
-
const add = () => onChange([...pairs, { key: "", value: "" }]);
|
|
9944
|
+
const add = () => onChange([...pairs, { key: "", value: "", ...rowToggle ? { enabled: true } : {} }]);
|
|
9919
9945
|
const canAdd = !disabled && (maxRows === void 0 || pairs.length < maxRows);
|
|
9920
9946
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
9921
9947
|
"div",
|
|
@@ -9924,68 +9950,101 @@ function KeyValueEditor({
|
|
|
9924
9950
|
"ods-kv-editor",
|
|
9925
9951
|
`ods-kv-editor--${size}`,
|
|
9926
9952
|
error && "ods-kv-editor--error",
|
|
9953
|
+
showDescription && "ods-kv-editor--with-description",
|
|
9927
9954
|
className
|
|
9928
9955
|
),
|
|
9929
9956
|
children: [
|
|
9930
9957
|
label && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "ods-kv-editor__label", children: label }),
|
|
9931
9958
|
pairs.length === 0 && emptyLabel && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "ods-kv-editor__empty", children: emptyLabel }),
|
|
9932
|
-
pairs.map((pair, i) =>
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
size,
|
|
9938
|
-
value: pair.key,
|
|
9939
|
-
options: keyOptions,
|
|
9940
|
-
onChange: (v) => setAt(i, { key: v }),
|
|
9941
|
-
placeholder: keyPlaceholder,
|
|
9942
|
-
disabled
|
|
9943
|
-
}
|
|
9944
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9945
|
-
"input",
|
|
9946
|
-
{
|
|
9947
|
-
className: "ods-kv-editor__input",
|
|
9948
|
-
"aria-label": "Key",
|
|
9949
|
-
value: pair.key,
|
|
9950
|
-
onChange: (e) => setAt(i, { key: e.target.value }),
|
|
9951
|
-
placeholder: keyPlaceholder,
|
|
9952
|
-
disabled
|
|
9953
|
-
}
|
|
9954
|
-
),
|
|
9955
|
-
valueOptions ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9956
|
-
Combobox,
|
|
9957
|
-
{
|
|
9958
|
-
ariaLabel: "Value",
|
|
9959
|
-
size,
|
|
9960
|
-
value: pair.value,
|
|
9961
|
-
options: valueOptions,
|
|
9962
|
-
onChange: (v) => setAt(i, { value: v }),
|
|
9963
|
-
placeholder: valuePlaceholder,
|
|
9964
|
-
disabled
|
|
9965
|
-
}
|
|
9966
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9967
|
-
"input",
|
|
9968
|
-
{
|
|
9969
|
-
className: "ods-kv-editor__input",
|
|
9970
|
-
"aria-label": "Value",
|
|
9971
|
-
value: pair.value,
|
|
9972
|
-
onChange: (e) => setAt(i, { value: e.target.value }),
|
|
9973
|
-
placeholder: valuePlaceholder,
|
|
9974
|
-
disabled
|
|
9975
|
-
}
|
|
9976
|
-
),
|
|
9977
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9978
|
-
"button",
|
|
9959
|
+
pairs.map((pair, i) => {
|
|
9960
|
+
const rowOff = rowToggle && !isRowEnabled(pair);
|
|
9961
|
+
const fieldsDisabled = disabled || rowOff;
|
|
9962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
9963
|
+
"div",
|
|
9979
9964
|
{
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9965
|
+
className: cn("ods-kv-editor__row", rowOff && "ods-kv-editor__row--disabled"),
|
|
9966
|
+
children: [
|
|
9967
|
+
rowToggle && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9968
|
+
Checkbox,
|
|
9969
|
+
{
|
|
9970
|
+
size: size === "lg" ? "md" : size,
|
|
9971
|
+
"aria-label": "Enable row",
|
|
9972
|
+
checked: isRowEnabled(pair),
|
|
9973
|
+
onChange: (on) => setAt(i, { enabled: on }),
|
|
9974
|
+
disabled
|
|
9975
|
+
}
|
|
9976
|
+
),
|
|
9977
|
+
keyOptions ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9978
|
+
Combobox,
|
|
9979
|
+
{
|
|
9980
|
+
ariaLabel: "Key",
|
|
9981
|
+
size,
|
|
9982
|
+
value: pair.key,
|
|
9983
|
+
options: keyOptions,
|
|
9984
|
+
onChange: (v) => setAt(i, { key: v }),
|
|
9985
|
+
placeholder: keyPlaceholder,
|
|
9986
|
+
disabled: fieldsDisabled
|
|
9987
|
+
}
|
|
9988
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9989
|
+
"input",
|
|
9990
|
+
{
|
|
9991
|
+
className: "ods-kv-editor__input",
|
|
9992
|
+
"aria-label": "Key",
|
|
9993
|
+
value: pair.key,
|
|
9994
|
+
onChange: (e) => setAt(i, { key: e.target.value }),
|
|
9995
|
+
placeholder: keyPlaceholder,
|
|
9996
|
+
disabled: fieldsDisabled
|
|
9997
|
+
}
|
|
9998
|
+
),
|
|
9999
|
+
valueOptions ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
10000
|
+
Combobox,
|
|
10001
|
+
{
|
|
10002
|
+
ariaLabel: "Value",
|
|
10003
|
+
size,
|
|
10004
|
+
value: pair.value,
|
|
10005
|
+
options: valueOptions,
|
|
10006
|
+
onChange: (v) => setAt(i, { value: v }),
|
|
10007
|
+
placeholder: valuePlaceholder,
|
|
10008
|
+
disabled: fieldsDisabled
|
|
10009
|
+
}
|
|
10010
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
10011
|
+
"input",
|
|
10012
|
+
{
|
|
10013
|
+
className: "ods-kv-editor__input",
|
|
10014
|
+
"aria-label": "Value",
|
|
10015
|
+
value: pair.value,
|
|
10016
|
+
onChange: (e) => setAt(i, { value: e.target.value }),
|
|
10017
|
+
placeholder: valuePlaceholder,
|
|
10018
|
+
disabled: fieldsDisabled
|
|
10019
|
+
}
|
|
10020
|
+
),
|
|
10021
|
+
showDescription && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
10022
|
+
"input",
|
|
10023
|
+
{
|
|
10024
|
+
className: "ods-kv-editor__input ods-kv-editor__input--description",
|
|
10025
|
+
"aria-label": "Description",
|
|
10026
|
+
value: pair.description ?? "",
|
|
10027
|
+
onChange: (e) => setAt(i, { description: e.target.value }),
|
|
10028
|
+
placeholder: descriptionPlaceholder,
|
|
10029
|
+
disabled: fieldsDisabled
|
|
10030
|
+
}
|
|
10031
|
+
),
|
|
10032
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
10033
|
+
"button",
|
|
10034
|
+
{
|
|
10035
|
+
type: "button",
|
|
10036
|
+
className: "ods-kv-editor__remove",
|
|
10037
|
+
"aria-label": "Remove row",
|
|
10038
|
+
onClick: () => removeAt(i),
|
|
10039
|
+
disabled,
|
|
10040
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_icons12.CloseIcon, { width: 14, height: 14, "aria-hidden": "true" })
|
|
10041
|
+
}
|
|
10042
|
+
)
|
|
10043
|
+
]
|
|
10044
|
+
},
|
|
10045
|
+
i
|
|
10046
|
+
);
|
|
10047
|
+
}),
|
|
9989
10048
|
canAdd && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("button", { type: "button", className: "ods-kv-editor__add", onClick: add, children: [
|
|
9990
10049
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_icons12.AddIcon, { width: 14, height: 14, "aria-hidden": "true" }),
|
|
9991
10050
|
addLabel
|