@laser-ui/components 0.1.2 → 0.1.4

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,19 @@
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.4](https://github.com/laser-ui/laser-ui/compare/v0.1.3...v0.1.4) (2023-09-18)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **components:** fix `Icon` override style ([fc75aca](https://github.com/laser-ui/laser-ui/commit/fc75acac62f714ff5d8b633ed572331cac82b2cb))
10
+
11
+ ## [0.1.3](https://github.com/laser-ui/laser-ui/compare/v0.1.2...v0.1.3) (2023-09-15)
12
+
13
+ ### Bug Fixes
14
+
15
+ - **components:** fix creating uid when upload file ([5e3a8af](https://github.com/laser-ui/laser-ui/commit/5e3a8afa656721871e88f01f0b6e48843bdb64c1))
16
+ - **components:** fix width of form-item's content ([6063665](https://github.com/laser-ui/laser-ui/commit/60636657f4c581bc2964471f30078f1685f906c1))
17
+
5
18
  ## [0.1.2](https://github.com/laser-ui/laser-ui/compare/v0.1.1...v0.1.2) (2023-09-14)
6
19
 
7
20
  **Note:** Version bump only for package @laser-ui/components
package/form/FormItem.js CHANGED
@@ -156,7 +156,11 @@ export function FormItem(props) {
156
156
  'form__item-label--colon': formContext.labelColon,
157
157
  }), { htmlFor: labelFor, "data-l-form-label": true, children: [label, (labelExtra || (formContext.requiredType === 'optional' && !required)) && (_jsxs("div", Object.assign({}, styled('form__item-label-extra'), { children: [formContext.requiredType === 'optional' && !required && _jsx("span", { children: t('Form', 'Optional') }), labelExtra] })))] }))) }))), _jsxs("div", Object.assign({}, mergeCS(styled('form__item-content'), {
158
158
  style: {
159
- width: `calc(100% - ${formContext.vertical ? '0px' : labelWidth === 'auto' ? 'var(--label-width)' : labelWidth}${isNumber(labelWidth) ? 'px' : ''} - ${formContext.feedbackIcon ? 'var(--size)' : '0px'})`,
159
+ width: `calc(100% - ${formContext.vertical
160
+ ? '0px'
161
+ : labelWidth === 'auto'
162
+ ? 'var(--label-width)'
163
+ : labelWidth + (isNumber(labelWidth) ? 'px' : '')} - ${formContext.feedbackIcon ? 'var(--size)' : '0px'})`,
160
164
  },
161
165
  }), { children: [_jsx("div", Object.assign({}, styled('form__item-control'), { children: isFunction(children) ? children(formControlProviders) : children })), _jsx("div", Object.assign({}, styled('form__error-container'), { children: (() => {
162
166
  const errorsMap = new Map();
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.2",
3
+ "version": "0.1.4",
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.2",
30
- "@laser-ui/utils": "0.1.2",
29
+ "@laser-ui/hooks": "0.1.4",
30
+ "@laser-ui/utils": "0.1.4",
31
31
  "@material-design-icons/svg": "^0.14.12",
32
32
  "jss": "^10.10.0",
33
33
  "jss-preset-default": "^10.10.0",
@@ -45,5 +45,5 @@
45
45
  "access": "public",
46
46
  "directory": "../../dist/libs/components"
47
47
  },
48
- "gitHead": "6658d3823bb6ca76b1ffd33defdbeefd7c4297f2"
48
+ "gitHead": "eb0e7cedff3b277b90e724eddc6850c3b623d7b2"
49
49
  }
@@ -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, {})) })) })))] })));
package/upload/Upload.js CHANGED
@@ -32,12 +32,13 @@ function UploadFC(props, ref) {
32
32
  customUpload(fileList);
33
33
  }
34
34
  else {
35
+ let n = Date.now();
35
36
  const filesAdded = [];
36
37
  for (let index = 0; index < fileList.length; index++) {
37
38
  const file = fileList.item(index);
38
39
  if (file) {
39
40
  const xhr = new XMLHttpRequest();
40
- let uid = Date.now();
41
+ let uid = ++n;
41
42
  const add = (obj) => {
42
43
  const fileURL = URL.createObjectURL(file);
43
44
  dataRef.current.fileURLs.push(fileURL);