@laser-ui/components 0.1.3 → 0.1.5

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
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ ## [0.1.5](https://github.com/laser-ui/laser-ui/compare/v0.1.4...v0.1.5) (2023-10-09)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **components:** fix form `enter` ([ebbe78b](https://github.com/laser-ui/laser-ui/commit/ebbe78b2afc3ee3f257847f143ee23fe12fd17fa))
10
+
11
+ ## [0.1.4](https://github.com/laser-ui/laser-ui/compare/v0.1.3...v0.1.4) (2023-09-18)
12
+
13
+ ### Bug Fixes
14
+
15
+ - **components:** fix `Icon` override style ([fc75aca](https://github.com/laser-ui/laser-ui/commit/fc75acac62f714ff5d8b633ed572331cac82b2cb))
16
+
5
17
  ## [0.1.3](https://github.com/laser-ui/laser-ui/compare/v0.1.2...v0.1.3) (2023-09-15)
6
18
 
7
19
  ### Bug Fixes
package/form/Form.js CHANGED
@@ -23,7 +23,16 @@ export const Form = (props) => {
23
23
  return (_jsx("form", Object.assign({}, restProps, mergeCS(styled('form', `form--${size}`), {
24
24
  className: restProps.className,
25
25
  style: restProps.style,
26
- }), { ref: formRef, children: _jsx(ConfigProvider, { context: { componentSize: size }, children: _jsx(FormContext.Provider, { value: {
26
+ }), { ref: formRef, onSubmit: (e) => {
27
+ var _a;
28
+ (_a = restProps.onSubmit) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
29
+ e.preventDefault();
30
+ e.stopPropagation();
31
+ }, onReset: (e) => {
32
+ var _a;
33
+ (_a = restProps.onReset) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
34
+ e.preventDefault();
35
+ }, children: _jsx(ConfigProvider, { context: { componentSize: size }, children: _jsx(FormContext.Provider, { value: {
27
36
  vertical,
28
37
  labelWidth: labelWidth !== null && labelWidth !== void 0 ? labelWidth : (vertical ? undefined : 'auto'),
29
38
  labelColon: labelColon !== null && labelColon !== void 0 ? labelColon : !vertical,
package/icon/Icon.js CHANGED
@@ -6,13 +6,16 @@ import { CLASSES } from './vars';
6
6
  import { useComponentProps, useNamespace, useStyled } from '../hooks';
7
7
  import { mergeCS } from '../utils';
8
8
  export function Icon(props) {
9
- const _a = useComponentProps('Icon', props), { children, styleOverrides, styleProvider, size = '1em', theme, rotate, spin, spinSpeed = 1 } = _a, restProps = __rest(_a, ["children", "styleOverrides", "styleProvider", "size", "theme", "rotate", "spin", "spinSpeed"]);
9
+ var _a, _b;
10
+ const _c = useComponentProps('Icon', props), { children, styleOverrides, styleProvider, size = '1em', theme, rotate, spin, spinSpeed = 1 } = _c, restProps = __rest(_c, ["children", "styleOverrides", "styleProvider", "size", "theme", "rotate", "spin", "spinSpeed"]);
10
11
  const namespace = useNamespace();
11
12
  const styled = useStyled(CLASSES, { icon: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.icon }, styleOverrides);
12
13
  const [width, height] = isArray(size) ? size : [size, size];
13
14
  return (_jsx("div", Object.assign({}, restProps, mergeCS(styled('icon', { [`icon.t-${theme}`]: theme }), {
14
15
  className: restProps.className,
15
16
  style: restProps.style,
16
- }), { children: cloneElement(children, Object.assign(Object.assign({}, children.props), { style: Object.assign(Object.assign({}, children.props.style), { transform: isUndefined(rotate) ? undefined : `rotate(${rotate}deg)`, animation: spin ? `${namespace}-spin ${spinSpeed}${isNumber(spinSpeed) ? 's' : ''} linear infinite` : undefined }), fill: 'currentColor', width,
17
+ }), { children: cloneElement(children, Object.assign(Object.assign({}, children.props), { style: Object.assign(Object.assign({}, children.props.style), { transform: isUndefined(rotate) ? (_a = children.props.style) === null || _a === void 0 ? void 0 : _a.transform : `rotate(${rotate}deg)`, animation: spin
18
+ ? `${namespace}-spin ${spinSpeed}${isNumber(spinSpeed) ? 's' : ''} linear infinite`
19
+ : (_b = children.props.style) === null || _b === void 0 ? void 0 : _b.animation }), fill: 'currentColor', width,
17
20
  height })) })));
18
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laser-ui/components",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "React components.",
5
5
  "keywords": [
6
6
  "ui",
@@ -26,8 +26,8 @@
26
26
  "module": "./index.js",
27
27
  "types": "./index.d.ts",
28
28
  "dependencies": {
29
- "@laser-ui/hooks": "0.1.3",
30
- "@laser-ui/utils": "0.1.3",
29
+ "@laser-ui/hooks": "0.1.5",
30
+ "@laser-ui/utils": "0.1.5",
31
31
  "@material-design-icons/svg": "^0.14.12",
32
32
  "jss": "^10.10.0",
33
33
  "jss-preset-default": "^10.10.0",
@@ -39,11 +39,12 @@
39
39
  "dayjs": "^1.11.0",
40
40
  "immer": ">=2.0.0",
41
41
  "react": "^18.0.0",
42
- "react-dom": "^18.0.0"
42
+ "react-dom": "^18.0.0",
43
+ "tslib": "^2.0.0"
43
44
  },
44
45
  "publishConfig": {
45
46
  "access": "public",
46
47
  "directory": "../../dist/libs/components"
47
48
  },
48
- "gitHead": "3975a04e735243cb8fc0b80374677c8a3cd619a9"
49
+ "gitHead": "c8b89225f4f524d25980cf918af57106d0a1a587"
49
50
  }
@@ -36,9 +36,7 @@ export function Progress(props) {
36
36
  const r = 60 - lineWidth / 2;
37
37
  const c = 2 * Math.PI * r;
38
38
  const dash = c - (pattern === 'circle' ? 0 : (gapDegree / 360) * c);
39
- return (_jsx(Icon, { size: size, children: _jsxs("svg", Object.assign({}, mergeCS(styled('progress__svg'), {
40
- style: { transform: pattern === 'circle' ? 'rotate(-90deg)' : `rotate(${90 + gapDegree / 2}deg)` },
41
- }), { viewBox: "0 0 120 120", children: [linearGradient && (_jsx("defs", { children: _jsxs("linearGradient", { id: `${namespace}-progress-gradient-${uniqueId}-1`, gradientUnits: "userSpaceOnUse", children: [_jsx("stop", { offset: "0%", stopColor: linearGradient[0] }), _jsx("stop", { offset: "100%", stopColor: linearGradient[100] })] }) })), _jsx("circle", { cx: 60, cy: 60, r: r, strokeLinecap: lineCap, strokeWidth: lineWidth, stroke: "var(--background-color)", fill: "none", strokeDasharray: `${dash} ${c}` }), _jsx("circle", { style: { opacity: percent === 0 ? 0 : 1 }, cx: 60, cy: 60, r: r, strokeLinecap: lineCap, strokeWidth: lineWidth, stroke: isUndefined(linearGradient) ? 'var(--color)' : `url(#${namespace}-progress-gradient-${uniqueId}-1)`, fill: "none", strokeDasharray: `${dash * (percent / 100)} ${c}` })] })) }));
39
+ return (_jsx(Icon, { size: size, rotate: pattern === 'circle' ? -90 : 90 + gapDegree / 2, children: _jsxs("svg", Object.assign({}, styled('progress__svg'), { viewBox: "0 0 120 120", children: [linearGradient && (_jsx("defs", { children: _jsxs("linearGradient", { id: `${namespace}-progress-gradient-${uniqueId}-1`, gradientUnits: "userSpaceOnUse", children: [_jsx("stop", { offset: "0%", stopColor: linearGradient[0] }), _jsx("stop", { offset: "100%", stopColor: linearGradient[100] })] }) })), _jsx("circle", { cx: 60, cy: 60, r: r, strokeLinecap: lineCap, strokeWidth: lineWidth, stroke: "var(--background-color)", fill: "none", strokeDasharray: `${dash} ${c}` }), _jsx("circle", { style: { opacity: percent === 0 ? 0 : 1 }, cx: 60, cy: 60, r: r, strokeLinecap: lineCap, strokeWidth: lineWidth, stroke: isUndefined(linearGradient) ? 'var(--color)' : `url(#${namespace}-progress-gradient-${uniqueId}-1)`, fill: "none", strokeDasharray: `${dash * (percent / 100)} ${c}` })] })) }));
42
40
  })()), label !== false && (_jsx("div", Object.assign({}, mergeCS(styled('progress__label'), {
43
41
  style: { fontSize: pattern === 'line' ? undefined : `calc(${size}px / 5)` },
44
42
  }), { children: checkNodeExist(label) ? (label) : state === 'process' ? (`${percent}%`) : (_jsx(Icon, { size: "1.25em", children: state === 'success' ? (pattern === 'line' ? (_jsx(CheckCircleFilled, {})) : (_jsx(CheckOutlined, {}))) : state === 'warning' ? (pattern === 'line' ? (_jsx(WarningFilled, {})) : (_jsx(WarningAmberOutlined, {}))) : pattern === 'line' ? (_jsx(CancelFilled, {})) : (_jsx(CloseOutlined, {})) })) })))] })));