@edu-tosel/design 1.0.284 → 1.0.286
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/board/design/Board.design.d.ts +1 -1
- package/board/design/Header.design.d.ts +1 -1
- package/board/design/Header.design.js +12 -2
- package/board/template/CanvasBoard.d.ts +1 -1
- package/board/template/ManageBoard.d.ts +2 -2
- package/board/template/PaperBoard.d.ts +1 -1
- package/interface/Board.d.ts +14 -10
- package/interface/widget/Select.d.ts +1 -0
- package/package.json +1 -1
- package/version.txt +1 -1
- package/widget/template/Select/Toggle.d.ts +1 -1
- package/widget/template/Select/Toggle.js +4 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BoardProps } from "../../interface/Board";
|
|
2
|
-
export declare function Board<
|
|
2
|
+
export declare function Board<B1, B2, B3, B4>({ children, action, option, debug, buttons, }: BoardProps<B1, B2, B3, B4>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BoardHeaderProps } from "../../interface/Board";
|
|
2
|
-
export default function BoardHeader<
|
|
2
|
+
export default function BoardHeader<B1, B2, B3, B4>({ titles, tag, widgets, option, }: BoardHeaderProps<B1, B2, B3, B4>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
|
-
import { Input, Select } from "../../widget";
|
|
3
|
+
import { Input, Label, Select } from "../../widget";
|
|
4
4
|
export default function BoardHeader({ titles, tag, widgets, option, }) {
|
|
5
5
|
const { title, icon, titleColor } = titles ?? {};
|
|
6
6
|
const { selects, inputs } = tag ?? {};
|
|
@@ -23,8 +23,18 @@ function HeaderWidgetRender(props) {
|
|
|
23
23
|
if (props.type === "select") {
|
|
24
24
|
return _jsx(Select, { ...props.data });
|
|
25
25
|
}
|
|
26
|
+
if (props.type === "button") {
|
|
27
|
+
return (_jsx(Label.Button, { ...props.data, option: {
|
|
28
|
+
...props.data.option,
|
|
29
|
+
width: "xs",
|
|
30
|
+
height: "xs",
|
|
31
|
+
} }));
|
|
32
|
+
}
|
|
26
33
|
if (props.type === "selectToggle") {
|
|
27
|
-
return _jsx(Select.Toggle, { ...props.data
|
|
34
|
+
return (_jsx(Select.Toggle, { ...props.data, option: {
|
|
35
|
+
...props.data.option,
|
|
36
|
+
isText: true,
|
|
37
|
+
} }));
|
|
28
38
|
}
|
|
29
39
|
return null;
|
|
30
40
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CanvasBoardProps } from "../../interface/Board";
|
|
2
|
-
export default function CanvasBoard<
|
|
2
|
+
export default function CanvasBoard<B1, B2, B3, B4>({ header, children, action, buttons, option, }: CanvasBoardProps<B1, B2, B3, B4>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ManageBoardProps } from "../../interface/Board";
|
|
2
|
-
export default function ManageBoard<
|
|
2
|
+
export default function ManageBoard<B1, B2, B3, B4, K extends string, T extends {
|
|
3
3
|
[p in K]: any;
|
|
4
|
-
}>({ header, dataSets, dataField, action, option, buttons, }: ManageBoardProps<
|
|
4
|
+
}>({ header, dataSets, dataField, action, option, buttons, }: ManageBoardProps<B1, B2, B3, B4, K, T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PaperBoardProps } from "../../interface/Board";
|
|
2
|
-
export default function PaperBoard<
|
|
2
|
+
export default function PaperBoard<B1, B2, B3, B4>({ children, debug, option, }: PaperBoardProps<B1, B2, B3, B4>): import("react/jsx-runtime").JSX.Element;
|
package/interface/Board.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ interface BoardOption {
|
|
|
14
14
|
noPadding?: boolean;
|
|
15
15
|
noMobile?: boolean;
|
|
16
16
|
}
|
|
17
|
-
export interface BoardProps<
|
|
18
|
-
header?: BoardHeaderProps<
|
|
17
|
+
export interface BoardProps<B1, B2, B3, B4> {
|
|
18
|
+
header?: BoardHeaderProps<B1, B2, B3, B4>;
|
|
19
19
|
children?: React.ReactNode;
|
|
20
20
|
action?: ActionProps;
|
|
21
21
|
option?: BoardOption;
|
|
@@ -35,30 +35,34 @@ interface HeaderSelectToggleWidget<T> {
|
|
|
35
35
|
type: "selectToggle";
|
|
36
36
|
data: SelectToggleProps<T>;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
interface HeaderButtonWidget {
|
|
39
|
+
type: "button";
|
|
40
|
+
data: LabelWidget;
|
|
41
|
+
}
|
|
42
|
+
export type HeaderWidgetType<B1, B2, B3, B4> = HeaderInputWidget | HeaderSelectWidget<B1> | HeaderSelectToggleWidget<B2> | HeaderButtonWidget;
|
|
43
|
+
export interface BoardHeaderProps<B1, B2, B3, B4> {
|
|
40
44
|
titles?: Omit<Titles, "subtitle"> & {
|
|
41
45
|
icon?: string;
|
|
42
46
|
};
|
|
43
47
|
tag?: {
|
|
44
|
-
selects?: SelectWidget<
|
|
48
|
+
selects?: SelectWidget<B1>[];
|
|
45
49
|
inputs?: InputWidget[];
|
|
46
50
|
};
|
|
47
|
-
widgets?: HeaderWidgetType<
|
|
51
|
+
widgets?: HeaderWidgetType<B1, B2, B3, B4>[];
|
|
48
52
|
option?: {
|
|
49
53
|
background?: string;
|
|
50
54
|
text?: string;
|
|
51
55
|
boundary?: string;
|
|
52
56
|
};
|
|
53
57
|
}
|
|
54
|
-
export interface CanvasBoardProps<
|
|
58
|
+
export interface CanvasBoardProps<B1, B2, B3, B4> extends BoardProps<B1, B2, B3, B4> {
|
|
55
59
|
}
|
|
56
|
-
export interface ManageBoardProps<
|
|
60
|
+
export interface ManageBoardProps<B1, B2, B3, B4, K extends string, T extends {
|
|
57
61
|
[p in K]: any;
|
|
58
|
-
}> extends BoardProps<
|
|
62
|
+
}> extends BoardProps<B1, B2, B3, B4> {
|
|
59
63
|
dataSets: DataSet<T>[];
|
|
60
64
|
dataField?: DataField<T>;
|
|
61
65
|
}
|
|
62
|
-
export interface PaperBoardProps<
|
|
66
|
+
export interface PaperBoardProps<B1, B2, B3, B4> extends BoardProps<B1, B2, B3, B4> {
|
|
63
67
|
}
|
|
64
68
|
export {};
|
package/package.json
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.286
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SelectToggleProps } from "../../../interface";
|
|
2
|
-
export default function SelectToggle<T>({ state, selectOptions: selectOptionsInput, }: SelectToggleProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function SelectToggle<T>({ state, selectOptions: selectOptionsInput, option, }: SelectToggleProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { toSelectOption } from "../../../interface";
|
|
3
3
|
import { cn } from "../../../util";
|
|
4
|
-
export default function SelectToggle({ state, selectOptions: selectOptionsInput, }) {
|
|
4
|
+
export default function SelectToggle({ state, selectOptions: selectOptionsInput, option, }) {
|
|
5
5
|
const selectOptions = selectOptionsInput?.map(toSelectOption);
|
|
6
6
|
const [value, setValue] = state;
|
|
7
7
|
const isOff = value === selectOptions[0].value;
|
|
@@ -25,5 +25,6 @@ export default function SelectToggle({ state, selectOptions: selectOptionsInput,
|
|
|
25
25
|
return setValue(selectOptions[1].value);
|
|
26
26
|
return setValue(selectOptions[0].value);
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
const selectedTitle = selectOptions?.find((option) => option.value === value)?.title;
|
|
29
|
+
return (_jsxs("div", { className: "flex items-center gap-x-1.5 ", children: [selectedTitle && option?.isText && (_jsx("div", { className: "text-sm leading-none", children: selectedTitle })), _jsx("button", { onClick: toggle, className: cn(container), children: _jsx("div", { className: cn(controller) }) })] }));
|
|
29
30
|
}
|