@tidbcloud/uikit 2.0.0-beta.71 → 2.0.0-beta.73

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @tidbcloud/uikit
2
2
 
3
+ ## 2.0.0-beta.73
4
+
5
+ ### Patch Changes
6
+
7
+ - fix protable sticky & rowVirtualization style
8
+
9
+ ## 2.0.0-beta.72
10
+
11
+ ### Patch Changes
12
+
13
+ - fix ProTable footer style
14
+
3
15
  ## 2.0.0-beta.71
4
16
 
5
17
  ### Patch Changes
@@ -100,6 +100,7 @@ const CodeBlock = ({
100
100
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(HoverCard.HoverCard.Target, { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
101
101
  ActionIcon.ActionIcon,
102
102
  {
103
+ "aria-hidden": true,
103
104
  size: "sm",
104
105
  variant: "subtle",
105
106
  onClick: () => {
@@ -116,6 +117,7 @@ const CodeBlock = ({
116
117
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(HoverCard.HoverCard.Target, { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
117
118
  ActionIcon.ActionIcon,
118
119
  {
120
+ "aria-label": "Copy",
119
121
  size: "sm",
120
122
  variant: "subtle",
121
123
  onClick: () => {
@@ -154,6 +156,7 @@ const CopyText = ({ children, value, ...rest }) => {
154
156
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(CopyButton.CopyButton, { value, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(Tooltip.Tooltip, { label: copied ? "Copied" : "Copy", withArrow: true, position: "top", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
155
157
  ActionIcon.ActionIcon,
156
158
  {
159
+ "aria-label": "Copy",
157
160
  variant: "subtle",
158
161
  size: "sm",
159
162
  ml: 8,
@@ -98,6 +98,7 @@ const CodeBlock = ({
98
98
  /* @__PURE__ */ jsxRuntimeExports.jsx(HoverCard.Target, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
99
99
  ActionIcon,
100
100
  {
101
+ "aria-hidden": true,
101
102
  size: "sm",
102
103
  variant: "subtle",
103
104
  onClick: () => {
@@ -114,6 +115,7 @@ const CodeBlock = ({
114
115
  /* @__PURE__ */ jsxRuntimeExports.jsx(HoverCard.Target, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
115
116
  ActionIcon,
116
117
  {
118
+ "aria-label": "Copy",
117
119
  size: "sm",
118
120
  variant: "subtle",
119
121
  onClick: () => {
@@ -152,6 +154,7 @@ const CopyText = ({ children, value, ...rest }) => {
152
154
  /* @__PURE__ */ jsxRuntimeExports.jsx(CopyButton, { value, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: copied ? "Copied" : "Copy", withArrow: true, position: "top", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
153
155
  ActionIcon,
154
156
  {
157
+ "aria-label": "Copy",
155
158
  variant: "subtle",
156
159
  size: "sm",
157
160
  ml: 8,
@@ -60,7 +60,7 @@ const FormCopyText = ({
60
60
  children: value
61
61
  }
62
62
  ),
63
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(Tooltip.Tooltip, { label: copied ? "Copied" : "Copy", withArrow: true, ...tooltipProps, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(ActionIcon.ActionIcon, { color: "carbon.8", variant: "transparent", onClick: copy, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
63
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(Tooltip.Tooltip, { label: copied ? "Copied" : "Copy", withArrow: true, ...tooltipProps, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(ActionIcon.ActionIcon, { "aria-label": "Copy", color: "carbon.8", variant: "transparent", onClick: copy, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
64
64
  index$1.IconCopy01,
65
65
  {
66
66
  size,
@@ -58,7 +58,7 @@ const FormCopyText = ({
58
58
  children: value
59
59
  }
60
60
  ),
61
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: copied ? "Copied" : "Copy", withArrow: true, ...tooltipProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { color: "carbon.8", variant: "transparent", onClick: copy, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
61
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: copied ? "Copied" : "Copy", withArrow: true, ...tooltipProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { "aria-label": "Copy", color: "carbon.8", variant: "transparent", onClick: copy, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
62
62
  IconCopy01,
63
63
  {
64
64
  size,
@@ -20,10 +20,11 @@ const FormTextInput = ({ name, rules, onChange, ...rest }) => {
20
20
  name,
21
21
  rules,
22
22
  render: ({ field }) => {
23
- const { onChange: handleChange, ...restField } = field;
23
+ const { value = "", onChange: handleChange, ...restField } = field;
24
24
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
25
25
  TextInput.TextInput,
26
26
  {
27
+ value,
27
28
  onChange: (e) => {
28
29
  handleChange(e);
29
30
  onChange == null ? void 0 : onChange(e);
@@ -18,10 +18,11 @@ const FormTextInput = ({ name, rules, onChange, ...rest }) => {
18
18
  name,
19
19
  rules,
20
20
  render: ({ field }) => {
21
- const { onChange: handleChange, ...restField } = field;
21
+ const { value = "", onChange: handleChange, ...restField } = field;
22
22
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
23
23
  TextInput,
24
24
  {
25
+ value,
25
26
  onChange: (e) => {
26
27
  handleChange(e);
27
28
  onChange == null ? void 0 : onChange(e);
@@ -63,6 +63,7 @@ const PageShell = ({
63
63
  const leftSection = (!!withBack || !!headerBack) && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
64
64
  ActionIcon.ActionIcon,
65
65
  {
66
+ "aria-label": "Navigate Back",
66
67
  variant: "default",
67
68
  onClick: () => {
68
69
  if (onBackClick) {
@@ -61,6 +61,7 @@ const PageShell = ({
61
61
  const leftSection = (!!withBack || !!headerBack) && /* @__PURE__ */ jsxRuntimeExports.jsx(
62
62
  ActionIcon,
63
63
  {
64
+ "aria-label": "Navigate Back",
64
65
  variant: "default",
65
66
  onClick: () => {
66
67
  if (onBackClick) {
@@ -32,12 +32,20 @@ function mergeProTableProps(props) {
32
32
  mantinePaperProps = {},
33
33
  mantineSkeletonProps = {},
34
34
  mantineTableBodyProps,
35
+ mantineTableHeadCellProps = {},
35
36
  mantineTableBodyCellProps = {},
37
+ mantineTableBodyRowProps = {},
36
38
  mantineBottomToolbarProps = {},
39
+ mantineTableFooterCellProps = {},
40
+ mantineTableFooterRowProps = {},
41
+ mantineTableFooterProps = {},
42
+ mantineLoadingOverlayProps = {},
37
43
  withBorder = true,
38
44
  loading = false,
39
45
  enableExpanding = false,
46
+ enableRowVirtualization = false,
40
47
  enableStickyHeader,
48
+ enableStickyFooter,
41
49
  emptyMessage,
42
50
  errorMessage,
43
51
  data,
@@ -117,11 +125,36 @@ function mergeProTableProps(props) {
117
125
  }
118
126
  return {};
119
127
  }, mantineTableBodyProps);
128
+ const mTableHeaderCellProps = mergeMProps(() => {
129
+ return {
130
+ sx: {
131
+ ".mrt-table-head-sort-button": {
132
+ height: "auto",
133
+ width: "auto",
134
+ backgroundColor: "transparent",
135
+ borderColor: "transparent",
136
+ minWidth: 20,
137
+ minHeight: 20
138
+ }
139
+ }
140
+ };
141
+ }, mantineTableHeadCellProps);
120
142
  const mTableBodyCellProps = mergeMProps(() => {
121
143
  return {
122
144
  h: 48
123
145
  };
124
146
  }, mantineTableBodyCellProps);
147
+ const mTableBodyRowProps = mergeMProps(() => {
148
+ return {
149
+ sx: {
150
+ "&:where([data-with-row-border]):not(:last-of-type)": {
151
+ td: {
152
+ borderBottom: enableRowVirtualization ? "none !important" : void 0
153
+ }
154
+ }
155
+ }
156
+ };
157
+ }, mantineTableBodyRowProps);
125
158
  const mBottomToolbarProps = mergeMProps(
126
159
  {
127
160
  sx: (theme2) => ({
@@ -133,6 +166,12 @@ function mergeProTableProps(props) {
133
166
  },
134
167
  mantineBottomToolbarProps
135
168
  );
169
+ const mLoadingOverlayProps = mergeMProps(
170
+ () => ({
171
+ visible: false
172
+ }),
173
+ mantineLoadingOverlayProps
174
+ );
136
175
  const mTabelSkeletonProps = mergeMProps(
137
176
  {
138
177
  sx: (theme2) => ({
@@ -143,23 +182,52 @@ function mergeProTableProps(props) {
143
182
  },
144
183
  mantineSkeletonProps
145
184
  );
185
+ const mTableFooterCellProps = mergeMProps(
186
+ {
187
+ p: 8
188
+ },
189
+ mantineTableFooterCellProps
190
+ );
191
+ const mTableFooterRowProps = mergeMProps(
192
+ {
193
+ sx: { borderBottom: "none", outline: enableStickyFooter ? "none" : void 0 }
194
+ },
195
+ mantineTableFooterRowProps
196
+ );
197
+ const mTableFooterProps = mergeMProps(
198
+ {
199
+ sx: { outline: enableStickyFooter ? "none" : void 0 }
200
+ },
201
+ mantineTableFooterProps
202
+ );
146
203
  return {
147
204
  enableColumnActions: false,
148
205
  enableColumnFilters: false,
149
206
  enableTopToolbar: false,
150
207
  enableSorting: false,
151
208
  enablePagination: false,
209
+ enableBottomToolbar: false,
210
+ enableExpanding,
211
+ enableStickyHeader,
212
+ enableStickyFooter,
213
+ enableRowVirtualization,
152
214
  mantinePaperProps: mPaperProps,
153
215
  mantineTableProps: mTableProps,
216
+ mantineTableHeadCellProps: mTableHeaderCellProps,
154
217
  mantineSkeletonProps: mTabelSkeletonProps,
218
+ mantineLoadingOverlayProps: mLoadingOverlayProps,
155
219
  mantineTableBodyProps: mTableBodyProps,
156
220
  mantineBottomToolbarProps: mBottomToolbarProps,
221
+ mantineTableBodyRowProps: mTableBodyRowProps,
157
222
  mantineTableBodyCellProps: mTableBodyCellProps,
223
+ mantineTableFooterCellProps: mTableFooterCellProps,
224
+ mantineTableFooterRowProps: mTableFooterRowProps,
225
+ mantineTableFooterProps: mTableFooterProps,
158
226
  data,
159
227
  icons: {
160
- IconArrowsSort: () => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(index.IconSwitchVertical02, { size: 14 }),
161
- IconSortAscending: () => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(index.IconArrowUp, { size: 14 }),
162
- IconSortDescending: () => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(index.IconArrowDown, { size: 14 })
228
+ IconArrowsSort: (props2) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(index.IconSwitchVertical02, { size: 14, ...props2 }),
229
+ IconSortAscending: (props2) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(index.IconArrowUp, { size: 14, ...props2 }),
230
+ IconSortDescending: (props2) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(index.IconArrowDown, { size: 14, ...props2 })
163
231
  },
164
232
  localization: {
165
233
  noRecordsToDisplay: errorMessage ? errorMessage : emptyMessage ? emptyMessage : void 0,
@@ -30,12 +30,20 @@ function mergeProTableProps(props) {
30
30
  mantinePaperProps = {},
31
31
  mantineSkeletonProps = {},
32
32
  mantineTableBodyProps,
33
+ mantineTableHeadCellProps = {},
33
34
  mantineTableBodyCellProps = {},
35
+ mantineTableBodyRowProps = {},
34
36
  mantineBottomToolbarProps = {},
37
+ mantineTableFooterCellProps = {},
38
+ mantineTableFooterRowProps = {},
39
+ mantineTableFooterProps = {},
40
+ mantineLoadingOverlayProps = {},
35
41
  withBorder = true,
36
42
  loading = false,
37
43
  enableExpanding = false,
44
+ enableRowVirtualization = false,
38
45
  enableStickyHeader,
46
+ enableStickyFooter,
39
47
  emptyMessage,
40
48
  errorMessage,
41
49
  data,
@@ -115,11 +123,36 @@ function mergeProTableProps(props) {
115
123
  }
116
124
  return {};
117
125
  }, mantineTableBodyProps);
126
+ const mTableHeaderCellProps = mergeMProps(() => {
127
+ return {
128
+ sx: {
129
+ ".mrt-table-head-sort-button": {
130
+ height: "auto",
131
+ width: "auto",
132
+ backgroundColor: "transparent",
133
+ borderColor: "transparent",
134
+ minWidth: 20,
135
+ minHeight: 20
136
+ }
137
+ }
138
+ };
139
+ }, mantineTableHeadCellProps);
118
140
  const mTableBodyCellProps = mergeMProps(() => {
119
141
  return {
120
142
  h: 48
121
143
  };
122
144
  }, mantineTableBodyCellProps);
145
+ const mTableBodyRowProps = mergeMProps(() => {
146
+ return {
147
+ sx: {
148
+ "&:where([data-with-row-border]):not(:last-of-type)": {
149
+ td: {
150
+ borderBottom: enableRowVirtualization ? "none !important" : void 0
151
+ }
152
+ }
153
+ }
154
+ };
155
+ }, mantineTableBodyRowProps);
123
156
  const mBottomToolbarProps = mergeMProps(
124
157
  {
125
158
  sx: (theme2) => ({
@@ -131,6 +164,12 @@ function mergeProTableProps(props) {
131
164
  },
132
165
  mantineBottomToolbarProps
133
166
  );
167
+ const mLoadingOverlayProps = mergeMProps(
168
+ () => ({
169
+ visible: false
170
+ }),
171
+ mantineLoadingOverlayProps
172
+ );
134
173
  const mTabelSkeletonProps = mergeMProps(
135
174
  {
136
175
  sx: (theme2) => ({
@@ -141,23 +180,52 @@ function mergeProTableProps(props) {
141
180
  },
142
181
  mantineSkeletonProps
143
182
  );
183
+ const mTableFooterCellProps = mergeMProps(
184
+ {
185
+ p: 8
186
+ },
187
+ mantineTableFooterCellProps
188
+ );
189
+ const mTableFooterRowProps = mergeMProps(
190
+ {
191
+ sx: { borderBottom: "none", outline: enableStickyFooter ? "none" : void 0 }
192
+ },
193
+ mantineTableFooterRowProps
194
+ );
195
+ const mTableFooterProps = mergeMProps(
196
+ {
197
+ sx: { outline: enableStickyFooter ? "none" : void 0 }
198
+ },
199
+ mantineTableFooterProps
200
+ );
144
201
  return {
145
202
  enableColumnActions: false,
146
203
  enableColumnFilters: false,
147
204
  enableTopToolbar: false,
148
205
  enableSorting: false,
149
206
  enablePagination: false,
207
+ enableBottomToolbar: false,
208
+ enableExpanding,
209
+ enableStickyHeader,
210
+ enableStickyFooter,
211
+ enableRowVirtualization,
150
212
  mantinePaperProps: mPaperProps,
151
213
  mantineTableProps: mTableProps,
214
+ mantineTableHeadCellProps: mTableHeaderCellProps,
152
215
  mantineSkeletonProps: mTabelSkeletonProps,
216
+ mantineLoadingOverlayProps: mLoadingOverlayProps,
153
217
  mantineTableBodyProps: mTableBodyProps,
154
218
  mantineBottomToolbarProps: mBottomToolbarProps,
219
+ mantineTableBodyRowProps: mTableBodyRowProps,
155
220
  mantineTableBodyCellProps: mTableBodyCellProps,
221
+ mantineTableFooterCellProps: mTableFooterCellProps,
222
+ mantineTableFooterRowProps: mTableFooterRowProps,
223
+ mantineTableFooterProps: mTableFooterProps,
156
224
  data,
157
225
  icons: {
158
- IconArrowsSort: () => /* @__PURE__ */ jsxRuntimeExports.jsx(IconSwitchVertical02, { size: 14 }),
159
- IconSortAscending: () => /* @__PURE__ */ jsxRuntimeExports.jsx(IconArrowUp, { size: 14 }),
160
- IconSortDescending: () => /* @__PURE__ */ jsxRuntimeExports.jsx(IconArrowDown, { size: 14 })
226
+ IconArrowsSort: (props2) => /* @__PURE__ */ jsxRuntimeExports.jsx(IconSwitchVertical02, { size: 14, ...props2 }),
227
+ IconSortAscending: (props2) => /* @__PURE__ */ jsxRuntimeExports.jsx(IconArrowUp, { size: 14, ...props2 }),
228
+ IconSortDescending: (props2) => /* @__PURE__ */ jsxRuntimeExports.jsx(IconArrowDown, { size: 14, ...props2 })
161
229
  },
162
230
  localization: {
163
231
  noRecordsToDisplay: errorMessage ? errorMessage : emptyMessage ? emptyMessage : void 0,
@@ -496,9 +496,6 @@ const theme = createTheme.createTheme({
496
496
  },
497
497
  Select: {
498
498
  defaultProps: {
499
- transition: "fade",
500
- transitionDuration: 200,
501
- transitionTimingFunction: "ease",
502
499
  size: "md",
503
500
  withCheckIcon: false
504
501
  },
@@ -559,9 +556,6 @@ const theme = createTheme.createTheme({
559
556
  MultiSelect: {
560
557
  defaultProps: {
561
558
  size: "md",
562
- transition: "fade",
563
- transitionDuration: 200,
564
- transitionTimingFunction: "ease",
565
559
  withCheckIcon: false
566
560
  },
567
561
  styles: (theme2, props) => {
@@ -494,9 +494,6 @@ const theme = createTheme({
494
494
  },
495
495
  Select: {
496
496
  defaultProps: {
497
- transition: "fade",
498
- transitionDuration: 200,
499
- transitionTimingFunction: "ease",
500
497
  size: "md",
501
498
  withCheckIcon: false
502
499
  },
@@ -557,9 +554,6 @@ const theme = createTheme({
557
554
  MultiSelect: {
558
555
  defaultProps: {
559
556
  size: "md",
560
- transition: "fade",
561
- transitionDuration: 200,
562
- transitionTimingFunction: "ease",
563
557
  withCheckIcon: false
564
558
  },
565
559
  styles: (theme2, props) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidbcloud/uikit",
3
- "version": "2.0.0-beta.71",
3
+ "version": "2.0.0-beta.73",
4
4
  "description": "tidbcloud uikit",
5
5
  "type": "module",
6
6
  "main": "dist/primitive/index.cjs",