@qsxy/element-plus-react 1.0.0-next.18 → 1.0.0-next.21
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 +12 -39
- package/dist/Breadcrumb/BreadcrumbItem.js +4 -7
- package/dist/Switch/Switch.js +50 -17
- package/dist/Switch/typings.d.ts +4 -0
- package/dist/Tooltip/Tooltip.js +2 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/package.json +1 -2
- package/theme-chalk/{avatar/index.scss → avatar.scss} +1 -1
- package/theme-chalk/{badge/index.scss → badge.scss} +1 -1
- package/theme-chalk/{breadcrumb/index.scss → breadcrumb.scss} +1 -1
- package/theme-chalk/build.scss +1 -1
- package/theme-chalk/button/_mixins.scss +3 -3
- package/theme-chalk/button/button-group.scss +1 -1
- package/theme-chalk/button/button.scss +2 -2
- package/theme-chalk/button/index.scss +2 -2
- package/theme-chalk/button--bak/_mixins.scss +317 -0
- package/theme-chalk/button--bak/button-group.scss +83 -0
- package/theme-chalk/button--bak/button.scss +382 -0
- package/theme-chalk/button--bak/index.scss +2 -0
- package/theme-chalk/button-group.scss +80 -0
- package/theme-chalk/button.scss +304 -0
- package/theme-chalk/calendar/date-picker.scss +1 -1
- package/theme-chalk/calendar/date-range-picker.scss +1 -1
- package/theme-chalk/calendar/date-table.scss +164 -156
- package/theme-chalk/calendar/date-table.scss--bak +156 -0
- package/theme-chalk/calendar/index.scss +6 -6
- package/theme-chalk/calendar/month-table.scss +1 -1
- package/theme-chalk/calendar/picker-panel.scss +1 -1
- package/theme-chalk/calendar/year-table.scss +1 -1
- package/theme-chalk/{card/index.scss → card.scss} +1 -1
- package/theme-chalk/{carousel/index.scss → carousel.scss} +1 -1
- package/theme-chalk/{cascader/cascader-panel.scss → cascader-panel.scss} +1 -1
- package/theme-chalk/{cascader/cascader.scss → cascader.scss} +1 -1
- package/theme-chalk/{checkbox-button/index.scss → checkbox-button.scss} +1 -1
- package/theme-chalk/{checkbox-group/index.scss → checkbox-group.scss} +1 -1
- package/theme-chalk/{checkbox/index.scss → checkbox.scss} +2 -1
- package/theme-chalk/col/_mixins.scss +5 -3
- package/theme-chalk/col/index.scss +2 -2
- package/theme-chalk/{collapse/index.scss → collapse.scss} +1 -1
- package/theme-chalk/color/index.scss +20 -0
- package/theme-chalk/{color-picker/index.scss → color-picker.scss} +3 -3
- package/theme-chalk/common/index.scss +127 -178
- package/theme-chalk/common/var.scss +1632 -0
- package/theme-chalk/dark/css-vars.scss +39 -0
- package/theme-chalk/dark/var.scss +225 -0
- package/theme-chalk/{date-picker/index.scss → date-picker.scss} +1 -1
- package/theme-chalk/{date-time-picker/time-picker.scss → date-time-picker.scss} +1 -1
- package/theme-chalk/{descriptions/descriptions-item.scss → descriptions-item.scss} +1 -1
- package/theme-chalk/{descriptions/descriptions.scss → descriptions.scss} +1 -1
- package/theme-chalk/dev.scss +2 -2
- package/theme-chalk/{dialog/index.scss → dialog.scss} +1 -1
- package/theme-chalk/display.scss +1 -1
- package/theme-chalk/{divider/index.scss → divider.scss} +1 -1
- package/theme-chalk/doc.scss +2 -2
- package/theme-chalk/{drawer/index.scss → drawer.scss} +1 -1
- package/theme-chalk/{dropdown/index.scss → dropdown.scss} +1 -1
- package/theme-chalk/{empty/index.scss → empty.scss} +1 -1
- package/theme-chalk/{form/index.scss → form.scss} +1 -1
- package/theme-chalk/icon/fonts.scss +9 -9
- package/theme-chalk/icon/index.scss +1 -1
- package/theme-chalk/icon/scss/_animated.scss +1 -0
- package/theme-chalk/icon/scss/_bordered-pulled.scss +1 -0
- package/theme-chalk/icon/scss/_core.scss +2 -0
- package/theme-chalk/icon/scss/_duotone-icons.scss +3 -4
- package/theme-chalk/icon/scss/_fixed-width.scss +1 -0
- package/theme-chalk/icon/scss/_functions.scss +2 -1
- package/theme-chalk/icon/scss/_icons.scss +3 -4
- package/theme-chalk/icon/scss/_list.scss +1 -0
- package/theme-chalk/icon/scss/_mixins.scss +10 -7
- package/theme-chalk/icon/scss/_rotated-flipped.scss +1 -0
- package/theme-chalk/icon/scss/_screen-reader.scss +2 -0
- package/theme-chalk/icon/scss/_shims.scss +292 -290
- package/theme-chalk/icon/scss/_sizing.scss +2 -0
- package/theme-chalk/icon/scss/_stacked.scss +1 -0
- package/theme-chalk/icon/scss/brands.scss +8 -6
- package/theme-chalk/icon/scss/duotone.scss +6 -5
- package/theme-chalk/icon/scss/fontawesome.scss +13 -13
- package/theme-chalk/icon/scss/index.scss +12 -15
- package/theme-chalk/icon/scss/light.scss +3 -2
- package/theme-chalk/icon/scss/regular.scss +3 -2
- package/theme-chalk/icon/scss/solid.scss +3 -2
- package/theme-chalk/icon/scss/thin.scss +3 -2
- package/theme-chalk/icon/scss/{_variables.scss → variables.scss} +2 -0
- package/theme-chalk/index.scss +63 -57
- package/theme-chalk/input/_mixins.scss +1 -1
- package/theme-chalk/input/index.scss +2 -3
- package/theme-chalk/input/input-range.scss +2 -1
- package/theme-chalk/input/input.scss +2 -1
- package/theme-chalk/{input-number/index.scss → input-number.scss} +4 -4
- package/theme-chalk/{link/index.scss → link.scss} +1 -1
- package/theme-chalk/{loading/index.scss → loading.scss} +1 -1
- package/theme-chalk/{message-box/index.scss → message-box.scss} +1 -1
- package/theme-chalk/{message/index.scss → message.scss} +2 -1
- package/theme-chalk/mixins/_button.scss +224 -0
- package/theme-chalk/mixins/_col.scss +33 -0
- package/theme-chalk/mixins/_var.scss +67 -0
- package/theme-chalk/{common/_var.scss → mixins/config.scss} +5 -6
- package/theme-chalk/mixins/function.scss +99 -0
- package/theme-chalk/mixins/mixins.scss +240 -0
- package/theme-chalk/mixins/utils.scss +39 -0
- package/theme-chalk/{notification/index.scss → notification.scss} +2 -1
- package/theme-chalk/pagination.scss +303 -0
- package/theme-chalk/{popconfirm/index.scss → popconfirm.scss} +1 -1
- package/theme-chalk/{popover/index.scss → popover.scss} +1 -1
- package/theme-chalk/popper.scss +104 -0
- package/theme-chalk/{popper/index.scss → popper.scss--bak} +1 -1
- package/theme-chalk/{progress/index.scss → progress.scss} +1 -1
- package/theme-chalk/radio-button.scss +169 -0
- package/theme-chalk/{radio/radio-button.scss → radio-button.scss--bak} +1 -1
- package/theme-chalk/{radio-group/index.scss → radio-group.scss} +1 -10
- package/theme-chalk/{radio/radio.scss → radio.scss} +1 -1
- package/theme-chalk/{row/index.scss → row.scss} +1 -1
- package/theme-chalk/{scrollbar/index.scss → scrollbar.scss} +1 -1
- package/theme-chalk/select/index.scss +1 -1
- package/theme-chalk/{skeleton/index.scss → skeleton.scss} +1 -1
- package/theme-chalk/switch.scss +300 -0
- package/theme-chalk/{switch/index.scss → switch.scss--bak} +1 -1
- package/theme-chalk/{table/index.scss → table.scss} +1 -1
- package/theme-chalk/{tabs/index.scss → tabs.scss} +1 -1
- package/theme-chalk/{tag/index.scss → tag.scss} +1 -1
- package/theme-chalk/{time-line/_timeline.scss → time-line.scss} +1 -1
- package/theme-chalk/{time-picker/index.scss → time-picker.scss} +1 -1
- package/theme-chalk/{date-time-picker/time-range-picker.scss → time-range-picker.scss} +1 -1
- package/theme-chalk/{time-line/_timeline-item.scss → timeline-item.scss} +1 -1
- package/theme-chalk/{tooltip/index.scss → tooltip.scss} +1 -1
- package/theme-chalk/{transfer/index.scss → transfer.scss} +1 -1
- package/theme-chalk/{transition/index.scss → transition.scss} +1 -1
- package/theme-chalk/tree/_directory.scss +1 -1
- package/theme-chalk/tree/_tree.scss +1 -1
- package/theme-chalk/tree/index.scss +2 -2
- package/theme-chalk/{tree-select/index.scss → tree-select.scss} +1 -1
- package/theme-chalk/{upload/index.scss → upload.scss} +1 -1
- package/theme-chalk/var.scss +83 -0
- package/theme-chalk/cascader/index.scss +0 -2
- package/theme-chalk/common/index.ts +0 -1
- package/theme-chalk/date-time-picker/index.scss +0 -3
- package/theme-chalk/descriptions/index.scss +0 -2
- package/theme-chalk/icon/scss/v4-shims.scss +0 -3
- package/theme-chalk/pagination/index.scss +0 -303
- package/theme-chalk/placeholder/index.scss +0 -120
- package/theme-chalk/radio/index.scss +0 -2
- package/theme-chalk/time-line/index.scss +0 -2
package/README.md
CHANGED
|
@@ -26,43 +26,17 @@ element-plus-react 的 theme-chalk 使用 SCSS 编写,如果你的项目也使
|
|
|
26
26
|
/_ 改变主题色变量 _/
|
|
27
27
|
|
|
28
28
|
```scss
|
|
29
|
-
@use '
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// 主题色变量
|
|
41
|
-
--el-color-primary: #4f8ffa;
|
|
42
|
-
// Theme background color variable (button class)
|
|
43
|
-
// 主题背景颜色变量(按钮类)
|
|
44
|
-
--el-bg-color-primary: #4f8ffa;
|
|
45
|
-
// Theme border color variable (button class)
|
|
46
|
-
// 主题边框颜色变量(按钮类)
|
|
47
|
-
--btn-border-color: #48aff9;
|
|
48
|
-
|
|
49
|
-
@each $i in (3, 5, 7, 8, 9) {
|
|
50
|
-
@include set-color-mix-level($i, 'light', $--el-color-primary, #ffffff);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@include set-color-mix-level(2, 'dark', $--el-color-primary, #000000);
|
|
54
|
-
|
|
55
|
-
// dark mode 暗黑模式
|
|
56
|
-
&.is-dark {
|
|
57
|
-
--el-color-primary: #{mix(#141414, $--el-color-primary, 5)};
|
|
58
|
-
|
|
59
|
-
@each $i in (3, 5, 7, 8, 9) {
|
|
60
|
-
@include set-color-mix-level($i, 'light', $--el-color-primary, #141414);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@include set-color-mix-level(2, 'dark', $--el-color-primary, #141414);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
29
|
+
@use '@qsxy/element-plus-react/theme-chalk/common/var' with(
|
|
30
|
+
// 字体文件路径必填
|
|
31
|
+
$fa-font-path: '~/node_modules/@qsxy/element-plus-react/theme-chalk/fonts',
|
|
32
|
+
// 其他变量可自定义
|
|
33
|
+
$colors:
|
|
34
|
+
(
|
|
35
|
+
'primary': (
|
|
36
|
+
'base': green,
|
|
37
|
+
)
|
|
38
|
+
)
|
|
39
|
+
);
|
|
66
40
|
```
|
|
67
41
|
|
|
68
42
|
/_ Change icon font path variable, required _/
|
|
@@ -70,8 +44,7 @@ $--el-color-primary: #4f8ffa;
|
|
|
70
44
|
/_ 改变 icon 字体路径变量,必需 _/
|
|
71
45
|
|
|
72
46
|
```scss
|
|
73
|
-
$fa-font-path: '~@/assets/fonts';
|
|
74
|
-
@import '@qsxy/element-plus-react/theme-chalk/index.scss';
|
|
47
|
+
@use '@qsxy/element-plus-react/theme-chalk/common/var' with($fa-font-path: '~@/assets/fonts');
|
|
75
48
|
```
|
|
76
49
|
|
|
77
50
|
## Warm Reminder
|
|
@@ -8,7 +8,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
8
8
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import React, { cloneElement, memo, useCallback, useContext } from 'react';
|
|
11
|
-
import { useNavigate } from 'react-router-dom';
|
|
12
11
|
import { useClassNames } from "../hooks";
|
|
13
12
|
import { isNotEmpty } from "../Util";
|
|
14
13
|
import { BreadcrumbContext } from "./Breadcrumb";
|
|
@@ -23,16 +22,14 @@ var BreadcrumbItem = /*#__PURE__*/memo(function (props) {
|
|
|
23
22
|
is = _useClassNames.is;
|
|
24
23
|
var _useContext = useContext(BreadcrumbContext),
|
|
25
24
|
separator = _useContext.separator;
|
|
26
|
-
var navigate = useNavigate();
|
|
27
25
|
|
|
28
26
|
/** 点击链接跳转 */
|
|
29
27
|
var onClickLink = useCallback(function () {
|
|
30
|
-
if (isNotEmpty(to)) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
28
|
+
// if (isNotEmpty(to)) {
|
|
29
|
+
// navigate(typeof to === 'string' ? to : to?.path ?? '*');
|
|
30
|
+
// }
|
|
34
31
|
onClick === null || onClick === void 0 || onClick(to);
|
|
35
|
-
}, [
|
|
32
|
+
}, [onClick, to]);
|
|
36
33
|
return /*#__PURE__*/React.createElement("div", {
|
|
37
34
|
className: classNames(e(_templateObject || (_templateObject = _taggedTemplateLiteral(["item"]))), props.className),
|
|
38
35
|
style: props.style,
|
package/dist/Switch/Switch.js
CHANGED
|
@@ -40,6 +40,8 @@ var Switch = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
40
40
|
inactiveValue = _props.inactiveValue,
|
|
41
41
|
activeIcon = _props.activeIcon,
|
|
42
42
|
inactiveIcon = _props.inactiveIcon,
|
|
43
|
+
activeAction = _props.activeAction,
|
|
44
|
+
inactiveAction = _props.inactiveAction,
|
|
43
45
|
loading = _props.loading,
|
|
44
46
|
className = _props.className,
|
|
45
47
|
style = _props.style,
|
|
@@ -84,10 +86,10 @@ var Switch = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
84
86
|
var borderColor = useMemo(function () {
|
|
85
87
|
return active ? props.borderColor || currentColor : currentColor;
|
|
86
88
|
}, [active, props.borderColor, currentColor]);
|
|
87
|
-
var handleChange = useCallback(function () {
|
|
89
|
+
var handleChange = useCallback(function (event) {
|
|
88
90
|
var val = active ? inactiveValue : activeValue;
|
|
89
91
|
setValue(val);
|
|
90
|
-
onChange === null || onChange === void 0 || onChange(val, !active);
|
|
92
|
+
onChange === null || onChange === void 0 || onChange(val, !active, event);
|
|
91
93
|
}, [active, activeValue, inactiveValue, onChange, setValue]);
|
|
92
94
|
var switchValue = useCallback(function (event) {
|
|
93
95
|
event.preventDefault();
|
|
@@ -95,7 +97,7 @@ var Switch = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
95
97
|
return;
|
|
96
98
|
}
|
|
97
99
|
if (!beforeChange) {
|
|
98
|
-
handleChange();
|
|
100
|
+
handleChange(event);
|
|
99
101
|
onClick === null || onClick === void 0 || onClick();
|
|
100
102
|
return;
|
|
101
103
|
}
|
|
@@ -109,14 +111,14 @@ var Switch = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
109
111
|
if (shouldChange instanceof Promise) {
|
|
110
112
|
shouldChange.then(function (result) {
|
|
111
113
|
if (result) {
|
|
112
|
-
handleChange();
|
|
114
|
+
handleChange(event);
|
|
113
115
|
onClick === null || onClick === void 0 || onClick();
|
|
114
116
|
}
|
|
115
117
|
}).catch(function (event1) {
|
|
116
118
|
warning(false, event1);
|
|
117
119
|
});
|
|
118
120
|
} else if (shouldChange) {
|
|
119
|
-
handleChange();
|
|
121
|
+
handleChange(event);
|
|
120
122
|
onClick === null || onClick === void 0 || onClick();
|
|
121
123
|
}
|
|
122
124
|
}, [beforeChange, disabled, handleChange, onClick]);
|
|
@@ -143,6 +145,17 @@ var Switch = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
143
145
|
}
|
|
144
146
|
return null;
|
|
145
147
|
}, [active, activeIcon, activeText, e, em, is]);
|
|
148
|
+
var actions = useMemo(function () {
|
|
149
|
+
if (active && activeAction) {
|
|
150
|
+
return typeof activeIcon === 'string' ? /*#__PURE__*/React.createElement(Icon, {
|
|
151
|
+
name: activeIcon
|
|
152
|
+
}) : activeAction;
|
|
153
|
+
} else if (!active && inactiveAction) {
|
|
154
|
+
return typeof inactiveAction === 'string' ? /*#__PURE__*/React.createElement(Icon, {
|
|
155
|
+
name: inactiveAction
|
|
156
|
+
}) : inactiveAction;
|
|
157
|
+
}
|
|
158
|
+
}, [active, activeAction, activeIcon, inactiveAction]);
|
|
146
159
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
147
160
|
className: classNames(b(), m(_defineProperty({}, size, size)), is({
|
|
148
161
|
disabled: disabled,
|
|
@@ -176,17 +189,37 @@ var Switch = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
176
189
|
}
|
|
177
190
|
}, inlinePrompt && /*#__PURE__*/React.createElement("div", {
|
|
178
191
|
className: e(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["inner"])))
|
|
179
|
-
}, !active ?
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
192
|
+
}, !active ? function () {
|
|
193
|
+
if (activeText) {
|
|
194
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
195
|
+
className: "is-text"
|
|
196
|
+
}, activeText);
|
|
197
|
+
} else if (activeIcon) {
|
|
198
|
+
if (typeof activeIcon === 'string') {
|
|
199
|
+
/*#__PURE__*/React.createElement(Icon, {
|
|
200
|
+
className: "is-icon",
|
|
201
|
+
name: activeIcon
|
|
202
|
+
});
|
|
203
|
+
} else {
|
|
204
|
+
return activeIcon;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}() : null, active ? function () {
|
|
208
|
+
if (inactiveText) {
|
|
209
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
210
|
+
className: "is-text"
|
|
211
|
+
}, inactiveText);
|
|
212
|
+
} else if (inactiveIcon) {
|
|
213
|
+
if (typeof inactiveIcon === 'string') {
|
|
214
|
+
/*#__PURE__*/React.createElement(Icon, {
|
|
215
|
+
className: "is-icon",
|
|
216
|
+
name: inactiveIcon
|
|
217
|
+
});
|
|
218
|
+
} else {
|
|
219
|
+
return inactiveIcon;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}() : null), /*#__PURE__*/React.createElement("div", {
|
|
190
223
|
className: e(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["action"]))),
|
|
191
224
|
style: {
|
|
192
225
|
color: currentColor
|
|
@@ -194,6 +227,6 @@ var Switch = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
194
227
|
}, loading ? /*#__PURE__*/React.createElement(Icon, {
|
|
195
228
|
name: "spinner",
|
|
196
229
|
spin: true
|
|
197
|
-
}) :
|
|
230
|
+
}) : actions)), !inlinePrompt && trueLabel);
|
|
198
231
|
});
|
|
199
232
|
export default Switch;
|
package/dist/Switch/typings.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export interface SwitchProps<V = ValueType> extends Omit<FormControlBaseProps<V>
|
|
|
17
17
|
activeIcon?: IconName | React.ReactElement<any>;
|
|
18
18
|
/** switch 的状态为 off 时的文字描述 */
|
|
19
19
|
inactiveIcon?: IconName | React.ReactElement<any>;
|
|
20
|
+
/** on状态下显示的图标组件 */
|
|
21
|
+
activeAction?: IconName | React.ReactElement<any>;
|
|
22
|
+
/** off状态下显示的图标组件 */
|
|
23
|
+
inactiveAction?: IconName | React.ReactElement<any>;
|
|
20
24
|
/** 当在 on 状态时的背景颜色 */
|
|
21
25
|
activeColor?: string;
|
|
22
26
|
/** off 状态时的背景颜色 */
|
package/dist/Tooltip/Tooltip.js
CHANGED
|
@@ -182,7 +182,8 @@ var Tooltip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
182
182
|
},
|
|
183
183
|
onMouseEnter: enterable && trigger === 'hover' ? handleMouseEnter : noop,
|
|
184
184
|
onMouseLeave: enterable && trigger === 'hover' ? handleMouseLeave : noop,
|
|
185
|
-
className: classNames(
|
|
185
|
+
className: classNames(props.popperClass, _defineProperty({}, e(_templateObject || (_templateObject = _taggedTemplateLiteral(["popper"]))), classPrefix === 'tooltip')),
|
|
186
|
+
effect: effect,
|
|
186
187
|
unmountOnExit: unmountOnExit
|
|
187
188
|
}, popperProps, transitionProps), /*#__PURE__*/React.createElement(TooltipContext.Provider, {
|
|
188
189
|
value: {
|