@timeax/form-palette 0.1.28 → 0.1.29
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/{core-BS2fNt2O.d.mts → core-74nd0n1e.d.mts} +13 -2
- package/dist/{core-CtnF6uJt.d.ts → core-B8Htm7S-.d.ts} +13 -2
- package/dist/extra.d.mts +2 -2
- package/dist/extra.d.ts +2 -2
- package/dist/extra.js +108 -36
- package/dist/extra.js.map +1 -1
- package/dist/extra.mjs +108 -36
- package/dist/extra.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +112 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +112 -39
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -43,6 +43,13 @@ interface ChangeDetail<TMeta = unknown, TRaw = unknown> {
|
|
|
43
43
|
* Example: original keyboard input or pasted string.
|
|
44
44
|
*/
|
|
45
45
|
raw?: TRaw;
|
|
46
|
+
/**
|
|
47
|
+
* Raw selected option entries as provided by the variant input.
|
|
48
|
+
*
|
|
49
|
+
* For primitive options this contains primitives, for object options
|
|
50
|
+
* it contains the original objects.
|
|
51
|
+
*/
|
|
52
|
+
selectedOptions?: unknown[];
|
|
46
53
|
nativeEvent?: React__default.SyntheticEvent;
|
|
47
54
|
/**
|
|
48
55
|
* Variant-specific metadata (e.g. cursor position).
|
|
@@ -1249,6 +1256,7 @@ interface RadioItem<TValue> {
|
|
|
1249
1256
|
description?: React.ReactNode;
|
|
1250
1257
|
disabled?: boolean;
|
|
1251
1258
|
key?: React.Key;
|
|
1259
|
+
raw?: unknown;
|
|
1252
1260
|
/**
|
|
1253
1261
|
* Option-level renderer (provided by the normaliser).
|
|
1254
1262
|
* If present, it overrides the variant-level `renderOption` for this item.
|
|
@@ -1405,6 +1413,7 @@ type CheckboxTriStateValue = true | false;
|
|
|
1405
1413
|
* "none" is used to represent "no stance yet".
|
|
1406
1414
|
*/
|
|
1407
1415
|
type CheckboxInternalState = true | false | "none";
|
|
1416
|
+
type CheckboxGroupSelectedValue<TValue> = readonly TValue[] | undefined;
|
|
1408
1417
|
type CheckboxGroupValueMain<TValue extends string | number | symbol> = Record<TValue, CheckboxTriStateValue>;
|
|
1409
1418
|
/**
|
|
1410
1419
|
* Single checkbox value.
|
|
@@ -1419,13 +1428,14 @@ type CheckboxSingleValue = boolean | undefined;
|
|
|
1419
1428
|
*
|
|
1420
1429
|
* At the type level this is a union; at runtime we branch using `single`.
|
|
1421
1430
|
*/
|
|
1422
|
-
type CheckboxVariantValue<TValue> = CheckboxSingleValue | CheckboxGroupValueMain<TValue>;
|
|
1431
|
+
type CheckboxVariantValue<TValue> = CheckboxSingleValue | CheckboxGroupValueMain<TValue> | CheckboxGroupSelectedValue<TValue>;
|
|
1423
1432
|
interface CheckboxItem<TValue> {
|
|
1424
1433
|
value: TValue;
|
|
1425
1434
|
label: React.ReactNode;
|
|
1426
1435
|
description?: React.ReactNode;
|
|
1427
1436
|
disabled?: boolean;
|
|
1428
1437
|
key?: React.Key;
|
|
1438
|
+
raw?: unknown;
|
|
1429
1439
|
/**
|
|
1430
1440
|
* Option-level renderer (provided by the normaliser).
|
|
1431
1441
|
* If present, it should override the variant-level `renderOption` for this item.
|
|
@@ -1605,7 +1615,8 @@ type DefaultCheckboxItemValue = string | number;
|
|
|
1605
1615
|
* Public "value" type for the checkbox variant used by the registry:
|
|
1606
1616
|
*
|
|
1607
1617
|
* - Single mode: boolean | undefined
|
|
1608
|
-
* - Group mode:
|
|
1618
|
+
* - Group mode (non-tristate): DefaultCheckboxItemValue[] | undefined
|
|
1619
|
+
* - Group mode (tristate): Record<DefaultCheckboxItemValue, true | false>
|
|
1609
1620
|
*
|
|
1610
1621
|
* In tri-state group mode, both `true` and `false` entries are present;
|
|
1611
1622
|
* `"none"` never appears in this type.
|
|
@@ -43,6 +43,13 @@ interface ChangeDetail<TMeta = unknown, TRaw = unknown> {
|
|
|
43
43
|
* Example: original keyboard input or pasted string.
|
|
44
44
|
*/
|
|
45
45
|
raw?: TRaw;
|
|
46
|
+
/**
|
|
47
|
+
* Raw selected option entries as provided by the variant input.
|
|
48
|
+
*
|
|
49
|
+
* For primitive options this contains primitives, for object options
|
|
50
|
+
* it contains the original objects.
|
|
51
|
+
*/
|
|
52
|
+
selectedOptions?: unknown[];
|
|
46
53
|
nativeEvent?: React__default.SyntheticEvent;
|
|
47
54
|
/**
|
|
48
55
|
* Variant-specific metadata (e.g. cursor position).
|
|
@@ -1249,6 +1256,7 @@ interface RadioItem<TValue> {
|
|
|
1249
1256
|
description?: React.ReactNode;
|
|
1250
1257
|
disabled?: boolean;
|
|
1251
1258
|
key?: React.Key;
|
|
1259
|
+
raw?: unknown;
|
|
1252
1260
|
/**
|
|
1253
1261
|
* Option-level renderer (provided by the normaliser).
|
|
1254
1262
|
* If present, it overrides the variant-level `renderOption` for this item.
|
|
@@ -1405,6 +1413,7 @@ type CheckboxTriStateValue = true | false;
|
|
|
1405
1413
|
* "none" is used to represent "no stance yet".
|
|
1406
1414
|
*/
|
|
1407
1415
|
type CheckboxInternalState = true | false | "none";
|
|
1416
|
+
type CheckboxGroupSelectedValue<TValue> = readonly TValue[] | undefined;
|
|
1408
1417
|
type CheckboxGroupValueMain<TValue extends string | number | symbol> = Record<TValue, CheckboxTriStateValue>;
|
|
1409
1418
|
/**
|
|
1410
1419
|
* Single checkbox value.
|
|
@@ -1419,13 +1428,14 @@ type CheckboxSingleValue = boolean | undefined;
|
|
|
1419
1428
|
*
|
|
1420
1429
|
* At the type level this is a union; at runtime we branch using `single`.
|
|
1421
1430
|
*/
|
|
1422
|
-
type CheckboxVariantValue<TValue> = CheckboxSingleValue | CheckboxGroupValueMain<TValue>;
|
|
1431
|
+
type CheckboxVariantValue<TValue> = CheckboxSingleValue | CheckboxGroupValueMain<TValue> | CheckboxGroupSelectedValue<TValue>;
|
|
1423
1432
|
interface CheckboxItem<TValue> {
|
|
1424
1433
|
value: TValue;
|
|
1425
1434
|
label: React.ReactNode;
|
|
1426
1435
|
description?: React.ReactNode;
|
|
1427
1436
|
disabled?: boolean;
|
|
1428
1437
|
key?: React.Key;
|
|
1438
|
+
raw?: unknown;
|
|
1429
1439
|
/**
|
|
1430
1440
|
* Option-level renderer (provided by the normaliser).
|
|
1431
1441
|
* If present, it should override the variant-level `renderOption` for this item.
|
|
@@ -1605,7 +1615,8 @@ type DefaultCheckboxItemValue = string | number;
|
|
|
1605
1615
|
* Public "value" type for the checkbox variant used by the registry:
|
|
1606
1616
|
*
|
|
1607
1617
|
* - Single mode: boolean | undefined
|
|
1608
|
-
* - Group mode:
|
|
1618
|
+
* - Group mode (non-tristate): DefaultCheckboxItemValue[] | undefined
|
|
1619
|
+
* - Group mode (tristate): Record<DefaultCheckboxItemValue, true | false>
|
|
1609
1620
|
*
|
|
1610
1621
|
* In tri-state group mode, both `true` and `false` entries are present;
|
|
1611
1622
|
* `"none"` never appears in this type.
|
package/dist/extra.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { Q as ListerSearchPayload, U as ListerId, W as ListerDefinition, X as ListerOption, Y as PresetMap, Z as ListerApi, _ as ListerStoreState, $ as ListerSessionId, a0 as ListerSearchTarget, a1 as ListerSearchMode, a2 as ListerFilterCtx, a3 as ListerDetails, a4 as ListerProviderHost, a5 as ListerRuntimeState, a6 as ShadcnJsonEditorProps, a7 as JsonEditorIndexHandle } from './core-
|
|
4
|
-
export { ad as ListerChangeEvent, am as ListerFilterApply, al as ListerFilterApplyMode, an as ListerFilterBindKey, ap as ListerFilterGroupOption, ao as ListerFilterInput, ar as ListerFilterInputOption, as as ListerFilterOption, at as ListerFilterSpec, aq as ListerFilterValueOption, af as ListerLogCode, ag as ListerLogEntry, ae as ListerLogLevel, ai as ListerMapping, a8 as ListerMode, ax as ListerOpenOptions, a9 as ListerOpenReason, ay as ListerOpenResult, aw as ListerOptionsForMode, ah as ListerPermissionCtx, av as ListerRawForMode, ak as ListerSearchSpec, aD as ListerSessionState, aj as ListerSource, au as ListerValueForMode, ac as OpenAnchor, aB as PresetFilters, aC as PresetMeta, az as PresetRaw, aA as PresetValue, ab as Resolver, aa as Selector } from './core-
|
|
3
|
+
import { Q as ListerSearchPayload, U as ListerId, W as ListerDefinition, X as ListerOption, Y as PresetMap, Z as ListerApi, _ as ListerStoreState, $ as ListerSessionId, a0 as ListerSearchTarget, a1 as ListerSearchMode, a2 as ListerFilterCtx, a3 as ListerDetails, a4 as ListerProviderHost, a5 as ListerRuntimeState, a6 as ShadcnJsonEditorProps, a7 as JsonEditorIndexHandle } from './core-74nd0n1e.mjs';
|
|
4
|
+
export { ad as ListerChangeEvent, am as ListerFilterApply, al as ListerFilterApplyMode, an as ListerFilterBindKey, ap as ListerFilterGroupOption, ao as ListerFilterInput, ar as ListerFilterInputOption, as as ListerFilterOption, at as ListerFilterSpec, aq as ListerFilterValueOption, af as ListerLogCode, ag as ListerLogEntry, ae as ListerLogLevel, ai as ListerMapping, a8 as ListerMode, ax as ListerOpenOptions, a9 as ListerOpenReason, ay as ListerOpenResult, aw as ListerOptionsForMode, ah as ListerPermissionCtx, av as ListerRawForMode, ak as ListerSearchSpec, aD as ListerSessionState, aj as ListerSource, au as ListerValueForMode, ac as OpenAnchor, aB as PresetFilters, aC as PresetMeta, az as PresetRaw, aA as PresetValue, ab as Resolver, aa as Selector } from './core-74nd0n1e.mjs';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import './adapter-CvjXO9Gi.mjs';
|
|
7
7
|
import '@inertiajs/core';
|
package/dist/extra.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { Q as ListerSearchPayload, U as ListerId, W as ListerDefinition, X as ListerOption, Y as PresetMap, Z as ListerApi, _ as ListerStoreState, $ as ListerSessionId, a0 as ListerSearchTarget, a1 as ListerSearchMode, a2 as ListerFilterCtx, a3 as ListerDetails, a4 as ListerProviderHost, a5 as ListerRuntimeState, a6 as ShadcnJsonEditorProps, a7 as JsonEditorIndexHandle } from './core-
|
|
4
|
-
export { ad as ListerChangeEvent, am as ListerFilterApply, al as ListerFilterApplyMode, an as ListerFilterBindKey, ap as ListerFilterGroupOption, ao as ListerFilterInput, ar as ListerFilterInputOption, as as ListerFilterOption, at as ListerFilterSpec, aq as ListerFilterValueOption, af as ListerLogCode, ag as ListerLogEntry, ae as ListerLogLevel, ai as ListerMapping, a8 as ListerMode, ax as ListerOpenOptions, a9 as ListerOpenReason, ay as ListerOpenResult, aw as ListerOptionsForMode, ah as ListerPermissionCtx, av as ListerRawForMode, ak as ListerSearchSpec, aD as ListerSessionState, aj as ListerSource, au as ListerValueForMode, ac as OpenAnchor, aB as PresetFilters, aC as PresetMeta, az as PresetRaw, aA as PresetValue, ab as Resolver, aa as Selector } from './core-
|
|
3
|
+
import { Q as ListerSearchPayload, U as ListerId, W as ListerDefinition, X as ListerOption, Y as PresetMap, Z as ListerApi, _ as ListerStoreState, $ as ListerSessionId, a0 as ListerSearchTarget, a1 as ListerSearchMode, a2 as ListerFilterCtx, a3 as ListerDetails, a4 as ListerProviderHost, a5 as ListerRuntimeState, a6 as ShadcnJsonEditorProps, a7 as JsonEditorIndexHandle } from './core-B8Htm7S-.js';
|
|
4
|
+
export { ad as ListerChangeEvent, am as ListerFilterApply, al as ListerFilterApplyMode, an as ListerFilterBindKey, ap as ListerFilterGroupOption, ao as ListerFilterInput, ar as ListerFilterInputOption, as as ListerFilterOption, at as ListerFilterSpec, aq as ListerFilterValueOption, af as ListerLogCode, ag as ListerLogEntry, ae as ListerLogLevel, ai as ListerMapping, a8 as ListerMode, ax as ListerOpenOptions, a9 as ListerOpenReason, ay as ListerOpenResult, aw as ListerOptionsForMode, ah as ListerPermissionCtx, av as ListerRawForMode, ak as ListerSearchSpec, aD as ListerSessionState, aj as ListerSource, au as ListerValueForMode, ac as OpenAnchor, aB as PresetFilters, aC as PresetMeta, az as PresetRaw, aA as PresetValue, ab as Resolver, aa as Selector } from './core-B8Htm7S-.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import './adapter-CvjXO9Gi.js';
|
|
7
7
|
import '@inertiajs/core';
|
package/dist/extra.js
CHANGED
|
@@ -20019,17 +20019,21 @@ function normalizeItems(items, mappers, optionValueKey, optionLabelKey) {
|
|
|
20019
20019
|
label: mappers.getLabel(item, index),
|
|
20020
20020
|
description: mappers.getDescription ? mappers.getDescription(item, index) : void 0,
|
|
20021
20021
|
disabled: mappers.isDisabled ? mappers.isDisabled(item, index) : false,
|
|
20022
|
-
key: mappers.getKey ? mappers.getKey(item, index) : index
|
|
20022
|
+
key: mappers.getKey ? mappers.getKey(item, index) : index,
|
|
20023
|
+
raw: item
|
|
20023
20024
|
}));
|
|
20024
20025
|
}
|
|
20025
20026
|
if (optionValueKey || optionLabelKey) {
|
|
20026
20027
|
return items.map((item, index) => {
|
|
20027
|
-
return
|
|
20028
|
-
|
|
20029
|
-
|
|
20030
|
-
|
|
20031
|
-
|
|
20032
|
-
|
|
20028
|
+
return {
|
|
20029
|
+
...globalNormalizeCheckBasedOptions(
|
|
20030
|
+
item,
|
|
20031
|
+
index,
|
|
20032
|
+
optionLabelKey,
|
|
20033
|
+
optionValueKey
|
|
20034
|
+
),
|
|
20035
|
+
raw: item
|
|
20036
|
+
};
|
|
20033
20037
|
});
|
|
20034
20038
|
}
|
|
20035
20039
|
return items.map((item, index) => {
|
|
@@ -20040,7 +20044,8 @@ function normalizeItems(items, mappers, optionValueKey, optionLabelKey) {
|
|
|
20040
20044
|
label: String(item),
|
|
20041
20045
|
description: void 0,
|
|
20042
20046
|
disabled: false,
|
|
20043
|
-
key: index
|
|
20047
|
+
key: index,
|
|
20048
|
+
raw: item
|
|
20044
20049
|
};
|
|
20045
20050
|
}
|
|
20046
20051
|
return item;
|
|
@@ -20103,11 +20108,12 @@ var InnerShadcnRadioVariant = (props, ref) => {
|
|
|
20103
20108
|
return found ? String(found.value) : void 0;
|
|
20104
20109
|
}, [normalized, value]);
|
|
20105
20110
|
const handleSelect = React74__namespace.useCallback(
|
|
20106
|
-
(next) => {
|
|
20111
|
+
(next, selectedRaw) => {
|
|
20107
20112
|
if (!onValue || disabled) return;
|
|
20108
20113
|
const detail = {
|
|
20109
20114
|
source: "variant",
|
|
20110
|
-
raw: next,
|
|
20115
|
+
raw: selectedRaw != null ? selectedRaw : next,
|
|
20116
|
+
selectedOptions: [selectedRaw != null ? selectedRaw : next],
|
|
20111
20117
|
nativeEvent: void 0,
|
|
20112
20118
|
meta: void 0
|
|
20113
20119
|
};
|
|
@@ -20117,9 +20123,10 @@ var InnerShadcnRadioVariant = (props, ref) => {
|
|
|
20117
20123
|
);
|
|
20118
20124
|
const handleRadioChange = React74__namespace.useCallback(
|
|
20119
20125
|
(raw) => {
|
|
20126
|
+
var _a;
|
|
20120
20127
|
const found = normalized.find((item) => String(item.value) === raw);
|
|
20121
20128
|
if (!found) return;
|
|
20122
|
-
handleSelect(found.value);
|
|
20129
|
+
handleSelect(found.value, (_a = found.raw) != null ? _a : found.value);
|
|
20123
20130
|
},
|
|
20124
20131
|
[normalized, handleSelect]
|
|
20125
20132
|
);
|
|
@@ -20365,7 +20372,8 @@ function normalizeItems2(items, mappers, optionValueKey, optionLabelKey) {
|
|
|
20365
20372
|
description: mappers.getDescription ? mappers.getDescription(item, index) : void 0,
|
|
20366
20373
|
disabled: mappers.isDisabled ? mappers.isDisabled(item, index) : false,
|
|
20367
20374
|
key: mappers.getKey ? mappers.getKey(item, index) : index,
|
|
20368
|
-
tristate: mappers.getTristate ? mappers.getTristate(item, index) : void 0
|
|
20375
|
+
tristate: mappers.getTristate ? mappers.getTristate(item, index) : void 0,
|
|
20376
|
+
raw: item
|
|
20369
20377
|
}));
|
|
20370
20378
|
}
|
|
20371
20379
|
if (optionValueKey || optionLabelKey) {
|
|
@@ -20380,7 +20388,8 @@ function normalizeItems2(items, mappers, optionValueKey, optionLabelKey) {
|
|
|
20380
20388
|
const tristate = anyItem.tristate;
|
|
20381
20389
|
return {
|
|
20382
20390
|
...normalised,
|
|
20383
|
-
tristate
|
|
20391
|
+
tristate,
|
|
20392
|
+
raw: item
|
|
20384
20393
|
};
|
|
20385
20394
|
});
|
|
20386
20395
|
}
|
|
@@ -20393,7 +20402,8 @@ function normalizeItems2(items, mappers, optionValueKey, optionLabelKey) {
|
|
|
20393
20402
|
description: void 0,
|
|
20394
20403
|
disabled: false,
|
|
20395
20404
|
key: index,
|
|
20396
|
-
tristate: void 0
|
|
20405
|
+
tristate: void 0,
|
|
20406
|
+
raw: item
|
|
20397
20407
|
};
|
|
20398
20408
|
}
|
|
20399
20409
|
return item;
|
|
@@ -20404,7 +20414,17 @@ function isEqualValue2(a3, b2) {
|
|
|
20404
20414
|
}
|
|
20405
20415
|
function asGroupValue(value) {
|
|
20406
20416
|
if (!value) return void 0;
|
|
20407
|
-
if (Array.isArray(value))
|
|
20417
|
+
if (Array.isArray(value)) {
|
|
20418
|
+
if (value.length === 0) return void 0;
|
|
20419
|
+
const first = value[0];
|
|
20420
|
+
if (first && typeof first === "object" && "value" in first && "state" in first) {
|
|
20421
|
+
return value;
|
|
20422
|
+
}
|
|
20423
|
+
return value.map((item) => ({
|
|
20424
|
+
value: item,
|
|
20425
|
+
state: true
|
|
20426
|
+
}));
|
|
20427
|
+
}
|
|
20408
20428
|
if (typeof value == "object")
|
|
20409
20429
|
return Object.keys(value).map(
|
|
20410
20430
|
(key) => ({
|
|
@@ -20460,11 +20480,21 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
20460
20480
|
} = props;
|
|
20461
20481
|
const hasError = !!error;
|
|
20462
20482
|
const isSingle = !!single;
|
|
20483
|
+
const normalized = React74__namespace.useMemo(
|
|
20484
|
+
() => normalizeItems2(
|
|
20485
|
+
items != null ? items : options,
|
|
20486
|
+
mappers,
|
|
20487
|
+
optionValue,
|
|
20488
|
+
optionLabel
|
|
20489
|
+
),
|
|
20490
|
+
[items, options, mappers, optionValue, optionLabel]
|
|
20491
|
+
);
|
|
20463
20492
|
if (isSingle) {
|
|
20464
20493
|
const singleVal = asSingleValue(value);
|
|
20465
20494
|
const effectiveTristate = !!tristateDefault;
|
|
20466
20495
|
const internalState = effectiveTristate ? singleVal != null ? singleVal : "none" : !!singleVal;
|
|
20467
20496
|
const handleSingleChange = (next) => {
|
|
20497
|
+
var _a;
|
|
20468
20498
|
if (!onValue || disabled) return;
|
|
20469
20499
|
let nextPublic;
|
|
20470
20500
|
if (effectiveTristate) {
|
|
@@ -20475,6 +20505,7 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
20475
20505
|
const detail = {
|
|
20476
20506
|
source: "variant",
|
|
20477
20507
|
raw: nextPublic,
|
|
20508
|
+
selectedOptions: nextPublic === true ? normalized[0] ? [(_a = normalized[0].raw) != null ? _a : normalized[0].value] : [] : [],
|
|
20478
20509
|
nativeEvent: void 0,
|
|
20479
20510
|
meta: void 0
|
|
20480
20511
|
};
|
|
@@ -20533,15 +20564,6 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
20533
20564
|
);
|
|
20534
20565
|
}
|
|
20535
20566
|
const groupValue = asGroupValue(value);
|
|
20536
|
-
const normalized = React74__namespace.useMemo(
|
|
20537
|
-
() => normalizeItems2(
|
|
20538
|
-
items != null ? items : options,
|
|
20539
|
-
mappers,
|
|
20540
|
-
optionValue,
|
|
20541
|
-
optionLabel
|
|
20542
|
-
),
|
|
20543
|
-
[items, options, mappers, optionValue, optionLabel]
|
|
20544
|
-
);
|
|
20545
20567
|
const {
|
|
20546
20568
|
groupStyle,
|
|
20547
20569
|
groupClasses,
|
|
@@ -20561,6 +20583,13 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
20561
20583
|
labelTextSizeClass: labelTextSize2(size),
|
|
20562
20584
|
descriptionTextSizeClass: descriptionTextSize2(size)
|
|
20563
20585
|
});
|
|
20586
|
+
const hasAnyTristate = React74__namespace.useMemo(
|
|
20587
|
+
() => normalized.some((item) => {
|
|
20588
|
+
var _a, _b;
|
|
20589
|
+
return (_b = (_a = item.tristate) != null ? _a : tristateDefault) != null ? _b : false;
|
|
20590
|
+
}),
|
|
20591
|
+
[normalized, tristateDefault]
|
|
20592
|
+
);
|
|
20564
20593
|
const findEntryIndex = React74__namespace.useCallback(
|
|
20565
20594
|
(val) => {
|
|
20566
20595
|
if (!groupValue) return -1;
|
|
@@ -20633,14 +20662,28 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
|
|
|
20633
20662
|
const detail = {
|
|
20634
20663
|
source: "variant",
|
|
20635
20664
|
raw: nextList,
|
|
20665
|
+
selectedOptions: nextList.map(
|
|
20666
|
+
(entry) => {
|
|
20667
|
+
var _a, _b;
|
|
20668
|
+
return (_b = (_a = normalized.find(
|
|
20669
|
+
(item) => isEqualValue2(item.value, entry.value)
|
|
20670
|
+
)) == null ? void 0 : _a.raw) != null ? _b : entry.value;
|
|
20671
|
+
}
|
|
20672
|
+
),
|
|
20636
20673
|
nativeEvent: void 0,
|
|
20637
20674
|
meta: void 0
|
|
20638
20675
|
};
|
|
20639
|
-
|
|
20640
|
-
|
|
20641
|
-
|
|
20676
|
+
if (hasAnyTristate) {
|
|
20677
|
+
const value2 = {};
|
|
20678
|
+
nextList.forEach(
|
|
20679
|
+
(item) => value2[item.value] = item.state
|
|
20680
|
+
);
|
|
20681
|
+
onValue(value2, detail);
|
|
20682
|
+
return;
|
|
20683
|
+
}
|
|
20684
|
+
onValue(nextList.map((item) => item.value), detail);
|
|
20642
20685
|
},
|
|
20643
|
-
[onValue, disabled, groupValue]
|
|
20686
|
+
[onValue, disabled, groupValue, normalized, hasAnyTristate]
|
|
20644
20687
|
);
|
|
20645
20688
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20646
20689
|
"div",
|
|
@@ -20916,13 +20959,14 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
20916
20959
|
);
|
|
20917
20960
|
const handleChange = React74__namespace.useCallback(
|
|
20918
20961
|
(rawKey) => {
|
|
20919
|
-
var _a2, _b2, _c;
|
|
20962
|
+
var _a2, _b2, _c, _d;
|
|
20920
20963
|
if (!onValue || rawKey === "") return;
|
|
20921
20964
|
const primitive = (_a2 = valueMap.get(rawKey)) != null ? _a2 : rawKey;
|
|
20922
20965
|
const item = (_b2 = items.find((it) => String(it.value) === String(primitive))) != null ? _b2 : null;
|
|
20923
20966
|
const detail = {
|
|
20924
20967
|
source: "variant",
|
|
20925
20968
|
raw: (_c = item == null ? void 0 : item.raw) != null ? _c : primitive,
|
|
20969
|
+
selectedOptions: [(_d = item == null ? void 0 : item.raw) != null ? _d : primitive],
|
|
20926
20970
|
nativeEvent: void 0,
|
|
20927
20971
|
meta: void 0
|
|
20928
20972
|
};
|
|
@@ -21024,6 +21068,7 @@ var ShadcnSelectVariant = React74__namespace.forwardRef(function ShadcnSelectVar
|
|
|
21024
21068
|
const detail = {
|
|
21025
21069
|
source: "variant",
|
|
21026
21070
|
raw: void 0,
|
|
21071
|
+
selectedOptions: [],
|
|
21027
21072
|
nativeEvent: void 0,
|
|
21028
21073
|
meta: { action: "clear" }
|
|
21029
21074
|
};
|
|
@@ -21658,7 +21703,12 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
21658
21703
|
next = [...current, primitive];
|
|
21659
21704
|
}
|
|
21660
21705
|
const final = next.length ? next : void 0;
|
|
21661
|
-
const values = next == null ? void 0 : next.map(
|
|
21706
|
+
const values = next == null ? void 0 : next.map(
|
|
21707
|
+
(item) => {
|
|
21708
|
+
var _a2, _b;
|
|
21709
|
+
return (_b = (_a2 = keyedItems[item]) == null ? void 0 : _a2.raw) != null ? _b : item;
|
|
21710
|
+
}
|
|
21711
|
+
);
|
|
21662
21712
|
const detail = {
|
|
21663
21713
|
source: "variant",
|
|
21664
21714
|
raw: {
|
|
@@ -21667,12 +21717,13 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
21667
21717
|
next: final,
|
|
21668
21718
|
values
|
|
21669
21719
|
},
|
|
21720
|
+
selectedOptions: values != null ? values : [],
|
|
21670
21721
|
nativeEvent: void 0,
|
|
21671
21722
|
meta: void 0
|
|
21672
21723
|
};
|
|
21673
21724
|
onValue(final, detail);
|
|
21674
21725
|
},
|
|
21675
|
-
[onValue, value, disabled, readOnly]
|
|
21726
|
+
[onValue, value, disabled, readOnly, keyedItems]
|
|
21676
21727
|
);
|
|
21677
21728
|
const handleSelectAll = React74__namespace.useCallback(() => {
|
|
21678
21729
|
if (!onValue || disabled || readOnly) return;
|
|
@@ -21688,7 +21739,10 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
21688
21739
|
next = Array.from(merged);
|
|
21689
21740
|
}
|
|
21690
21741
|
const final = next.length ? next : void 0;
|
|
21691
|
-
const values = next.map((item) =>
|
|
21742
|
+
const values = next.map((item) => {
|
|
21743
|
+
var _a2, _b;
|
|
21744
|
+
return (_b = (_a2 = keyedItems[item]) == null ? void 0 : _a2.raw) != null ? _b : item;
|
|
21745
|
+
});
|
|
21692
21746
|
const detail = {
|
|
21693
21747
|
source: "variant",
|
|
21694
21748
|
raw: {
|
|
@@ -21696,6 +21750,7 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
21696
21750
|
next: final,
|
|
21697
21751
|
values
|
|
21698
21752
|
},
|
|
21753
|
+
selectedOptions: values,
|
|
21699
21754
|
nativeEvent: void 0,
|
|
21700
21755
|
meta: {
|
|
21701
21756
|
allSelected: !currentlyAllSelected
|
|
@@ -21708,7 +21763,8 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
21708
21763
|
disabled,
|
|
21709
21764
|
readOnly,
|
|
21710
21765
|
allSelectableValues,
|
|
21711
|
-
selectedValues
|
|
21766
|
+
selectedValues,
|
|
21767
|
+
keyedItems
|
|
21712
21768
|
]);
|
|
21713
21769
|
const handleClearAll = React74__namespace.useCallback(() => {
|
|
21714
21770
|
if (!onValue || disabled || readOnly) return;
|
|
@@ -21717,6 +21773,7 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
21717
21773
|
raw: {
|
|
21718
21774
|
type: "clear"
|
|
21719
21775
|
},
|
|
21776
|
+
selectedOptions: [],
|
|
21720
21777
|
nativeEvent: void 0,
|
|
21721
21778
|
meta: void 0
|
|
21722
21779
|
};
|
|
@@ -21732,9 +21789,14 @@ var ShadcnMultiSelectVariant = React74__namespace.forwardRef(function ShadcnMult
|
|
|
21732
21789
|
selectedValues,
|
|
21733
21790
|
item.value
|
|
21734
21791
|
);
|
|
21792
|
+
const selectedOptions = (updated != null ? updated : []).map((value2) => {
|
|
21793
|
+
var _a2, _b;
|
|
21794
|
+
return (_b = (_a2 = keyedItems[value2]) == null ? void 0 : _a2.raw) != null ? _b : value2;
|
|
21795
|
+
});
|
|
21735
21796
|
const detail = {
|
|
21736
21797
|
source: "variant",
|
|
21737
21798
|
raw: item,
|
|
21799
|
+
selectedOptions,
|
|
21738
21800
|
nativeEvent: void 0,
|
|
21739
21801
|
meta: { action: "remove", removed: value }
|
|
21740
21802
|
};
|
|
@@ -23659,9 +23721,16 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
23659
23721
|
setOpen(false);
|
|
23660
23722
|
}
|
|
23661
23723
|
const nextSelectedValues = Array.isArray(nextValue) ? nextValue : nextValue !== void 0 && nextValue !== null ? [nextValue] : [];
|
|
23724
|
+
const nextSelectedOptions = nextSelectedValues.map(
|
|
23725
|
+
(val) => {
|
|
23726
|
+
var _a, _b;
|
|
23727
|
+
return (_b = (_a = allNodesFlat.find((node) => node.value === val)) == null ? void 0 : _a.raw) != null ? _b : val;
|
|
23728
|
+
}
|
|
23729
|
+
);
|
|
23662
23730
|
const detail = {
|
|
23663
23731
|
source: "variant",
|
|
23664
23732
|
raw: item.raw,
|
|
23733
|
+
selectedOptions: nextSelectedOptions,
|
|
23665
23734
|
nativeEvent: void 0,
|
|
23666
23735
|
meta: {
|
|
23667
23736
|
toggled: item.value,
|
|
@@ -23676,7 +23745,8 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
23676
23745
|
multiple,
|
|
23677
23746
|
selectedValues,
|
|
23678
23747
|
onValue,
|
|
23679
|
-
toggleExpanded
|
|
23748
|
+
toggleExpanded,
|
|
23749
|
+
allNodesFlat
|
|
23680
23750
|
]
|
|
23681
23751
|
);
|
|
23682
23752
|
const handleClear = React74__namespace.useCallback(() => {
|
|
@@ -23684,6 +23754,7 @@ var ShadcnTreeSelectVariant = React74__namespace.forwardRef(function ShadcnTreeS
|
|
|
23684
23754
|
const detail = {
|
|
23685
23755
|
source: "variant",
|
|
23686
23756
|
raw: void 0,
|
|
23757
|
+
selectedOptions: [],
|
|
23687
23758
|
nativeEvent: void 0,
|
|
23688
23759
|
meta: { action: "clear" }
|
|
23689
23760
|
};
|
|
@@ -25457,6 +25528,7 @@ var ShadcnToggleVariant3 = React74__namespace.forwardRef(function ShadcnToggleVa
|
|
|
25457
25528
|
source: "variant",
|
|
25458
25529
|
raw: rawSelection,
|
|
25459
25530
|
// original item(s)
|
|
25531
|
+
selectedOptions: Array.isArray(rawSelection) ? rawSelection : rawSelection === void 0 ? [] : [rawSelection],
|
|
25460
25532
|
nativeEvent: void 0,
|
|
25461
25533
|
meta: { action: "toggle" }
|
|
25462
25534
|
};
|
|
@@ -30236,7 +30308,7 @@ var ShadcnIconVariant = React74__namespace.forwardRef(function ShadcnIconVariant
|
|
|
30236
30308
|
PopoverContent,
|
|
30237
30309
|
{
|
|
30238
30310
|
className: cn(
|
|
30239
|
-
"w-(--radix-popover-trigger-width) p-0",
|
|
30311
|
+
"w-(--radix-popover-trigger-width) p-0 max-h-(--radix-popper-available-height)",
|
|
30240
30312
|
popoverClassName
|
|
30241
30313
|
),
|
|
30242
30314
|
align: "start",
|
|
@@ -31086,7 +31158,7 @@ var ShadcnImageIconVariant = React74__namespace.forwardRef(function ShadcnImageI
|
|
|
31086
31158
|
PopoverContent,
|
|
31087
31159
|
{
|
|
31088
31160
|
className: cn(
|
|
31089
|
-
"w-(--radix-popover-trigger-width) p-0",
|
|
31161
|
+
"w-(--radix-popover-trigger-width) p-0 max-h-(--radix-popper-available-height)",
|
|
31090
31162
|
popoverClassName
|
|
31091
31163
|
),
|
|
31092
31164
|
align: "start",
|