impact-nova 3.0.0-alpha.7 → 3.0.0-alpha.9
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/README.md +1 -1
- package/dist/components/data/expandable-list-item/sku-picker-chrome.d.ts +4 -0
- package/dist/components/data/expandable-list-item/sku-picker-chrome.js +37 -42
- package/dist/components/data-display/stereo-scatter/index.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/index.js +10 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-frame.d.ts +41 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-frame.js +178 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-theme.d.ts +14 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-theme.js +29 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-wedges.d.ts +23 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-wedges.js +80 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine.d.ts +120 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine.js +519 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-math.d.ts +64 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-math.js +129 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-model.d.ts +37 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-model.js +71 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-context.d.ts +33 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-context.js +19 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-key.d.ts +4 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-key.js +19 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-legend.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-legend.js +75 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-scene.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-scene.js +149 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-toolbar.d.ts +13 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-toolbar.js +93 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-tooltip.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-tooltip.js +62 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-viewport.d.ts +3 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-viewport.js +41 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.d.ts +12 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.js +107 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.stories-data.d.ts +11 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.types.d.ts +69 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.variants.d.ts +13 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.variants.js +42 -0
- package/dist/components/feedback/tooltip/button-icon-tooltip.d.ts +3 -1
- package/dist/components/feedback/tooltip/button-icon-tooltip.js +22 -19
- package/dist/components/flows/iris-chat/IrisChatComposerVoiceCapture.d.ts +5 -0
- package/dist/components/flows/iris-chat/IrisChatComposerVoiceCapture.js +73 -0
- package/dist/components/flows/iris-chat/IrisChatVoiceWaveform.d.ts +3 -0
- package/dist/components/flows/iris-chat/IrisChatVoiceWaveform.js +25 -0
- package/dist/components/flows/iris-chat/index.d.ts +3 -1
- package/dist/components/flows/iris-chat/index.js +58 -53
- package/dist/components/flows/iris-chat/iris-chat-chrome.d.ts +39 -0
- package/dist/components/flows/iris-chat/iris-chat-chrome.js +325 -0
- package/dist/components/flows/iris-chat/iris-chat-close-animation.d.ts +12 -0
- package/dist/components/flows/iris-chat/iris-chat-close-animation.js +21 -0
- package/dist/components/flows/iris-chat/iris-chat-composer.js +266 -238
- package/dist/components/flows/iris-chat/iris-chat-context.d.ts +13 -0
- package/dist/components/flows/iris-chat/iris-chat-context.js +14 -10
- package/dist/components/flows/iris-chat/iris-chat-copy-feedback.d.ts +4 -0
- package/dist/components/flows/iris-chat/iris-chat-copy-feedback.js +16 -0
- package/dist/components/flows/iris-chat/iris-chat-frame.d.ts +31 -0
- package/dist/components/flows/iris-chat/iris-chat-frame.js +79 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.d.ts +1 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.js +28 -15
- package/dist/components/flows/iris-chat/iris-chat-launch-animation.d.ts +11 -0
- package/dist/components/flows/iris-chat/iris-chat-launch-animation.js +35 -0
- package/dist/components/flows/iris-chat/iris-chat-markdown.js +70 -50
- package/dist/components/flows/iris-chat/iris-chat-menu.js +91 -86
- package/dist/components/flows/iris-chat/iris-chat-speech.d.ts +52 -0
- package/dist/components/flows/iris-chat/iris-chat-speech.js +121 -0
- package/dist/components/flows/iris-chat/iris-chat-thread.d.ts +3 -0
- package/dist/components/flows/iris-chat/iris-chat-thread.js +241 -190
- package/dist/components/flows/iris-chat/iris-chat-window-chrome.d.ts +30 -0
- package/dist/components/flows/iris-chat/iris-chat-window-chrome.js +34 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry-context.d.ts +14 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry-context.js +15 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry.d.ts +12 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry.js +113 -0
- package/dist/components/flows/iris-chat/iris-chat-window-handles.d.ts +6 -0
- package/dist/components/flows/iris-chat/iris-chat-window-handles.js +50 -0
- package/dist/components/flows/iris-chat/iris-chat-window-shell.d.ts +8 -0
- package/dist/components/flows/iris-chat/iris-chat-window-shell.js +37 -0
- package/dist/components/flows/iris-chat/iris-chat.d.ts +3 -39
- package/dist/components/flows/iris-chat/iris-chat.js +22 -330
- package/dist/components/flows/iris-chat/iris-chat.types.d.ts +18 -0
- package/dist/components/flows/iris-chat/iris-chat.variants.d.ts +3 -3
- package/dist/components/flows/iris-chat/iris-chat.variants.js +21 -16
- package/dist/components/flows/iris-chat/use-iris-chat-root.d.ts +26 -0
- package/dist/components/flows/iris-chat/use-iris-chat-root.js +140 -0
- package/dist/components/forms/choice-card/choice-card.d.ts +1 -0
- package/dist/components/forms/choice-card/choice-card.js +183 -186
- package/dist/components/layout/header/header.js +1 -0
- package/dist/form-react/Fields/SelectField.js +66 -57
- package/dist/form-react/Fields/VirtualizedListField.js +140 -96
- package/dist/form-react/index.d.ts +1 -1
- package/dist/form-react/types/fields.types.d.ts +27 -0
- package/dist/form-react/types/reactHookForm.types.d.ts +18 -1
- package/dist/i18n/defaultMessages.d.ts +37 -0
- package/dist/i18n/defaultMessages.js +54 -18
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +36 -0
- package/dist/i18n/locales/es.js +36 -0
- package/dist/i18n/locales/hi.js +36 -0
- package/dist/i18n/locales/kn.js +36 -0
- package/dist/impact-nova-components.css +19 -0
- package/dist/impact-nova.css +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +5 -1
|
@@ -111,6 +111,7 @@ const P = i(
|
|
|
111
111
|
{
|
|
112
112
|
ref: o,
|
|
113
113
|
type: "button",
|
|
114
|
+
"data-component": "header-iris-button",
|
|
114
115
|
className: n(
|
|
115
116
|
"relative flex items-center justify-center h-8 gap-1 px-3 py-1.5 rounded-md cursor-pointer outline-none",
|
|
116
117
|
"header-iris-button-gradient",
|
|
@@ -1,73 +1,82 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Controller as
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R } from "react";
|
|
3
|
+
import { Controller as v } from "react-hook-form";
|
|
4
4
|
import { Select as M } from "../../components/forms/select/select.js";
|
|
5
|
-
import { useSelectOptions as
|
|
6
|
-
import { getFieldTestId as
|
|
7
|
-
const
|
|
8
|
-
field:
|
|
9
|
-
validationRules:
|
|
10
|
-
isDisabled:
|
|
11
|
-
formHelpers:
|
|
12
|
-
supportedValues:
|
|
5
|
+
import { useSelectOptions as T } from "../hooks/useSelectOptions.js";
|
|
6
|
+
import { getFieldTestId as E } from "../utils/fieldTestIds.js";
|
|
7
|
+
const F = ({
|
|
8
|
+
field: t,
|
|
9
|
+
validationRules: m,
|
|
10
|
+
isDisabled: S,
|
|
11
|
+
formHelpers: r,
|
|
12
|
+
supportedValues: b
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
apiConfig:
|
|
16
|
-
formHelpers:
|
|
17
|
-
initialOptions:
|
|
18
|
-
id:
|
|
19
|
-
isEnabled:
|
|
20
|
-
getSelectOptionsName:
|
|
21
|
-
fieldSupportedValues:
|
|
22
|
-
cascadingDependency:
|
|
14
|
+
const e = t.fieldType === "select" ? t : null, [h, l] = R(!1), g = r.form.control, O = b?.[t.id], { options: i, isLoading: C, error: x, refetch: y } = T({
|
|
15
|
+
apiConfig: e?.apiConfig,
|
|
16
|
+
formHelpers: r,
|
|
17
|
+
initialOptions: e?.options,
|
|
18
|
+
id: t.id,
|
|
19
|
+
isEnabled: h,
|
|
20
|
+
getSelectOptionsName: e?.getSelectOptionsName,
|
|
21
|
+
fieldSupportedValues: O,
|
|
22
|
+
cascadingDependency: t.cascadingDependency
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
if (!e) return null;
|
|
25
|
+
const s = e.optionRendererName ? r.formContext?.optionRenderers?.[e.optionRendererName] : void 0;
|
|
26
|
+
return /* @__PURE__ */ u(
|
|
27
|
+
v,
|
|
26
28
|
{
|
|
27
|
-
name:
|
|
28
|
-
control:
|
|
29
|
-
rules:
|
|
30
|
-
render: ({ field: o, fieldState:
|
|
31
|
-
const
|
|
32
|
-
return /* @__PURE__ */
|
|
29
|
+
name: t.id,
|
|
30
|
+
control: g,
|
|
31
|
+
rules: m,
|
|
32
|
+
render: ({ field: o, fieldState: a }) => {
|
|
33
|
+
const c = !!a.error, d = o.value, f = e?.isMultiSelect ? d ?? [] : d?.[0] ?? null;
|
|
34
|
+
return /* @__PURE__ */ u(
|
|
33
35
|
M,
|
|
34
36
|
{
|
|
35
|
-
id:
|
|
36
|
-
label:
|
|
37
|
-
placeholder:
|
|
38
|
-
required:
|
|
39
|
-
isReadOnly:
|
|
40
|
-
disabled:
|
|
41
|
-
options:
|
|
42
|
-
maxSelectableOptions:
|
|
43
|
-
value:
|
|
44
|
-
onChange: (
|
|
45
|
-
|
|
46
|
-
Array.isArray(
|
|
47
|
-
) :
|
|
48
|
-
Array.isArray(
|
|
37
|
+
id: t.id,
|
|
38
|
+
label: t.label,
|
|
39
|
+
placeholder: t?.placeholder,
|
|
40
|
+
required: t.isRequired,
|
|
41
|
+
isReadOnly: t.isFieldReadonly,
|
|
42
|
+
disabled: S,
|
|
43
|
+
options: i,
|
|
44
|
+
maxSelectableOptions: e?.maxSelectLimit,
|
|
45
|
+
value: f,
|
|
46
|
+
onChange: (n) => {
|
|
47
|
+
e?.isMultiSelect ? o.onChange(
|
|
48
|
+
Array.isArray(n) ? n : []
|
|
49
|
+
) : n == null ? o.onChange([]) : o.onChange(
|
|
50
|
+
Array.isArray(n) ? n : [n]
|
|
49
51
|
);
|
|
50
52
|
},
|
|
51
|
-
isSearchable: !
|
|
52
|
-
isClearable: !
|
|
53
|
-
multiple:
|
|
54
|
-
isSelectAllEnabled: !
|
|
55
|
-
labelOrientation:
|
|
56
|
-
error:
|
|
57
|
-
helperText:
|
|
53
|
+
isSearchable: !e?.disableOptionSearch,
|
|
54
|
+
isClearable: !e?.disableClearAll,
|
|
55
|
+
multiple: e?.isMultiSelect,
|
|
56
|
+
isSelectAllEnabled: !e?.disableSelectAll,
|
|
57
|
+
labelOrientation: e?.labelOrientation || "top",
|
|
58
|
+
error: c,
|
|
59
|
+
helperText: c ? a.error?.message : t.helpText,
|
|
58
60
|
ignoreAccents: !0,
|
|
59
|
-
isLoading:
|
|
60
|
-
fetchError:
|
|
61
|
-
onRefetch:
|
|
62
|
-
onMenuOpen: () =>
|
|
63
|
-
onMenuClose: () =>
|
|
64
|
-
|
|
61
|
+
isLoading: C,
|
|
62
|
+
fetchError: x,
|
|
63
|
+
onRefetch: y,
|
|
64
|
+
onMenuOpen: () => l(!0),
|
|
65
|
+
onMenuClose: () => l(!1),
|
|
66
|
+
renderOption: s ? (n, p) => s({
|
|
67
|
+
option: p,
|
|
68
|
+
index: i.findIndex((A) => A.value === p.value),
|
|
69
|
+
options: i,
|
|
70
|
+
selected: n.selected,
|
|
71
|
+
disabled: n.disabled
|
|
72
|
+
}) : void 0,
|
|
73
|
+
"data-testid": E(t.id)
|
|
65
74
|
}
|
|
66
75
|
);
|
|
67
76
|
}
|
|
68
77
|
}
|
|
69
|
-
)
|
|
78
|
+
);
|
|
70
79
|
};
|
|
71
80
|
export {
|
|
72
|
-
|
|
81
|
+
F as SelectField
|
|
73
82
|
};
|
|
@@ -1,179 +1,223 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l, jsxs as T } from "react/jsx-runtime";
|
|
2
2
|
import { useState as b } from "react";
|
|
3
|
-
import { Controller as
|
|
4
|
-
import { ChoiceCardGroup as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
3
|
+
import { Controller as E } from "react-hook-form";
|
|
4
|
+
import { ChoiceCardGroup as R, ChoiceCard as W, ChoiceCardIndicator as _, ChoiceCardContent as P, ChoiceCardTitle as j } from "../../components/forms/choice-card/choice-card.js";
|
|
5
|
+
import { OverflowTooltip as q } from "../../components/feedback/tooltip/overflow-tooltip.js";
|
|
6
|
+
import { SkuPickerChrome as z } from "../../components/data/expandable-list-item/sku-picker-chrome.js";
|
|
7
|
+
import { nextAlphabeticalSortDirection as B, compareAlphabeticalValues as H } from "../../lib/alphabetical-sort.js";
|
|
8
|
+
import { cn as N } from "../../lib/utils.js";
|
|
9
|
+
import { getFieldTestId as y } from "../utils/fieldTestIds.js";
|
|
10
|
+
const G = 180, U = [];
|
|
11
|
+
function Y(e) {
|
|
10
12
|
if (!Array.isArray(e))
|
|
11
13
|
return [];
|
|
12
|
-
const
|
|
14
|
+
const n = [];
|
|
13
15
|
for (const t of e)
|
|
14
|
-
typeof t == "string" &&
|
|
15
|
-
return
|
|
16
|
+
typeof t == "string" && n.push(t);
|
|
17
|
+
return n;
|
|
16
18
|
}
|
|
17
|
-
function
|
|
19
|
+
function S(e, n, t) {
|
|
18
20
|
if (t === "single") {
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
+
const o = Array.from(n).find((s) => !e.includes(s));
|
|
22
|
+
return o ? [o] : Array.from(n).slice(0, 1);
|
|
21
23
|
}
|
|
22
|
-
const
|
|
23
|
-
for (const
|
|
24
|
-
|
|
25
|
-
for (const
|
|
26
|
-
e.includes(
|
|
27
|
-
return
|
|
24
|
+
const r = [];
|
|
25
|
+
for (const o of e)
|
|
26
|
+
n.has(o) && r.push(o);
|
|
27
|
+
for (const o of n)
|
|
28
|
+
e.includes(o) || r.push(o);
|
|
29
|
+
return r;
|
|
28
30
|
}
|
|
29
|
-
function
|
|
31
|
+
function m(e) {
|
|
30
32
|
return typeof e.label == "string" ? e.label : e.value;
|
|
31
33
|
}
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
(s) =>
|
|
34
|
+
function J(e, n, t) {
|
|
35
|
+
const r = n.trim().toLowerCase(), o = e.filter(
|
|
36
|
+
(s) => m(s).toLowerCase().includes(r)
|
|
35
37
|
);
|
|
36
|
-
return t === "none" ?
|
|
37
|
-
(s, f) =>
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
return t === "none" ? o : o.sort(
|
|
39
|
+
(s, f) => H(
|
|
40
|
+
m(s),
|
|
41
|
+
m(f),
|
|
40
42
|
t
|
|
41
43
|
)
|
|
42
44
|
);
|
|
43
45
|
}
|
|
44
|
-
function
|
|
46
|
+
function K(e, n) {
|
|
45
47
|
let t = 0;
|
|
46
|
-
for (const
|
|
47
|
-
if (
|
|
48
|
+
for (const r of e)
|
|
49
|
+
if (r.isDisabled !== !0 && (t += 1, !n.includes(r.value)))
|
|
48
50
|
return !1;
|
|
49
51
|
return t > 0;
|
|
50
52
|
}
|
|
51
|
-
function
|
|
53
|
+
function Q(e, n) {
|
|
52
54
|
const t = [];
|
|
53
|
-
for (const
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
55
|
+
for (const r of n) {
|
|
56
|
+
const o = e.find((s) => s.value === r);
|
|
57
|
+
if (o && (t.push(m(o)), t.length === 5))
|
|
56
58
|
break;
|
|
57
59
|
}
|
|
58
60
|
return t;
|
|
59
61
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
function x(e) {
|
|
63
|
+
if (!(e === void 0 || e <= 0))
|
|
64
|
+
return e;
|
|
65
|
+
}
|
|
66
|
+
function X(e) {
|
|
67
|
+
const n = `${e.itemMinWidth}px`;
|
|
68
|
+
if (e.view === "list")
|
|
69
|
+
return `repeat(${x(e.listColumnCount) ?? 1}, minmax(${n}, 1fr))`;
|
|
70
|
+
const t = x(e.cardColumnCount);
|
|
71
|
+
return t ? `repeat(${t}, minmax(${n}, 1fr))` : `repeat(auto-fit, minmax(${n}, 1fr))`;
|
|
72
|
+
}
|
|
73
|
+
function Z(e) {
|
|
74
|
+
const n = e.view === "card", t = m(e.option), r = e.renderOption ? e.renderOption({
|
|
75
|
+
option: e.option,
|
|
76
|
+
index: e.index,
|
|
77
|
+
options: e.options,
|
|
78
|
+
selected: e.selected,
|
|
79
|
+
disabled: e.disabled,
|
|
80
|
+
view: e.view
|
|
81
|
+
}) : null;
|
|
82
|
+
return /* @__PURE__ */ l(
|
|
83
|
+
R,
|
|
64
84
|
{
|
|
65
85
|
type: "multiple",
|
|
66
|
-
value: e.selected ? [e.option.value] :
|
|
67
|
-
onValueChange: (
|
|
68
|
-
|
|
86
|
+
value: e.selected ? [e.option.value] : U,
|
|
87
|
+
onValueChange: (o) => {
|
|
88
|
+
o.includes(e.option.value) !== e.selected && e.onToggle();
|
|
69
89
|
},
|
|
70
90
|
disabled: e.disabled,
|
|
71
91
|
className: "min-w-0 w-full",
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
-
|
|
92
|
+
children: /* @__PURE__ */ T(
|
|
93
|
+
W,
|
|
74
94
|
{
|
|
75
95
|
value: e.option.value,
|
|
76
96
|
size: "sm",
|
|
77
97
|
disabled: e.disabled,
|
|
78
|
-
"aria-label":
|
|
79
|
-
className:
|
|
98
|
+
"aria-label": t,
|
|
99
|
+
className: N(
|
|
80
100
|
"w-full min-w-0 items-center",
|
|
81
|
-
!
|
|
101
|
+
!n && "justify-start gap-3 rounded-none border-0 bg-transparent p-0 shadow-none hover:border-0 data-[selected]:border-0 data-[selected]:bg-transparent data-[selected]:shadow-none"
|
|
82
102
|
),
|
|
83
103
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
|
|
104
|
+
e.indicatorStyle === "none" ? null : /* @__PURE__ */ l(
|
|
105
|
+
_,
|
|
86
106
|
{
|
|
87
|
-
|
|
107
|
+
shape: e.indicatorStyle === "radio" ? "radio" : void 0,
|
|
108
|
+
className: n ? "order-last self-center" : "order-first self-center"
|
|
88
109
|
}
|
|
89
110
|
),
|
|
90
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ l(P, { className: "min-w-0 overflow-hidden", children: r ?? /* @__PURE__ */ l(j, { className: "min-w-0 normal-case", children: /* @__PURE__ */ l(
|
|
112
|
+
q,
|
|
113
|
+
{
|
|
114
|
+
triggerClassName: "truncate whitespace-nowrap normal-case",
|
|
115
|
+
content: t,
|
|
116
|
+
children: t
|
|
117
|
+
}
|
|
118
|
+
) }) })
|
|
91
119
|
]
|
|
92
120
|
}
|
|
93
121
|
)
|
|
94
122
|
}
|
|
95
123
|
);
|
|
96
124
|
}
|
|
97
|
-
const
|
|
125
|
+
const se = ({
|
|
98
126
|
field: e,
|
|
99
|
-
validationRules:
|
|
127
|
+
validationRules: n,
|
|
100
128
|
isDisabled: t,
|
|
101
|
-
formHelpers:
|
|
129
|
+
formHelpers: r
|
|
102
130
|
}) => {
|
|
103
|
-
const [
|
|
131
|
+
const [o, s] = b(""), [f, A] = b("none"), [h, L] = b("card");
|
|
104
132
|
if (e.fieldType !== "virtualized_list") return null;
|
|
105
|
-
const
|
|
106
|
-
return /* @__PURE__ */
|
|
107
|
-
|
|
133
|
+
const v = e.options ?? [], C = e.selectionMode ?? "multi", O = e.viewportHeight ?? 240, V = e.itemMinWidth ?? G, M = e.optionRendererName ? r.formContext?.optionRenderers?.[e.optionRendererName] : void 0, $ = r.form.control, d = J(v, o, f);
|
|
134
|
+
return /* @__PURE__ */ l(
|
|
135
|
+
E,
|
|
108
136
|
{
|
|
109
137
|
name: e.id,
|
|
110
|
-
control:
|
|
138
|
+
control: $,
|
|
111
139
|
disabled: t,
|
|
112
|
-
rules:
|
|
113
|
-
render: ({ field: u, fieldState:
|
|
114
|
-
const c =
|
|
115
|
-
if (t ||
|
|
140
|
+
rules: n,
|
|
141
|
+
render: ({ field: u, fieldState: w }) => {
|
|
142
|
+
const c = Y(u.value), g = !!w.error, p = g ? w.error?.message : e.helpText, D = (i) => {
|
|
143
|
+
if (t || i.isDisabled === !0 || C === "single" && c.includes(i.value))
|
|
116
144
|
return;
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
122
|
-
u.onChange(
|
|
145
|
+
const a = new Set(c);
|
|
146
|
+
a.has(i.value) ? a.delete(i.value) : a.add(i.value), u.onChange(S(c, a, C));
|
|
147
|
+
}, I = () => {
|
|
148
|
+
if (C === "single") {
|
|
149
|
+
const a = d.find((k) => k.isDisabled !== !0);
|
|
150
|
+
u.onChange(a ? [a.value] : []);
|
|
123
151
|
return;
|
|
124
152
|
}
|
|
125
|
-
const
|
|
126
|
-
for (const
|
|
127
|
-
|
|
128
|
-
u.onChange(
|
|
153
|
+
const i = new Set(c);
|
|
154
|
+
for (const a of d)
|
|
155
|
+
a.isDisabled !== !0 && i.add(a.value);
|
|
156
|
+
u.onChange(S(c, i, "multi"));
|
|
129
157
|
};
|
|
130
|
-
return /* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
158
|
+
return /* @__PURE__ */ T("div", { "data-testid": y(e.id), children: [
|
|
159
|
+
/* @__PURE__ */ l(
|
|
160
|
+
z,
|
|
133
161
|
{
|
|
134
162
|
collapsible: e.collapsible,
|
|
135
163
|
defaultCollapsed: e.defaultCollapsed,
|
|
136
|
-
title: e.label,
|
|
164
|
+
title: e.label?.trim() ? e.label : void 0,
|
|
137
165
|
required: e.isRequired,
|
|
138
166
|
emptyLabel: "None selected",
|
|
139
167
|
searchLabel: e.label ? `Search ${e.label}` : "Search",
|
|
140
168
|
showBack: !1,
|
|
141
|
-
|
|
142
|
-
|
|
169
|
+
showToolbar: e.showToolbar,
|
|
170
|
+
view: h,
|
|
171
|
+
search: o,
|
|
143
172
|
sortDirection: f,
|
|
144
173
|
selectedCount: c.length,
|
|
145
|
-
allSelected:
|
|
146
|
-
previewCodes:
|
|
174
|
+
allSelected: K(d, c),
|
|
175
|
+
previewCodes: Q(v, c),
|
|
147
176
|
onSearchChange: s,
|
|
148
|
-
onViewChange:
|
|
149
|
-
onToggleSort: () =>
|
|
150
|
-
|
|
177
|
+
onViewChange: L,
|
|
178
|
+
onToggleSort: () => A((i) => B(i)),
|
|
179
|
+
showBulkActions: C === "multi",
|
|
180
|
+
onSelectAll: I,
|
|
151
181
|
onClear: () => u.onChange([]),
|
|
152
|
-
children: /* @__PURE__ */
|
|
182
|
+
children: /* @__PURE__ */ l(
|
|
153
183
|
"div",
|
|
154
184
|
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
185
|
+
"data-testid": `${y(e.id)}-options`,
|
|
186
|
+
className: h === "card" ? "grid w-full min-w-0 gap-3 overflow-y-auto" : "grid w-full min-w-0 gap-2 overflow-y-auto",
|
|
187
|
+
style: {
|
|
188
|
+
maxHeight: O,
|
|
189
|
+
gridTemplateColumns: X({
|
|
190
|
+
view: h,
|
|
191
|
+
cardColumnCount: e.cardColumnCount,
|
|
192
|
+
listColumnCount: e.listColumnCount,
|
|
193
|
+
itemMinWidth: V
|
|
194
|
+
})
|
|
195
|
+
},
|
|
196
|
+
children: d.map((i, a) => /* @__PURE__ */ l(
|
|
197
|
+
Z,
|
|
158
198
|
{
|
|
159
|
-
option:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
199
|
+
option: i,
|
|
200
|
+
index: a,
|
|
201
|
+
options: d,
|
|
202
|
+
selected: c.includes(i.value),
|
|
203
|
+
disabled: t || i.isDisabled === !0,
|
|
204
|
+
view: h,
|
|
205
|
+
indicatorStyle: e.indicatorStyle,
|
|
206
|
+
renderOption: M,
|
|
207
|
+
onToggle: () => D(i)
|
|
164
208
|
},
|
|
165
|
-
|
|
209
|
+
i.value
|
|
166
210
|
))
|
|
167
211
|
}
|
|
168
212
|
)
|
|
169
213
|
}
|
|
170
214
|
),
|
|
171
|
-
|
|
215
|
+
p ? /* @__PURE__ */ l("p", { className: N("mt-1 text-xs", g ? "text-destructive" : "text-content-tertiary"), children: p }) : null
|
|
172
216
|
] });
|
|
173
217
|
}
|
|
174
218
|
}
|
|
175
219
|
);
|
|
176
220
|
};
|
|
177
221
|
export {
|
|
178
|
-
|
|
222
|
+
se as VirtualizedListField
|
|
179
223
|
};
|
|
@@ -36,7 +36,7 @@ export { FormFileUploadWrapper } from './components/FormFileUploadWrapper';
|
|
|
36
36
|
export { registerFieldType, getFieldComponent, hasRegisteredFieldType, listRegisteredFieldTypes, } from './registry/fieldRegistry';
|
|
37
37
|
export { registerDefaultFieldTypes } from './registry/defaultFieldRegistrations';
|
|
38
38
|
export { resolveFieldComponent, renderRegisteredField } from './registry/resolveFieldComponent';
|
|
39
|
-
export type { IFormConfig, FormFieldProps, FormType, FormStepConfig, FormStepStateMeta, ReactHooksFormStepActions, FieldVisibilityBase, ReactHooksFormProps, UseSelectOptionsProps, FormContext, FormValidationMeta, FormTransport, CustomFieldTypesMap, FetchSelectOptionsParams, PastedValuesValidationResult, ValidatePastedValuesParams, ValidateUploadedFileParams, UploadedFileValidationResult, ValidateTextFieldWithBackendParams, TextFieldBackendValidationResult, SupportedValuesMap, } from './types/reactHookForm.types';
|
|
39
|
+
export type { IFormConfig, FormFieldProps, FormType, FormStepConfig, FormStepStateMeta, ReactHooksFormStepActions, FieldVisibilityBase, ReactHooksFormProps, UseSelectOptionsProps, FormContext, OptionRenderParams, OptionRenderer, FormValidationMeta, FormTransport, CustomFieldTypesMap, FetchSelectOptionsParams, PastedValuesValidationResult, ValidatePastedValuesParams, ValidateUploadedFileParams, UploadedFileValidationResult, ValidateTextFieldWithBackendParams, TextFieldBackendValidationResult, SupportedValuesMap, } from './types/reactHookForm.types';
|
|
40
40
|
export type { IField } from './types/fields.types';
|
|
41
41
|
export type * from './types/fields.types';
|
|
42
42
|
export type * from './types/fieldsOutput.types';
|
|
@@ -117,6 +117,11 @@ export type SelectField = BaseField & {
|
|
|
117
117
|
* When set, that resolver is used instead of apiConfig fetch.
|
|
118
118
|
*/
|
|
119
119
|
getSelectOptionsName?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Name of formContext.optionRenderers[name].
|
|
122
|
+
* Replaces the default option row content. Omit for the default label.
|
|
123
|
+
*/
|
|
124
|
+
optionRendererName?: string;
|
|
120
125
|
apiConfig?: {
|
|
121
126
|
apiEndpoint: string;
|
|
122
127
|
method: "GET" | "POST";
|
|
@@ -507,6 +512,28 @@ export type VirtualizedListField = BaseField & {
|
|
|
507
512
|
collapsible?: boolean;
|
|
508
513
|
/** Start folded. Ignored unless `collapsible` is set. */
|
|
509
514
|
defaultCollapsed?: boolean;
|
|
515
|
+
/**
|
|
516
|
+
* Columns in card view. Omit for `auto-fill` at `itemMinWidth`.
|
|
517
|
+
*/
|
|
518
|
+
cardColumnCount?: number;
|
|
519
|
+
/**
|
|
520
|
+
* Columns in list view. Default: 1.
|
|
521
|
+
*/
|
|
522
|
+
listColumnCount?: number;
|
|
523
|
+
/** Minimum item width in pixels. Default: 180. */
|
|
524
|
+
itemMinWidth?: number;
|
|
525
|
+
/**
|
|
526
|
+
* Name of formContext.optionRenderers[name].
|
|
527
|
+
* Replaces the default option label inside the choice card. Omit for the default label.
|
|
528
|
+
*/
|
|
529
|
+
optionRendererName?: string;
|
|
530
|
+
/** Search, sort, view toggle, Select All, and Clear. Default: true. */
|
|
531
|
+
showToolbar?: boolean;
|
|
532
|
+
/**
|
|
533
|
+
* Selection mark on each option.
|
|
534
|
+
* Omit for the checkbox. `'radio'` is the round mark. `'none'` is the card highlight only.
|
|
535
|
+
*/
|
|
536
|
+
indicatorStyle?: "checkbox" | "radio" | "none";
|
|
510
537
|
};
|
|
511
538
|
export type DividerField = BaseField & {
|
|
512
539
|
fieldType: "divider";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import { FieldErrors, FormState, RegisterOptions, UseFormReturn } from 'react-hook-form';
|
|
3
3
|
import { Option } from '../../components/forms/select';
|
|
4
4
|
import { FieldVisibilityBase, FormStepConfig } from '../../form-engine';
|
|
@@ -46,6 +46,18 @@ export type FormContextValidator = (params: FormContextFieldChangeParams) => str
|
|
|
46
46
|
export type FormContextGetSelectOptions = (params: FormContextFieldChangeParams) => Option[] | Promise<Option[]>;
|
|
47
47
|
export type FormContextFunction = (params: FormContextFunctionParams) => unknown | Promise<unknown>;
|
|
48
48
|
export type FormContextOnFieldChange = (params: FormContextFieldChangeParams) => void;
|
|
49
|
+
/** Per-option render params — same shape for select menus and virtualized lists. */
|
|
50
|
+
export type OptionRenderParams = {
|
|
51
|
+
option: Option;
|
|
52
|
+
index: number;
|
|
53
|
+
options: readonly Option[];
|
|
54
|
+
selected: boolean;
|
|
55
|
+
disabled: boolean;
|
|
56
|
+
/** Set by virtualized_list. Select menu rows omit it. */
|
|
57
|
+
view?: 'card' | 'list';
|
|
58
|
+
};
|
|
59
|
+
/** Named option content renderer, looked up via field.optionRendererName. */
|
|
60
|
+
export type OptionRenderer = (params: OptionRenderParams) => ReactNode;
|
|
49
61
|
export type FetchSelectOptionsParams = {
|
|
50
62
|
fieldId: string;
|
|
51
63
|
apiConfig: NonNullable<SelectField['apiConfig']>;
|
|
@@ -136,6 +148,11 @@ export interface FormContext {
|
|
|
136
148
|
getSelectOptions?: Record<string, FormContextGetSelectOptions>;
|
|
137
149
|
/** Named handlers — referenced via BaseField.handlerName (on change + specialized validate) */
|
|
138
150
|
functions?: Record<string, FormContextFunction>;
|
|
151
|
+
/**
|
|
152
|
+
* Named option content renderers — referenced via optionRendererName
|
|
153
|
+
* on select and virtualized_list fields.
|
|
154
|
+
*/
|
|
155
|
+
optionRenderers?: Record<string, OptionRenderer>;
|
|
139
156
|
/** Called after any field value changes */
|
|
140
157
|
onFieldChange?: FormContextOnFieldChange;
|
|
141
158
|
/** Host-provided network transport (axios, fetch, etc.) — not implemented by Impact Nova */
|
|
@@ -314,10 +314,22 @@ export interface IrisChatMessages {
|
|
|
314
314
|
attachImage: string;
|
|
315
315
|
mic: string;
|
|
316
316
|
listening: string;
|
|
317
|
+
listeningHint: string;
|
|
318
|
+
speechRecordingTitle: string;
|
|
319
|
+
speechRecordingHint: string;
|
|
320
|
+
speechRecordingWaiting: string;
|
|
321
|
+
speechStopRecording: string;
|
|
322
|
+
speechUnsupported: string;
|
|
323
|
+
speechPermissionDenied: string;
|
|
324
|
+
speechNoSpeech: string;
|
|
325
|
+
speechNetwork: string;
|
|
326
|
+
speechError: string;
|
|
327
|
+
speechEmpty: string;
|
|
317
328
|
model: string;
|
|
318
329
|
newChat: string;
|
|
319
330
|
minimize: string;
|
|
320
331
|
expand: string;
|
|
332
|
+
resize: string;
|
|
321
333
|
back: string;
|
|
322
334
|
filter: string;
|
|
323
335
|
filterType: string;
|
|
@@ -433,6 +445,30 @@ export interface GlobeMapMessages {
|
|
|
433
445
|
trendingNow: string;
|
|
434
446
|
slideLabel: string;
|
|
435
447
|
}
|
|
448
|
+
export interface StereoScatterMessages {
|
|
449
|
+
chartLabel: string;
|
|
450
|
+
legend: string;
|
|
451
|
+
hideCluster: string;
|
|
452
|
+
showCluster: string;
|
|
453
|
+
storeCount: string;
|
|
454
|
+
toolbar: string;
|
|
455
|
+
viewIso: string;
|
|
456
|
+
viewFront: string;
|
|
457
|
+
viewTop: string;
|
|
458
|
+
viewSide: string;
|
|
459
|
+
zoomIn: string;
|
|
460
|
+
zoomOut: string;
|
|
461
|
+
resetView: string;
|
|
462
|
+
autoRotate: string;
|
|
463
|
+
towardViewer: string;
|
|
464
|
+
awayFromViewer: string;
|
|
465
|
+
clusterAverage: string;
|
|
466
|
+
inspectCluster: string;
|
|
467
|
+
versusAverage: string;
|
|
468
|
+
interactionHint: string;
|
|
469
|
+
clearFocus: string;
|
|
470
|
+
webglUnavailable: string;
|
|
471
|
+
}
|
|
436
472
|
export interface ImpactNovaMessages {
|
|
437
473
|
calendar: CalendarMessages;
|
|
438
474
|
datePicker: DatePickerMessages;
|
|
@@ -456,6 +492,7 @@ export interface ImpactNovaMessages {
|
|
|
456
492
|
irisChat: IrisChatMessages;
|
|
457
493
|
hexTilemap: HexTilemapMessages;
|
|
458
494
|
globeMap: GlobeMapMessages;
|
|
495
|
+
stereoScatter: StereoScatterMessages;
|
|
459
496
|
}
|
|
460
497
|
/** Default English messages used when no provider or partial override */
|
|
461
498
|
export declare const defaultMessages: ImpactNovaMessages;
|