@uipath/apollo-wind 2.93.0 → 2.94.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/forms/field-renderer.cjs +1 -1
- package/dist/components/forms/field-renderer.js +1 -1
- package/dist/components/forms/field-rules-strings.cjs +40 -0
- package/dist/components/forms/field-rules-strings.d.ts +17 -0
- package/dist/components/forms/field-rules-strings.js +6 -0
- package/dist/components/forms/field-rules.cjs +526 -0
- package/dist/components/forms/field-rules.d.ts +97 -0
- package/dist/components/forms/field-rules.js +468 -0
- package/dist/components/forms/form-designer.cjs +208 -592
- package/dist/components/forms/form-designer.js +210 -594
- package/dist/components/forms/form-schema.d.ts +5 -0
- package/dist/components/forms/index.cjs +43 -3
- package/dist/components/forms/index.d.ts +4 -0
- package/dist/components/forms/index.js +5 -1
- package/dist/components/forms/metadata-form.cjs +1 -1
- package/dist/components/forms/metadata-form.js +1 -1
- package/dist/components/forms/rules-engine-dialect.cjs +644 -0
- package/dist/components/forms/rules-engine-dialect.d.ts +90 -0
- package/dist/components/forms/rules-engine-dialect.js +537 -0
- package/dist/components/forms/rules-engine.cjs +99 -10
- package/dist/components/forms/rules-engine.d.ts +5 -0
- package/dist/components/forms/rules-engine.js +99 -10
- package/dist/components/forms/use-field-rules.cjs +122 -0
- package/dist/components/forms/use-field-rules.d.ts +31 -0
- package/dist/components/forms/use-field-rules.js +88 -0
- package/dist/components/ui/command.cjs +1 -1
- package/dist/components/ui/command.js +1 -1
- package/dist/components/ui/conditions-editor/condition-row.cjs +458 -0
- package/dist/components/ui/conditions-editor/condition-row.d.ts +23 -0
- package/dist/components/ui/conditions-editor/condition-row.js +421 -0
- package/dist/components/ui/conditions-editor/conditions-editor.cjs +363 -0
- package/dist/components/ui/conditions-editor/conditions-editor.d.ts +67 -0
- package/dist/components/ui/conditions-editor/conditions-editor.js +329 -0
- package/dist/components/ui/conditions-editor/context.cjs +45 -0
- package/dist/components/ui/conditions-editor/context.d.ts +54 -0
- package/dist/components/ui/conditions-editor/context.js +8 -0
- package/dist/components/ui/conditions-editor/index.cjs +55 -0
- package/dist/components/ui/conditions-editor/index.d.ts +6 -0
- package/dist/components/ui/conditions-editor/index.js +6 -0
- package/dist/components/ui/conditions-editor/model.cjs +126 -0
- package/dist/components/ui/conditions-editor/model.d.ts +39 -0
- package/dist/components/ui/conditions-editor/model.js +71 -0
- package/dist/components/ui/conditions-editor/status.cjs +198 -0
- package/dist/components/ui/conditions-editor/status.d.ts +44 -0
- package/dist/components/ui/conditions-editor/status.js +131 -0
- package/dist/components/ui/conditions-editor/strings.cjs +86 -0
- package/dist/components/ui/conditions-editor/strings.d.ts +62 -0
- package/dist/components/ui/conditions-editor/strings.js +52 -0
- package/dist/components/ui/conditions-editor/vocabulary.cjs +163 -0
- package/dist/components/ui/conditions-editor/vocabulary.d.ts +51 -0
- package/dist/components/ui/conditions-editor/vocabulary.js +129 -0
- package/dist/components/ui/context-menu.cjs +1 -1
- package/dist/components/ui/context-menu.js +1 -1
- package/dist/components/ui/dropdown-menu.cjs +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/field-actions/index.cjs +9 -2
- package/dist/components/ui/field-actions/index.d.ts +1 -0
- package/dist/components/ui/field-actions/index.js +2 -1
- package/dist/components/ui/field-actions/insert-variable-action.cjs +3 -1
- package/dist/components/ui/field-actions/insert-variable-action.d.ts +4 -1
- package/dist/components/ui/field-actions/insert-variable-action.js +3 -1
- package/dist/components/ui/field-actions/rules-action.cjs +244 -0
- package/dist/components/ui/field-actions/rules-action.d.ts +42 -0
- package/dist/components/ui/field-actions/rules-action.js +207 -0
- package/dist/components/ui/index.cjs +285 -246
- package/dist/components/ui/index.d.ts +3 -0
- package/dist/components/ui/index.js +3 -0
- package/dist/components/ui/quick-form-field/components/field-header.cjs +137 -167
- package/dist/components/ui/quick-form-field/components/field-header.d.ts +1 -1
- package/dist/components/ui/quick-form-field/components/field-header.js +138 -168
- package/dist/components/ui/quick-form-field/components/header-actions.cjs +187 -0
- package/dist/components/ui/quick-form-field/components/header-actions.d.ts +59 -0
- package/dist/components/ui/quick-form-field/components/header-actions.js +138 -0
- package/dist/components/ui/quick-form-field/components/header-context.cjs +59 -0
- package/dist/components/ui/quick-form-field/components/header-context.d.ts +33 -0
- package/dist/components/ui/quick-form-field/components/header-context.js +16 -0
- package/dist/components/ui/quick-form-field/index.cjs +18 -4
- package/dist/components/ui/quick-form-field/index.d.ts +2 -0
- package/dist/components/ui/quick-form-field/index.js +3 -1
- package/dist/components/ui/quick-form-field/quick-form-field.cjs +1 -1
- package/dist/components/ui/quick-form-field/quick-form-field.d.ts +6 -6
- package/dist/components/ui/quick-form-field/quick-form-field.js +1 -1
- package/dist/components/ui/quick-form-field/types.d.ts +42 -11
- package/dist/components/ui/row-groups/add-row-button.cjs +54 -0
- package/dist/components/ui/row-groups/add-row-button.d.ts +10 -0
- package/dist/components/ui/row-groups/add-row-button.js +20 -0
- package/dist/components/ui/row-groups/after-press.cjs +73 -0
- package/dist/components/ui/row-groups/after-press.d.ts +7 -0
- package/dist/components/ui/row-groups/after-press.js +36 -0
- package/dist/components/ui/row-groups/collapsible-row-group.cjs +83 -0
- package/dist/components/ui/row-groups/collapsible-row-group.d.ts +13 -0
- package/dist/components/ui/row-groups/collapsible-row-group.js +49 -0
- package/dist/components/ui/row-groups/empty-rows.cjs +42 -0
- package/dist/components/ui/row-groups/empty-rows.d.ts +7 -0
- package/dist/components/ui/row-groups/empty-rows.js +8 -0
- package/dist/components/ui/row-groups/group-mode-toggle.cjs +80 -0
- package/dist/components/ui/row-groups/group-mode-toggle.d.ts +26 -0
- package/dist/components/ui/row-groups/group-mode-toggle.js +40 -0
- package/dist/components/ui/row-groups/index.cjs +62 -0
- package/dist/components/ui/row-groups/index.d.ts +6 -0
- package/dist/components/ui/row-groups/index.js +7 -0
- package/dist/components/ui/row-groups/row-delete-button.cjs +54 -0
- package/dist/components/ui/row-groups/row-delete-button.d.ts +18 -0
- package/dist/components/ui/row-groups/row-delete-button.js +20 -0
- package/dist/components/ui/row-groups/use-row-focus.cjs +82 -0
- package/dist/components/ui/row-groups/use-row-focus.d.ts +17 -0
- package/dist/components/ui/row-groups/use-row-focus.js +48 -0
- package/dist/components/ui/rules-editor/context.cjs +45 -0
- package/dist/components/ui/rules-editor/context.d.ts +52 -0
- package/dist/components/ui/rules-editor/context.js +8 -0
- package/dist/components/ui/rules-editor/index.cjs +56 -0
- package/dist/components/ui/rules-editor/index.d.ts +4 -0
- package/dist/components/ui/rules-editor/index.js +4 -0
- package/dist/components/ui/rules-editor/model.cjs +205 -0
- package/dist/components/ui/rules-editor/model.d.ts +128 -0
- package/dist/components/ui/rules-editor/model.js +144 -0
- package/dist/components/ui/rules-editor/rule-card.cjs +470 -0
- package/dist/components/ui/rules-editor/rule-card.d.ts +14 -0
- package/dist/components/ui/rules-editor/rule-card.js +436 -0
- package/dist/components/ui/rules-editor/rules-editor.cjs +160 -0
- package/dist/components/ui/rules-editor/rules-editor.d.ts +66 -0
- package/dist/components/ui/rules-editor/rules-editor.js +126 -0
- package/dist/components/ui/rules-editor/strings.cjs +68 -0
- package/dist/components/ui/rules-editor/strings.d.ts +56 -0
- package/dist/components/ui/rules-editor/strings.js +34 -0
- package/dist/components/ui/select.cjs +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/index.cjs +129 -8
- package/dist/index.d.ts +17 -4
- package/dist/index.js +10 -3
- package/dist/styles.css +97 -24
- package/package.json +2 -2
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
let trackers = 0;
|
|
3
|
+
let pressed = false;
|
|
4
|
+
const press = ()=>{
|
|
5
|
+
pressed = true;
|
|
6
|
+
};
|
|
7
|
+
const release = ()=>{
|
|
8
|
+
pressed = false;
|
|
9
|
+
};
|
|
10
|
+
function usePressTracking() {
|
|
11
|
+
useEffect(()=>{
|
|
12
|
+
if (0 === trackers++) {
|
|
13
|
+
window.addEventListener('pointerdown', press, true);
|
|
14
|
+
window.addEventListener('pointerup', release, true);
|
|
15
|
+
window.addEventListener('pointercancel', release, true);
|
|
16
|
+
}
|
|
17
|
+
return ()=>{
|
|
18
|
+
if (--trackers > 0) return;
|
|
19
|
+
window.removeEventListener('pointerdown', press, true);
|
|
20
|
+
window.removeEventListener('pointerup', release, true);
|
|
21
|
+
window.removeEventListener('pointercancel', release, true);
|
|
22
|
+
pressed = false;
|
|
23
|
+
};
|
|
24
|
+
}, []);
|
|
25
|
+
}
|
|
26
|
+
function afterPress(effect) {
|
|
27
|
+
if (!pressed) return void effect();
|
|
28
|
+
const done = ()=>{
|
|
29
|
+
window.removeEventListener('pointerup', done, true);
|
|
30
|
+
window.removeEventListener('pointercancel', done, true);
|
|
31
|
+
setTimeout(effect, 0);
|
|
32
|
+
};
|
|
33
|
+
window.addEventListener('pointerup', done, true);
|
|
34
|
+
window.addEventListener('pointercancel', done, true);
|
|
35
|
+
}
|
|
36
|
+
export { afterPress, usePressTracking };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
CollapsibleRowGroup: ()=>CollapsibleRowGroup
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
32
|
+
const external_collapsible_cjs_namespaceObject = require("../collapsible.cjs");
|
|
33
|
+
const external_form_field_cjs_namespaceObject = require("../form-field.cjs");
|
|
34
|
+
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
35
|
+
function CollapsibleRowGroup({ summary, detail, error, defaultOpen = true, children }) {
|
|
36
|
+
const [open, setOpen] = external_react_namespaceObject.useState(defaultOpen);
|
|
37
|
+
const errorId = external_react_namespaceObject.useId();
|
|
38
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
39
|
+
className: "flex min-w-0 flex-col",
|
|
40
|
+
children: [
|
|
41
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_collapsible_cjs_namespaceObject.Collapsible, {
|
|
42
|
+
open: open,
|
|
43
|
+
onOpenChange: setOpen,
|
|
44
|
+
className: (0, index_cjs_namespaceObject.cn)('rounded-lg border border-border bg-card', error && 'border-error'),
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_collapsible_cjs_namespaceObject.CollapsibleTrigger, {
|
|
47
|
+
"aria-describedby": error ? errorId : void 0,
|
|
48
|
+
className: "group/trigger flex w-full min-w-0 items-center gap-2 rounded-lg px-3 py-2.5 text-left text-xs font-medium text-foreground hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
|
|
51
|
+
"aria-hidden": "true",
|
|
52
|
+
className: "size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=closed]/trigger:-rotate-90"
|
|
53
|
+
}),
|
|
54
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
55
|
+
className: "shrink-0",
|
|
56
|
+
children: summary
|
|
57
|
+
}),
|
|
58
|
+
!open && detail && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
59
|
+
className: "min-w-0 truncate font-normal text-muted-foreground",
|
|
60
|
+
children: detail
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
}),
|
|
64
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_collapsible_cjs_namespaceObject.CollapsibleContent, {
|
|
65
|
+
className: "border-t border-border p-3",
|
|
66
|
+
children: children
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
}),
|
|
70
|
+
error && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
|
|
71
|
+
id: errorId,
|
|
72
|
+
children: error
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
exports.CollapsibleRowGroup = __webpack_exports__.CollapsibleRowGroup;
|
|
78
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
79
|
+
"CollapsibleRowGroup"
|
|
80
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
81
|
+
Object.defineProperty(exports, '__esModule', {
|
|
82
|
+
value: true
|
|
83
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface CollapsibleRowGroupProps {
|
|
3
|
+
/** Counts the items, e.g. "3 conditions". */
|
|
4
|
+
summary: string;
|
|
5
|
+
/** Shown beside the summary while collapsed, so the group stays checkable, e.g. its plain-language reading. */
|
|
6
|
+
detail?: string;
|
|
7
|
+
/** Group-level message. It sits outside the collapsing part, so it is never hidden. */
|
|
8
|
+
error?: string;
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** A bordered row group whose header collapses its items. */
|
|
13
|
+
export declare function CollapsibleRowGroup({ summary, detail, error, defaultOpen, children, }: CollapsibleRowGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown } from "lucide-react";
|
|
3
|
+
import { useId, useState } from "react";
|
|
4
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../collapsible.js";
|
|
5
|
+
import { FormFieldError } from "../form-field.js";
|
|
6
|
+
import { cn } from "../../../lib/index.js";
|
|
7
|
+
function CollapsibleRowGroup({ summary, detail, error, defaultOpen = true, children }) {
|
|
8
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
9
|
+
const errorId = useId();
|
|
10
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
11
|
+
className: "flex min-w-0 flex-col",
|
|
12
|
+
children: [
|
|
13
|
+
/*#__PURE__*/ jsxs(Collapsible, {
|
|
14
|
+
open: open,
|
|
15
|
+
onOpenChange: setOpen,
|
|
16
|
+
className: cn('rounded-lg border border-border bg-card', error && 'border-error'),
|
|
17
|
+
children: [
|
|
18
|
+
/*#__PURE__*/ jsxs(CollapsibleTrigger, {
|
|
19
|
+
"aria-describedby": error ? errorId : void 0,
|
|
20
|
+
className: "group/trigger flex w-full min-w-0 items-center gap-2 rounded-lg px-3 py-2.5 text-left text-xs font-medium text-foreground hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
21
|
+
children: [
|
|
22
|
+
/*#__PURE__*/ jsx(ChevronDown, {
|
|
23
|
+
"aria-hidden": "true",
|
|
24
|
+
className: "size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=closed]/trigger:-rotate-90"
|
|
25
|
+
}),
|
|
26
|
+
/*#__PURE__*/ jsx("span", {
|
|
27
|
+
className: "shrink-0",
|
|
28
|
+
children: summary
|
|
29
|
+
}),
|
|
30
|
+
!open && detail && /*#__PURE__*/ jsx("span", {
|
|
31
|
+
className: "min-w-0 truncate font-normal text-muted-foreground",
|
|
32
|
+
children: detail
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
}),
|
|
36
|
+
/*#__PURE__*/ jsx(CollapsibleContent, {
|
|
37
|
+
className: "border-t border-border p-3",
|
|
38
|
+
children: children
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
}),
|
|
42
|
+
error && /*#__PURE__*/ jsx(FormFieldError, {
|
|
43
|
+
id: errorId,
|
|
44
|
+
children: error
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export { CollapsibleRowGroup };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
EmptyRows: ()=>EmptyRows
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
function EmptyRows({ children }) {
|
|
31
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
32
|
+
className: "py-2 text-center text-xs italic text-muted-foreground",
|
|
33
|
+
children: children
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
exports.EmptyRows = __webpack_exports__.EmptyRows;
|
|
37
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
38
|
+
"EmptyRows"
|
|
39
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
40
|
+
Object.defineProperty(exports, '__esModule', {
|
|
41
|
+
value: true
|
|
42
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
export interface EmptyRowsProps {
|
|
3
|
+
/** Says what happens with no items, e.g. "No conditions. The rule always applies." */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/** Stands in for a repeatable list's items once the last one is removed. */
|
|
7
|
+
export declare function EmptyRows({ children }: EmptyRowsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
DEFAULT_GROUP_MODE_TOGGLE_STRINGS: ()=>DEFAULT_GROUP_MODE_TOGGLE_STRINGS,
|
|
28
|
+
GroupModeToggle: ()=>GroupModeToggle,
|
|
29
|
+
MATCH_MODES: ()=>MATCH_MODES
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const external_toggle_group_cjs_namespaceObject = require("../toggle-group.cjs");
|
|
33
|
+
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
34
|
+
const MATCH_MODES = [
|
|
35
|
+
{
|
|
36
|
+
value: 'all',
|
|
37
|
+
label: 'All (AND)'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: 'any',
|
|
41
|
+
label: 'Any (OR)'
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
const DEFAULT_GROUP_MODE_TOGGLE_STRINGS = {
|
|
45
|
+
label: 'Group mode'
|
|
46
|
+
};
|
|
47
|
+
function GroupModeToggle({ modes, value, onValueChange, disabled, strings }) {
|
|
48
|
+
const text = {
|
|
49
|
+
...DEFAULT_GROUP_MODE_TOGGLE_STRINGS,
|
|
50
|
+
...strings
|
|
51
|
+
};
|
|
52
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_toggle_group_cjs_namespaceObject.ToggleGroup, {
|
|
53
|
+
type: "single",
|
|
54
|
+
variant: "outline",
|
|
55
|
+
size: "xs",
|
|
56
|
+
"aria-label": text.label,
|
|
57
|
+
value: value,
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
onValueChange: (next)=>{
|
|
60
|
+
const mode = modes.find((option)=>option.value === next);
|
|
61
|
+
if (mode) onValueChange?.(mode.value);
|
|
62
|
+
},
|
|
63
|
+
children: modes.map((mode, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_toggle_group_cjs_namespaceObject.ToggleGroupItem, {
|
|
64
|
+
value: mode.value,
|
|
65
|
+
className: (0, index_cjs_namespaceObject.cn)('h-7 rounded-lg px-2.5', index > 0 && '-ml-px rounded-l-none', index < modes.length - 1 && 'rounded-r-none'),
|
|
66
|
+
children: mode.label
|
|
67
|
+
}, mode.value))
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
exports.DEFAULT_GROUP_MODE_TOGGLE_STRINGS = __webpack_exports__.DEFAULT_GROUP_MODE_TOGGLE_STRINGS;
|
|
71
|
+
exports.GroupModeToggle = __webpack_exports__.GroupModeToggle;
|
|
72
|
+
exports.MATCH_MODES = __webpack_exports__.MATCH_MODES;
|
|
73
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
74
|
+
"DEFAULT_GROUP_MODE_TOGGLE_STRINGS",
|
|
75
|
+
"GroupModeToggle",
|
|
76
|
+
"MATCH_MODES"
|
|
77
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
78
|
+
Object.defineProperty(exports, '__esModule', {
|
|
79
|
+
value: true
|
|
80
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface GroupModeOption<T extends string> {
|
|
2
|
+
value: T;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
/** How a group's conditions combine: every one (AND) or any one (OR). */
|
|
6
|
+
export type MatchMode = 'all' | 'any';
|
|
7
|
+
/** The modes of a condition group. Map the labels to translate them. */
|
|
8
|
+
export declare const MATCH_MODES: readonly GroupModeOption<MatchMode>[];
|
|
9
|
+
export interface GroupModeToggleStrings {
|
|
10
|
+
/** The toggle's accessible name. Name the group when there are several, e.g. "Group 1 match mode". */
|
|
11
|
+
label: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const DEFAULT_GROUP_MODE_TOGGLE_STRINGS: GroupModeToggleStrings;
|
|
14
|
+
export interface GroupModeToggleProps<T extends string> {
|
|
15
|
+
/** Two or three short options. More than that belongs in a Select. */
|
|
16
|
+
modes: readonly GroupModeOption<T>[];
|
|
17
|
+
value: T;
|
|
18
|
+
onValueChange?: (value: T) => void;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Overrides for any subset of the English strings. */
|
|
21
|
+
strings?: Partial<GroupModeToggleStrings>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A row group's mode switch, such as a condition group's All / Any. One per group, above its rows.
|
|
25
|
+
*/
|
|
26
|
+
export declare function GroupModeToggle<T extends string>({ modes, value, onValueChange, disabled, strings, }: GroupModeToggleProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ToggleGroup, ToggleGroupItem } from "../toggle-group.js";
|
|
3
|
+
import { cn } from "../../../lib/index.js";
|
|
4
|
+
const MATCH_MODES = [
|
|
5
|
+
{
|
|
6
|
+
value: 'all',
|
|
7
|
+
label: 'All (AND)'
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
value: 'any',
|
|
11
|
+
label: 'Any (OR)'
|
|
12
|
+
}
|
|
13
|
+
];
|
|
14
|
+
const DEFAULT_GROUP_MODE_TOGGLE_STRINGS = {
|
|
15
|
+
label: 'Group mode'
|
|
16
|
+
};
|
|
17
|
+
function GroupModeToggle({ modes, value, onValueChange, disabled, strings }) {
|
|
18
|
+
const text = {
|
|
19
|
+
...DEFAULT_GROUP_MODE_TOGGLE_STRINGS,
|
|
20
|
+
...strings
|
|
21
|
+
};
|
|
22
|
+
return /*#__PURE__*/ jsx(ToggleGroup, {
|
|
23
|
+
type: "single",
|
|
24
|
+
variant: "outline",
|
|
25
|
+
size: "xs",
|
|
26
|
+
"aria-label": text.label,
|
|
27
|
+
value: value,
|
|
28
|
+
disabled: disabled,
|
|
29
|
+
onValueChange: (next)=>{
|
|
30
|
+
const mode = modes.find((option)=>option.value === next);
|
|
31
|
+
if (mode) onValueChange?.(mode.value);
|
|
32
|
+
},
|
|
33
|
+
children: modes.map((mode, index)=>/*#__PURE__*/ jsx(ToggleGroupItem, {
|
|
34
|
+
value: mode.value,
|
|
35
|
+
className: cn('h-7 rounded-lg px-2.5', index > 0 && '-ml-px rounded-l-none', index < modes.length - 1 && 'rounded-r-none'),
|
|
36
|
+
children: mode.label
|
|
37
|
+
}, mode.value))
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export { DEFAULT_GROUP_MODE_TOGGLE_STRINGS, GroupModeToggle, MATCH_MODES };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
DEFAULT_GROUP_MODE_TOGGLE_STRINGS: ()=>external_group_mode_toggle_cjs_namespaceObject.DEFAULT_GROUP_MODE_TOGGLE_STRINGS,
|
|
28
|
+
GroupModeToggle: ()=>external_group_mode_toggle_cjs_namespaceObject.GroupModeToggle,
|
|
29
|
+
EmptyRows: ()=>external_empty_rows_cjs_namespaceObject.EmptyRows,
|
|
30
|
+
MATCH_MODES: ()=>external_group_mode_toggle_cjs_namespaceObject.MATCH_MODES,
|
|
31
|
+
CollapsibleRowGroup: ()=>external_collapsible_row_group_cjs_namespaceObject.CollapsibleRowGroup,
|
|
32
|
+
useRowFocus: ()=>external_use_row_focus_cjs_namespaceObject.useRowFocus,
|
|
33
|
+
AddRowButton: ()=>external_add_row_button_cjs_namespaceObject.AddRowButton,
|
|
34
|
+
RowDeleteButton: ()=>external_row_delete_button_cjs_namespaceObject.RowDeleteButton
|
|
35
|
+
});
|
|
36
|
+
const external_add_row_button_cjs_namespaceObject = require("./add-row-button.cjs");
|
|
37
|
+
const external_collapsible_row_group_cjs_namespaceObject = require("./collapsible-row-group.cjs");
|
|
38
|
+
const external_empty_rows_cjs_namespaceObject = require("./empty-rows.cjs");
|
|
39
|
+
const external_group_mode_toggle_cjs_namespaceObject = require("./group-mode-toggle.cjs");
|
|
40
|
+
const external_row_delete_button_cjs_namespaceObject = require("./row-delete-button.cjs");
|
|
41
|
+
const external_use_row_focus_cjs_namespaceObject = require("./use-row-focus.cjs");
|
|
42
|
+
exports.AddRowButton = __webpack_exports__.AddRowButton;
|
|
43
|
+
exports.CollapsibleRowGroup = __webpack_exports__.CollapsibleRowGroup;
|
|
44
|
+
exports.DEFAULT_GROUP_MODE_TOGGLE_STRINGS = __webpack_exports__.DEFAULT_GROUP_MODE_TOGGLE_STRINGS;
|
|
45
|
+
exports.EmptyRows = __webpack_exports__.EmptyRows;
|
|
46
|
+
exports.GroupModeToggle = __webpack_exports__.GroupModeToggle;
|
|
47
|
+
exports.MATCH_MODES = __webpack_exports__.MATCH_MODES;
|
|
48
|
+
exports.RowDeleteButton = __webpack_exports__.RowDeleteButton;
|
|
49
|
+
exports.useRowFocus = __webpack_exports__.useRowFocus;
|
|
50
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
51
|
+
"AddRowButton",
|
|
52
|
+
"CollapsibleRowGroup",
|
|
53
|
+
"DEFAULT_GROUP_MODE_TOGGLE_STRINGS",
|
|
54
|
+
"EmptyRows",
|
|
55
|
+
"GroupModeToggle",
|
|
56
|
+
"MATCH_MODES",
|
|
57
|
+
"RowDeleteButton",
|
|
58
|
+
"useRowFocus"
|
|
59
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
60
|
+
Object.defineProperty(exports, '__esModule', {
|
|
61
|
+
value: true
|
|
62
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AddRowButton, type AddRowButtonProps } from './add-row-button';
|
|
2
|
+
export { CollapsibleRowGroup, type CollapsibleRowGroupProps } from './collapsible-row-group';
|
|
3
|
+
export { EmptyRows, type EmptyRowsProps } from './empty-rows';
|
|
4
|
+
export { DEFAULT_GROUP_MODE_TOGGLE_STRINGS, type GroupModeOption, GroupModeToggle, type GroupModeToggleProps, type GroupModeToggleStrings, MATCH_MODES, type MatchMode, } from './group-mode-toggle';
|
|
5
|
+
export { RowDeleteButton, type RowDeleteButtonProps } from './row-delete-button';
|
|
6
|
+
export { useRowFocus } from './use-row-focus';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AddRowButton } from "./add-row-button.js";
|
|
2
|
+
import { CollapsibleRowGroup } from "./collapsible-row-group.js";
|
|
3
|
+
import { EmptyRows } from "./empty-rows.js";
|
|
4
|
+
import { DEFAULT_GROUP_MODE_TOGGLE_STRINGS, GroupModeToggle, MATCH_MODES } from "./group-mode-toggle.js";
|
|
5
|
+
import { RowDeleteButton } from "./row-delete-button.js";
|
|
6
|
+
import { useRowFocus } from "./use-row-focus.js";
|
|
7
|
+
export { AddRowButton, CollapsibleRowGroup, DEFAULT_GROUP_MODE_TOGGLE_STRINGS, EmptyRows, GroupModeToggle, MATCH_MODES, RowDeleteButton, useRowFocus };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
RowDeleteButton: ()=>RowDeleteButton
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
31
|
+
const external_button_cjs_namespaceObject = require("../button.cjs");
|
|
32
|
+
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
33
|
+
function RowDeleteButton({ label, onClick, disabled, revealOnHover = false, className }) {
|
|
34
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
35
|
+
type: "button",
|
|
36
|
+
variant: "ghost",
|
|
37
|
+
size: "xs",
|
|
38
|
+
icon: true,
|
|
39
|
+
"aria-label": label,
|
|
40
|
+
title: label,
|
|
41
|
+
onClick: onClick,
|
|
42
|
+
disabled: disabled,
|
|
43
|
+
"data-row-delete": "",
|
|
44
|
+
className: (0, index_cjs_namespaceObject.cn)('shrink-0 text-muted-foreground hover:text-foreground', revealOnHover && 'opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100', className),
|
|
45
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Trash2, {})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
exports.RowDeleteButton = __webpack_exports__.RowDeleteButton;
|
|
49
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
50
|
+
"RowDeleteButton"
|
|
51
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
52
|
+
Object.defineProperty(exports, '__esModule', {
|
|
53
|
+
value: true
|
|
54
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface RowDeleteButtonProps {
|
|
2
|
+
/** Accessible name and hover title that say which row goes, e.g. "Remove condition 2". */
|
|
3
|
+
label: string;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Hides the action until the row is hovered or holds focus. For dense lists only, since it hides
|
|
8
|
+
* the action from touch users; needs a `group` ancestor.
|
|
9
|
+
*/
|
|
10
|
+
revealOnHover?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Removes one item of a repeatable list. Muted at rest and neutral on hover, never red: red is
|
|
15
|
+
* for destructive menu items and confirmation dialogs. Marked `data-row-delete`, so `useRowFocus`
|
|
16
|
+
* can land on it after a delete.
|
|
17
|
+
*/
|
|
18
|
+
export declare function RowDeleteButton({ label, onClick, disabled, revealOnHover, className, }: RowDeleteButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Trash2 } from "lucide-react";
|
|
3
|
+
import { Button } from "../button.js";
|
|
4
|
+
import { cn } from "../../../lib/index.js";
|
|
5
|
+
function RowDeleteButton({ label, onClick, disabled, revealOnHover = false, className }) {
|
|
6
|
+
return /*#__PURE__*/ jsx(Button, {
|
|
7
|
+
type: "button",
|
|
8
|
+
variant: "ghost",
|
|
9
|
+
size: "xs",
|
|
10
|
+
icon: true,
|
|
11
|
+
"aria-label": label,
|
|
12
|
+
title: label,
|
|
13
|
+
onClick: onClick,
|
|
14
|
+
disabled: disabled,
|
|
15
|
+
"data-row-delete": "",
|
|
16
|
+
className: cn('shrink-0 text-muted-foreground hover:text-foreground', revealOnHover && 'opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100', className),
|
|
17
|
+
children: /*#__PURE__*/ jsx(Trash2, {})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export { RowDeleteButton };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
useRowFocus: ()=>useRowFocus
|
|
28
|
+
});
|
|
29
|
+
const external_react_namespaceObject = require("react");
|
|
30
|
+
const ROWS = ':scope > [data-row]';
|
|
31
|
+
function rowCount(list) {
|
|
32
|
+
return list?.querySelectorAll(ROWS).length ?? 0;
|
|
33
|
+
}
|
|
34
|
+
function useRowFocus() {
|
|
35
|
+
const listRef = external_react_namespaceObject.useRef(null);
|
|
36
|
+
const addRef = external_react_namespaceObject.useRef(null);
|
|
37
|
+
const pending = external_react_namespaceObject.useRef(null);
|
|
38
|
+
external_react_namespaceObject.useEffect(()=>{
|
|
39
|
+
const next = pending.current;
|
|
40
|
+
const list = listRef.current;
|
|
41
|
+
if (!next || !list) return;
|
|
42
|
+
pending.current = null;
|
|
43
|
+
const rows = Array.from(list.querySelectorAll(ROWS));
|
|
44
|
+
if (rows.length !== next.rows) return;
|
|
45
|
+
if ('add' === next.kind) {
|
|
46
|
+
const row = rows[rows.length - 1];
|
|
47
|
+
(row?.querySelector('[data-row-first]') ?? row?.querySelector('button, input, textarea'))?.focus();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const target = rows[Math.min(next.position, rows.length - 1)];
|
|
51
|
+
(target?.querySelector('[data-row-delete]') ?? addRef.current)?.focus();
|
|
52
|
+
});
|
|
53
|
+
const afterAdd = external_react_namespaceObject.useCallback(()=>{
|
|
54
|
+
pending.current = {
|
|
55
|
+
kind: 'add',
|
|
56
|
+
rows: rowCount(listRef.current) + 1
|
|
57
|
+
};
|
|
58
|
+
}, []);
|
|
59
|
+
const afterDelete = external_react_namespaceObject.useCallback((position)=>{
|
|
60
|
+
pending.current = {
|
|
61
|
+
kind: 'delete',
|
|
62
|
+
position,
|
|
63
|
+
rows: Math.max(rowCount(listRef.current) - 1, 0)
|
|
64
|
+
};
|
|
65
|
+
}, []);
|
|
66
|
+
return external_react_namespaceObject.useMemo(()=>({
|
|
67
|
+
listRef,
|
|
68
|
+
addRef,
|
|
69
|
+
afterAdd,
|
|
70
|
+
afterDelete
|
|
71
|
+
}), [
|
|
72
|
+
afterAdd,
|
|
73
|
+
afterDelete
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
exports.useRowFocus = __webpack_exports__.useRowFocus;
|
|
77
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
78
|
+
"useRowFocus"
|
|
79
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
80
|
+
Object.defineProperty(exports, '__esModule', {
|
|
81
|
+
value: true
|
|
82
|
+
});
|