@cardenelabs/cdl 0.60.0 → 0.61.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/CHANGELOG.md +22 -1
- package/dist/index.cjs +74 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -8
- package/dist/index.d.ts +22 -8
- package/dist/index.js +74 -35
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +65 -29
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +65 -29
- package/dist/react.js.map +1 -1
- package/dist/{render-MbIjRWdX.d.cts → render-Dk8_6ua6.d.cts} +21 -6
- package/dist/{render-MbIjRWdX.d.ts → render-Dk8_6ua6.d.ts} +21 -6
- package/package.json +1 -1
- package/src/builder.ts +17 -11
- package/src/index.ts +1 -1
- package/src/input-option.ts +62 -0
- package/src/kinds/generic.tsx +6 -2
- package/src/render/interactive-panel.tsx +18 -16
- package/src/render/nodes.tsx +13 -6
- package/src/render/stage.tsx +5 -0
- package/src/render/utils.ts +14 -2
- package/src/render.tsx +6 -1
- package/src/types.ts +18 -5
package/src/types.ts
CHANGED
|
@@ -820,6 +820,15 @@ export type CdlState = {
|
|
|
820
820
|
initial: number | string;
|
|
821
821
|
};
|
|
822
822
|
|
|
823
|
+
/**
|
|
824
|
+
* 選択肢を持つ入力欄 (`dropdown` / `radio` / `tabs` / `multi-select`) の 1 つの選択肢 (#855)。
|
|
825
|
+
*
|
|
826
|
+
* 文字列は値と見せる字を兼ねる。 組は `value` を入力欄の値にし、`label` を操作部の選択肢と
|
|
827
|
+
* 箱の字の差し込み (`{id}`) に描く。 値は綴りのまま残るので、綴りで読む読み出し (信号の灯り等) と
|
|
828
|
+
* 表示の出し分け (`visibleIf`) は名前に影響されない。
|
|
829
|
+
*/
|
|
830
|
+
export type CdlInputOption = string | { value: string; label: string };
|
|
831
|
+
|
|
823
832
|
/**
|
|
824
833
|
* interactive input widget spec (v0.5+、 CAR #243)。
|
|
825
834
|
*
|
|
@@ -855,8 +864,8 @@ export type CdlInput =
|
|
|
855
864
|
| {
|
|
856
865
|
id: string;
|
|
857
866
|
kind: "dropdown";
|
|
858
|
-
/** 選択肢一覧 (非空必須、 defaultValue はこの中の 1
|
|
859
|
-
options: readonly
|
|
867
|
+
/** 選択肢一覧 (非空必須、 defaultValue はこの中の 1 つの値) */
|
|
868
|
+
options: readonly CdlInputOption[];
|
|
860
869
|
defaultValue: string;
|
|
861
870
|
label?: string;
|
|
862
871
|
}
|
|
@@ -865,6 +874,10 @@ export type CdlInput =
|
|
|
865
874
|
kind: "toggle";
|
|
866
875
|
defaultValue: boolean;
|
|
867
876
|
label?: string;
|
|
877
|
+
/** 入の時に箱の字の差し込み (`{id}`) へ描く名前。 省略時は `true` (#855) */
|
|
878
|
+
onLabel?: string;
|
|
879
|
+
/** 切の時に箱の字の差し込み (`{id}`) へ描く名前。 省略時は `false` (#855) */
|
|
880
|
+
offLabel?: string;
|
|
868
881
|
}
|
|
869
882
|
/**
|
|
870
883
|
* XY pad = 2 軸 slider、 `.input.xypad(id)` は 実は 2 個の signal (id_x / id_y) を生成する
|
|
@@ -896,7 +909,7 @@ export type CdlInput =
|
|
|
896
909
|
| {
|
|
897
910
|
id: string;
|
|
898
911
|
kind: "radio";
|
|
899
|
-
options: readonly
|
|
912
|
+
options: readonly CdlInputOption[];
|
|
900
913
|
defaultValue: string;
|
|
901
914
|
label?: string;
|
|
902
915
|
}
|
|
@@ -922,7 +935,7 @@ export type CdlInput =
|
|
|
922
935
|
| {
|
|
923
936
|
id: string;
|
|
924
937
|
kind: "multi-select";
|
|
925
|
-
options: readonly
|
|
938
|
+
options: readonly CdlInputOption[];
|
|
926
939
|
defaultValues: readonly string[];
|
|
927
940
|
label?: string;
|
|
928
941
|
}
|
|
@@ -930,7 +943,7 @@ export type CdlInput =
|
|
|
930
943
|
| {
|
|
931
944
|
id: string;
|
|
932
945
|
kind: "tabs";
|
|
933
|
-
options: readonly
|
|
946
|
+
options: readonly CdlInputOption[];
|
|
934
947
|
defaultValue: string;
|
|
935
948
|
label?: string;
|
|
936
949
|
}
|