@almadar/ui 5.31.0 → 5.32.0
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/avl/index.cjs +30 -22
- package/dist/avl/index.js +30 -22
- package/dist/components/core/atoms/Select.d.ts +10 -2
- package/dist/components/index.cjs +31 -23
- package/dist/components/index.js +31 -23
- package/dist/providers/index.cjs +29 -21
- package/dist/providers/index.js +29 -21
- package/dist/runtime/index.cjs +29 -21
- package/dist/runtime/index.js +29 -21
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -7265,6 +7265,7 @@ function NativeSelect({
|
|
|
7265
7265
|
placeholder,
|
|
7266
7266
|
error,
|
|
7267
7267
|
onChange,
|
|
7268
|
+
onValueChange,
|
|
7268
7269
|
value,
|
|
7269
7270
|
...props
|
|
7270
7271
|
}) {
|
|
@@ -7273,8 +7274,9 @@ function NativeSelect({
|
|
|
7273
7274
|
if (typeof onChange === "string") {
|
|
7274
7275
|
eventBus.emit(`UI:${onChange}`, { value: e.target.value });
|
|
7275
7276
|
} else {
|
|
7276
|
-
onChange?.(e
|
|
7277
|
+
onChange?.(e);
|
|
7277
7278
|
}
|
|
7279
|
+
onValueChange?.(e.target.value);
|
|
7278
7280
|
};
|
|
7279
7281
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
7280
7282
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -7309,6 +7311,7 @@ function RichSelect({
|
|
|
7309
7311
|
placeholder,
|
|
7310
7312
|
error,
|
|
7311
7313
|
onChange,
|
|
7314
|
+
onValueChange,
|
|
7312
7315
|
value,
|
|
7313
7316
|
multiple,
|
|
7314
7317
|
searchable,
|
|
@@ -7332,18 +7335,16 @@ function RichSelect({
|
|
|
7332
7335
|
}
|
|
7333
7336
|
if (typeof onChange === "string") {
|
|
7334
7337
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
7335
|
-
} else {
|
|
7336
|
-
onChange?.(next);
|
|
7337
7338
|
}
|
|
7339
|
+
onValueChange?.(next);
|
|
7338
7340
|
};
|
|
7339
7341
|
const clear = (e) => {
|
|
7340
7342
|
e.stopPropagation();
|
|
7341
7343
|
const next = multiple ? [] : "";
|
|
7342
7344
|
if (typeof onChange === "string") {
|
|
7343
7345
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
7344
|
-
} else {
|
|
7345
|
-
onChange?.(next);
|
|
7346
7346
|
}
|
|
7347
|
+
onValueChange?.(next);
|
|
7347
7348
|
};
|
|
7348
7349
|
React88.useEffect(() => {
|
|
7349
7350
|
const handler = (e) => {
|
|
@@ -7361,6 +7362,7 @@ function RichSelect({
|
|
|
7361
7362
|
"button",
|
|
7362
7363
|
{
|
|
7363
7364
|
type: "button",
|
|
7365
|
+
dir: opt.dir,
|
|
7364
7366
|
disabled: opt.disabled,
|
|
7365
7367
|
onClick: () => !opt.disabled && toggle(opt.value),
|
|
7366
7368
|
className: cn(
|
|
@@ -7370,8 +7372,14 @@ function RichSelect({
|
|
|
7370
7372
|
selected.includes(opt.value) && "text-primary font-medium"
|
|
7371
7373
|
),
|
|
7372
7374
|
children: [
|
|
7373
|
-
/* @__PURE__ */ jsxRuntime.
|
|
7374
|
-
|
|
7375
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2 min-w-0", children: [
|
|
7376
|
+
opt.icon != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 flex items-center", children: opt.icon }),
|
|
7377
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-col min-w-0", children: [
|
|
7378
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: opt.label }),
|
|
7379
|
+
opt.secondaryLabel != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground font-normal", children: opt.secondaryLabel })
|
|
7380
|
+
] })
|
|
7381
|
+
] }),
|
|
7382
|
+
selected.includes(opt.value) && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "check", className: "h-icon-default w-icon-default shrink-0" })
|
|
7375
7383
|
]
|
|
7376
7384
|
},
|
|
7377
7385
|
opt.value
|
|
@@ -19220,7 +19228,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
19220
19228
|
options: sourceOptions,
|
|
19221
19229
|
value: rule.sourceQuestionId,
|
|
19222
19230
|
placeholder: t("branchingLogic.selectQuestion"),
|
|
19223
|
-
|
|
19231
|
+
onValueChange: handleSource,
|
|
19224
19232
|
disabled: readOnly,
|
|
19225
19233
|
error: broken ? t("branchingLogic.brokenReference") : void 0
|
|
19226
19234
|
}
|
|
@@ -19230,7 +19238,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
19230
19238
|
{
|
|
19231
19239
|
options: operatorOptions,
|
|
19232
19240
|
value: rule.operator,
|
|
19233
|
-
|
|
19241
|
+
onValueChange: handleOperator,
|
|
19234
19242
|
disabled: readOnly
|
|
19235
19243
|
}
|
|
19236
19244
|
) }),
|
|
@@ -19252,7 +19260,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
19252
19260
|
options: valueOptions.filter((o) => !chips.includes(o.value)),
|
|
19253
19261
|
value: "",
|
|
19254
19262
|
placeholder: t("branchingLogic.addValue"),
|
|
19255
|
-
|
|
19263
|
+
onValueChange: handleAddChip,
|
|
19256
19264
|
disabled: readOnly
|
|
19257
19265
|
}
|
|
19258
19266
|
) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -19278,7 +19286,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
19278
19286
|
options: valueOptions,
|
|
19279
19287
|
value: scalarValue,
|
|
19280
19288
|
placeholder: t("branchingLogic.selectValue"),
|
|
19281
|
-
|
|
19289
|
+
onValueChange: (v) => onChange({ ...rule, value: v }),
|
|
19282
19290
|
disabled: readOnly
|
|
19283
19291
|
}
|
|
19284
19292
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -19301,7 +19309,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
19301
19309
|
options: targetOptions,
|
|
19302
19310
|
value: rule.targetQuestionId,
|
|
19303
19311
|
placeholder: t("branchingLogic.selectTarget"),
|
|
19304
|
-
|
|
19312
|
+
onValueChange: handleTarget,
|
|
19305
19313
|
disabled: readOnly,
|
|
19306
19314
|
error: broken && rule.targetQuestionId !== END_OF_SURVEY ? t("branchingLogic.brokenReference") : void 0
|
|
19307
19315
|
}
|
|
@@ -21710,7 +21718,7 @@ var init_Pagination = __esm({
|
|
|
21710
21718
|
Select,
|
|
21711
21719
|
{
|
|
21712
21720
|
value: String(pageSize),
|
|
21713
|
-
|
|
21721
|
+
onValueChange: (v) => handlePageSizeChange(Number(v)),
|
|
21714
21722
|
options: pageSizeOptions.map((size) => ({
|
|
21715
21723
|
value: String(size),
|
|
21716
21724
|
label: String(size)
|
|
@@ -26640,7 +26648,7 @@ var init_FilterGroup = __esm({
|
|
|
26640
26648
|
Select,
|
|
26641
26649
|
{
|
|
26642
26650
|
value: selectedValues[filter.field] || "all",
|
|
26643
|
-
|
|
26651
|
+
onValueChange: (v) => handleFilterSelect(filter.field, v),
|
|
26644
26652
|
options: [
|
|
26645
26653
|
{ value: "all", label: t("filterGroup.all") },
|
|
26646
26654
|
...filter.options?.map((opt) => ({
|
|
@@ -26723,7 +26731,7 @@ var init_FilterGroup = __esm({
|
|
|
26723
26731
|
Select,
|
|
26724
26732
|
{
|
|
26725
26733
|
value: selectedValues[filter.field] || "all",
|
|
26726
|
-
|
|
26734
|
+
onValueChange: (v) => handleFilterSelect(filter.field, v),
|
|
26727
26735
|
options: [
|
|
26728
26736
|
{ value: "all", label: t("filterGroup.allOf", { label: filter.label }) },
|
|
26729
26737
|
...filter.options?.map((opt) => ({
|
|
@@ -26841,7 +26849,7 @@ var init_FilterGroup = __esm({
|
|
|
26841
26849
|
Select,
|
|
26842
26850
|
{
|
|
26843
26851
|
value: selectedValues[filter.field] || "all",
|
|
26844
|
-
|
|
26852
|
+
onValueChange: (v) => handleFilterSelect(filter.field, v),
|
|
26845
26853
|
options: [
|
|
26846
26854
|
{ value: "all", label: t("filterGroup.all") },
|
|
26847
26855
|
...filter.options?.map((opt) => ({
|
|
@@ -36559,7 +36567,7 @@ var init_VersionDiff = __esm({
|
|
|
36559
36567
|
{
|
|
36560
36568
|
options,
|
|
36561
36569
|
value: activeBeforeId,
|
|
36562
|
-
|
|
36570
|
+
onValueChange: handleBeforeChange,
|
|
36563
36571
|
"aria-label": t("versionDiff.beforeRevision")
|
|
36564
36572
|
}
|
|
36565
36573
|
) }),
|
|
@@ -36569,7 +36577,7 @@ var init_VersionDiff = __esm({
|
|
|
36569
36577
|
{
|
|
36570
36578
|
options,
|
|
36571
36579
|
value: activeAfterId,
|
|
36572
|
-
|
|
36580
|
+
onValueChange: handleAfterChange,
|
|
36573
36581
|
"aria-label": t("versionDiff.afterRevision")
|
|
36574
36582
|
}
|
|
36575
36583
|
) }),
|
|
@@ -40743,7 +40751,7 @@ function RuleEditor({
|
|
|
40743
40751
|
Select,
|
|
40744
40752
|
{
|
|
40745
40753
|
value: rule.whenEvent,
|
|
40746
|
-
|
|
40754
|
+
onValueChange: handleWhenChange,
|
|
40747
40755
|
options: availableEvents,
|
|
40748
40756
|
disabled,
|
|
40749
40757
|
className: "flex-1 min-w-0"
|
|
@@ -40754,7 +40762,7 @@ function RuleEditor({
|
|
|
40754
40762
|
Select,
|
|
40755
40763
|
{
|
|
40756
40764
|
value: rule.thenAction,
|
|
40757
|
-
|
|
40765
|
+
onValueChange: handleThenChange,
|
|
40758
40766
|
options: availableActions,
|
|
40759
40767
|
disabled,
|
|
40760
40768
|
className: "flex-1 min-w-0"
|
|
@@ -41811,7 +41819,7 @@ var init_Form = __esm({
|
|
|
41811
41819
|
...commonProps,
|
|
41812
41820
|
options,
|
|
41813
41821
|
value: String(currentValue),
|
|
41814
|
-
|
|
41822
|
+
onValueChange: (v) => handleChange(fieldName, v),
|
|
41815
41823
|
placeholder: field.placeholder || `Select ${label}...`
|
|
41816
41824
|
}
|
|
41817
41825
|
);
|
|
@@ -57184,7 +57192,7 @@ function OrbInspector({ node, schema, editable = false, userType = "builder", th
|
|
|
57184
57192
|
{
|
|
57185
57193
|
value: f3.type,
|
|
57186
57194
|
options: FIELD_TYPE_OPTIONS,
|
|
57187
|
-
|
|
57195
|
+
onValueChange: (v) => handleUpdateField(f3.name, { type: v }),
|
|
57188
57196
|
className: "w-20 text-xs h-6"
|
|
57189
57197
|
}
|
|
57190
57198
|
),
|
package/dist/avl/index.js
CHANGED
|
@@ -7216,6 +7216,7 @@ function NativeSelect({
|
|
|
7216
7216
|
placeholder,
|
|
7217
7217
|
error,
|
|
7218
7218
|
onChange,
|
|
7219
|
+
onValueChange,
|
|
7219
7220
|
value,
|
|
7220
7221
|
...props
|
|
7221
7222
|
}) {
|
|
@@ -7224,8 +7225,9 @@ function NativeSelect({
|
|
|
7224
7225
|
if (typeof onChange === "string") {
|
|
7225
7226
|
eventBus.emit(`UI:${onChange}`, { value: e.target.value });
|
|
7226
7227
|
} else {
|
|
7227
|
-
onChange?.(e
|
|
7228
|
+
onChange?.(e);
|
|
7228
7229
|
}
|
|
7230
|
+
onValueChange?.(e.target.value);
|
|
7229
7231
|
};
|
|
7230
7232
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
7231
7233
|
/* @__PURE__ */ jsxs(
|
|
@@ -7260,6 +7262,7 @@ function RichSelect({
|
|
|
7260
7262
|
placeholder,
|
|
7261
7263
|
error,
|
|
7262
7264
|
onChange,
|
|
7265
|
+
onValueChange,
|
|
7263
7266
|
value,
|
|
7264
7267
|
multiple,
|
|
7265
7268
|
searchable,
|
|
@@ -7283,18 +7286,16 @@ function RichSelect({
|
|
|
7283
7286
|
}
|
|
7284
7287
|
if (typeof onChange === "string") {
|
|
7285
7288
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
7286
|
-
} else {
|
|
7287
|
-
onChange?.(next);
|
|
7288
7289
|
}
|
|
7290
|
+
onValueChange?.(next);
|
|
7289
7291
|
};
|
|
7290
7292
|
const clear = (e) => {
|
|
7291
7293
|
e.stopPropagation();
|
|
7292
7294
|
const next = multiple ? [] : "";
|
|
7293
7295
|
if (typeof onChange === "string") {
|
|
7294
7296
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
7295
|
-
} else {
|
|
7296
|
-
onChange?.(next);
|
|
7297
7297
|
}
|
|
7298
|
+
onValueChange?.(next);
|
|
7298
7299
|
};
|
|
7299
7300
|
useEffect(() => {
|
|
7300
7301
|
const handler = (e) => {
|
|
@@ -7312,6 +7313,7 @@ function RichSelect({
|
|
|
7312
7313
|
"button",
|
|
7313
7314
|
{
|
|
7314
7315
|
type: "button",
|
|
7316
|
+
dir: opt.dir,
|
|
7315
7317
|
disabled: opt.disabled,
|
|
7316
7318
|
onClick: () => !opt.disabled && toggle(opt.value),
|
|
7317
7319
|
className: cn(
|
|
@@ -7321,8 +7323,14 @@ function RichSelect({
|
|
|
7321
7323
|
selected.includes(opt.value) && "text-primary font-medium"
|
|
7322
7324
|
),
|
|
7323
7325
|
children: [
|
|
7324
|
-
/* @__PURE__ */
|
|
7325
|
-
|
|
7326
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 min-w-0", children: [
|
|
7327
|
+
opt.icon != null && /* @__PURE__ */ jsx("span", { className: "shrink-0 flex items-center", children: opt.icon }),
|
|
7328
|
+
/* @__PURE__ */ jsxs("span", { className: "flex flex-col min-w-0", children: [
|
|
7329
|
+
/* @__PURE__ */ jsx("span", { children: opt.label }),
|
|
7330
|
+
opt.secondaryLabel != null && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground font-normal", children: opt.secondaryLabel })
|
|
7331
|
+
] })
|
|
7332
|
+
] }),
|
|
7333
|
+
selected.includes(opt.value) && /* @__PURE__ */ jsx(Icon, { name: "check", className: "h-icon-default w-icon-default shrink-0" })
|
|
7326
7334
|
]
|
|
7327
7335
|
},
|
|
7328
7336
|
opt.value
|
|
@@ -19171,7 +19179,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
19171
19179
|
options: sourceOptions,
|
|
19172
19180
|
value: rule.sourceQuestionId,
|
|
19173
19181
|
placeholder: t("branchingLogic.selectQuestion"),
|
|
19174
|
-
|
|
19182
|
+
onValueChange: handleSource,
|
|
19175
19183
|
disabled: readOnly,
|
|
19176
19184
|
error: broken ? t("branchingLogic.brokenReference") : void 0
|
|
19177
19185
|
}
|
|
@@ -19181,7 +19189,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
19181
19189
|
{
|
|
19182
19190
|
options: operatorOptions,
|
|
19183
19191
|
value: rule.operator,
|
|
19184
|
-
|
|
19192
|
+
onValueChange: handleOperator,
|
|
19185
19193
|
disabled: readOnly
|
|
19186
19194
|
}
|
|
19187
19195
|
) }),
|
|
@@ -19203,7 +19211,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
19203
19211
|
options: valueOptions.filter((o) => !chips.includes(o.value)),
|
|
19204
19212
|
value: "",
|
|
19205
19213
|
placeholder: t("branchingLogic.addValue"),
|
|
19206
|
-
|
|
19214
|
+
onValueChange: handleAddChip,
|
|
19207
19215
|
disabled: readOnly
|
|
19208
19216
|
}
|
|
19209
19217
|
) }) : /* @__PURE__ */ jsx(
|
|
@@ -19229,7 +19237,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
19229
19237
|
options: valueOptions,
|
|
19230
19238
|
value: scalarValue,
|
|
19231
19239
|
placeholder: t("branchingLogic.selectValue"),
|
|
19232
|
-
|
|
19240
|
+
onValueChange: (v) => onChange({ ...rule, value: v }),
|
|
19233
19241
|
disabled: readOnly
|
|
19234
19242
|
}
|
|
19235
19243
|
) : /* @__PURE__ */ jsx(
|
|
@@ -19252,7 +19260,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
19252
19260
|
options: targetOptions,
|
|
19253
19261
|
value: rule.targetQuestionId,
|
|
19254
19262
|
placeholder: t("branchingLogic.selectTarget"),
|
|
19255
|
-
|
|
19263
|
+
onValueChange: handleTarget,
|
|
19256
19264
|
disabled: readOnly,
|
|
19257
19265
|
error: broken && rule.targetQuestionId !== END_OF_SURVEY ? t("branchingLogic.brokenReference") : void 0
|
|
19258
19266
|
}
|
|
@@ -21661,7 +21669,7 @@ var init_Pagination = __esm({
|
|
|
21661
21669
|
Select,
|
|
21662
21670
|
{
|
|
21663
21671
|
value: String(pageSize),
|
|
21664
|
-
|
|
21672
|
+
onValueChange: (v) => handlePageSizeChange(Number(v)),
|
|
21665
21673
|
options: pageSizeOptions.map((size) => ({
|
|
21666
21674
|
value: String(size),
|
|
21667
21675
|
label: String(size)
|
|
@@ -26591,7 +26599,7 @@ var init_FilterGroup = __esm({
|
|
|
26591
26599
|
Select,
|
|
26592
26600
|
{
|
|
26593
26601
|
value: selectedValues[filter.field] || "all",
|
|
26594
|
-
|
|
26602
|
+
onValueChange: (v) => handleFilterSelect(filter.field, v),
|
|
26595
26603
|
options: [
|
|
26596
26604
|
{ value: "all", label: t("filterGroup.all") },
|
|
26597
26605
|
...filter.options?.map((opt) => ({
|
|
@@ -26674,7 +26682,7 @@ var init_FilterGroup = __esm({
|
|
|
26674
26682
|
Select,
|
|
26675
26683
|
{
|
|
26676
26684
|
value: selectedValues[filter.field] || "all",
|
|
26677
|
-
|
|
26685
|
+
onValueChange: (v) => handleFilterSelect(filter.field, v),
|
|
26678
26686
|
options: [
|
|
26679
26687
|
{ value: "all", label: t("filterGroup.allOf", { label: filter.label }) },
|
|
26680
26688
|
...filter.options?.map((opt) => ({
|
|
@@ -26792,7 +26800,7 @@ var init_FilterGroup = __esm({
|
|
|
26792
26800
|
Select,
|
|
26793
26801
|
{
|
|
26794
26802
|
value: selectedValues[filter.field] || "all",
|
|
26795
|
-
|
|
26803
|
+
onValueChange: (v) => handleFilterSelect(filter.field, v),
|
|
26796
26804
|
options: [
|
|
26797
26805
|
{ value: "all", label: t("filterGroup.all") },
|
|
26798
26806
|
...filter.options?.map((opt) => ({
|
|
@@ -36510,7 +36518,7 @@ var init_VersionDiff = __esm({
|
|
|
36510
36518
|
{
|
|
36511
36519
|
options,
|
|
36512
36520
|
value: activeBeforeId,
|
|
36513
|
-
|
|
36521
|
+
onValueChange: handleBeforeChange,
|
|
36514
36522
|
"aria-label": t("versionDiff.beforeRevision")
|
|
36515
36523
|
}
|
|
36516
36524
|
) }),
|
|
@@ -36520,7 +36528,7 @@ var init_VersionDiff = __esm({
|
|
|
36520
36528
|
{
|
|
36521
36529
|
options,
|
|
36522
36530
|
value: activeAfterId,
|
|
36523
|
-
|
|
36531
|
+
onValueChange: handleAfterChange,
|
|
36524
36532
|
"aria-label": t("versionDiff.afterRevision")
|
|
36525
36533
|
}
|
|
36526
36534
|
) }),
|
|
@@ -40694,7 +40702,7 @@ function RuleEditor({
|
|
|
40694
40702
|
Select,
|
|
40695
40703
|
{
|
|
40696
40704
|
value: rule.whenEvent,
|
|
40697
|
-
|
|
40705
|
+
onValueChange: handleWhenChange,
|
|
40698
40706
|
options: availableEvents,
|
|
40699
40707
|
disabled,
|
|
40700
40708
|
className: "flex-1 min-w-0"
|
|
@@ -40705,7 +40713,7 @@ function RuleEditor({
|
|
|
40705
40713
|
Select,
|
|
40706
40714
|
{
|
|
40707
40715
|
value: rule.thenAction,
|
|
40708
|
-
|
|
40716
|
+
onValueChange: handleThenChange,
|
|
40709
40717
|
options: availableActions,
|
|
40710
40718
|
disabled,
|
|
40711
40719
|
className: "flex-1 min-w-0"
|
|
@@ -41762,7 +41770,7 @@ var init_Form = __esm({
|
|
|
41762
41770
|
...commonProps,
|
|
41763
41771
|
options,
|
|
41764
41772
|
value: String(currentValue),
|
|
41765
|
-
|
|
41773
|
+
onValueChange: (v) => handleChange(fieldName, v),
|
|
41766
41774
|
placeholder: field.placeholder || `Select ${label}...`
|
|
41767
41775
|
}
|
|
41768
41776
|
);
|
|
@@ -57135,7 +57143,7 @@ function OrbInspector({ node, schema, editable = false, userType = "builder", th
|
|
|
57135
57143
|
{
|
|
57136
57144
|
value: f3.type,
|
|
57137
57145
|
options: FIELD_TYPE_OPTIONS,
|
|
57138
|
-
|
|
57146
|
+
onValueChange: (v) => handleUpdateField(f3.name, { type: v }),
|
|
57139
57147
|
className: "w-20 text-xs h-6"
|
|
57140
57148
|
}
|
|
57141
57149
|
),
|
|
@@ -4,6 +4,12 @@ export interface SelectOption {
|
|
|
4
4
|
value: string;
|
|
5
5
|
label: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
/** Leading content rendered in rich mode only (native mode ignores this). */
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
/** Secondary line of text rendered below label in rich mode only. */
|
|
10
|
+
secondaryLabel?: string;
|
|
11
|
+
/** dir attribute applied to the option row in rich mode only. */
|
|
12
|
+
dir?: string;
|
|
7
13
|
}
|
|
8
14
|
export interface SelectOptionGroup {
|
|
9
15
|
label: string;
|
|
@@ -30,7 +36,9 @@ export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectE
|
|
|
30
36
|
searchable?: boolean;
|
|
31
37
|
/** Show a clear button when a value is selected. */
|
|
32
38
|
clearable?: boolean;
|
|
33
|
-
/** onChange handler or declarative event key for trait dispatch */
|
|
34
|
-
onChange?:
|
|
39
|
+
/** onChange handler (native ChangeEvent) or declarative event key for trait dispatch */
|
|
40
|
+
onChange?: React.ChangeEventHandler<HTMLSelectElement> | EventKey;
|
|
41
|
+
/** Value-based callback — receives the selected string (or string[] for multiple). */
|
|
42
|
+
onValueChange?: (value: string | string[]) => void;
|
|
35
43
|
}
|
|
36
44
|
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
@@ -2414,6 +2414,7 @@ function NativeSelect({
|
|
|
2414
2414
|
placeholder,
|
|
2415
2415
|
error,
|
|
2416
2416
|
onChange,
|
|
2417
|
+
onValueChange,
|
|
2417
2418
|
value,
|
|
2418
2419
|
...props
|
|
2419
2420
|
}) {
|
|
@@ -2422,8 +2423,9 @@ function NativeSelect({
|
|
|
2422
2423
|
if (typeof onChange === "string") {
|
|
2423
2424
|
eventBus.emit(`UI:${onChange}`, { value: e.target.value });
|
|
2424
2425
|
} else {
|
|
2425
|
-
onChange?.(e
|
|
2426
|
+
onChange?.(e);
|
|
2426
2427
|
}
|
|
2428
|
+
onValueChange?.(e.target.value);
|
|
2427
2429
|
};
|
|
2428
2430
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2429
2431
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2458,6 +2460,7 @@ function RichSelect({
|
|
|
2458
2460
|
placeholder,
|
|
2459
2461
|
error,
|
|
2460
2462
|
onChange,
|
|
2463
|
+
onValueChange,
|
|
2461
2464
|
value,
|
|
2462
2465
|
multiple,
|
|
2463
2466
|
searchable,
|
|
@@ -2481,18 +2484,16 @@ function RichSelect({
|
|
|
2481
2484
|
}
|
|
2482
2485
|
if (typeof onChange === "string") {
|
|
2483
2486
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
2484
|
-
} else {
|
|
2485
|
-
onChange?.(next);
|
|
2486
2487
|
}
|
|
2488
|
+
onValueChange?.(next);
|
|
2487
2489
|
};
|
|
2488
2490
|
const clear = (e) => {
|
|
2489
2491
|
e.stopPropagation();
|
|
2490
2492
|
const next = multiple ? [] : "";
|
|
2491
2493
|
if (typeof onChange === "string") {
|
|
2492
2494
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
2493
|
-
} else {
|
|
2494
|
-
onChange?.(next);
|
|
2495
2495
|
}
|
|
2496
|
+
onValueChange?.(next);
|
|
2496
2497
|
};
|
|
2497
2498
|
React74.useEffect(() => {
|
|
2498
2499
|
const handler = (e) => {
|
|
@@ -2510,6 +2511,7 @@ function RichSelect({
|
|
|
2510
2511
|
"button",
|
|
2511
2512
|
{
|
|
2512
2513
|
type: "button",
|
|
2514
|
+
dir: opt.dir,
|
|
2513
2515
|
disabled: opt.disabled,
|
|
2514
2516
|
onClick: () => !opt.disabled && toggle(opt.value),
|
|
2515
2517
|
className: cn(
|
|
@@ -2519,8 +2521,14 @@ function RichSelect({
|
|
|
2519
2521
|
selected.includes(opt.value) && "text-primary font-medium"
|
|
2520
2522
|
),
|
|
2521
2523
|
children: [
|
|
2522
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2523
|
-
|
|
2524
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2 min-w-0", children: [
|
|
2525
|
+
opt.icon != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 flex items-center", children: opt.icon }),
|
|
2526
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-col min-w-0", children: [
|
|
2527
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: opt.label }),
|
|
2528
|
+
opt.secondaryLabel != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground font-normal", children: opt.secondaryLabel })
|
|
2529
|
+
] })
|
|
2530
|
+
] }),
|
|
2531
|
+
selected.includes(opt.value) && /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: "check", className: "h-icon-default w-icon-default shrink-0" })
|
|
2524
2532
|
]
|
|
2525
2533
|
},
|
|
2526
2534
|
opt.value
|
|
@@ -15299,7 +15307,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
15299
15307
|
options: sourceOptions,
|
|
15300
15308
|
value: rule.sourceQuestionId,
|
|
15301
15309
|
placeholder: t("branchingLogic.selectQuestion"),
|
|
15302
|
-
|
|
15310
|
+
onValueChange: handleSource,
|
|
15303
15311
|
disabled: readOnly,
|
|
15304
15312
|
error: broken ? t("branchingLogic.brokenReference") : void 0
|
|
15305
15313
|
}
|
|
@@ -15309,7 +15317,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
15309
15317
|
{
|
|
15310
15318
|
options: operatorOptions,
|
|
15311
15319
|
value: rule.operator,
|
|
15312
|
-
|
|
15320
|
+
onValueChange: handleOperator,
|
|
15313
15321
|
disabled: readOnly
|
|
15314
15322
|
}
|
|
15315
15323
|
) }),
|
|
@@ -15331,7 +15339,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
15331
15339
|
options: valueOptions.filter((o) => !chips.includes(o.value)),
|
|
15332
15340
|
value: "",
|
|
15333
15341
|
placeholder: t("branchingLogic.addValue"),
|
|
15334
|
-
|
|
15342
|
+
onValueChange: handleAddChip,
|
|
15335
15343
|
disabled: readOnly
|
|
15336
15344
|
}
|
|
15337
15345
|
) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15357,7 +15365,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
15357
15365
|
options: valueOptions,
|
|
15358
15366
|
value: scalarValue,
|
|
15359
15367
|
placeholder: t("branchingLogic.selectValue"),
|
|
15360
|
-
|
|
15368
|
+
onValueChange: (v) => onChange({ ...rule, value: v }),
|
|
15361
15369
|
disabled: readOnly
|
|
15362
15370
|
}
|
|
15363
15371
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15380,7 +15388,7 @@ var init_BranchingLogicBuilder = __esm({
|
|
|
15380
15388
|
options: targetOptions,
|
|
15381
15389
|
value: rule.targetQuestionId,
|
|
15382
15390
|
placeholder: t("branchingLogic.selectTarget"),
|
|
15383
|
-
|
|
15391
|
+
onValueChange: handleTarget,
|
|
15384
15392
|
disabled: readOnly,
|
|
15385
15393
|
error: broken && rule.targetQuestionId !== END_OF_SURVEY ? t("branchingLogic.brokenReference") : void 0
|
|
15386
15394
|
}
|
|
@@ -17789,7 +17797,7 @@ var init_Pagination = __esm({
|
|
|
17789
17797
|
exports.Select,
|
|
17790
17798
|
{
|
|
17791
17799
|
value: String(pageSize),
|
|
17792
|
-
|
|
17800
|
+
onValueChange: (v) => handlePageSizeChange(Number(v)),
|
|
17793
17801
|
options: pageSizeOptions.map((size) => ({
|
|
17794
17802
|
value: String(size),
|
|
17795
17803
|
label: String(size)
|
|
@@ -23279,7 +23287,7 @@ function FieldControl({
|
|
|
23279
23287
|
{
|
|
23280
23288
|
options: decl.values.map((v) => ({ value: v, label: v })),
|
|
23281
23289
|
value: typeof value === "string" ? value : "",
|
|
23282
|
-
|
|
23290
|
+
onValueChange: (v) => onChange(name, v)
|
|
23283
23291
|
}
|
|
23284
23292
|
);
|
|
23285
23293
|
} else if (decl.type === "number") {
|
|
@@ -23431,7 +23439,7 @@ var init_NodeSlotEditor = __esm({
|
|
|
23431
23439
|
{
|
|
23432
23440
|
options,
|
|
23433
23441
|
value: type,
|
|
23434
|
-
|
|
23442
|
+
onValueChange: (v) => emit(v, props)
|
|
23435
23443
|
}
|
|
23436
23444
|
),
|
|
23437
23445
|
type !== "" && /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "none", className: "pl-1", children: [
|
|
@@ -23885,7 +23893,7 @@ var init_FilterGroup = __esm({
|
|
|
23885
23893
|
exports.Select,
|
|
23886
23894
|
{
|
|
23887
23895
|
value: selectedValues[filter.field] || "all",
|
|
23888
|
-
|
|
23896
|
+
onValueChange: (v) => handleFilterSelect(filter.field, v),
|
|
23889
23897
|
options: [
|
|
23890
23898
|
{ value: "all", label: t("filterGroup.all") },
|
|
23891
23899
|
...filter.options?.map((opt) => ({
|
|
@@ -23968,7 +23976,7 @@ var init_FilterGroup = __esm({
|
|
|
23968
23976
|
exports.Select,
|
|
23969
23977
|
{
|
|
23970
23978
|
value: selectedValues[filter.field] || "all",
|
|
23971
|
-
|
|
23979
|
+
onValueChange: (v) => handleFilterSelect(filter.field, v),
|
|
23972
23980
|
options: [
|
|
23973
23981
|
{ value: "all", label: t("filterGroup.allOf", { label: filter.label }) },
|
|
23974
23982
|
...filter.options?.map((opt) => ({
|
|
@@ -24086,7 +24094,7 @@ var init_FilterGroup = __esm({
|
|
|
24086
24094
|
exports.Select,
|
|
24087
24095
|
{
|
|
24088
24096
|
value: selectedValues[filter.field] || "all",
|
|
24089
|
-
|
|
24097
|
+
onValueChange: (v) => handleFilterSelect(filter.field, v),
|
|
24090
24098
|
options: [
|
|
24091
24099
|
{ value: "all", label: t("filterGroup.all") },
|
|
24092
24100
|
...filter.options?.map((opt) => ({
|
|
@@ -34340,7 +34348,7 @@ var init_VersionDiff = __esm({
|
|
|
34340
34348
|
{
|
|
34341
34349
|
options,
|
|
34342
34350
|
value: activeBeforeId,
|
|
34343
|
-
|
|
34351
|
+
onValueChange: handleBeforeChange,
|
|
34344
34352
|
"aria-label": t("versionDiff.beforeRevision")
|
|
34345
34353
|
}
|
|
34346
34354
|
) }),
|
|
@@ -34350,7 +34358,7 @@ var init_VersionDiff = __esm({
|
|
|
34350
34358
|
{
|
|
34351
34359
|
options,
|
|
34352
34360
|
value: activeAfterId,
|
|
34353
|
-
|
|
34361
|
+
onValueChange: handleAfterChange,
|
|
34354
34362
|
"aria-label": t("versionDiff.afterRevision")
|
|
34355
34363
|
}
|
|
34356
34364
|
) }),
|
|
@@ -39153,7 +39161,7 @@ function RuleEditor({
|
|
|
39153
39161
|
exports.Select,
|
|
39154
39162
|
{
|
|
39155
39163
|
value: rule.whenEvent,
|
|
39156
|
-
|
|
39164
|
+
onValueChange: handleWhenChange,
|
|
39157
39165
|
options: availableEvents,
|
|
39158
39166
|
disabled,
|
|
39159
39167
|
className: "flex-1 min-w-0"
|
|
@@ -39164,7 +39172,7 @@ function RuleEditor({
|
|
|
39164
39172
|
exports.Select,
|
|
39165
39173
|
{
|
|
39166
39174
|
value: rule.thenAction,
|
|
39167
|
-
|
|
39175
|
+
onValueChange: handleThenChange,
|
|
39168
39176
|
options: availableActions,
|
|
39169
39177
|
disabled,
|
|
39170
39178
|
className: "flex-1 min-w-0"
|
|
@@ -40221,7 +40229,7 @@ var init_Form = __esm({
|
|
|
40221
40229
|
...commonProps,
|
|
40222
40230
|
options,
|
|
40223
40231
|
value: String(currentValue2),
|
|
40224
|
-
|
|
40232
|
+
onValueChange: (v) => handleChange(fieldName, v),
|
|
40225
40233
|
placeholder: field.placeholder || `Select ${label}...`
|
|
40226
40234
|
}
|
|
40227
40235
|
);
|