@qsxy/element-plus-react 1.0.0-next.3 → 1.0.0-next.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/README.md +5 -7
- package/dist/Badge/Badge.js +1 -1
- package/dist/Carousel/Carousel.d.ts +4 -0
- package/dist/Carousel/Carousel.js +168 -0
- package/dist/Carousel/CarouselContext.d.ts +4 -0
- package/dist/Carousel/CarouselContext.js +52 -0
- package/dist/Carousel/CarouselItem.d.ts +4 -0
- package/dist/Carousel/CarouselItem.js +75 -0
- package/dist/Carousel/hooks/useCarousel.d.ts +37 -0
- package/dist/Carousel/hooks/useCarousel.js +348 -0
- package/dist/Carousel/hooks/useCarouselItem.d.ts +8 -0
- package/dist/Carousel/hooks/useCarouselItem.js +161 -0
- package/dist/Carousel/index.d.ts +3 -0
- package/dist/Carousel/index.js +42 -0
- package/dist/Carousel/typings.d.ts +83 -0
- package/dist/Carousel/typings.js +17 -0
- package/dist/Collapse/CollapseItem.js +1 -1
- package/dist/DatePicker/DatePicker.js +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +3 -3
- package/dist/Dialog/Dialog.js +2 -2
- package/dist/Dialog/typings.d.ts +2 -2
- package/dist/Drawer/Drawer.js +18 -9
- package/dist/Dropdown/Dropdown.js +1 -1
- package/dist/Dropdown/typings.d.ts +1 -1
- package/dist/Form/utils/classUtil.js +2 -2
- package/dist/Input/Input.js +2 -1
- package/dist/Input/InputRange.js +3 -3
- package/dist/MessageBox/MessageBox.js +1 -1
- package/dist/Popconfirm/Popconfirm.js +1 -1
- package/dist/Popconfirm/typings.d.ts +2 -1
- package/dist/Popover/Popover.js +1 -1
- package/dist/Popover/typings.d.ts +1 -1
- package/dist/Popper/Popper.js +7 -7
- package/dist/Progress/Progress.js +1 -1
- package/dist/Table/hooks/useSelection.d.ts +0 -7
- package/dist/Table/util.js +2 -2
- package/dist/Tabs/Tabs.js +1 -1
- package/dist/TimePicker/TimePicker.js +2 -1
- package/dist/TimePicker/TimeSpinnerPanel.js +2 -1
- package/dist/hooks/prefix.d.ts +1 -1
- package/dist/hooks/prefix.js +4 -4
- package/dist/hooks/useClassNames.js +1 -1
- package/dist/index.css +222 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/theme-chalk/carousel/index.scss +237 -0
- package/dist/theme-chalk/dev.scss +2 -0
- package/dist/theme-chalk/index.scss +1 -1
- package/package.json +1 -1
- package/dist/theme-chalk/build.scss +0 -64
package/README.md
CHANGED
|
@@ -7,7 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
## Usage
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
```javascript
|
|
11
|
+
// how to use
|
|
12
|
+
import '@qsxy/element-plus-react/dist/index.css';
|
|
13
|
+
import { ElButton, ElLink } from '@qsxy/element-plus-react';
|
|
14
|
+
```
|
|
11
15
|
|
|
12
16
|
## Options
|
|
13
17
|
|
|
@@ -20,12 +24,6 @@ TODO
|
|
|
20
24
|
$ npm i @qsxy/element-plus-react
|
|
21
25
|
```
|
|
22
26
|
|
|
23
|
-
```javascript
|
|
24
|
-
// how to use
|
|
25
|
-
import '@qsxy/element-plus-react/dist/index.css';
|
|
26
|
-
import { ElButton, ElLink } from '@qsxy/element-plus-react';
|
|
27
|
-
```
|
|
28
|
-
|
|
29
27
|
## LICENSE
|
|
30
28
|
|
|
31
29
|
MIT
|
package/dist/Badge/Badge.js
CHANGED
|
@@ -50,7 +50,7 @@ var Badge = (0, import_react.forwardRef)((props, ref) => {
|
|
|
50
50
|
}
|
|
51
51
|
return `${value}`;
|
|
52
52
|
}, [isDot, max, value]);
|
|
53
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { ref, className: (0, import_classnames.default)(b(), props.className), style: props.style }, props.children, /* @__PURE__ */ import_react.default.createElement(import_Transition.default, { nodeRef, name: "
|
|
53
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { ref, className: (0, import_classnames.default)(b(), props.className), style: props.style }, props.children, /* @__PURE__ */ import_react.default.createElement(import_Transition.default, { nodeRef, name: b("zoom-in-center", false), visible: !hidden && (!!content || isDot) && !(!showZero && value === 0), display: "inline-flex" }, /* @__PURE__ */ import_react.default.createElement(
|
|
54
54
|
"sup",
|
|
55
55
|
{
|
|
56
56
|
ref: nodeRef,
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/Carousel/Carousel.tsx
|
|
30
|
+
var Carousel_exports = {};
|
|
31
|
+
__export(Carousel_exports, {
|
|
32
|
+
default: () => Carousel_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Carousel_exports);
|
|
35
|
+
var import_classnames = __toESM(require("classnames"));
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_Icon = require("../Icon");
|
|
38
|
+
var import_Transition = require("../Transition");
|
|
39
|
+
var import_Util = require("../Util");
|
|
40
|
+
var import_hooks = require("../hooks");
|
|
41
|
+
var import_prefix = require("../hooks/prefix");
|
|
42
|
+
var import_CarouselContext = require("./CarouselContext");
|
|
43
|
+
var import_useCarousel = require("./hooks/useCarousel");
|
|
44
|
+
var Carousel = (0, import_react.memo)(
|
|
45
|
+
(0, import_react.forwardRef)((props, ref) => {
|
|
46
|
+
props = (0, import_Util.mergeDefaultProps)(
|
|
47
|
+
{
|
|
48
|
+
trigger: "hover",
|
|
49
|
+
autoplay: true,
|
|
50
|
+
interval: 3e3,
|
|
51
|
+
initialIndex: 0,
|
|
52
|
+
arrow: "hover",
|
|
53
|
+
cardScale: 0.83,
|
|
54
|
+
loop: true,
|
|
55
|
+
direction: "horizontal",
|
|
56
|
+
pauseOnHover: true,
|
|
57
|
+
motionBlur: false,
|
|
58
|
+
classPrefix: "carousel"
|
|
59
|
+
},
|
|
60
|
+
props
|
|
61
|
+
);
|
|
62
|
+
const { indicatorPosition, arrow = "hover", cardScale = 0.83, loop = true, direction = "horizontal", motionBlur = false, classPrefix = "carousel", children } = props;
|
|
63
|
+
const { b, e, m, em, is } = (0, import_hooks.useClassNames)(classPrefix);
|
|
64
|
+
const {
|
|
65
|
+
items,
|
|
66
|
+
addItem,
|
|
67
|
+
removeItem,
|
|
68
|
+
setContainerHeight,
|
|
69
|
+
root,
|
|
70
|
+
activeIndex,
|
|
71
|
+
hasLabel,
|
|
72
|
+
hover,
|
|
73
|
+
isCardType,
|
|
74
|
+
isTransitioning,
|
|
75
|
+
isVertical,
|
|
76
|
+
containerStyle,
|
|
77
|
+
handleButtonEnter,
|
|
78
|
+
handleButtonLeave,
|
|
79
|
+
handleIndicatorClick,
|
|
80
|
+
handleMouseEnter,
|
|
81
|
+
handleMouseLeave,
|
|
82
|
+
handleTransitionEnd,
|
|
83
|
+
setActiveItem,
|
|
84
|
+
isTwoLengthShow,
|
|
85
|
+
throttledArrowClick,
|
|
86
|
+
throttledIndicatorHover,
|
|
87
|
+
prev,
|
|
88
|
+
next
|
|
89
|
+
} = (0, import_useCarousel.useCarousel)(props);
|
|
90
|
+
const buttonLeft = (0, import_react.useRef)();
|
|
91
|
+
const buttonRight = (0, import_react.useRef)();
|
|
92
|
+
const carouselContainer = (0, import_react.useMemo)(() => {
|
|
93
|
+
const classes = [e`container`];
|
|
94
|
+
if (motionBlur && isTransitioning && items.length > 1) {
|
|
95
|
+
classes.push(isVertical ? `${import_prefix.namespace}-transitioning-vertical` : `${import_prefix.namespace}-transitioning`);
|
|
96
|
+
}
|
|
97
|
+
return (0, import_classnames.default)(classes);
|
|
98
|
+
}, [e, isTransitioning, isVertical, items.length, motionBlur]);
|
|
99
|
+
const indicatorsClasses = (0, import_react.useMemo)(() => {
|
|
100
|
+
const classes = [e("indicators"), em("indicators", direction)];
|
|
101
|
+
if (hasLabel) {
|
|
102
|
+
classes.push(em("indicators", "labels"));
|
|
103
|
+
}
|
|
104
|
+
if (indicatorPosition === "outside") {
|
|
105
|
+
classes.push(em("indicators", "outside"));
|
|
106
|
+
}
|
|
107
|
+
if (isVertical) {
|
|
108
|
+
classes.push(em("indicators", "right"));
|
|
109
|
+
}
|
|
110
|
+
return (0, import_classnames.default)(classes);
|
|
111
|
+
}, [direction, e, em, hasLabel, indicatorPosition, isVertical]);
|
|
112
|
+
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
113
|
+
activeIndex,
|
|
114
|
+
setActiveItem,
|
|
115
|
+
prev,
|
|
116
|
+
next
|
|
117
|
+
}));
|
|
118
|
+
return /* @__PURE__ */ import_react.default.createElement(import_CarouselContext.CarouselContext.Provider, { value: { root, isCardType, isVertical, items, addItem, removeItem, loop, cardScale, setActiveItem, setContainerHeight } }, /* @__PURE__ */ import_react.default.createElement(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
ref: root,
|
|
122
|
+
className: (0, import_classnames.default)(b(), m(direction), { [m`card`]: isCardType }, props.className),
|
|
123
|
+
style: props.style,
|
|
124
|
+
onMouseEnter: handleMouseEnter,
|
|
125
|
+
onMouseLeave: handleMouseLeave
|
|
126
|
+
},
|
|
127
|
+
/* @__PURE__ */ import_react.default.createElement(import_Transition.Transition, { nodeRef: buttonLeft, visible: (arrow === "always" || hover) && (loop || activeIndex > 0), name: "carousel-arrow-left" }, /* @__PURE__ */ import_react.default.createElement(
|
|
128
|
+
"button",
|
|
129
|
+
{
|
|
130
|
+
ref: buttonLeft,
|
|
131
|
+
type: "button",
|
|
132
|
+
className: (0, import_classnames.default)(e`arrow`, em("arrow", "left")),
|
|
133
|
+
onMouseEnter: () => handleButtonEnter("left"),
|
|
134
|
+
onMouseLeave: handleButtonLeave,
|
|
135
|
+
onClick: () => throttledArrowClick(activeIndex - 1)
|
|
136
|
+
},
|
|
137
|
+
/* @__PURE__ */ import_react.default.createElement(import_Icon.Icon, { name: "angle-left", prefix: "far" })
|
|
138
|
+
)),
|
|
139
|
+
/* @__PURE__ */ import_react.default.createElement(import_Transition.Transition, { nodeRef: buttonRight, visible: (arrow === "always" || hover) && (loop || activeIndex < items.length - 1), name: "carousel-arrow-right" }, /* @__PURE__ */ import_react.default.createElement(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
ref: buttonRight,
|
|
143
|
+
type: "button",
|
|
144
|
+
className: (0, import_classnames.default)(e`arrow`, em("arrow", "right")),
|
|
145
|
+
onMouseEnter: () => handleButtonEnter("right"),
|
|
146
|
+
onMouseLeave: handleButtonLeave,
|
|
147
|
+
onClick: () => throttledArrowClick(activeIndex + 1)
|
|
148
|
+
},
|
|
149
|
+
/* @__PURE__ */ import_react.default.createElement(import_Icon.Icon, { name: "angle-right", prefix: "far" })
|
|
150
|
+
)),
|
|
151
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: carouselContainer, style: containerStyle, onTransitionEnd: handleTransitionEnd }, children),
|
|
152
|
+
indicatorPosition !== "none" && /* @__PURE__ */ import_react.default.createElement("ul", { className: indicatorsClasses }, items.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
153
|
+
"li",
|
|
154
|
+
{
|
|
155
|
+
key: index,
|
|
156
|
+
className: (0, import_classnames.default)(e`indicator`, em("indicator", direction), is({ active: index === activeIndex })),
|
|
157
|
+
style: { display: isTwoLengthShow(index) ? "" : "none" },
|
|
158
|
+
onMouseEnter: () => throttledIndicatorHover(index),
|
|
159
|
+
onClick: () => handleIndicatorClick(index)
|
|
160
|
+
},
|
|
161
|
+
/* @__PURE__ */ import_react.default.createElement("button", { className: e`button` }, hasLabel && /* @__PURE__ */ import_react.default.createElement("span", null, item.props.label))
|
|
162
|
+
))),
|
|
163
|
+
motionBlur && /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", version: "1.1", style: { display: "none" } }, /* @__PURE__ */ import_react.default.createElement("defs", null, /* @__PURE__ */ import_react.default.createElement("filter", { id: "elCarouselHorizontal" }, /* @__PURE__ */ import_react.default.createElement("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "12,0" })), /* @__PURE__ */ import_react.default.createElement("filter", { id: "elCarouselVertical" }, /* @__PURE__ */ import_react.default.createElement("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "0,10" }))))
|
|
164
|
+
));
|
|
165
|
+
})
|
|
166
|
+
);
|
|
167
|
+
Carousel.displayName = "ElCarousel";
|
|
168
|
+
var Carousel_default = Carousel;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/Carousel/CarouselContext.ts
|
|
20
|
+
var CarouselContext_exports = {};
|
|
21
|
+
__export(CarouselContext_exports, {
|
|
22
|
+
CarouselContext: () => CarouselContext,
|
|
23
|
+
useCarouselContext: () => useCarouselContext
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(CarouselContext_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var CarouselContext = (0, import_react.createContext)({
|
|
28
|
+
root: void 0,
|
|
29
|
+
isCardType: false,
|
|
30
|
+
isVertical: false,
|
|
31
|
+
items: [],
|
|
32
|
+
loop: false,
|
|
33
|
+
cardScale: 0,
|
|
34
|
+
addItem: function() {
|
|
35
|
+
throw new Error("Function not implemented.");
|
|
36
|
+
},
|
|
37
|
+
removeItem: function() {
|
|
38
|
+
throw new Error("Function not implemented.");
|
|
39
|
+
},
|
|
40
|
+
setActiveItem: function() {
|
|
41
|
+
throw new Error("Function not implemented.");
|
|
42
|
+
},
|
|
43
|
+
setContainerHeight: function() {
|
|
44
|
+
throw new Error("Function not implemented.");
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
var useCarouselContext = () => (0, import_react.useContext)(CarouselContext);
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
CarouselContext,
|
|
51
|
+
useCarouselContext
|
|
52
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/Carousel/CarouselItem.tsx
|
|
30
|
+
var CarouselItem_exports = {};
|
|
31
|
+
__export(CarouselItem_exports, {
|
|
32
|
+
default: () => CarouselItem_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(CarouselItem_exports);
|
|
35
|
+
var import_classnames = __toESM(require("classnames"));
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_hooks = require("../hooks");
|
|
38
|
+
var import_CarouselContext = require("./CarouselContext");
|
|
39
|
+
var import_useCarouselItem = require("./hooks/useCarouselItem");
|
|
40
|
+
var CarouselItem = (0, import_react.memo)((props) => {
|
|
41
|
+
const { classPrefix = "carousel", children } = props;
|
|
42
|
+
const { e, em, is } = (0, import_hooks.useClassNames)(classPrefix);
|
|
43
|
+
const { isCardType, isVertical } = (0, import_CarouselContext.useCarouselContext)();
|
|
44
|
+
const { carouselItemRef, state, handleItemClick } = (0, import_useCarouselItem.useCarouselItem)(props);
|
|
45
|
+
const itemStyle = (0, import_react.useMemo)(() => {
|
|
46
|
+
const translateType = `translate${isVertical ? "Y" : "X"}`;
|
|
47
|
+
const _translate = `${translateType}(${state.translate}px)`;
|
|
48
|
+
const _scale = `scale(${state.scale})`;
|
|
49
|
+
const transform = [_translate, _scale].join(" ");
|
|
50
|
+
return {
|
|
51
|
+
transform
|
|
52
|
+
};
|
|
53
|
+
}, [isVertical, state.scale, state.translate]);
|
|
54
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
ref: carouselItemRef,
|
|
58
|
+
className: (0, import_classnames.default)(
|
|
59
|
+
e`item`,
|
|
60
|
+
is({ active: state.active, "in-stage": state.inStage, hover: state.hover, animating: state.animating }),
|
|
61
|
+
{
|
|
62
|
+
[em("item", "card")]: isCardType,
|
|
63
|
+
[em("item", "card-vertical")]: isCardType && isVertical
|
|
64
|
+
},
|
|
65
|
+
props.className
|
|
66
|
+
),
|
|
67
|
+
style: { ...itemStyle, display: state.ready ? "" : "none", ...props.style ?? {} },
|
|
68
|
+
onClick: handleItemClick
|
|
69
|
+
},
|
|
70
|
+
isCardType && /* @__PURE__ */ import_react.default.createElement("div", { className: e`mask`, style: { display: !state.active ? "" : "none" } }),
|
|
71
|
+
children
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
CarouselItem.displayName = "ElCarouselItem";
|
|
75
|
+
var CarouselItem_default = CarouselItem;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="lodash" />
|
|
3
|
+
import { CarouselItemContext, CarouselProps } from '../typings';
|
|
4
|
+
export declare const useCarousel: (props: CarouselProps) => {
|
|
5
|
+
items: CarouselItemContext[];
|
|
6
|
+
addItem: (item: CarouselItemContext) => void;
|
|
7
|
+
removeItem: (uid: string) => void;
|
|
8
|
+
setContainerHeight: (_height: string | number) => void;
|
|
9
|
+
root: import("react").MutableRefObject<HTMLDivElement>;
|
|
10
|
+
activeIndex: number;
|
|
11
|
+
arrowDisplay: boolean;
|
|
12
|
+
hasLabel: boolean;
|
|
13
|
+
hover: boolean;
|
|
14
|
+
isCardType: boolean;
|
|
15
|
+
isTransitioning: boolean;
|
|
16
|
+
isVertical: boolean;
|
|
17
|
+
containerStyle: {
|
|
18
|
+
height: string | number;
|
|
19
|
+
overflow?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
height: number;
|
|
22
|
+
overflow: string;
|
|
23
|
+
};
|
|
24
|
+
isItemsTwoLength: import("react").MutableRefObject<boolean>;
|
|
25
|
+
handleButtonEnter: (_arrow: 'left' | 'right') => void;
|
|
26
|
+
handleTransitionEnd: () => void;
|
|
27
|
+
handleButtonLeave: () => void;
|
|
28
|
+
handleIndicatorClick: (index: number) => void;
|
|
29
|
+
handleMouseEnter: () => void;
|
|
30
|
+
handleMouseLeave: () => void;
|
|
31
|
+
setActiveItem: (index: number | string) => void;
|
|
32
|
+
prev: () => void;
|
|
33
|
+
next: () => void;
|
|
34
|
+
isTwoLengthShow: (index: number) => boolean;
|
|
35
|
+
throttledArrowClick: import("lodash").DebouncedFuncLeading<(index: number) => void>;
|
|
36
|
+
throttledIndicatorHover: import("lodash").DebouncedFuncLeading<(index: number) => void>;
|
|
37
|
+
};
|