@canlooks/can-ui 0.0.188 → 0.0.190

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.
@@ -1,2 +1,2 @@
1
1
  import { PanelProps } from './calendar';
2
- export declare const PanelMonth: import("react").MemoExoticComponent<({ innerD, setInnerD, onSelected, min, max }: PanelProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
2
+ export declare const PanelMonth: import("react").MemoExoticComponent<({ innerD, setInnerD, onSelected }: PanelProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
@@ -5,23 +5,17 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const calendar_style_1 = require("./calendar.style");
7
7
  const button_1 = require("../button");
8
- exports.PanelMonth = (0, react_1.memo)(({ innerD, setInnerD, onSelected, min, max }) => {
8
+ exports.PanelMonth = (0, react_1.memo)(({ innerD, setInnerD, onSelected }) => {
9
9
  const currentMonth = innerD.month();
10
10
  const clickHandler = (d, i) => {
11
11
  currentMonth !== i && setInnerD(d);
12
12
  onSelected(d);
13
13
  };
14
- const isDisabled = (d) => {
15
- if (min && min.isAfter(d)) {
16
- return true;
17
- }
18
- return max && max.isBefore(d);
19
- };
20
14
  const renderButtons = () => {
21
15
  const ret = [];
22
16
  for (let i = 0; i < 12; i++) {
23
17
  const d = innerD.month(i);
24
- ret.push((0, jsx_runtime_1.jsxs)(button_1.Button, { className: calendar_style_1.classes.monthItem, variant: currentMonth === i ? 'filled' : 'text', size: "large", color: currentMonth === i ? 'primary' : 'text', disabled: isDisabled(d), onClick: () => clickHandler(d, i), children: [i + 1, "\u6708"] }, i));
18
+ ret.push((0, jsx_runtime_1.jsxs)(button_1.Button, { className: calendar_style_1.classes.monthItem, variant: currentMonth === i ? 'filled' : 'text', size: "large", color: currentMonth === i ? 'primary' : 'text', onClick: () => clickHandler(d, i), children: [i + 1, "\u6708"] }, i));
25
19
  }
26
20
  return ret;
27
21
  };
@@ -1,2 +1,2 @@
1
1
  import { PanelProps } from './calendar';
2
- export declare const PanelYear: import("react").MemoExoticComponent<({ innerD, setInnerD, onSelected, min, max }: PanelProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
2
+ export declare const PanelYear: import("react").MemoExoticComponent<({ innerD, setInnerD, onSelected }: PanelProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
@@ -9,7 +9,7 @@ const tooltip_1 = require("../tooltip");
9
9
  const icon_1 = require("../icon");
10
10
  const faAngleLeft_1 = require("@fortawesome/free-solid-svg-icons/faAngleLeft");
11
11
  const faAngleRight_1 = require("@fortawesome/free-solid-svg-icons/faAngleRight");
12
- exports.PanelYear = (0, react_1.memo)(({ innerD, setInnerD, onSelected, min, max }) => {
12
+ exports.PanelYear = (0, react_1.memo)(({ innerD, setInnerD, onSelected }) => {
13
13
  const currentYear = innerD.year();
14
14
  const clickHandler = (d, yearNum) => {
15
15
  currentYear !== yearNum && setInnerD(d);
@@ -17,18 +17,12 @@ exports.PanelYear = (0, react_1.memo)(({ innerD, setInnerD, onSelected, min, max
17
17
  };
18
18
  const [page, setPage] = (0, react_1.useState)(() => Math.floor(currentYear / 12));
19
19
  const renderHeadControl = (icon, title, onClick) => ((0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: title, children: (0, jsx_runtime_1.jsx)(button_1.Button, { className: calendar_style_1.classes.headControl, variant: "text", size: "small", color: "text.secondary", onClick: onClick, children: icon }) }));
20
- const isDisabled = (d) => {
21
- if (min && min.isAfter(d)) {
22
- return true;
23
- }
24
- return max && max.isBefore(d);
25
- };
26
20
  const renderButtons = () => {
27
21
  const ret = [];
28
22
  for (let i = 0; i < 12; i++) {
29
23
  const yearNum = page * 12 + i + 1;
30
24
  const d = innerD.year(yearNum);
31
- ret.push((0, jsx_runtime_1.jsx)(button_1.Button, { className: calendar_style_1.classes.monthItem, variant: currentYear === yearNum ? 'filled' : 'text', size: "large", color: currentYear === yearNum ? 'primary' : 'text', disabled: isDisabled(d), onClick: () => clickHandler(d, yearNum), children: yearNum }, i));
25
+ ret.push((0, jsx_runtime_1.jsx)(button_1.Button, { className: calendar_style_1.classes.monthItem, variant: currentYear === yearNum ? 'filled' : 'text', size: "large", color: currentYear === yearNum ? 'primary' : 'text', onClick: () => clickHandler(d, yearNum), children: yearNum }, i));
32
26
  }
33
27
  return ret;
34
28
  };
@@ -103,6 +103,16 @@ exports.style = (0, utils_1.defineCss)(({ spacing, mode, gray, text, colors, eas
103
103
  .${exports.classes.children} {
104
104
  padding: ${spacing[4]}px ${spacing[5]}px;
105
105
  border-bottom: 1px solid ${gray(mode === 'light' ? .12 : .32)};
106
+
107
+ thead, tfoot {
108
+ z-index: 3;
109
+ }
110
+
111
+ th, td {
112
+ &[data-sticky=left], &[data-sticky=right] {
113
+ z-index: 2;
114
+ }
115
+ }
106
116
  }
107
117
  }
108
118
  }
@@ -139,12 +149,6 @@ exports.style = (0, utils_1.defineCss)(({ spacing, mode, gray, text, colors, eas
139
149
  }
140
150
  }
141
151
 
142
- .${exports.classes.empty} {
143
- height: auto;
144
- position: sticky;
145
- left: 0;
146
- }
147
-
148
152
  .${exports.classes.resizeHandle} {
149
153
  width: 8px;
150
154
  height: 100%;
@@ -168,6 +172,12 @@ exports.style = (0, utils_1.defineCss)(({ spacing, mode, gray, text, colors, eas
168
172
  }
169
173
  }
170
174
 
175
+ .${exports.classes.empty} {
176
+ height: auto;
177
+ position: sticky;
178
+ left: 0;
179
+ }
180
+
171
181
  &[data-column-resizable=true] .${table_style_1.classes.root} {
172
182
  width: max-content;
173
183
  table-layout: fixed;
@@ -20,7 +20,7 @@ exports.style = (0, utils_1.defineCss)(({ mode, spacing, gray, divider, backgrou
20
20
 
21
21
  thead, tfoot {
22
22
  position: sticky;
23
- z-index: 3;
23
+ z-index: 5;
24
24
 
25
25
  th, td {
26
26
  background-color: ${headerBg};
@@ -11,7 +11,7 @@ exports.style = (0, utils_1.defineCss)(({ easing }) => (0, react_1.css) `
11
11
  &[data-sticky=left], &[data-sticky=right] {
12
12
  overflow: visible;
13
13
  position: sticky;
14
- z-index: 2;
14
+ z-index: 4;
15
15
 
16
16
  &::after {
17
17
  content: '';
@@ -1,2 +1,2 @@
1
1
  import { PanelProps } from './calendar.js';
2
- export declare const PanelMonth: import("react").MemoExoticComponent<({ innerD, setInnerD, onSelected, min, max }: PanelProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
2
+ export declare const PanelMonth: import("react").MemoExoticComponent<({ innerD, setInnerD, onSelected }: PanelProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
@@ -2,23 +2,17 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "@emotion/reac
2
2
  import { memo } from 'react';
3
3
  import { classes } from './calendar.style.js';
4
4
  import { Button } from '../button/index.js';
5
- export const PanelMonth = memo(({ innerD, setInnerD, onSelected, min, max }) => {
5
+ export const PanelMonth = memo(({ innerD, setInnerD, onSelected }) => {
6
6
  const currentMonth = innerD.month();
7
7
  const clickHandler = (d, i) => {
8
8
  currentMonth !== i && setInnerD(d);
9
9
  onSelected(d);
10
10
  };
11
- const isDisabled = (d) => {
12
- if (min && min.isAfter(d)) {
13
- return true;
14
- }
15
- return max && max.isBefore(d);
16
- };
17
11
  const renderButtons = () => {
18
12
  const ret = [];
19
13
  for (let i = 0; i < 12; i++) {
20
14
  const d = innerD.month(i);
21
- ret.push(_jsxs(Button, { className: classes.monthItem, variant: currentMonth === i ? 'filled' : 'text', size: "large", color: currentMonth === i ? 'primary' : 'text', disabled: isDisabled(d), onClick: () => clickHandler(d, i), children: [i + 1, "\u6708"] }, i));
15
+ ret.push(_jsxs(Button, { className: classes.monthItem, variant: currentMonth === i ? 'filled' : 'text', size: "large", color: currentMonth === i ? 'primary' : 'text', onClick: () => clickHandler(d, i), children: [i + 1, "\u6708"] }, i));
22
16
  }
23
17
  return ret;
24
18
  };
@@ -1,2 +1,2 @@
1
1
  import { PanelProps } from './calendar.js';
2
- export declare const PanelYear: import("react").MemoExoticComponent<({ innerD, setInnerD, onSelected, min, max }: PanelProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
2
+ export declare const PanelYear: import("react").MemoExoticComponent<({ innerD, setInnerD, onSelected }: PanelProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
@@ -6,7 +6,7 @@ import { Tooltip } from '../tooltip/index.js';
6
6
  import { Icon } from '../icon/index.js';
7
7
  import { faAngleLeft } from '@fortawesome/free-solid-svg-icons/faAngleLeft';
8
8
  import { faAngleRight } from '@fortawesome/free-solid-svg-icons/faAngleRight';
9
- export const PanelYear = memo(({ innerD, setInnerD, onSelected, min, max }) => {
9
+ export const PanelYear = memo(({ innerD, setInnerD, onSelected }) => {
10
10
  const currentYear = innerD.year();
11
11
  const clickHandler = (d, yearNum) => {
12
12
  currentYear !== yearNum && setInnerD(d);
@@ -14,18 +14,12 @@ export const PanelYear = memo(({ innerD, setInnerD, onSelected, min, max }) => {
14
14
  };
15
15
  const [page, setPage] = useState(() => Math.floor(currentYear / 12));
16
16
  const renderHeadControl = (icon, title, onClick) => (_jsx(Tooltip, { title: title, children: _jsx(Button, { className: classes.headControl, variant: "text", size: "small", color: "text.secondary", onClick: onClick, children: icon }) }));
17
- const isDisabled = (d) => {
18
- if (min && min.isAfter(d)) {
19
- return true;
20
- }
21
- return max && max.isBefore(d);
22
- };
23
17
  const renderButtons = () => {
24
18
  const ret = [];
25
19
  for (let i = 0; i < 12; i++) {
26
20
  const yearNum = page * 12 + i + 1;
27
21
  const d = innerD.year(yearNum);
28
- ret.push(_jsx(Button, { className: classes.monthItem, variant: currentYear === yearNum ? 'filled' : 'text', size: "large", color: currentYear === yearNum ? 'primary' : 'text', disabled: isDisabled(d), onClick: () => clickHandler(d, yearNum), children: yearNum }, i));
22
+ ret.push(_jsx(Button, { className: classes.monthItem, variant: currentYear === yearNum ? 'filled' : 'text', size: "large", color: currentYear === yearNum ? 'primary' : 'text', onClick: () => clickHandler(d, yearNum), children: yearNum }, i));
29
23
  }
30
24
  return ret;
31
25
  };
@@ -100,6 +100,16 @@ export const style = defineCss(({ spacing, mode, gray, text, colors, easing }) =
100
100
  .${classes.children} {
101
101
  padding: ${spacing[4]}px ${spacing[5]}px;
102
102
  border-bottom: 1px solid ${gray(mode === 'light' ? .12 : .32)};
103
+
104
+ thead, tfoot {
105
+ z-index: 3;
106
+ }
107
+
108
+ th, td {
109
+ &[data-sticky=left], &[data-sticky=right] {
110
+ z-index: 2;
111
+ }
112
+ }
103
113
  }
104
114
  }
105
115
  }
@@ -136,12 +146,6 @@ export const style = defineCss(({ spacing, mode, gray, text, colors, easing }) =
136
146
  }
137
147
  }
138
148
 
139
- .${classes.empty} {
140
- height: auto;
141
- position: sticky;
142
- left: 0;
143
- }
144
-
145
149
  .${classes.resizeHandle} {
146
150
  width: 8px;
147
151
  height: 100%;
@@ -165,6 +169,12 @@ export const style = defineCss(({ spacing, mode, gray, text, colors, easing }) =
165
169
  }
166
170
  }
167
171
 
172
+ .${classes.empty} {
173
+ height: auto;
174
+ position: sticky;
175
+ left: 0;
176
+ }
177
+
168
178
  &[data-column-resizable=true] .${tableClasses.root} {
169
179
  width: max-content;
170
180
  table-layout: fixed;
@@ -16,7 +16,7 @@ export const style = defineCss(({ mode, spacing, gray, divider, background, easi
16
16
 
17
17
  thead, tfoot {
18
18
  position: sticky;
19
- z-index: 3;
19
+ z-index: 5;
20
20
 
21
21
  th, td {
22
22
  background-color: ${headerBg};
@@ -8,7 +8,7 @@ export const style = defineCss(({ easing }) => css `
8
8
  &[data-sticky=left], &[data-sticky=right] {
9
9
  overflow: visible;
10
10
  position: sticky;
11
- z-index: 2;
11
+ z-index: 4;
12
12
 
13
13
  &::after {
14
14
  content: '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canlooks/can-ui",
3
- "version": "0.0.188",
3
+ "version": "0.0.190",
4
4
  "author": "C.CanLiang <canlooks@gmail.com>",
5
5
  "description": "My ui framework",
6
6
  "license": "MIT",