@edu-tosel/design 1.0.82 → 1.0.83

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.
@@ -40,7 +40,7 @@ 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?: ((item: T) => string) | string;
44
44
  option?: {
45
45
  text?: string;
46
46
  background?: string;
@@ -44,7 +44,10 @@ 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
- return (_jsx(Label.Button, { title: item[key], hoverTitle: data.hoverTitle, onClick: () => data.onClick(item), option: { ...data.option, width: "xs", height: "xs" } }));
47
+ if (isDataButton(data)) {
48
+ return (_jsx(Label.Button, { title: item[key], hoverTitle: typeof data.hoverTitle === "string"
49
+ ? data.hoverTitle
50
+ : data.hoverTitle?.(item), onClick: () => data.onClick(item), option: { ...data.option, width: "xs", height: "xs" } }));
51
+ }
49
52
  return _jsx(_Fragment, { children: item[key] });
50
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.82",
3
+ "version": "1.0.83",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.82
1
+ 1.0.83