@laser-ui/components 0.2.2 → 0.4.0

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/accordion/Accordion.js +1 -1
  3. package/alert/Alert.js +5 -5
  4. package/cascader/Cascader.js +4 -4
  5. package/cascader/internal/CascaderPanel.js +1 -1
  6. package/date-picker/DatePicker.js +3 -3
  7. package/date-picker/internal/DatePickerPanel.js +4 -4
  8. package/drawer/DrawerHeader.js +1 -1
  9. package/dropdown/Dropdown.js +1 -4
  10. package/dropdown/internal/DropdownSub.js +1 -1
  11. package/fab/FabBacktop.js +1 -1
  12. package/fab/FabButton.js +1 -1
  13. package/form/FormItem.js +4 -4
  14. package/image/Image.js +4 -4
  15. package/image/ImagePreview.js +6 -6
  16. package/image/types.d.ts +1 -2
  17. package/input/Input.js +3 -3
  18. package/input/InputNumber.js +3 -3
  19. package/modal/ModalAlert.js +4 -4
  20. package/modal/ModalHeader.js +1 -1
  21. package/notification/Notification.js +5 -5
  22. package/package.json +4 -4
  23. package/pagination/Pagination.js +5 -5
  24. package/popover/PopoverHeader.js +1 -1
  25. package/progress/Progress.js +6 -6
  26. package/rating/Rating.js +1 -1
  27. package/root/dialog-service.js +5 -1
  28. package/select/Select.js +5 -5
  29. package/slides/Slides.js +2 -2
  30. package/stepper/Stepper.js +2 -2
  31. package/table/TableFilter.js +1 -1
  32. package/tabs/Tabs.js +3 -3
  33. package/time-picker/TimePicker.js +3 -3
  34. package/toast/Toast.js +5 -5
  35. package/transfer/Transfer.js +2 -2
  36. package/transfer/internal/TransferPanel.js +1 -1
  37. package/tree/internal/TreePanel.js +3 -3
  38. package/tree-select/TreeSelect.js +4 -4
  39. package/upload/UploadAction.js +2 -2
  40. package/upload/UploadButton.js +2 -2
  41. package/upload/UploadList.js +1 -1
  42. package/upload/UploadPicture.js +1 -1
  43. package/upload/UploadPictureList.js +1 -1
  44. package/upload/UploadPreviewAction.js +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
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.4.0](https://github.com/laser-ui/laser-ui/compare/v0.3.0...v0.4.0) (2023-12-06)
6
+
7
+ ### Features
8
+
9
+ - update `vite-plugin-svgr` to **v4** ([5d05979](https://github.com/laser-ui/laser-ui/commit/5d0597973f3f41968bf70542e96eb9318f439328))
10
+
11
+ # [0.3.0](https://github.com/laser-ui/laser-ui/compare/v0.2.2...v0.3.0) (2023-11-03)
12
+
13
+ **Note:** Version bump only for package @laser-ui/components
14
+
5
15
  ## [0.2.2](https://github.com/laser-ui/laser-ui/compare/v0.2.1...v0.2.2) (2023-10-31)
6
16
 
7
17
  ### Bug Fixes
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { createElement as _createElement } from "react";
4
- import { ReactComponent as KeyboardArrowDownOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg';
4
+ import KeyboardArrowDownOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg?react';
5
5
  import { isNull, isUndefined, nth } from 'lodash';
6
6
  import { useId } from 'react';
7
7
  import { CLASSES } from './vars';
package/alert/Alert.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { checkNodeExist } from '@laser-ui/utils';
4
- import { ReactComponent as CheckCircleOutlined } from '@material-design-icons/svg/outlined/check_circle.svg';
5
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
6
- import { ReactComponent as HighlightOffOutlined } from '@material-design-icons/svg/outlined/highlight_off.svg';
7
- import { ReactComponent as InfoOutlined } from '@material-design-icons/svg/outlined/info.svg';
8
- import { ReactComponent as WarningAmberOutlined } from '@material-design-icons/svg/outlined/warning_amber.svg';
4
+ import CheckCircleOutlined from '@material-design-icons/svg/outlined/check_circle.svg?react';
5
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
6
+ import HighlightOffOutlined from '@material-design-icons/svg/outlined/highlight_off.svg?react';
7
+ import InfoOutlined from '@material-design-icons/svg/outlined/info.svg?react';
8
+ import WarningAmberOutlined from '@material-design-icons/svg/outlined/warning_amber.svg?react';
9
9
  import { isUndefined } from 'lodash';
10
10
  import { CLASSES } from './vars';
11
11
  import { useComponentProps, useControlled, useStyled, useTranslation } from '../hooks';
@@ -2,10 +2,10 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useEvent, useEventCallback, useForkRef, useResize } from '@laser-ui/hooks';
4
4
  import { findNested } from '@laser-ui/utils';
5
- import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
6
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
7
- import { ReactComponent as KeyboardArrowDownOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg';
8
- import { ReactComponent as SearchOutlined } from '@material-design-icons/svg/outlined/search.svg';
5
+ import CancelFilled from '@material-design-icons/svg/filled/cancel.svg?react';
6
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
7
+ import KeyboardArrowDownOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg?react';
8
+ import SearchOutlined from '@material-design-icons/svg/outlined/search.svg?react';
9
9
  import { isNull, isUndefined } from 'lodash';
10
10
  import { createElement, forwardRef, useId, useImperativeHandle, useMemo, useRef, useState } from 'react';
11
11
  import { CascaderPanel } from './internal/CascaderPanel';
@@ -2,7 +2,7 @@ import { createElement as _createElement } from "react";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEventCallback } from '@laser-ui/hooks';
4
4
  import { scrollIntoViewIfNeeded } from '@laser-ui/utils';
5
- import { ReactComponent as KeyboardArrowRightOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg';
5
+ import KeyboardArrowRightOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg?react';
6
6
  import { isNumber, isUndefined } from 'lodash';
7
7
  import { forwardRef, useImperativeHandle, useMemo, useRef } from 'react';
8
8
  import { Checkbox } from '../../checkbox';
@@ -2,9 +2,9 @@ import { __rest } from "tslib";
2
2
  import { createElement as _createElement } from "react";
3
3
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import { useAsync, useEvent, useEventCallback, useForceUpdate, useForkRef, useImmer, useResize } from '@laser-ui/hooks';
5
- import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
6
- import { ReactComponent as CalendarTodayOutlined } from '@material-design-icons/svg/outlined/calendar_today.svg';
7
- import { ReactComponent as SwapHorizOutlined } from '@material-design-icons/svg/outlined/swap_horiz.svg';
5
+ import CancelFilled from '@material-design-icons/svg/filled/cancel.svg?react';
6
+ import CalendarTodayOutlined from '@material-design-icons/svg/outlined/calendar_today.svg?react';
7
+ import SwapHorizOutlined from '@material-design-icons/svg/outlined/swap_horiz.svg?react';
8
8
  import { isArray, isBoolean, isNull, isUndefined } from 'lodash';
9
9
  import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
10
10
  import { DatePickerPanel } from './internal/DatePickerPanel';
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useAsync, useEvent, useRefExtra } from '@laser-ui/hooks';
3
- import { ReactComponent as KeyboardArrowLeftOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg';
4
- import { ReactComponent as KeyboardArrowRightOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg';
5
- import { ReactComponent as KeyboardDoubleArrowLeftOutlined } from '@material-design-icons/svg/outlined/keyboard_double_arrow_left.svg';
6
- import { ReactComponent as KeyboardDoubleArrowRightOutlined } from '@material-design-icons/svg/outlined/keyboard_double_arrow_right.svg';
3
+ import KeyboardArrowLeftOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg?react';
4
+ import KeyboardArrowRightOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg?react';
5
+ import KeyboardDoubleArrowLeftOutlined from '@material-design-icons/svg/outlined/keyboard_double_arrow_left.svg?react';
6
+ import KeyboardDoubleArrowRightOutlined from '@material-design-icons/svg/outlined/keyboard_double_arrow_right.svg?react';
7
7
  import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
8
8
  import dayjs from '../../dayjs';
9
9
  import { useTranslation } from '../../hooks';
@@ -1,6 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
3
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
4
4
  import { Children } from 'react';
5
5
  import { CLASSES } from './vars';
6
6
  import { Button } from '../button';
@@ -267,10 +267,7 @@ function DropdownFC(props, ref) {
267
267
  triggerRef,
268
268
  popupRef,
269
269
  containerRefs: [],
270
- }, onVisibleChange: (visible) => {
271
- console.log(visible);
272
- changeVisible(visible);
273
- }, children: ({ renderTrigger, renderPopup }) => {
270
+ }, onVisibleChange: changeVisible, children: ({ renderTrigger, renderPopup }) => {
274
271
  const render = (el) => {
275
272
  var _a, _b;
276
273
  triggerId = (_a = el.props.id) !== null && _a !== void 0 ? _a : `${namespace}-dropdown-trigger-${uniqueId}`;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEventCallback } from '@laser-ui/hooks';
3
3
  import { checkNodeExist } from '@laser-ui/utils';
4
- import { ReactComponent as KeyboardArrowRightOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg';
4
+ import KeyboardArrowRightOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg?react';
5
5
  import { isUndefined } from 'lodash';
6
6
  import { forwardRef, useImperativeHandle, useRef } from 'react';
7
7
  import { useJSS, useTranslation } from '../../hooks';
package/fab/FabBacktop.js CHANGED
@@ -2,7 +2,7 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useEvent, useIsomorphicLayoutEffect, useRefExtra, useResize } from '@laser-ui/hooks';
4
4
  import { scrollTo, toPx } from '@laser-ui/utils';
5
- import { ReactComponent as VerticalAlignTopOutlined } from '@material-design-icons/svg/outlined/vertical_align_top.svg';
5
+ import VerticalAlignTopOutlined from '@material-design-icons/svg/outlined/vertical_align_top.svg?react';
6
6
  import { isString } from 'lodash';
7
7
  import { cloneElement, useRef, useState } from 'react';
8
8
  import { FabButton } from './FabButton';
package/fab/FabButton.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ReactComponent as AddOutlined } from '@material-design-icons/svg/outlined/add.svg';
3
+ import AddOutlined from '@material-design-icons/svg/outlined/add.svg?react';
4
4
  import { forwardRef } from 'react';
5
5
  import { BUTTON_CLASSES } from './vars';
6
6
  import { useComponentProps, useStyled } from '../hooks';
package/form/FormItem.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
4
- import { ReactComponent as CheckCircleFilled } from '@material-design-icons/svg/filled/check_circle.svg';
5
- import { ReactComponent as ErrorFilled } from '@material-design-icons/svg/filled/error.svg';
6
- import { ReactComponent as HelpOutlineOutlined } from '@material-design-icons/svg/outlined/help_outline.svg';
3
+ import CancelFilled from '@material-design-icons/svg/filled/cancel.svg?react';
4
+ import CheckCircleFilled from '@material-design-icons/svg/filled/check_circle.svg?react';
5
+ import ErrorFilled from '@material-design-icons/svg/filled/error.svg?react';
6
+ import HelpOutlineOutlined from '@material-design-icons/svg/outlined/help_outline.svg?react';
7
7
  import { isBoolean, isFunction, isNull, isNumber, isString } from 'lodash';
8
8
  import { useContext, useId, useRef } from 'react';
9
9
  import { FormError } from './internal/FormError';
package/image/Image.js CHANGED
@@ -9,15 +9,15 @@ import { CLASSES } from './vars';
9
9
  import { useComponentProps, useStyled } from '../hooks';
10
10
  import { mergeCS } from '../utils';
11
11
  export const Image = (props) => {
12
- const _a = useComponentProps('Image', props), { styleOverrides, styleProvider, src, loading, error, actions, imgProps } = _a, restProps = __rest(_a, ["styleOverrides", "styleProvider", "src", "loading", "error", "actions", "imgProps"]);
12
+ const _a = useComponentProps('Image', props), { styleOverrides, styleProvider, loading, error, actions, imgProps } = _a, restProps = __rest(_a, ["styleOverrides", "styleProvider", "loading", "error", "actions", "imgProps"]);
13
13
  const styled = useStyled(CLASSES, { image: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.image }, styleOverrides);
14
14
  const forceUpdate = useForceUpdate();
15
15
  const dataRef = useRef({
16
16
  isLoading: true,
17
17
  isError: false,
18
18
  });
19
- if (src !== dataRef.current.prevSrc) {
20
- dataRef.current.prevSrc = src;
19
+ if (imgProps.src !== dataRef.current.prevSrc) {
20
+ dataRef.current.prevSrc = imgProps.src;
21
21
  dataRef.current.isLoading = true;
22
22
  dataRef.current.isError = false;
23
23
  }
@@ -27,7 +27,7 @@ export const Image = (props) => {
27
27
  }), { children: [dataRef.current.isLoading && checkNodeExist(loading) && loading, dataRef.current.isError && checkNodeExist(error) && error, actions && _jsx("div", Object.assign({}, styled('image__actions'), { children: Children.map(actions, (action) => action) })), _jsx("img", Object.assign({}, imgProps, mergeCS(styled('image__img'), {
28
28
  className: imgProps === null || imgProps === void 0 ? void 0 : imgProps.className,
29
29
  style: Object.assign(Object.assign({}, imgProps === null || imgProps === void 0 ? void 0 : imgProps.style), { display: (dataRef.current.isLoading && loading) || (dataRef.current.isError && error) ? 'none' : undefined }),
30
- }), { src: src, onLoadStart: (e) => {
30
+ }), { onLoadStart: (e) => {
31
31
  var _a;
32
32
  // https://bugs.chromium.org/p/chromium/issues/detail?id=458851
33
33
  (_a = imgProps === null || imgProps === void 0 ? void 0 : imgProps.onLoadStart) === null || _a === void 0 ? void 0 : _a.call(imgProps, e);
@@ -2,12 +2,12 @@ import { __rest } from "tslib";
2
2
  import { createElement as _createElement } from "react";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import { useEvent, useImmer, useRefExtra } from '@laser-ui/hooks';
5
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
6
- import { ReactComponent as KeyboardArrowLeftOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg';
7
- import { ReactComponent as KeyboardArrowRightOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg';
8
- import { ReactComponent as Rotate90DegreesCwOutlined } from '@material-design-icons/svg/outlined/rotate_90_degrees_cw.svg';
9
- import { ReactComponent as ZoomInOutlined } from '@material-design-icons/svg/outlined/zoom_in.svg';
10
- import { ReactComponent as ZoomOutOutlined } from '@material-design-icons/svg/outlined/zoom_out.svg';
5
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
6
+ import KeyboardArrowLeftOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg?react';
7
+ import KeyboardArrowRightOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg?react';
8
+ import Rotate90DegreesCwOutlined from '@material-design-icons/svg/outlined/rotate_90_degrees_cw.svg?react';
9
+ import ZoomInOutlined from '@material-design-icons/svg/outlined/zoom_in.svg?react';
10
+ import ZoomOutOutlined from '@material-design-icons/svg/outlined/zoom_out.svg?react';
11
11
  import { isNull, isUndefined } from 'lodash';
12
12
  import { useRef, useState } from 'react';
13
13
  import { PREVIEW_CLASSES } from './vars';
package/image/types.d.ts CHANGED
@@ -3,11 +3,10 @@ import type { CLASSES, PREVIEW_CLASSES } from './vars';
3
3
  import type { BaseProps } from '../types';
4
4
  export {};
5
5
  export interface ImageProps extends BaseProps<'image', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
6
- src: string;
6
+ imgProps: React.ImgHTMLAttributes<HTMLImageElement>;
7
7
  loading?: React.ReactNode;
8
8
  error?: React.ReactNode;
9
9
  actions?: React.ReactElement[];
10
- imgProps?: React.ImgHTMLAttributes<HTMLImageElement>;
11
10
  }
12
11
  export interface ImageActionProps extends BaseProps<'image', typeof CLASSES>, React.ButtonHTMLAttributes<HTMLButtonElement> {
13
12
  }
package/input/Input.js CHANGED
@@ -2,9 +2,9 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useForkRef } from '@laser-ui/hooks';
4
4
  import { checkNodeExist } from '@laser-ui/utils';
5
- import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
6
- import { ReactComponent as VisibilityOutlined } from '@material-design-icons/svg/outlined/visibility.svg';
7
- import { ReactComponent as VisibilityOffOutlined } from '@material-design-icons/svg/outlined/visibility_off.svg';
5
+ import CancelFilled from '@material-design-icons/svg/filled/cancel.svg?react';
6
+ import VisibilityOutlined from '@material-design-icons/svg/outlined/visibility.svg?react';
7
+ import VisibilityOffOutlined from '@material-design-icons/svg/outlined/visibility_off.svg?react';
8
8
  import { useRef } from 'react';
9
9
  import { InputNumber } from './InputNumber';
10
10
  import { CLASSES } from './vars';
@@ -2,9 +2,9 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useAsync, useEvent, useForceUpdate, useForkRef, useRefExtra } from '@laser-ui/hooks';
4
4
  import { checkNodeExist } from '@laser-ui/utils';
5
- import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
6
- import { ReactComponent as KeyboardArrowDownOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg';
7
- import { ReactComponent as KeyboardArrowUpOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_up.svg';
5
+ import CancelFilled from '@material-design-icons/svg/filled/cancel.svg?react';
6
+ import KeyboardArrowDownOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg?react';
7
+ import KeyboardArrowUpOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_up.svg?react';
8
8
  import { isNull, isUndefined } from 'lodash';
9
9
  import { useRef } from 'react';
10
10
  import { CLASSES } from './vars';
@@ -1,10 +1,10 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { checkNodeExist } from '@laser-ui/utils';
4
- import { ReactComponent as CheckCircleOutlined } from '@material-design-icons/svg/outlined/check_circle.svg';
5
- import { ReactComponent as HighlightOffOutlined } from '@material-design-icons/svg/outlined/highlight_off.svg';
6
- import { ReactComponent as InfoOutlined } from '@material-design-icons/svg/outlined/info.svg';
7
- import { ReactComponent as WarningAmberOutlined } from '@material-design-icons/svg/outlined/warning_amber.svg';
4
+ import CheckCircleOutlined from '@material-design-icons/svg/outlined/check_circle.svg?react';
5
+ import HighlightOffOutlined from '@material-design-icons/svg/outlined/highlight_off.svg?react';
6
+ import InfoOutlined from '@material-design-icons/svg/outlined/info.svg?react';
7
+ import WarningAmberOutlined from '@material-design-icons/svg/outlined/warning_amber.svg?react';
8
8
  import { CLASSES } from './vars';
9
9
  import { useComponentProps, useStyled } from '../hooks';
10
10
  import { Icon } from '../icon';
@@ -1,6 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
3
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
4
4
  import { Children } from 'react';
5
5
  import { CLASSES } from './vars';
6
6
  import { Button } from '../button';
@@ -2,11 +2,11 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useAsync, useMount } from '@laser-ui/hooks';
4
4
  import { checkNodeExist } from '@laser-ui/utils';
5
- import { ReactComponent as CheckCircleOutlined } from '@material-design-icons/svg/outlined/check_circle.svg';
6
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
7
- import { ReactComponent as HighlightOffOutlined } from '@material-design-icons/svg/outlined/highlight_off.svg';
8
- import { ReactComponent as InfoOutlined } from '@material-design-icons/svg/outlined/info.svg';
9
- import { ReactComponent as WarningAmberOutlined } from '@material-design-icons/svg/outlined/warning_amber.svg';
5
+ import CheckCircleOutlined from '@material-design-icons/svg/outlined/check_circle.svg?react';
6
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
7
+ import HighlightOffOutlined from '@material-design-icons/svg/outlined/highlight_off.svg?react';
8
+ import InfoOutlined from '@material-design-icons/svg/outlined/info.svg?react';
9
+ import WarningAmberOutlined from '@material-design-icons/svg/outlined/warning_amber.svg?react';
10
10
  import { isUndefined } from 'lodash';
11
11
  import { useId, useRef } from 'react';
12
12
  import { CLASSES, TTANSITION_DURING } from './vars';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laser-ui/components",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
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.2.2",
30
- "@laser-ui/utils": "0.2.2",
29
+ "@laser-ui/hooks": "0.4.0",
30
+ "@laser-ui/utils": "0.4.0",
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": "81e159d1e70c2b3191ce2dad33db867d7871d080"
48
+ "gitHead": "434cf3de2a91e6557cf77801eda230c46e137ec9"
49
49
  }
@@ -1,10 +1,10 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ReactComponent as KeyboardArrowLeftOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg';
4
- import { ReactComponent as KeyboardArrowRightOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg';
5
- import { ReactComponent as KeyboardDoubleArrowLeftOutlined } from '@material-design-icons/svg/outlined/keyboard_double_arrow_left.svg';
6
- import { ReactComponent as KeyboardDoubleArrowRightOutlined } from '@material-design-icons/svg/outlined/keyboard_double_arrow_right.svg';
7
- import { ReactComponent as MoreHorizOutlined } from '@material-design-icons/svg/outlined/more_horiz.svg';
3
+ import KeyboardArrowLeftOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg?react';
4
+ import KeyboardArrowRightOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg?react';
5
+ import KeyboardDoubleArrowLeftOutlined from '@material-design-icons/svg/outlined/keyboard_double_arrow_left.svg?react';
6
+ import KeyboardDoubleArrowRightOutlined from '@material-design-icons/svg/outlined/keyboard_double_arrow_right.svg?react';
7
+ import MoreHorizOutlined from '@material-design-icons/svg/outlined/more_horiz.svg?react';
8
8
  import { isNull, isNumber } from 'lodash';
9
9
  import { Fragment, cloneElement, useRef, useState } from 'react';
10
10
  import { buttonProps } from './utils';
@@ -1,6 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
3
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
4
4
  import { Children } from 'react';
5
5
  import { CLASSES } from './vars';
6
6
  import { Button } from '../button';
@@ -1,12 +1,12 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { checkNodeExist } from '@laser-ui/utils';
4
- import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
5
- import { ReactComponent as CheckCircleFilled } from '@material-design-icons/svg/filled/check_circle.svg';
6
- import { ReactComponent as WarningFilled } from '@material-design-icons/svg/filled/warning.svg';
7
- import { ReactComponent as CheckOutlined } from '@material-design-icons/svg/outlined/check.svg';
8
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
9
- import { ReactComponent as WarningAmberOutlined } from '@material-design-icons/svg/outlined/warning_amber.svg';
4
+ import CancelFilled from '@material-design-icons/svg/filled/cancel.svg?react';
5
+ import CheckCircleFilled from '@material-design-icons/svg/filled/check_circle.svg?react';
6
+ import WarningFilled from '@material-design-icons/svg/filled/warning.svg?react';
7
+ import CheckOutlined from '@material-design-icons/svg/outlined/check.svg?react';
8
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
9
+ import WarningAmberOutlined from '@material-design-icons/svg/outlined/warning_amber.svg?react';
10
10
  import { isUndefined } from 'lodash';
11
11
  import { useId } from 'react';
12
12
  import { CLASSES } from './vars';
package/rating/Rating.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { checkNodeExist } from '@laser-ui/utils';
4
- import { ReactComponent as StarFilled } from '@material-design-icons/svg/filled/star.svg';
4
+ import StarFilled from '@material-design-icons/svg/filled/star.svg?react';
5
5
  import { isFunction } from 'lodash';
6
6
  import { useId, useState } from 'react';
7
7
  import { RatingStar } from './internal/RatingStar';
@@ -7,7 +7,11 @@ export class DialogService {
7
7
  draft.push({
8
8
  key: dialogKey,
9
9
  type,
10
- props: Object.assign(Object.assign({}, props), { visible: true, skipFirstTransition: false, afterVisibleChange: (visible) => {
10
+ props: Object.assign(Object.assign({}, props), { visible: true, skipFirstTransition: false, onClose: () => {
11
+ var _a, _b;
12
+ (_b = (_a = props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
13
+ DialogService.close(dialogKey);
14
+ }, afterVisibleChange: (visible) => {
11
15
  var _a, _b;
12
16
  (_b = (_a = props).afterVisibleChange) === null || _b === void 0 ? void 0 : _b.call(_a, visible);
13
17
  if (!visible) {
package/select/Select.js CHANGED
@@ -3,11 +3,11 @@ import { createElement as _createElement } from "react";
3
3
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
4
  import { useEvent, useEventCallback, useForkRef, useResize } from '@laser-ui/hooks';
5
5
  import { findNested, scrollIntoViewIfNeeded } from '@laser-ui/utils';
6
- import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
7
- import { ReactComponent as AddOutlined } from '@material-design-icons/svg/outlined/add.svg';
8
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
9
- import { ReactComponent as KeyboardArrowDownOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg';
10
- import { ReactComponent as SearchOutlined } from '@material-design-icons/svg/outlined/search.svg';
6
+ import CancelFilled from '@material-design-icons/svg/filled/cancel.svg?react';
7
+ import AddOutlined from '@material-design-icons/svg/outlined/add.svg?react';
8
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
9
+ import KeyboardArrowDownOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg?react';
10
+ import SearchOutlined from '@material-design-icons/svg/outlined/search.svg?react';
11
11
  import { isNull, isNumber, isUndefined } from 'lodash';
12
12
  import { createElement, forwardRef, useCallback, useId, useImperativeHandle, useMemo, useRef, useState } from 'react';
13
13
  import { CLASSES, IS_CREATED } from './vars';
package/slides/Slides.js CHANGED
@@ -2,8 +2,8 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { createElement as _createElement } from "react";
4
4
  import { useAsync, useEvent, useRefExtra } from '@laser-ui/hooks';
5
- import { ReactComponent as KeyboardArrowLeftOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg';
6
- import { ReactComponent as KeyboardArrowRightOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg';
5
+ import KeyboardArrowLeftOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg?react';
6
+ import KeyboardArrowRightOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg?react';
7
7
  import { isBoolean, isNumber, isUndefined, nth } from 'lodash';
8
8
  import { useEffect, useId, useRef, useState } from 'react';
9
9
  import { CLASSES } from './vars';
@@ -2,8 +2,8 @@ import { __rest } from "tslib";
2
2
  import { createElement as _createElement } from "react";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import { checkNodeExist } from '@laser-ui/utils';
5
- import { ReactComponent as CheckOutlined } from '@material-design-icons/svg/outlined/check.svg';
6
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
5
+ import CheckOutlined from '@material-design-icons/svg/outlined/check.svg?react';
6
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
7
7
  import { isNumber, isUndefined } from 'lodash';
8
8
  import { CLASSES } from './vars';
9
9
  import { useComponentProps, useStyled } from '../hooks';
@@ -1,6 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ReactComponent as SearchOutlined } from '@material-design-icons/svg/outlined/search.svg';
3
+ import SearchOutlined from '@material-design-icons/svg/outlined/search.svg?react';
4
4
  import { CLASSES } from './vars';
5
5
  import { Button } from '../button';
6
6
  import { useComponentProps, useStyled, useTranslation } from '../hooks';
package/tabs/Tabs.js CHANGED
@@ -3,9 +3,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { createElement as _createElement } from "react";
4
4
  import { useEventCallback, useIsomorphicLayoutEffect, useResize } from '@laser-ui/hooks';
5
5
  import { checkScrollEnd, findNested } from '@laser-ui/utils';
6
- import { ReactComponent as AddOutlined } from '@material-design-icons/svg/outlined/add.svg';
7
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
8
- import { ReactComponent as MoreHorizOutlined } from '@material-design-icons/svg/outlined/more_horiz.svg';
6
+ import AddOutlined from '@material-design-icons/svg/outlined/add.svg?react';
7
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
8
+ import MoreHorizOutlined from '@material-design-icons/svg/outlined/more_horiz.svg?react';
9
9
  import { isUndefined, nth } from 'lodash';
10
10
  import { forwardRef, useEffect, useId, useImperativeHandle, useRef, useState } from 'react';
11
11
  import { CLASSES } from './vars';
@@ -1,9 +1,9 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useAsync, useEvent, useEventCallback, useForceUpdate, useForkRef, useImmer, useResize } from '@laser-ui/hooks';
4
- import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
5
- import { ReactComponent as AccessTimeOutlined } from '@material-design-icons/svg/outlined/access_time.svg';
6
- import { ReactComponent as SwapHorizOutlined } from '@material-design-icons/svg/outlined/swap_horiz.svg';
4
+ import CancelFilled from '@material-design-icons/svg/filled/cancel.svg?react';
5
+ import AccessTimeOutlined from '@material-design-icons/svg/outlined/access_time.svg?react';
6
+ import SwapHorizOutlined from '@material-design-icons/svg/outlined/swap_horiz.svg?react';
7
7
  import { isNull, isUndefined } from 'lodash';
8
8
  import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
9
9
  import { TimePickerPanel } from './internal/TimePickerPanel';
package/toast/Toast.js CHANGED
@@ -2,11 +2,11 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useAsync, useMount } from '@laser-ui/hooks';
4
4
  import { checkNodeExist } from '@laser-ui/utils';
5
- import { ReactComponent as CheckCircleOutlined } from '@material-design-icons/svg/outlined/check_circle.svg';
6
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
7
- import { ReactComponent as HighlightOffOutlined } from '@material-design-icons/svg/outlined/highlight_off.svg';
8
- import { ReactComponent as InfoOutlined } from '@material-design-icons/svg/outlined/info.svg';
9
- import { ReactComponent as WarningAmberOutlined } from '@material-design-icons/svg/outlined/warning_amber.svg';
5
+ import CheckCircleOutlined from '@material-design-icons/svg/outlined/check_circle.svg?react';
6
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
7
+ import HighlightOffOutlined from '@material-design-icons/svg/outlined/highlight_off.svg?react';
8
+ import InfoOutlined from '@material-design-icons/svg/outlined/info.svg?react';
9
+ import WarningAmberOutlined from '@material-design-icons/svg/outlined/warning_amber.svg?react';
10
10
  import { isUndefined } from 'lodash';
11
11
  import { useId, useRef } from 'react';
12
12
  import { CLASSES, TTANSITION_DURING } from './vars';
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ReactComponent as KeyboardArrowLeftOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg';
4
- import { ReactComponent as KeyboardArrowRightOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg';
3
+ import KeyboardArrowLeftOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg?react';
4
+ import KeyboardArrowRightOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg?react';
5
5
  import { isUndefined } from 'lodash';
6
6
  import { useMemo } from 'react';
7
7
  import { TransferPanel } from './internal/TransferPanel';
@@ -1,7 +1,7 @@
1
1
  import { createElement as _createElement } from "react";
2
2
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
3
3
  import { checkNodeExist } from '@laser-ui/utils';
4
- import { ReactComponent as SearchOutlined } from '@material-design-icons/svg/outlined/search.svg';
4
+ import SearchOutlined from '@material-design-icons/svg/outlined/search.svg?react';
5
5
  import { isNumber } from 'lodash';
6
6
  import { useCallback, useId, useMemo, useRef } from 'react';
7
7
  import { Checkbox } from '../../checkbox';
@@ -3,9 +3,9 @@ import { createElement as _createElement } from "react";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import { useEventCallback } from '@laser-ui/hooks';
5
5
  import { scrollIntoViewIfNeeded } from '@laser-ui/utils';
6
- import { ReactComponent as AddBoxOutlined } from '@material-design-icons/svg/outlined/add_box.svg';
7
- import { ReactComponent as ArrowRightOutlined } from '@material-design-icons/svg/outlined/arrow_right.svg';
8
- import { ReactComponent as IndeterminateCheckBoxOutlined } from '@material-design-icons/svg/outlined/indeterminate_check_box.svg';
6
+ import AddBoxOutlined from '@material-design-icons/svg/outlined/add_box.svg?react';
7
+ import ArrowRightOutlined from '@material-design-icons/svg/outlined/arrow_right.svg?react';
8
+ import IndeterminateCheckBoxOutlined from '@material-design-icons/svg/outlined/indeterminate_check_box.svg?react';
9
9
  import { isUndefined } from 'lodash';
10
10
  import { cloneElement, forwardRef, useImperativeHandle, useMemo, useRef } from 'react';
11
11
  import { Checkbox } from '../../checkbox';
@@ -2,10 +2,10 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useEvent, useEventCallback, useForkRef, useResize } from '@laser-ui/hooks';
4
4
  import { findNested } from '@laser-ui/utils';
5
- import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
6
- import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
7
- import { ReactComponent as KeyboardArrowDownOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg';
8
- import { ReactComponent as SearchOutlined } from '@material-design-icons/svg/outlined/search.svg';
5
+ import CancelFilled from '@material-design-icons/svg/filled/cancel.svg?react';
6
+ import CloseOutlined from '@material-design-icons/svg/outlined/close.svg?react';
7
+ import KeyboardArrowDownOutlined from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg?react';
8
+ import SearchOutlined from '@material-design-icons/svg/outlined/search.svg?react';
9
9
  import { isNull, isNumber, isUndefined } from 'lodash';
10
10
  import { createElement, forwardRef, useId, useImperativeHandle, useMemo, useRef, useState } from 'react';
11
11
  import { TreeSelectSearchPanel } from './internal/TreeSelectSearchPanel';
@@ -1,8 +1,8 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { saveFile } from '@laser-ui/utils';
4
- import { ReactComponent as DeleteOutlineOutlined } from '@material-design-icons/svg/outlined/delete_outline.svg';
5
- import { ReactComponent as FileDownloadOutlined } from '@material-design-icons/svg/outlined/file_download.svg';
4
+ import DeleteOutlineOutlined from '@material-design-icons/svg/outlined/delete_outline.svg?react';
5
+ import FileDownloadOutlined from '@material-design-icons/svg/outlined/file_download.svg?react';
6
6
  import { isUndefined } from 'lodash';
7
7
  import { forwardRef } from 'react';
8
8
  import { ACTION_CLASSES } from './vars';
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ReactComponent as AddOutlined } from '@material-design-icons/svg/outlined/add.svg';
4
- import { ReactComponent as InsertDriveFileTwoTone } from '@material-design-icons/svg/two-tone/insert_drive_file.svg';
3
+ import AddOutlined from '@material-design-icons/svg/outlined/add.svg?react';
4
+ import InsertDriveFileTwoTone from '@material-design-icons/svg/two-tone/insert_drive_file.svg?react';
5
5
  import { Children, cloneElement, forwardRef } from 'react';
6
6
  import { UploadAction } from './UploadAction';
7
7
  import { UploadPreviewAction } from './UploadPreviewAction';
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useImmer } from '@laser-ui/hooks';
4
- import { ReactComponent as AttachFileOutlined } from '@material-design-icons/svg/outlined/attach_file.svg';
4
+ import AttachFileOutlined from '@material-design-icons/svg/outlined/attach_file.svg?react';
5
5
  import { isNumber, isUndefined } from 'lodash';
6
6
  import { Children, cloneElement, useContext } from 'react';
7
7
  import { UploadAction } from './UploadAction';
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useImmer } from '@laser-ui/hooks';
4
- import { ReactComponent as InsertDriveFileTwoTone } from '@material-design-icons/svg/two-tone/insert_drive_file.svg';
4
+ import InsertDriveFileTwoTone from '@material-design-icons/svg/two-tone/insert_drive_file.svg?react';
5
5
  import { isNumber } from 'lodash';
6
6
  import { Children, cloneElement, useContext } from 'react';
7
7
  import { UploadAction } from './UploadAction';
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useImmer } from '@laser-ui/hooks';
4
- import { ReactComponent as InsertDriveFileTwoTone } from '@material-design-icons/svg/two-tone/insert_drive_file.svg';
4
+ import InsertDriveFileTwoTone from '@material-design-icons/svg/two-tone/insert_drive_file.svg?react';
5
5
  import { isNumber, isUndefined } from 'lodash';
6
6
  import { Children, cloneElement, useContext } from 'react';
7
7
  import { UploadAction } from './UploadAction';
@@ -1,6 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { ReactComponent as VisibilityOutlinedIcon } from '@material-design-icons/svg/outlined/visibility.svg';
3
+ import VisibilityOutlinedIcon from '@material-design-icons/svg/outlined/visibility.svg?react';
4
4
  import { isUndefined } from 'lodash';
5
5
  import { forwardRef } from 'react';
6
6
  import { ACTION_CLASSES } from './vars';