@edu-tosel/design 1.0.82 → 1.0.84
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/interface/Data.d.ts +4 -4
- package/interface/Property.d.ts +1 -0
- package/layout/design/Row.design/index.js +11 -2
- package/package.json +1 -1
- package/version.txt +1 -1
package/interface/Data.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Replace } from "./Action";
|
|
2
|
-
import { OnClick, Titles } from "./Property";
|
|
2
|
+
import { Click, OnClick, Titles } from "./Property";
|
|
3
3
|
export interface DataPackage<T> {
|
|
4
4
|
dataField: DataField<T>;
|
|
5
5
|
dataSet: Omit<DataSet<T>, "renderItem">;
|
|
@@ -40,10 +40,10 @@ declare function isDataSelectRoll(obj: any): obj is DataSelectRoll;
|
|
|
40
40
|
type DataButton<T> = {
|
|
41
41
|
type: "button";
|
|
42
42
|
onClick: OnClick<T>;
|
|
43
|
-
hoverTitle?: string;
|
|
43
|
+
hoverTitle?: Click<T, string> | string;
|
|
44
44
|
option?: {
|
|
45
|
-
text?: string;
|
|
46
|
-
background?: string;
|
|
45
|
+
text?: Click<T, string> | string;
|
|
46
|
+
background?: Click<T, string> | string;
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
declare function isDataButton<T>(obj: any): obj is DataButton<T>;
|
package/interface/Property.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export type Size = "5xs" | "4xs" | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "
|
|
|
41
41
|
* @property {"full"} full - Full size
|
|
42
42
|
*/
|
|
43
43
|
export type ImageSize = "sub" | "full";
|
|
44
|
+
export type Click<REQ = unknown, RES = any> = (prop?: REQ) => RES;
|
|
44
45
|
export type OnClick<Request = unknown, Response = unknown> = (prop?: Request) => Response | ((prop?: Request) => Promise<Response>);
|
|
45
46
|
export interface Button extends LabelWidget {
|
|
46
47
|
}
|
|
@@ -44,7 +44,16 @@ function RowElement(props) {
|
|
|
44
44
|
if (isDataSelectRoll(data)) {
|
|
45
45
|
return _jsx(SelectRoll, { item: item, entry: props.entry, data: data });
|
|
46
46
|
}
|
|
47
|
-
if (isDataButton(data))
|
|
48
|
-
|
|
47
|
+
if (isDataButton(data)) {
|
|
48
|
+
const { onClick, hoverTitle, option } = data;
|
|
49
|
+
const { background, text } = option ?? {};
|
|
50
|
+
return (_jsx(Label.Button, { title: item[key], hoverTitle: typeof hoverTitle === "string" ? hoverTitle : hoverTitle?.(item), onClick: () => onClick(item), option: {
|
|
51
|
+
...data.option,
|
|
52
|
+
background: typeof background === "string" ? background : background?.(item),
|
|
53
|
+
text: typeof text === "string" ? text : text?.(item),
|
|
54
|
+
width: "xs",
|
|
55
|
+
height: "xs",
|
|
56
|
+
} }));
|
|
57
|
+
}
|
|
49
58
|
return _jsx(_Fragment, { children: item[key] });
|
|
50
59
|
}
|
package/package.json
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.84
|