@jigowatts/jigowatts-ui 0.0.1-12
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/README.md +50 -0
- package/dist/AccordionSummary-B4zooGpd.js +831 -0
- package/dist/ButtonBase-pxtIu13Q.js +866 -0
- package/dist/DateTimePicker-DJSOr5wM.js +4653 -0
- package/dist/ListContext-DOVwHqy-.js +180 -0
- package/dist/MenuItem-yBaT3_db.js +470 -0
- package/dist/Paper-COvYqxZa.js +522 -0
- package/dist/Tabs-D3lJRumZ.js +1085 -0
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/index.css +1 -0
- package/dist/assets/index10.css +1 -0
- package/dist/assets/index11.css +1 -0
- package/dist/assets/index12.css +1 -0
- package/dist/assets/index13.css +1 -0
- package/dist/assets/index14.css +1 -0
- package/dist/assets/index15.css +1 -0
- package/dist/assets/index16.css +1 -0
- package/dist/assets/index17.css +1 -0
- package/dist/assets/index18.css +1 -0
- package/dist/assets/index19.css +1 -0
- package/dist/assets/index2.css +1 -0
- package/dist/assets/index20.css +1 -0
- package/dist/assets/index21.css +1 -0
- package/dist/assets/index22.css +1 -0
- package/dist/assets/index23.css +1 -0
- package/dist/assets/index24.css +1 -0
- package/dist/assets/index25.css +1 -0
- package/dist/assets/index26.css +1 -0
- package/dist/assets/index27.css +1 -0
- package/dist/assets/index3.css +1 -0
- package/dist/assets/index4.css +1 -0
- package/dist/assets/index5.css +1 -0
- package/dist/assets/index6.css +1 -0
- package/dist/assets/index7.css +1 -0
- package/dist/assets/index8.css +1 -0
- package/dist/assets/index9.css +1 -0
- package/dist/browser-DxfwT6rn.js +656 -0
- package/dist/components/Button/index.d.ts +28 -0
- package/dist/components/Button/index.js +18 -0
- package/dist/components/Button/index.test.d.ts +1 -0
- package/dist/components/Button/index.test.js +23 -0
- package/dist/components/Card/index.d.ts +16 -0
- package/dist/components/Card/index.js +37 -0
- package/dist/components/Card/index.test.d.ts +1 -0
- package/dist/components/Card/index.test.js +35 -0
- package/dist/components/CustomLink/index.d.ts +11 -0
- package/dist/components/CustomLink/index.js +1670 -0
- package/dist/components/CustomLink/index.test.d.ts +1 -0
- package/dist/components/CustomLink/index.test.js +40 -0
- package/dist/components/DataTable/index.d.ts +28 -0
- package/dist/components/DataTable/index.js +137 -0
- package/dist/components/DataTable/index.test.d.ts +1 -0
- package/dist/components/DataTable/index.test.js +3010 -0
- package/dist/components/DatePickerController/index.d.ts +16 -0
- package/dist/components/DatePickerController/index.js +83 -0
- package/dist/components/DatePickerController/index.test.d.ts +1 -0
- package/dist/components/DatePickerController/index.test.js +24 -0
- package/dist/components/ErrorMessage/index.d.ts +5 -0
- package/dist/components/ErrorMessage/index.js +11 -0
- package/dist/components/ErrorMessage/index.test.d.ts +1 -0
- package/dist/components/ErrorMessage/index.test.js +17 -0
- package/dist/components/EvseStateLabel/index.d.ts +5 -0
- package/dist/components/EvseStateLabel/index.js +36 -0
- package/dist/components/FlexButtons/index.d.ts +9 -0
- package/dist/components/FlexButtons/index.js +13 -0
- package/dist/components/Form/index.d.ts +8 -0
- package/dist/components/Form/index.js +11 -0
- package/dist/components/Form/index.test.d.ts +1 -0
- package/dist/components/Form/index.test.js +25 -0
- package/dist/components/FormItem/index.d.ts +9 -0
- package/dist/components/FormItem/index.js +19 -0
- package/dist/components/FormItem/index.test.d.ts +1 -0
- package/dist/components/FormItem/index.test.js +15 -0
- package/dist/components/FormTitle/index.d.ts +5 -0
- package/dist/components/FormTitle/index.js +11 -0
- package/dist/components/FormTitle/index.test.d.ts +1 -0
- package/dist/components/FormTitle/index.test.js +15 -0
- package/dist/components/Input/index.d.ts +15 -0
- package/dist/components/Input/index.js +39 -0
- package/dist/components/Input/index.test.d.ts +1 -0
- package/dist/components/Input/index.test.js +39 -0
- package/dist/components/InputController/index.d.ts +20 -0
- package/dist/components/InputController/index.js +81 -0
- package/dist/components/InputController/index.test.d.ts +1 -0
- package/dist/components/InputController/index.test.js +56 -0
- package/dist/components/InputGroup/index.d.ts +7 -0
- package/dist/components/InputGroup/index.js +11 -0
- package/dist/components/InputGroup/index.test.d.ts +1 -0
- package/dist/components/InputGroup/index.test.js +15 -0
- package/dist/components/Label/index.d.ts +7 -0
- package/dist/components/Label/index.js +14 -0
- package/dist/components/Label/index.test.d.ts +1 -0
- package/dist/components/Label/index.test.js +25 -0
- package/dist/components/LabeledContent/index.d.ts +15 -0
- package/dist/components/LabeledContent/index.js +28 -0
- package/dist/components/LabeledContent/index.test.d.ts +1 -0
- package/dist/components/LabeledContent/index.test.js +19 -0
- package/dist/components/LoadingOverlay/index.d.ts +2 -0
- package/dist/components/LoadingOverlay/index.js +134 -0
- package/dist/components/LoadingOverlay/index.test.d.ts +1 -0
- package/dist/components/LoadingOverlay/index.test.js +12 -0
- package/dist/components/Map/index.d.ts +8 -0
- package/dist/components/Map/index.js +6575 -0
- package/dist/components/MaxWidthContainer/index.d.ts +13 -0
- package/dist/components/MaxWidthContainer/index.js +15 -0
- package/dist/components/MaxWidthContainer/index.test.d.ts +1 -0
- package/dist/components/MaxWidthContainer/index.test.js +24 -0
- package/dist/components/NumericFieldController/index.d.ts +53 -0
- package/dist/components/NumericFieldController/index.js +620 -0
- package/dist/components/NumericFieldController/index.test.d.ts +1 -0
- package/dist/components/NumericFieldController/index.test.js +24 -0
- package/dist/components/OfflineLabel/index.d.ts +5 -0
- package/dist/components/OfflineLabel/index.js +34 -0
- package/dist/components/PageSizeSelector/index.d.ts +15 -0
- package/dist/components/PageSizeSelector/index.js +43 -0
- package/dist/components/Pagination/index.d.ts +9 -0
- package/dist/components/Pagination/index.js +7 -0
- package/dist/components/Pagination/index.test.d.ts +1 -0
- package/dist/components/Pagination/index.test.js +34 -0
- package/dist/components/PasswordInputController/index.d.ts +17 -0
- package/dist/components/PasswordInputController/index.js +78 -0
- package/dist/components/PasswordInputController/index.test.d.ts +1 -0
- package/dist/components/PasswordInputController/index.test.js +37 -0
- package/dist/components/RadioButton/index.d.ts +13 -0
- package/dist/components/RadioButton/index.js +7 -0
- package/dist/components/RadioButton/index.test.d.ts +1 -0
- package/dist/components/RadioButton/index.test.js +38 -0
- package/dist/components/RadioGroupController/index.d.ts +15 -0
- package/dist/components/RadioGroupController/index.js +48 -0
- package/dist/components/RadioGroupController/index.test.d.ts +1 -0
- package/dist/components/RadioGroupController/index.test.js +48 -0
- package/dist/components/RangeDatePicker/index.d.ts +14 -0
- package/dist/components/RangeDatePicker/index.js +1594 -0
- package/dist/components/RangeDatePickerController/index.d.ts +21 -0
- package/dist/components/RangeDatePickerController/index.js +123 -0
- package/dist/components/RangeDatePickerController/index.test.d.ts +1 -0
- package/dist/components/RangeDatePickerController/index.test.js +24 -0
- package/dist/components/ReportCard/index.d.ts +12 -0
- package/dist/components/ReportCard/index.js +18 -0
- package/dist/components/ReportCard/index.test.d.ts +1 -0
- package/dist/components/ReportCard/index.test.js +27 -0
- package/dist/components/ReportChart/index.d.ts +22 -0
- package/dist/components/ReportChart/index.js +23101 -0
- package/dist/components/ScrollableDialog/index.d.ts +19 -0
- package/dist/components/ScrollableDialog/index.js +42 -0
- package/dist/components/ScrollableDialog/index.test.d.ts +1 -0
- package/dist/components/ScrollableDialog/index.test.js +59 -0
- package/dist/components/SearchForm/index.d.ts +13 -0
- package/dist/components/SearchForm/index.js +86 -0
- package/dist/components/SelectBox/index.d.ts +18 -0
- package/dist/components/SelectBox/index.js +7 -0
- package/dist/components/SelectBox/index.test.d.ts +1 -0
- package/dist/components/SelectBox/index.test.js +34 -0
- package/dist/components/SelectBoxController/index.d.ts +20 -0
- package/dist/components/SelectBoxController/index.js +87 -0
- package/dist/components/SelectBoxController/index.test.d.ts +1 -0
- package/dist/components/SelectBoxController/index.test.js +52 -0
- package/dist/components/SubMenu/index.d.ts +22 -0
- package/dist/components/SubMenu/index.js +278 -0
- package/dist/components/SubMenu/index.test.d.ts +1 -0
- package/dist/components/SubMenu/index.test.js +41 -0
- package/dist/components/Tabs/index.d.ts +21 -0
- package/dist/components/Tabs/index.js +100 -0
- package/dist/components/Tabs/index.test.d.ts +1 -0
- package/dist/components/Tabs/index.test.js +24 -0
- package/dist/components/Textarea/index.d.ts +18 -0
- package/dist/components/Textarea/index.js +34 -0
- package/dist/components/Textarea/index.test.d.ts +1 -0
- package/dist/components/Textarea/index.test.js +25 -0
- package/dist/components/ToggleButton/index.d.ts +16 -0
- package/dist/components/ToggleButton/index.js +39 -0
- package/dist/components/ToggleButton/index.test.d.ts +1 -0
- package/dist/components/ToggleButton/index.test.js +49 -0
- package/dist/constants/datetime.d.ts +2 -0
- package/dist/constants/datetime.js +5 -0
- package/dist/createSvgIcon-B53UOwxg.js +183 -0
- package/dist/createSvgIcon-Dj8zNxRS.js +72 -0
- package/dist/index-BLPOOjNr.js +184 -0
- package/dist/index-BOjtnFU5.js +34 -0
- package/dist/index-Bs3JCwgu.js +689 -0
- package/dist/index-CICI7n5Y.js +19688 -0
- package/dist/index-CQDJfJT1.js +50 -0
- package/dist/index-C_i0-R5C.js +393 -0
- package/dist/index-DWRHnq8_.js +42 -0
- package/dist/index-Di2gTfPF.js +25175 -0
- package/dist/index-VF82hRp0.js +2522 -0
- package/dist/index-kvi6aotO.js +39 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.esm-ChwJSgnF.js +1052 -0
- package/dist/index.js +77 -0
- package/dist/isEqual-BBhdD79C.js +667 -0
- package/dist/mergeSlotProps-J197zKan.js +63 -0
- package/dist/react.esm-C8amP77L.js +11182 -0
- package/dist/styled-CWju4EfZ.js +2702 -0
- package/dist/unsupportedProp-DZaWZqWQ.js +30 -0
- package/dist/useControlled-BQCJRJNJ.js +64 -0
- package/dist/useIsFocusVisible-BxB-Hdhb.js +124 -0
- package/dist/useSlotProps-Bh7akxXV.js +33 -0
- package/package.json +360 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { b as d, a as i, w as l, s as a } from "../../react.esm-C8amP77L.js";
|
|
3
|
+
import { j as h } from "../../index-Di2gTfPF.js";
|
|
4
|
+
import { CustomLink as o } from "./index.js";
|
|
5
|
+
describe("CustomLink component", () => {
|
|
6
|
+
const s = "/test", t = "Test Link";
|
|
7
|
+
it("renders the link with correct href and children", async () => {
|
|
8
|
+
await d(() => {
|
|
9
|
+
i(/* @__PURE__ */ r(o, { href: s, children: t }));
|
|
10
|
+
}), await l(() => {
|
|
11
|
+
const e = a.getByText(t);
|
|
12
|
+
expect(e).toBeInTheDocument(), expect(e.closest("a")).toHaveAttribute("href", s);
|
|
13
|
+
});
|
|
14
|
+
}), it("applies the custom styles if isStyled is true", () => {
|
|
15
|
+
i(
|
|
16
|
+
/* @__PURE__ */ r(o, { href: s, isStyled: !0, children: t })
|
|
17
|
+
);
|
|
18
|
+
const e = a.getByText(t);
|
|
19
|
+
expect(e).toHaveClass("link");
|
|
20
|
+
}), it("does not apply the custom styles if isStyled is false", () => {
|
|
21
|
+
i(/* @__PURE__ */ r(o, { href: s, children: t }));
|
|
22
|
+
const e = a.getByText(t);
|
|
23
|
+
expect(e).not.toHaveClass("link");
|
|
24
|
+
}), it("renders the link with target and rel attributes if provided", () => {
|
|
25
|
+
const e = "_blank", n = "noopener noreferrer";
|
|
26
|
+
i(
|
|
27
|
+
/* @__PURE__ */ r(o, { href: s, target: e, rel: n, children: t })
|
|
28
|
+
);
|
|
29
|
+
const c = a.getByText(t);
|
|
30
|
+
expect(c.closest("a")).toHaveAttribute("target", e), expect(c.closest("a")).toHaveAttribute("rel", n);
|
|
31
|
+
}), it("should be accessible", async () => {
|
|
32
|
+
const { container: e } = i(
|
|
33
|
+
/* @__PURE__ */ r(o, { href: s, children: t })
|
|
34
|
+
);
|
|
35
|
+
await l(async () => {
|
|
36
|
+
const n = await h.axe(e);
|
|
37
|
+
expect.extend(h.toHaveNoViolations), expect(n).toHaveNoViolations();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type SortDirection = "asc" | "desc";
|
|
4
|
+
export type ColumnAlign = "left" | "right" | "center" | "justify" | "inherit" | undefined;
|
|
5
|
+
export type Column<T> = {
|
|
6
|
+
key: string;
|
|
7
|
+
title: string;
|
|
8
|
+
sortColumn?: keyof T;
|
|
9
|
+
render: (data: T) => ReactNode;
|
|
10
|
+
align?: ColumnAlign;
|
|
11
|
+
};
|
|
12
|
+
type Props<Key extends keyof T, T> = {
|
|
13
|
+
columns: Column<T>[];
|
|
14
|
+
dataList?: T[];
|
|
15
|
+
totalCount: number;
|
|
16
|
+
currentPage: number;
|
|
17
|
+
pageSize: number;
|
|
18
|
+
keyColumn: Key;
|
|
19
|
+
sortColumn?: keyof T;
|
|
20
|
+
sortDirection?: SortDirection;
|
|
21
|
+
isLoading: boolean;
|
|
22
|
+
onClickRow?: (data: T) => void;
|
|
23
|
+
onChangeSort?: (sortColumn: keyof T, sortDirection: SortDirection) => void;
|
|
24
|
+
onChangePage: (page: number) => void;
|
|
25
|
+
onChangePageSize?: (pageSize: number) => void;
|
|
26
|
+
};
|
|
27
|
+
export declare const DataTable: <Key extends keyof T, T extends Record<Key, string | number>>(props: Props<Key, T>) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export default DataTable;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { jsx as e, Fragment as P, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { Table as S, TableHead as x, TableRow as k, TableBody as y, TableCell as z } from "@mui/material";
|
|
3
|
+
import { c } from "../../index-DWRHnq8_.js";
|
|
4
|
+
import { G as p, P as B } from "../../index-C_i0-R5C.js";
|
|
5
|
+
import { PageSizeSelector as A } from "../PageSizeSelector/index.js";
|
|
6
|
+
import '../../assets/index20.css';function R(l) {
|
|
7
|
+
return p({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M11.178 19.569a.998.998 0 0 0 1.644 0l9-13A.999.999 0 0 0 21 5H3a1.002 1.002 0 0 0-.822 1.569l9 13z" } }] })(l);
|
|
8
|
+
}
|
|
9
|
+
function D(l) {
|
|
10
|
+
return p({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M3 19h18a1.002 1.002 0 0 0 .823-1.569l-9-13c-.373-.539-1.271-.539-1.645 0l-9 13A.999.999 0 0 0 3 19z" } }] })(l);
|
|
11
|
+
}
|
|
12
|
+
const M = "_contentContainer_gkhb7_2", j = "_scrollableTableContainer_gkhb7_10", G = "_table_gkhb7_20", H = "_header_gkhb7_26", F = "_th_gkhb7_34", U = "_headerCell_gkhb7_46", V = "_sortIcons_gkhb7_53", q = "_sortIcon_gkhb7_53", E = "_selected_gkhb7_65", J = "_row_gkhb7_69", K = "_clickable_gkhb7_77", O = "_td_gkhb7_81", t = {
|
|
13
|
+
contentContainer: M,
|
|
14
|
+
scrollableTableContainer: j,
|
|
15
|
+
table: G,
|
|
16
|
+
header: H,
|
|
17
|
+
th: F,
|
|
18
|
+
headerCell: U,
|
|
19
|
+
sortIcons: V,
|
|
20
|
+
sortIcon: q,
|
|
21
|
+
selected: E,
|
|
22
|
+
row: J,
|
|
23
|
+
clickable: K,
|
|
24
|
+
td: O
|
|
25
|
+
}, $ = (l) => {
|
|
26
|
+
const {
|
|
27
|
+
columns: _,
|
|
28
|
+
dataList: n,
|
|
29
|
+
totalCount: b,
|
|
30
|
+
currentPage: u,
|
|
31
|
+
pageSize: i,
|
|
32
|
+
keyColumn: f,
|
|
33
|
+
sortColumn: a,
|
|
34
|
+
sortDirection: h,
|
|
35
|
+
isLoading: N,
|
|
36
|
+
onClickRow: d,
|
|
37
|
+
onChangeSort: r,
|
|
38
|
+
onChangePage: w,
|
|
39
|
+
onChangePageSize: I
|
|
40
|
+
} = l;
|
|
41
|
+
if (N)
|
|
42
|
+
return /* @__PURE__ */ e("span", { children: "読み込み中" });
|
|
43
|
+
if (!n)
|
|
44
|
+
return /* @__PURE__ */ e("span", { children: "データの取得ができませんでした。" });
|
|
45
|
+
if ((n == null ? void 0 : n.length) === 0)
|
|
46
|
+
return /* @__PURE__ */ e("span", { children: "データがありません。" });
|
|
47
|
+
const T = Math.ceil(b / i), C = u - 1, m = C * i + 1, v = m - 1 + ((n == null ? void 0 : n.length) ?? 0);
|
|
48
|
+
return /* @__PURE__ */ e(P, { children: /* @__PURE__ */ s("div", { className: t.contentContainer, children: [
|
|
49
|
+
/* @__PURE__ */ e(
|
|
50
|
+
A,
|
|
51
|
+
{
|
|
52
|
+
startRecordNum: m,
|
|
53
|
+
endRecordNum: v,
|
|
54
|
+
totalCount: b,
|
|
55
|
+
defaultValue: i,
|
|
56
|
+
onChangePageSize: I
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ e("div", { className: t.scrollableTableContainer, children: /* @__PURE__ */ s(S, { className: t.table, children: [
|
|
60
|
+
/* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(k, { className: t.header, children: _.map((o) => /* @__PURE__ */ e(
|
|
61
|
+
"th",
|
|
62
|
+
{
|
|
63
|
+
className: c(t.th, {
|
|
64
|
+
[t.clickable]: o.sortColumn && r
|
|
65
|
+
}),
|
|
66
|
+
children: /* @__PURE__ */ s(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: t.headerCell,
|
|
70
|
+
onClick: () => {
|
|
71
|
+
o.sortColumn && r && (o.sortColumn === a ? r(
|
|
72
|
+
o.sortColumn,
|
|
73
|
+
h === "asc" ? "desc" : "asc"
|
|
74
|
+
) : (console.log(a), console.log("else"), r(o.sortColumn, "asc")));
|
|
75
|
+
},
|
|
76
|
+
children: [
|
|
77
|
+
o.title,
|
|
78
|
+
o.sortColumn && /* @__PURE__ */ s("div", { className: t.sortIcons, children: [
|
|
79
|
+
/* @__PURE__ */ e(
|
|
80
|
+
D,
|
|
81
|
+
{
|
|
82
|
+
className: c(t.sortIcon, {
|
|
83
|
+
[t.selected]: o.sortColumn === a && h === "asc"
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ e(
|
|
88
|
+
R,
|
|
89
|
+
{
|
|
90
|
+
className: c(t.sortIcon, {
|
|
91
|
+
[t.selected]: o.sortColumn === a && h === "desc"
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
},
|
|
100
|
+
o.key
|
|
101
|
+
)) }) }),
|
|
102
|
+
/* @__PURE__ */ e(y, { children: n.map((o) => /* @__PURE__ */ e(
|
|
103
|
+
k,
|
|
104
|
+
{
|
|
105
|
+
className: c(t.row, {
|
|
106
|
+
[t.clickable]: d
|
|
107
|
+
}),
|
|
108
|
+
onClick: () => {
|
|
109
|
+
d && d(o);
|
|
110
|
+
},
|
|
111
|
+
children: _.map((g) => /* @__PURE__ */ e(
|
|
112
|
+
z,
|
|
113
|
+
{
|
|
114
|
+
className: t.td,
|
|
115
|
+
align: g.align,
|
|
116
|
+
children: g.render(o)
|
|
117
|
+
},
|
|
118
|
+
g.key
|
|
119
|
+
))
|
|
120
|
+
},
|
|
121
|
+
o[f]
|
|
122
|
+
)) })
|
|
123
|
+
] }) }),
|
|
124
|
+
/* @__PURE__ */ e(
|
|
125
|
+
B,
|
|
126
|
+
{
|
|
127
|
+
pageCount: T,
|
|
128
|
+
activePage: C,
|
|
129
|
+
onChangePage: w
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] }) });
|
|
133
|
+
};
|
|
134
|
+
export {
|
|
135
|
+
$ as DataTable,
|
|
136
|
+
$ as default
|
|
137
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|