musae 0.3.3 → 0.3.6
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/dist/components/avatar/avatar.cjs +10 -2
- package/dist/components/avatar/avatar.mjs +10 -2
- package/dist/components/button/button.cjs +11 -10
- package/dist/components/button/button.mjs +7 -6
- package/dist/components/calendar/contribution.cjs +251 -0
- package/dist/components/calendar/contribution.d.ts +13 -0
- package/dist/components/calendar/contribution.mjs +249 -0
- package/dist/components/calendar/index.d.ts +2 -1
- package/dist/components/config/provider.cjs +2 -2
- package/dist/components/config/provider.mjs +2 -2
- package/dist/components/drawer/popup.cjs +51 -17
- package/dist/components/drawer/popup.d.ts +1 -1
- package/dist/components/drawer/popup.mjs +51 -17
- package/dist/components/fab/floatable.d.ts +1 -1
- package/dist/components/icon/icons/action/delete.cjs +20 -0
- package/dist/components/icon/icons/action/delete.d.ts +3 -0
- package/dist/components/icon/icons/action/delete.mjs +18 -0
- package/dist/components/icon/icons/action/index.cjs +7 -1
- package/dist/components/icon/icons/action/index.d.ts +5 -1
- package/dist/components/icon/icons/action/index.mjs +6 -2
- package/dist/components/icon/icons/action/three-d-rotation.cjs +28 -0
- package/dist/components/icon/icons/action/three-d-rotation.d.ts +3 -0
- package/dist/components/icon/icons/action/three-d-rotation.mjs +26 -0
- package/dist/components/icon/icons/editor/attch-file.cjs +20 -0
- package/dist/components/icon/icons/editor/attch-file.d.ts +3 -0
- package/dist/components/icon/icons/editor/attch-file.mjs +18 -0
- package/dist/components/icon/icons/editor/index.cjs +4 -1
- package/dist/components/icon/icons/editor/index.d.ts +3 -1
- package/dist/components/icon/icons/editor/index.mjs +4 -2
- package/dist/components/icon/icons/index.cjs +6 -0
- package/dist/components/icon/icons/index.mjs +3 -0
- package/dist/components/image/image.cjs +49 -2
- package/dist/components/image/image.d.ts +1 -1
- package/dist/components/image/image.mjs +50 -3
- package/dist/components/image/index.d.ts +1 -1
- package/dist/components/image/preview/preview.cjs +8 -3
- package/dist/components/image/preview/preview.mjs +8 -3
- package/dist/components/menu/hooks.d.ts +1 -2
- package/dist/components/menu/item.d.ts +2 -3
- package/dist/components/pagination/pagination.cjs +1 -1
- package/dist/components/pagination/pagination.mjs +2 -2
- package/dist/components/popover/popover.cjs +1 -1
- package/dist/components/popover/popover.mjs +1 -1
- package/dist/components/popper/dropdown.cjs +44 -19
- package/dist/components/popper/dropdown.mjs +46 -21
- package/dist/components/popper/hooks.cjs +88 -89
- package/dist/components/popper/hooks.d.ts +7 -13
- package/dist/components/popper/hooks.mjs +91 -91
- package/dist/components/rich-text-editor/plugins/controlled-state/index.cjs +1 -2
- package/dist/components/rich-text-editor/plugins/controlled-state/index.mjs +1 -2
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.cjs +5 -4
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.d.ts +3 -3
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.mjs +3 -4
- package/dist/components/rich-text-editor/rich-text-editor.cjs +5 -5
- package/dist/components/rich-text-editor/rich-text-editor.mjs +3 -3
- package/dist/components/select/utils.cjs +1 -3
- package/dist/components/select/utils.d.ts +1 -1
- package/dist/components/select/utils.mjs +2 -4
- package/dist/components/skeleton/skeleton.cjs +5 -48
- package/dist/components/skeleton/skeleton.d.ts +1 -1
- package/dist/components/skeleton/skeleton.mjs +5 -48
- package/dist/components/steps/context.d.ts +1 -1
- package/dist/components/steps/item.d.ts +1 -1
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/switch/switch.cjs +7 -6
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.mjs +8 -7
- package/dist/components/table/body.cjs +3 -1
- package/dist/components/table/body.mjs +3 -1
- package/dist/components/tabs/context.d.ts +1 -1
- package/dist/components/tabs/hooks.d.ts +2 -2
- package/dist/components/tabs/navigation.d.ts +1 -1
- package/dist/components/tabs/panels.d.ts +1 -1
- package/dist/components/tabs/tab.d.ts +1 -1
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tag/tag.d.ts +1 -1
- package/dist/components/theme/hooks.cjs +6 -6
- package/dist/components/theme/hooks.d.ts +1 -1
- package/dist/components/theme/hooks.mjs +6 -6
- package/dist/components/theme/theme-provider.cjs +12 -6
- package/dist/components/theme/theme-provider.d.ts +2 -2
- package/dist/components/theme/theme-provider.mjs +12 -6
- package/dist/components/time-picker/hooks.d.ts +1 -1
- package/dist/components/time-picker/panel.d.ts +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/timeline/context.d.ts +1 -1
- package/dist/components/timeline/item.d.ts +1 -1
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/transfer/context.d.ts +1 -1
- package/dist/components/transfer/hooks.d.ts +1 -1
- package/dist/components/transfer/item.d.ts +1 -1
- package/dist/components/transfer/list.d.ts +1 -1
- package/dist/components/transfer/transfer.d.ts +1 -1
- package/dist/components/upload/upload.cjs +31 -6
- package/dist/components/upload/upload.d.ts +2 -2
- package/dist/components/upload/upload.mjs +31 -6
- package/dist/components/upload/uploadeds.cjs +119 -55
- package/dist/components/upload/uploadeds.d.ts +1 -1
- package/dist/components/upload/uploadeds.mjs +121 -57
- package/dist/components/upload/utils.cjs +9 -0
- package/dist/components/upload/utils.d.ts +6 -0
- package/dist/components/upload/utils.mjs +9 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts +1 -1
- package/dist/components/waterfall/sequential.d.ts +1 -1
- package/dist/components/waterfall/waterfall.d.ts +1 -1
- package/dist/components/watermark/hooks.d.ts +1 -1
- package/dist/components/watermark/watermark.d.ts +1 -1
- package/dist/hooks/use-class-names.d.ts +4 -0
- package/dist/hooks/use-closable.cjs +0 -8
- package/dist/hooks/use-closable.mjs +0 -8
- package/dist/hooks/use-container.d.ts +1 -1
- package/dist/hooks/use-lazy-boolean.cjs +2 -2
- package/dist/hooks/use-lazy-boolean.mjs +2 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -0
- package/dist/locale/locales/en_US.cjs +5 -1
- package/dist/locale/locales/en_US.mjs +5 -1
- package/dist/locale/locales/zh_CN.cjs +5 -1
- package/dist/locale/locales/zh_CN.mjs +5 -1
- package/dist/styles.css +16 -7
- package/dist/types/drawer.d.ts +5 -0
- package/dist/types/element.d.ts +1 -56
- package/dist/types/form.d.ts +39 -1
- package/dist/types/image.d.ts +1 -0
- package/dist/types/locale.d.ts +6 -0
- package/dist/types/menu.d.ts +8 -3
- package/dist/types/popper.d.ts +1 -1
- package/dist/types/skeleton.d.ts +0 -7
- package/dist/{components/theme/types.d.ts → types/theme.d.ts} +1 -1
- package/dist/types/tree.d.ts +7 -2
- package/dist/{components/upload/types.d.ts → types/upload.d.ts} +59 -22
- package/dist/{components/waterfall/types.d.ts → types/waterfall.d.ts} +3 -3
- package/dist/utils/class-name.cjs +5 -1
- package/dist/utils/class-name.d.ts +12 -1
- package/dist/utils/class-name.mjs +6 -2
- package/dist/utils/colors.cjs +0 -10
- package/dist/utils/colors.d.ts +1 -4
- package/dist/utils/colors.mjs +1 -10
- package/dist/utils/component-token.cjs +2 -0
- package/dist/utils/component-token.d.ts +3 -1
- package/dist/utils/component-token.mjs +2 -0
- package/dist/utils/date.cjs +13 -0
- package/dist/utils/date.d.ts +6 -0
- package/dist/utils/date.mjs +13 -0
- package/package.json +25 -25
- package/dist/components/icon/icons/three-dimension-rotation.d.ts +0 -3
- /package/dist/{components/steps/types.d.ts → types/steps.d.ts} +0 -0
- /package/dist/{components/switch/types.d.ts → types/switch.d.ts} +0 -0
- /package/dist/{components/tabs/types.d.ts → types/tabs.d.ts} +0 -0
- /package/dist/{components/tag/types.d.ts → types/tag.d.ts} +0 -0
- /package/dist/{components/time-picker/types.d.ts → types/time-picker.d.ts} +0 -0
- /package/dist/{components/timeline/types.d.ts → types/timeline.d.ts} +0 -0
- /package/dist/{components/tooltip/types.d.ts → types/tooltip.d.ts} +0 -0
- /package/dist/{components/transfer/types.d.ts → types/transfer.d.ts} +0 -0
- /package/dist/{components/visually-hidden/types.d.ts → types/visually-hidden.d.ts} +0 -0
- /package/dist/{components/watermark/types.d.ts → types/watermark.d.ts} +0 -0
|
@@ -1,16 +1,42 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
+
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
3
4
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var preview = require('./preview/preview.cjs');
|
|
6
7
|
var context = require('./preview/context.cjs');
|
|
7
8
|
var relax = require('@aiszlab/relax');
|
|
9
|
+
var stylex = require('../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.cjs');
|
|
10
|
+
var skeleton = require('../skeleton/skeleton.cjs');
|
|
11
|
+
var useClassNames = require('../../hooks/use-class-names.cjs');
|
|
12
|
+
var componentToken = require('../../utils/component-token.cjs');
|
|
13
|
+
var className = require('../../utils/class-name.cjs');
|
|
8
14
|
|
|
15
|
+
var styles = {
|
|
16
|
+
size: function size(props) {
|
|
17
|
+
return [{
|
|
18
|
+
width: "musaex-17fnjtu",
|
|
19
|
+
height: "musaex-1jwls1v",
|
|
20
|
+
$$css: true
|
|
21
|
+
}, {
|
|
22
|
+
"--width": function (val) {
|
|
23
|
+
return typeof val === "number" ? val + "px" : val != null ? val : "initial";
|
|
24
|
+
}(props.width),
|
|
25
|
+
"--height": function (val) {
|
|
26
|
+
return typeof val === "number" ? val + "px" : val != null ? val : "initial";
|
|
27
|
+
}(props.height)
|
|
28
|
+
}];
|
|
29
|
+
}
|
|
30
|
+
};
|
|
9
31
|
var Image = function Image(_ref) {
|
|
10
32
|
var src = _ref.src,
|
|
11
33
|
alt = _ref.alt,
|
|
12
34
|
width = _ref.width,
|
|
13
|
-
height = _ref.height
|
|
35
|
+
height = _ref.height,
|
|
36
|
+
_ref$previewable = _ref.previewable,
|
|
37
|
+
previewable = _ref$previewable === void 0 ? true : _ref$previewable,
|
|
38
|
+
className$1 = _ref.className,
|
|
39
|
+
style = _ref.style;
|
|
14
40
|
var _useBoolean = relax.useBoolean(false),
|
|
15
41
|
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
16
42
|
isOpen = _useBoolean2[0],
|
|
@@ -18,10 +44,12 @@ var Image = function Image(_ref) {
|
|
|
18
44
|
turnOn = _useBoolean2$.turnOn,
|
|
19
45
|
turnOff = _useBoolean2$.turnOff;
|
|
20
46
|
var contextValue = React.useContext(context.default);
|
|
47
|
+
var classNames = useClassNames.useClassNames(componentToken.ComponentToken.Image);
|
|
21
48
|
var status = relax.useImageLoader({
|
|
22
49
|
src: src
|
|
23
50
|
});
|
|
24
51
|
var click = relax.useEvent(function () {
|
|
52
|
+
if (!previewable) return;
|
|
25
53
|
// if current image is in preview group
|
|
26
54
|
// just use preview group to preview image
|
|
27
55
|
if (contextValue) {
|
|
@@ -31,12 +59,31 @@ var Image = function Image(_ref) {
|
|
|
31
59
|
// not in preview group, render self
|
|
32
60
|
turnOn();
|
|
33
61
|
});
|
|
62
|
+
var styled = {
|
|
63
|
+
loading: stylex.default.props(styles.size({
|
|
64
|
+
width: width,
|
|
65
|
+
height: height
|
|
66
|
+
})),
|
|
67
|
+
image: stylex.default.props(styles.size({
|
|
68
|
+
width: width,
|
|
69
|
+
height: height
|
|
70
|
+
}))
|
|
71
|
+
};
|
|
72
|
+
if (status === "loading") {
|
|
73
|
+
return /*#__PURE__*/React.createElement(skeleton.default, {
|
|
74
|
+
className: styled.loading.className,
|
|
75
|
+
style: styled.loading.style
|
|
76
|
+
});
|
|
77
|
+
}
|
|
34
78
|
return /*#__PURE__*/React.createElement(React.Fragment, null, status === "loaded" && (/*#__PURE__*/React.createElement("img", {
|
|
79
|
+
className: relax.clsx(classNames[className.ImageClassToken.Image], className$1, styled.image.className),
|
|
80
|
+
style: _objectSpread(_objectSpread({}, styled.image.style), style),
|
|
35
81
|
src: src,
|
|
36
82
|
alt: alt,
|
|
37
83
|
onClick: click,
|
|
38
84
|
width: width,
|
|
39
|
-
height: height
|
|
85
|
+
height: height,
|
|
86
|
+
draggable: false
|
|
40
87
|
})), isOpen && !contextValue && /*#__PURE__*/React.createElement(preview.default, {
|
|
41
88
|
src: src,
|
|
42
89
|
onClose: turnOff,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ImageProps } from "musae/types/image";
|
|
3
|
-
declare const Image: ({ src, alt, width, height }: ImageProps) => React.JSX.Element;
|
|
3
|
+
declare const Image: ({ src, alt, width, height, previewable, className, style }: ImageProps) => React.JSX.Element;
|
|
4
4
|
export default Image;
|
|
@@ -1,14 +1,40 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
1
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
3
|
import React, { useContext } from 'react';
|
|
3
4
|
import Preview from './preview/preview.mjs';
|
|
4
5
|
import PreviewGroupContext from './preview/context.mjs';
|
|
5
|
-
import { useBoolean, useImageLoader, useEvent } from '@aiszlab/relax';
|
|
6
|
+
import { useBoolean, useImageLoader, useEvent, clsx } from '@aiszlab/relax';
|
|
7
|
+
import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.mjs';
|
|
8
|
+
import Skeleton from '../skeleton/skeleton.mjs';
|
|
9
|
+
import { useClassNames } from '../../hooks/use-class-names.mjs';
|
|
10
|
+
import { ComponentToken } from '../../utils/component-token.mjs';
|
|
11
|
+
import { ImageClassToken } from '../../utils/class-name.mjs';
|
|
6
12
|
|
|
13
|
+
var styles = {
|
|
14
|
+
size: function size(props) {
|
|
15
|
+
return [{
|
|
16
|
+
width: "musaex-17fnjtu",
|
|
17
|
+
height: "musaex-1jwls1v",
|
|
18
|
+
$$css: true
|
|
19
|
+
}, {
|
|
20
|
+
"--width": function (val) {
|
|
21
|
+
return typeof val === "number" ? val + "px" : val != null ? val : "initial";
|
|
22
|
+
}(props.width),
|
|
23
|
+
"--height": function (val) {
|
|
24
|
+
return typeof val === "number" ? val + "px" : val != null ? val : "initial";
|
|
25
|
+
}(props.height)
|
|
26
|
+
}];
|
|
27
|
+
}
|
|
28
|
+
};
|
|
7
29
|
var Image = function Image(_ref) {
|
|
8
30
|
var src = _ref.src,
|
|
9
31
|
alt = _ref.alt,
|
|
10
32
|
width = _ref.width,
|
|
11
|
-
height = _ref.height
|
|
33
|
+
height = _ref.height,
|
|
34
|
+
_ref$previewable = _ref.previewable,
|
|
35
|
+
previewable = _ref$previewable === void 0 ? true : _ref$previewable,
|
|
36
|
+
className = _ref.className,
|
|
37
|
+
style = _ref.style;
|
|
12
38
|
var _useBoolean = useBoolean(false),
|
|
13
39
|
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
14
40
|
isOpen = _useBoolean2[0],
|
|
@@ -16,10 +42,12 @@ var Image = function Image(_ref) {
|
|
|
16
42
|
turnOn = _useBoolean2$.turnOn,
|
|
17
43
|
turnOff = _useBoolean2$.turnOff;
|
|
18
44
|
var contextValue = useContext(PreviewGroupContext);
|
|
45
|
+
var classNames = useClassNames(ComponentToken.Image);
|
|
19
46
|
var status = useImageLoader({
|
|
20
47
|
src: src
|
|
21
48
|
});
|
|
22
49
|
var click = useEvent(function () {
|
|
50
|
+
if (!previewable) return;
|
|
23
51
|
// if current image is in preview group
|
|
24
52
|
// just use preview group to preview image
|
|
25
53
|
if (contextValue) {
|
|
@@ -29,12 +57,31 @@ var Image = function Image(_ref) {
|
|
|
29
57
|
// not in preview group, render self
|
|
30
58
|
turnOn();
|
|
31
59
|
});
|
|
60
|
+
var styled = {
|
|
61
|
+
loading: _stylex.props(styles.size({
|
|
62
|
+
width: width,
|
|
63
|
+
height: height
|
|
64
|
+
})),
|
|
65
|
+
image: _stylex.props(styles.size({
|
|
66
|
+
width: width,
|
|
67
|
+
height: height
|
|
68
|
+
}))
|
|
69
|
+
};
|
|
70
|
+
if (status === "loading") {
|
|
71
|
+
return /*#__PURE__*/React.createElement(Skeleton, {
|
|
72
|
+
className: styled.loading.className,
|
|
73
|
+
style: styled.loading.style
|
|
74
|
+
});
|
|
75
|
+
}
|
|
32
76
|
return /*#__PURE__*/React.createElement(React.Fragment, null, status === "loaded" && (/*#__PURE__*/React.createElement("img", {
|
|
77
|
+
className: clsx(classNames[ImageClassToken.Image], className, styled.image.className),
|
|
78
|
+
style: _objectSpread(_objectSpread({}, styled.image.style), style),
|
|
33
79
|
src: src,
|
|
34
80
|
alt: alt,
|
|
35
81
|
onClick: click,
|
|
36
82
|
width: width,
|
|
37
|
-
height: height
|
|
83
|
+
height: height,
|
|
84
|
+
draggable: false
|
|
38
85
|
})), isOpen && !contextValue && /*#__PURE__*/React.createElement(Preview, {
|
|
39
86
|
src: src,
|
|
40
87
|
onClose: turnOff,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const Image: (({ src, alt, width, height }: import("musae/types/image").ImageProps) => import("react").JSX.Element) & {
|
|
1
|
+
declare const Image: (({ src, alt, width, height, previewable, className, style }: import("musae/types/image").ImageProps) => import("react").JSX.Element) & {
|
|
2
2
|
Group: ({ children, items }: import("musae/types/image").PreviewGroupProps) => import("react").JSX.Element;
|
|
3
3
|
};
|
|
4
4
|
export { Image };
|
|
@@ -17,6 +17,7 @@ var styles = {
|
|
|
17
17
|
transitionDuration: null,
|
|
18
18
|
transitionProperty: null,
|
|
19
19
|
transitionTimingFunction: null,
|
|
20
|
+
pointerEvents: "musaex-67bb7w",
|
|
20
21
|
$$css: true
|
|
21
22
|
}, {
|
|
22
23
|
"--transform": "translate3d(0px, 0px, 0px) scale3d(".concat(props.scale * props.flipX, ", ").concat(props.scale * props.flipY, ", 1) rotate(").concat(props.rotate, "deg)") != null ? "translate3d(0px, 0px, 0px) scale3d(".concat(props.scale * props.flipX, ", ").concat(props.scale * props.flipY, ", 1) rotate(").concat(props.rotate, "deg)") : "initial"
|
|
@@ -101,19 +102,23 @@ var Preview = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
101
102
|
open: true,
|
|
102
103
|
onClose: onClose,
|
|
103
104
|
footer: false,
|
|
104
|
-
closable: ["esc"],
|
|
105
|
+
closable: ["esc", "overlay"],
|
|
105
106
|
styles: {
|
|
106
107
|
panel: {
|
|
107
108
|
backgroundColor: "transparent",
|
|
108
109
|
margin: 0,
|
|
109
110
|
width: "100%",
|
|
110
111
|
height: "100%",
|
|
111
|
-
|
|
112
|
+
maxWidth: "100%",
|
|
113
|
+
maxHeight: "100%",
|
|
114
|
+
pointerEvents: "none"
|
|
112
115
|
},
|
|
113
116
|
body: {
|
|
114
117
|
display: "flex",
|
|
115
118
|
alignItems: "center",
|
|
116
|
-
justifyContent: "center"
|
|
119
|
+
justifyContent: "center",
|
|
120
|
+
overflow: "hidden",
|
|
121
|
+
pointerEvents: "none"
|
|
117
122
|
}
|
|
118
123
|
}
|
|
119
124
|
}, /*#__PURE__*/React.createElement("img", {
|
|
@@ -15,6 +15,7 @@ var styles = {
|
|
|
15
15
|
transitionDuration: null,
|
|
16
16
|
transitionProperty: null,
|
|
17
17
|
transitionTimingFunction: null,
|
|
18
|
+
pointerEvents: "musaex-67bb7w",
|
|
18
19
|
$$css: true
|
|
19
20
|
}, {
|
|
20
21
|
"--transform": "translate3d(0px, 0px, 0px) scale3d(".concat(props.scale * props.flipX, ", ").concat(props.scale * props.flipY, ", 1) rotate(").concat(props.rotate, "deg)") != null ? "translate3d(0px, 0px, 0px) scale3d(".concat(props.scale * props.flipX, ", ").concat(props.scale * props.flipY, ", 1) rotate(").concat(props.rotate, "deg)") : "initial"
|
|
@@ -99,19 +100,23 @@ var Preview = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
99
100
|
open: true,
|
|
100
101
|
onClose: onClose,
|
|
101
102
|
footer: false,
|
|
102
|
-
closable: ["esc"],
|
|
103
|
+
closable: ["esc", "overlay"],
|
|
103
104
|
styles: {
|
|
104
105
|
panel: {
|
|
105
106
|
backgroundColor: "transparent",
|
|
106
107
|
margin: 0,
|
|
107
108
|
width: "100%",
|
|
108
109
|
height: "100%",
|
|
109
|
-
|
|
110
|
+
maxWidth: "100%",
|
|
111
|
+
maxHeight: "100%",
|
|
112
|
+
pointerEvents: "none"
|
|
110
113
|
},
|
|
111
114
|
body: {
|
|
112
115
|
display: "flex",
|
|
113
116
|
alignItems: "center",
|
|
114
|
-
justifyContent: "center"
|
|
117
|
+
justifyContent: "center",
|
|
118
|
+
overflow: "hidden",
|
|
119
|
+
pointerEvents: "none"
|
|
115
120
|
}
|
|
116
121
|
}
|
|
117
122
|
}, /*#__PURE__*/React.createElement("img", {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode } from "react";
|
|
2
|
-
import type { ContextValue, MenuProps, Mode } from "musae/types/menu";
|
|
3
|
-
import type { Size } from "musae/types/element";
|
|
2
|
+
import type { ContextValue, MenuProps, Mode, Size } from "musae/types/menu";
|
|
4
3
|
/**
|
|
5
4
|
* @description
|
|
6
5
|
* use menu context
|
|
@@ -5,13 +5,12 @@ import React from "react";
|
|
|
5
5
|
* @description
|
|
6
6
|
* menu item
|
|
7
7
|
*/
|
|
8
|
-
declare const Item: React.ForwardRefExoticComponent<Omit<import("musae/types/menu").MenuItem, "children" | "key"> & {
|
|
9
|
-
level: number;
|
|
10
|
-
} & import("../../types/element").ComponentProps & {
|
|
8
|
+
declare const Item: React.ForwardRefExoticComponent<Omit<import("musae/types/menu").MenuItem, "children" | "key"> & import("../../types/element").ComponentProps & {
|
|
11
9
|
value: React.Key;
|
|
12
10
|
suffix?: React.ReactNode;
|
|
13
11
|
onClick?: import("musae/types/menu").ContextValue["click"];
|
|
14
12
|
children?: React.ReactNode;
|
|
15
13
|
mode: import("musae/types/menu").Mode;
|
|
14
|
+
level: number;
|
|
16
15
|
} & React.RefAttributes<HTMLLIElement>>;
|
|
17
16
|
export default Item;
|
|
@@ -55,7 +55,7 @@ var Pagination = function Pagination(_ref) {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
var sizeOptions = React.useMemo(function () {
|
|
58
|
-
return
|
|
58
|
+
return relax.unique(pageSizes).map(function (size) {
|
|
59
59
|
return {
|
|
60
60
|
value: size,
|
|
61
61
|
label: relax.toFunction(locale.size)(size)
|
|
@@ -7,7 +7,7 @@ import { useClassNames } from '../../hooks/use-class-names.mjs';
|
|
|
7
7
|
import { PaginationClassToken } from '../../utils/class-name.mjs';
|
|
8
8
|
import { ComponentToken } from '../../utils/component-token.mjs';
|
|
9
9
|
import { useLocale } from '../../locale/use-locale.mjs';
|
|
10
|
-
import { toFunction, clsx } from '@aiszlab/relax';
|
|
10
|
+
import { unique, toFunction, clsx } from '@aiszlab/relax';
|
|
11
11
|
|
|
12
12
|
var Pagination = function Pagination(_ref) {
|
|
13
13
|
var _ref$total = _ref.total,
|
|
@@ -53,7 +53,7 @@ var Pagination = function Pagination(_ref) {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
var sizeOptions = useMemo(function () {
|
|
56
|
-
return
|
|
56
|
+
return unique(pageSizes).map(function (size) {
|
|
57
57
|
return {
|
|
58
58
|
value: size,
|
|
59
59
|
label: toFunction(locale.size)(size)
|
|
@@ -96,7 +96,7 @@ var Popover = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
96
96
|
return relax.chain(_children.props.onFocus, turnOn)(event);
|
|
97
97
|
},
|
|
98
98
|
onBlur: function onBlur(event) {
|
|
99
|
-
return relax.chain(_children.props.onBlur)(event);
|
|
99
|
+
return relax.chain(_children.props.onBlur, disappear)(event);
|
|
100
100
|
}
|
|
101
101
|
}),
|
|
102
102
|
_useFocus2 = _slicedToArray(_useFocus, 2),
|
|
@@ -94,7 +94,7 @@ var Popover = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
94
94
|
return chain(_children.props.onFocus, turnOn)(event);
|
|
95
95
|
},
|
|
96
96
|
onBlur: function onBlur(event) {
|
|
97
|
-
return chain(_children.props.onBlur)(event);
|
|
97
|
+
return chain(_children.props.onBlur, disappear)(event);
|
|
98
98
|
}
|
|
99
99
|
}),
|
|
100
100
|
_useFocus2 = _slicedToArray(_useFocus, 2),
|
|
@@ -15,6 +15,25 @@ var dom = require('@aiszlab/relax/dom');
|
|
|
15
15
|
|
|
16
16
|
var _excluded = ["open", "children", "placement", "style", "className", "onExit", "onExited", "onEntered", "trigger", "offset", "overlay", "arrow", "disappearable"];
|
|
17
17
|
var styles = {
|
|
18
|
+
portal: {
|
|
19
|
+
"default": {
|
|
20
|
+
position: "musaex-ixxii4",
|
|
21
|
+
overflow: "musaex-b3r6kr",
|
|
22
|
+
overflowX: null,
|
|
23
|
+
overflowY: null,
|
|
24
|
+
pointerEvents: "musaex-47corl",
|
|
25
|
+
inset: "musaex-10a8y8t",
|
|
26
|
+
insetInline: null,
|
|
27
|
+
insetInlineStart: null,
|
|
28
|
+
insetInlineEnd: null,
|
|
29
|
+
left: null,
|
|
30
|
+
right: null,
|
|
31
|
+
insetBlock: null,
|
|
32
|
+
top: null,
|
|
33
|
+
bottom: null,
|
|
34
|
+
$$css: true
|
|
35
|
+
}
|
|
36
|
+
},
|
|
18
37
|
dropdown: {
|
|
19
38
|
"default": function _default(props) {
|
|
20
39
|
return [{
|
|
@@ -35,7 +54,12 @@ var styles = {
|
|
|
35
54
|
borderTopRightRadius: null,
|
|
36
55
|
borderBottomLeftRadius: null,
|
|
37
56
|
borderBottomRightRadius: null,
|
|
38
|
-
|
|
57
|
+
pointerEvents: "musaex-67bb7w",
|
|
58
|
+
willChange: "musaex-1enemt",
|
|
59
|
+
transitionProperty: "musaex-qzan4j",
|
|
60
|
+
transitionDuration: "musaex-1g2r6go",
|
|
61
|
+
display: "musaex-1s85apg",
|
|
62
|
+
opacity: "musaex-g01cxk",
|
|
39
63
|
$$css: true
|
|
40
64
|
}, {
|
|
41
65
|
"--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial"
|
|
@@ -72,7 +96,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
72
96
|
onExited = _ref.onExited,
|
|
73
97
|
onEntered = _ref.onEntered,
|
|
74
98
|
trigger = _ref.trigger,
|
|
75
|
-
|
|
99
|
+
offset = _ref.offset,
|
|
76
100
|
_ref$overlay = _ref.overlay,
|
|
77
101
|
overlay = _ref$overlay === void 0 ? false : _ref$overlay,
|
|
78
102
|
_ref$arrow = _ref.arrow,
|
|
@@ -84,26 +108,23 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
84
108
|
var theme = hooks.useTheme();
|
|
85
109
|
var _useFloating = hooks$1.useFloating({
|
|
86
110
|
arrowable: arrowable,
|
|
87
|
-
offset:
|
|
111
|
+
offset: offset,
|
|
88
112
|
placement: placement,
|
|
89
113
|
open: open,
|
|
90
|
-
trigger: trigger
|
|
91
|
-
}),
|
|
92
|
-
floatableRef = _useFloating.floatableRef,
|
|
93
|
-
arrowRef = _useFloating.arrowRef;
|
|
94
|
-
var _useAnimation = hooks$1.useAnimation({
|
|
95
|
-
open: open,
|
|
96
|
-
disappearable: disappearable,
|
|
114
|
+
trigger: trigger,
|
|
97
115
|
onEntered: onEntered,
|
|
98
116
|
onExit: onExit,
|
|
99
|
-
onExited: onExited
|
|
117
|
+
onExited: onExited,
|
|
118
|
+
disappearable: disappearable
|
|
100
119
|
}),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
120
|
+
floatableRef = _useFloating.floatableRef,
|
|
121
|
+
arrowRef = _useFloating.arrowRef,
|
|
122
|
+
_disappear = _useFloating.disappear;
|
|
104
123
|
React.useImperativeHandle(ref, function () {
|
|
105
124
|
return {
|
|
106
|
-
disappear: disappear
|
|
125
|
+
disappear: function disappear() {
|
|
126
|
+
return _disappear(true);
|
|
127
|
+
},
|
|
107
128
|
contains: function contains(node) {
|
|
108
129
|
return dom.contains(floatableRef.current, node);
|
|
109
130
|
}
|
|
@@ -115,10 +136,14 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
115
136
|
}), overlay && styles.dropdown.overlay),
|
|
116
137
|
arrow: stylex.default.props(styles.arrow["default"]({
|
|
117
138
|
backgroundColor: theme.colors[colors.ColorToken.SurfaceContainer]
|
|
118
|
-
}))
|
|
139
|
+
})),
|
|
140
|
+
portal: stylex.default.props(styles.portal["default"])
|
|
119
141
|
};
|
|
120
|
-
return /*#__PURE__*/React.createElement("div",
|
|
121
|
-
|
|
142
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
143
|
+
className: styled.portal.className,
|
|
144
|
+
style: styled.portal.style
|
|
145
|
+
}, /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({
|
|
146
|
+
ref: floatableRef
|
|
122
147
|
}, props), {}, {
|
|
123
148
|
className: relax.clsx(classNames[className.PopperClassToken.Dropdown], className$1, styled.dropdown.className),
|
|
124
149
|
style: _objectSpread(_objectSpread({}, styled.dropdown.style), style)
|
|
@@ -126,7 +151,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
126
151
|
ref: arrowRef,
|
|
127
152
|
className: styled.arrow.className,
|
|
128
153
|
style: styled.arrow.style
|
|
129
|
-
})));
|
|
154
|
+
}))));
|
|
130
155
|
});
|
|
131
156
|
|
|
132
157
|
exports.default = Dropdown;
|
|
@@ -4,8 +4,8 @@ import React, { forwardRef, useImperativeHandle } from 'react';
|
|
|
4
4
|
import { PopperClassToken } from '../../utils/class-name.mjs';
|
|
5
5
|
import { useClassNames } from '../../hooks/use-class-names.mjs';
|
|
6
6
|
import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.mjs';
|
|
7
|
-
import {
|
|
8
|
-
import { useFloating
|
|
7
|
+
import { clsx } from '@aiszlab/relax';
|
|
8
|
+
import { useFloating } from './hooks.mjs';
|
|
9
9
|
import { useTheme } from '../theme/hooks.mjs';
|
|
10
10
|
import { ColorToken } from '../../utils/colors.mjs';
|
|
11
11
|
import { ComponentToken } from '../../utils/component-token.mjs';
|
|
@@ -13,6 +13,25 @@ import { contains } from '@aiszlab/relax/dom';
|
|
|
13
13
|
|
|
14
14
|
var _excluded = ["open", "children", "placement", "style", "className", "onExit", "onExited", "onEntered", "trigger", "offset", "overlay", "arrow", "disappearable"];
|
|
15
15
|
var styles = {
|
|
16
|
+
portal: {
|
|
17
|
+
"default": {
|
|
18
|
+
position: "musaex-ixxii4",
|
|
19
|
+
overflow: "musaex-b3r6kr",
|
|
20
|
+
overflowX: null,
|
|
21
|
+
overflowY: null,
|
|
22
|
+
pointerEvents: "musaex-47corl",
|
|
23
|
+
inset: "musaex-10a8y8t",
|
|
24
|
+
insetInline: null,
|
|
25
|
+
insetInlineStart: null,
|
|
26
|
+
insetInlineEnd: null,
|
|
27
|
+
left: null,
|
|
28
|
+
right: null,
|
|
29
|
+
insetBlock: null,
|
|
30
|
+
top: null,
|
|
31
|
+
bottom: null,
|
|
32
|
+
$$css: true
|
|
33
|
+
}
|
|
34
|
+
},
|
|
16
35
|
dropdown: {
|
|
17
36
|
"default": function _default(props) {
|
|
18
37
|
return [{
|
|
@@ -33,7 +52,12 @@ var styles = {
|
|
|
33
52
|
borderTopRightRadius: null,
|
|
34
53
|
borderBottomLeftRadius: null,
|
|
35
54
|
borderBottomRightRadius: null,
|
|
36
|
-
|
|
55
|
+
pointerEvents: "musaex-67bb7w",
|
|
56
|
+
willChange: "musaex-1enemt",
|
|
57
|
+
transitionProperty: "musaex-qzan4j",
|
|
58
|
+
transitionDuration: "musaex-1g2r6go",
|
|
59
|
+
display: "musaex-1s85apg",
|
|
60
|
+
opacity: "musaex-g01cxk",
|
|
37
61
|
$$css: true
|
|
38
62
|
}, {
|
|
39
63
|
"--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial"
|
|
@@ -70,7 +94,7 @@ var Dropdown = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
70
94
|
onExited = _ref.onExited,
|
|
71
95
|
onEntered = _ref.onEntered,
|
|
72
96
|
trigger = _ref.trigger,
|
|
73
|
-
|
|
97
|
+
offset = _ref.offset,
|
|
74
98
|
_ref$overlay = _ref.overlay,
|
|
75
99
|
overlay = _ref$overlay === void 0 ? false : _ref$overlay,
|
|
76
100
|
_ref$arrow = _ref.arrow,
|
|
@@ -82,26 +106,23 @@ var Dropdown = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
82
106
|
var theme = useTheme();
|
|
83
107
|
var _useFloating = useFloating({
|
|
84
108
|
arrowable: arrowable,
|
|
85
|
-
offset:
|
|
109
|
+
offset: offset,
|
|
86
110
|
placement: placement,
|
|
87
111
|
open: open,
|
|
88
|
-
trigger: trigger
|
|
89
|
-
}),
|
|
90
|
-
floatableRef = _useFloating.floatableRef,
|
|
91
|
-
arrowRef = _useFloating.arrowRef;
|
|
92
|
-
var _useAnimation = useAnimation({
|
|
93
|
-
open: open,
|
|
94
|
-
disappearable: disappearable,
|
|
112
|
+
trigger: trigger,
|
|
95
113
|
onEntered: onEntered,
|
|
96
114
|
onExit: onExit,
|
|
97
|
-
onExited: onExited
|
|
115
|
+
onExited: onExited,
|
|
116
|
+
disappearable: disappearable
|
|
98
117
|
}),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
118
|
+
floatableRef = _useFloating.floatableRef,
|
|
119
|
+
arrowRef = _useFloating.arrowRef,
|
|
120
|
+
_disappear = _useFloating.disappear;
|
|
102
121
|
useImperativeHandle(ref, function () {
|
|
103
122
|
return {
|
|
104
|
-
disappear: disappear
|
|
123
|
+
disappear: function disappear() {
|
|
124
|
+
return _disappear(true);
|
|
125
|
+
},
|
|
105
126
|
contains: function contains$1(node) {
|
|
106
127
|
return contains(floatableRef.current, node);
|
|
107
128
|
}
|
|
@@ -113,10 +134,14 @@ var Dropdown = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
113
134
|
}), overlay && styles.dropdown.overlay),
|
|
114
135
|
arrow: _stylex.props(styles.arrow["default"]({
|
|
115
136
|
backgroundColor: theme.colors[ColorToken.SurfaceContainer]
|
|
116
|
-
}))
|
|
137
|
+
})),
|
|
138
|
+
portal: _stylex.props(styles.portal["default"])
|
|
117
139
|
};
|
|
118
|
-
return /*#__PURE__*/React.createElement("div",
|
|
119
|
-
|
|
140
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
className: styled.portal.className,
|
|
142
|
+
style: styled.portal.style
|
|
143
|
+
}, /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({
|
|
144
|
+
ref: floatableRef
|
|
120
145
|
}, props), {}, {
|
|
121
146
|
className: clsx(classNames[PopperClassToken.Dropdown], className, styled.dropdown.className),
|
|
122
147
|
style: _objectSpread(_objectSpread({}, styled.dropdown.style), style)
|
|
@@ -124,7 +149,7 @@ var Dropdown = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
124
149
|
ref: arrowRef,
|
|
125
150
|
className: styled.arrow.className,
|
|
126
151
|
style: styled.arrow.style
|
|
127
|
-
})));
|
|
152
|
+
}))));
|
|
128
153
|
});
|
|
129
154
|
|
|
130
155
|
export { Dropdown as default };
|