@sheinx/shineout-style 3.9.10 → 3.9.11-beta.3
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/cjs/button/button-group.d.ts +5 -0
- package/cjs/button/button-group.d.ts.map +1 -0
- package/cjs/button/button-group.js +274 -0
- package/cjs/button/button.d.ts.map +1 -1
- package/cjs/button/button.js +0 -303
- package/cjs/button/index.d.ts +3 -0
- package/cjs/button/index.d.ts.map +1 -1
- package/cjs/button/index.js +9 -1
- package/cjs/jss-style/index.d.ts +1 -0
- package/cjs/jss-style/index.d.ts.map +1 -1
- package/cjs/jss-style/index.js +2 -2
- package/cjs/table/table.d.ts.map +1 -1
- package/cjs/table/table.js +15 -29
- package/cjs/version.d.ts +1 -1
- package/cjs/version.d.ts.map +1 -1
- package/cjs/version.js +1 -1
- package/esm/button/button-group.d.ts +5 -0
- package/esm/button/button-group.d.ts.map +1 -0
- package/esm/button/button-group.js +267 -0
- package/esm/button/button.d.ts.map +1 -1
- package/esm/button/button.js +0 -303
- package/esm/button/index.d.ts +3 -0
- package/esm/button/index.d.ts.map +1 -1
- package/esm/button/index.js +3 -0
- package/esm/jss-style/index.d.ts +1 -0
- package/esm/jss-style/index.d.ts.map +1 -1
- package/esm/jss-style/index.js +1 -1
- package/esm/table/table.d.ts.map +1 -1
- package/esm/table/table.js +15 -29
- package/esm/version.d.ts +1 -1
- package/esm/version.d.ts.map +1 -1
- package/esm/version.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["button-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AA6KlD,QAAA,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,kBAAkB,CAgKxD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _jssStyle = require("../jss-style");
|
|
8
|
+
var _theme = _interopRequireDefault(require("@sheinx/theme"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
+
// 引用 button stylesheet 的常量类名(元素同时拥有 hash class 和常量 class)
|
|
17
|
+
var bc = function bc(key) {
|
|
18
|
+
return ".".concat(_jssStyle.prefix, "-button-").concat(key);
|
|
19
|
+
};
|
|
20
|
+
var beforeLine = function beforeLine() {
|
|
21
|
+
return _defineProperty(_defineProperty({
|
|
22
|
+
'&::before': {
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
content: '" "',
|
|
25
|
+
height: 'calc(50% - 2px)',
|
|
26
|
+
top: 'calc(25% + 1px)',
|
|
27
|
+
width: 1,
|
|
28
|
+
background: _theme.default.buttonSplitlineFullBackgroundColor
|
|
29
|
+
},
|
|
30
|
+
'&[dir=ltr]::before': {
|
|
31
|
+
left: -1
|
|
32
|
+
},
|
|
33
|
+
'&[dir=rtl]::before': {
|
|
34
|
+
right: -1
|
|
35
|
+
}
|
|
36
|
+
}, "&".concat(bc('dashed'), ":hover"), _defineProperty({
|
|
37
|
+
'&::before': {
|
|
38
|
+
height: '100%',
|
|
39
|
+
top: 0,
|
|
40
|
+
bottom: 0,
|
|
41
|
+
borderLeft: '1px dashed currentColor',
|
|
42
|
+
background: 'none'
|
|
43
|
+
},
|
|
44
|
+
// 使用 ::after 在右侧创建分割线,颜色使用当前按钮的 currentColor
|
|
45
|
+
'&:not(:last-child)::after': {
|
|
46
|
+
content: '" "',
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
height: '100%',
|
|
49
|
+
top: 0,
|
|
50
|
+
width: 1,
|
|
51
|
+
borderLeft: '1px dashed currentColor',
|
|
52
|
+
background: 'none',
|
|
53
|
+
zIndex: 1
|
|
54
|
+
},
|
|
55
|
+
'&:not(:last-child)[dir=ltr]::after': {
|
|
56
|
+
right: -1
|
|
57
|
+
},
|
|
58
|
+
'&:not(:last-child)[dir=rtl]::after': {
|
|
59
|
+
left: -1
|
|
60
|
+
}
|
|
61
|
+
}, "& + ".concat(bc('button'), "::before"), {
|
|
62
|
+
opacity: 0
|
|
63
|
+
})), "&:not(".concat(bc('disabled'), "):not(").concat(bc('dashed'), "):hover"), _defineProperty({
|
|
64
|
+
'&::before': {
|
|
65
|
+
background: 'transparent'
|
|
66
|
+
}
|
|
67
|
+
}, "& + ".concat(bc('button'), ",& + * ").concat(bc('button')), {
|
|
68
|
+
'&::before': {
|
|
69
|
+
background: 'transparent'
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
var outlineBeforeLine = function outlineBeforeLine(type, styles) {
|
|
74
|
+
return _defineProperty({
|
|
75
|
+
'&::before': {
|
|
76
|
+
position: 'absolute',
|
|
77
|
+
content: '" "',
|
|
78
|
+
height: 'calc(50% - 2px)',
|
|
79
|
+
top: 'calc(25% + 1px)',
|
|
80
|
+
width: 1,
|
|
81
|
+
background: _theme.default["button".concat(type).concat(styles, "BorderColor")]
|
|
82
|
+
},
|
|
83
|
+
'&[dir=ltr]::before': {
|
|
84
|
+
left: -1
|
|
85
|
+
},
|
|
86
|
+
'&[dir=rtl]::before': {
|
|
87
|
+
right: -1
|
|
88
|
+
},
|
|
89
|
+
'&:not(:disabled):hover': _defineProperty(_defineProperty({
|
|
90
|
+
// before
|
|
91
|
+
'&::before': {
|
|
92
|
+
height: 'calc(100% + 1.8px)',
|
|
93
|
+
top: -0.8,
|
|
94
|
+
left: -1,
|
|
95
|
+
width: 1,
|
|
96
|
+
background: _theme.default["button".concat(type).concat(styles, "HoverBorderColor")]
|
|
97
|
+
}
|
|
98
|
+
}, "& + ".concat(bc('button'), ",& + * ").concat(bc('button')), {
|
|
99
|
+
'&::before': {
|
|
100
|
+
height: 'calc(100% + 1.8px)',
|
|
101
|
+
top: -0.8,
|
|
102
|
+
left: -1,
|
|
103
|
+
width: 1,
|
|
104
|
+
background: _theme.default["button".concat(type).concat(styles, "HoverBorderColor")]
|
|
105
|
+
}
|
|
106
|
+
}), '&:active', _defineProperty({
|
|
107
|
+
'&::before': {
|
|
108
|
+
background: _theme.default["button".concat(type).concat(styles, "ActiveBorderColor")]
|
|
109
|
+
}
|
|
110
|
+
}, "& + ".concat(bc('button'), ",& + * ").concat(bc('button')), {
|
|
111
|
+
'&::before': {
|
|
112
|
+
background: _theme.default["button".concat(type).concat(styles, "ActiveBorderColor")]
|
|
113
|
+
}
|
|
114
|
+
}))
|
|
115
|
+
}, "&".concat(bc('primary'), ",&").concat(bc('success'), ",&").concat(bc('warning'), ",&").concat(bc('danger'), ",").concat(bc('secondary')), {
|
|
116
|
+
'&::before': {
|
|
117
|
+
height: 'calc(100% + 2px)',
|
|
118
|
+
top: -1,
|
|
119
|
+
left: -1,
|
|
120
|
+
width: 1,
|
|
121
|
+
bottom: -1,
|
|
122
|
+
background: "".concat(_theme.default["button".concat(type).concat(styles, "BorderColor")])
|
|
123
|
+
},
|
|
124
|
+
'& + :not(&)': {
|
|
125
|
+
'&::before': {
|
|
126
|
+
height: 'calc(100% + 2px)',
|
|
127
|
+
top: -1,
|
|
128
|
+
left: -1,
|
|
129
|
+
width: 1,
|
|
130
|
+
bottom: -1,
|
|
131
|
+
background: _theme.default["button".concat(type).concat(styles, "BorderColor")]
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
'&:disabled': {
|
|
135
|
+
'&::before': {
|
|
136
|
+
background: _theme.default["button".concat(type).concat(styles, "DisabledBorderColor")]
|
|
137
|
+
},
|
|
138
|
+
'& + :not(&)': {
|
|
139
|
+
'&::before': {
|
|
140
|
+
background: _theme.default["button".concat(type).concat(styles, "DisabledBorderColor")]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
var textBeforeLine = function textBeforeLine() {
|
|
147
|
+
return _defineProperty({
|
|
148
|
+
'&::before': {
|
|
149
|
+
transition: 'all 0.3s',
|
|
150
|
+
position: 'absolute',
|
|
151
|
+
content: '" "',
|
|
152
|
+
height: 'calc(50% - 2px)',
|
|
153
|
+
top: 'calc(25% + 1px)',
|
|
154
|
+
width: 1,
|
|
155
|
+
background: _theme.default.buttonSplitlineOutlineBackgroundColor
|
|
156
|
+
},
|
|
157
|
+
'&[dir=ltr]::before': {
|
|
158
|
+
left: -1
|
|
159
|
+
},
|
|
160
|
+
'&[dir=rtl]::before': {
|
|
161
|
+
right: -1
|
|
162
|
+
}
|
|
163
|
+
}, "&:not(".concat(bc('disabled'), "):hover"), _defineProperty({
|
|
164
|
+
'&::before': {
|
|
165
|
+
background: 'transparent'
|
|
166
|
+
}
|
|
167
|
+
}, "& + ".concat(bc('button'), ",& + * ").concat(bc('button')), {
|
|
168
|
+
'&::before': {
|
|
169
|
+
background: 'transparent'
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
172
|
+
};
|
|
173
|
+
var ButtonGroupStyle = {
|
|
174
|
+
rootClass: {},
|
|
175
|
+
group: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
176
|
+
// 2.x 之前非 inline-block
|
|
177
|
+
display: 'inline-flex',
|
|
178
|
+
// 处理 dropdown 下的 button
|
|
179
|
+
'& [data-role="dropdown"]': _defineProperty(_defineProperty({}, "& ".concat(bc('button')), {
|
|
180
|
+
height: '100%'
|
|
181
|
+
}), '& [data-role="caret"]', {
|
|
182
|
+
margin: 0
|
|
183
|
+
})
|
|
184
|
+
}, "& > :first-child".concat(bc('button'), ",& > :first-child ").concat(bc('button')), {
|
|
185
|
+
'&::before': {
|
|
186
|
+
display: 'none'
|
|
187
|
+
}
|
|
188
|
+
}), "& > :first-child:not(:last-child)".concat(bc('button'), ",& > :first-child:not(:last-child) ").concat(bc('button')), {
|
|
189
|
+
'&[dir=ltr]': {
|
|
190
|
+
borderTopRightRadius: 0,
|
|
191
|
+
borderBottomRightRadius: 0,
|
|
192
|
+
borderRight: 'none'
|
|
193
|
+
},
|
|
194
|
+
'&[dir=rtl]': {
|
|
195
|
+
borderTopLeftRadius: 0,
|
|
196
|
+
borderBottomLeftRadius: 0,
|
|
197
|
+
borderRight: 'none'
|
|
198
|
+
}
|
|
199
|
+
}), "& > :last-child:not(:first-child)".concat(bc('button'), ",& > :last-child:not(:first-child) ").concat(bc('button')), {
|
|
200
|
+
'&[dir=ltr]': {
|
|
201
|
+
borderTopLeftRadius: 0,
|
|
202
|
+
borderBottomLeftRadius: 0,
|
|
203
|
+
borderLeft: 'none'
|
|
204
|
+
},
|
|
205
|
+
'&[dir=rtl]': {
|
|
206
|
+
borderTopRightRadius: 0,
|
|
207
|
+
borderBottomRightRadius: 0,
|
|
208
|
+
borderLeft: 'none'
|
|
209
|
+
}
|
|
210
|
+
}), "& > :not(:first-child):not(:last-child)".concat(bc('button'), ",& > :not(:first-child):not(:last-child) ").concat(bc('button')), {
|
|
211
|
+
borderRadius: 0,
|
|
212
|
+
borderLeft: 'none',
|
|
213
|
+
borderRight: 'none'
|
|
214
|
+
}), "& ".concat(bc('button'), ":not(").concat(bc('outline'), "):not(").concat(bc('text'), ")"), _defineProperty(_defineProperty(_defineProperty({
|
|
215
|
+
position: 'relative',
|
|
216
|
+
'&::before': {
|
|
217
|
+
transition: 'all 0.3s'
|
|
218
|
+
}
|
|
219
|
+
}, "&".concat(bc('secondary')), _objectSpread(_objectSpread({}, beforeLine()), {}, _defineProperty({
|
|
220
|
+
'&::before': {
|
|
221
|
+
position: 'absolute',
|
|
222
|
+
content: '" "',
|
|
223
|
+
height: 'calc(50% - 2px)',
|
|
224
|
+
top: 'calc(25% + 1px)',
|
|
225
|
+
width: 1,
|
|
226
|
+
background: _theme.default.buttonSplitlineOutlineBackgroundColor,
|
|
227
|
+
transition: 'none'
|
|
228
|
+
},
|
|
229
|
+
'&[dir=ltr]::before': {
|
|
230
|
+
left: -1
|
|
231
|
+
},
|
|
232
|
+
'&[dir=rtl]::before': {
|
|
233
|
+
right: -1
|
|
234
|
+
}
|
|
235
|
+
}, "& + :not(&),& + * ".concat(bc('button'), ":not(&)"), {
|
|
236
|
+
'&::before': {
|
|
237
|
+
background: 'transparent'
|
|
238
|
+
}
|
|
239
|
+
}))), "&".concat(bc('primary'), ",&").concat(bc('success'), ",&").concat(bc('warning'), ",&").concat(bc('danger')), _objectSpread({}, beforeLine())), "&".concat(bc('primary'), ",&").concat(bc('success'), ",&").concat(bc('warning'), ",&").concat(bc('danger'), ",").concat(bc('secondary')), _defineProperty(_defineProperty({}, "& + :not(&),& + * ".concat(bc('button'), ":not(&)"), {
|
|
240
|
+
'&::before': {
|
|
241
|
+
background: 'transparent'
|
|
242
|
+
}
|
|
243
|
+
}), "& + ".concat(bc('button'), ":not(&)"), {
|
|
244
|
+
'&::before': {
|
|
245
|
+
background: 'transparent'
|
|
246
|
+
}
|
|
247
|
+
}))), "& ".concat(bc('outline')), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
248
|
+
position: 'relative',
|
|
249
|
+
'&::before': {
|
|
250
|
+
transition: 'all 0.3s'
|
|
251
|
+
}
|
|
252
|
+
}, "&".concat(bc('secondary')), _objectSpread(_objectSpread({}, outlineBeforeLine('Secondary', 'Outline')), {}, {
|
|
253
|
+
'&::before': {
|
|
254
|
+
position: 'absolute',
|
|
255
|
+
content: '" "',
|
|
256
|
+
height: 'calc(50% - 2px)',
|
|
257
|
+
top: 'calc(25% + 1px)',
|
|
258
|
+
width: 1,
|
|
259
|
+
background: _theme.default.buttonSplitlineOutlineBackgroundColor // Neutral-border-1
|
|
260
|
+
},
|
|
261
|
+
'&[dir=ltr]::before': {
|
|
262
|
+
left: -1
|
|
263
|
+
},
|
|
264
|
+
'&[dir=rtl]::before': {
|
|
265
|
+
right: -1
|
|
266
|
+
}
|
|
267
|
+
})), "&".concat(bc('primary')), _objectSpread({}, outlineBeforeLine('Primary', 'Outline'))), "&".concat(bc('success')), _objectSpread({}, outlineBeforeLine('Success', 'Outline'))), "&".concat(bc('warning')), _objectSpread({}, outlineBeforeLine('Warning', 'Outline'))), "&".concat(bc('danger')), _objectSpread({}, outlineBeforeLine('Danger', 'Outline')))), "& ".concat(bc('text')), _objectSpread({
|
|
268
|
+
position: 'relative'
|
|
269
|
+
}, textBeforeLine())), "&".concat(bc('dashed')), {
|
|
270
|
+
position: 'relative',
|
|
271
|
+
borderStyle: 'none'
|
|
272
|
+
})
|
|
273
|
+
};
|
|
274
|
+
var _default = exports.default = ButtonGroupStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AA8C7C,QAAA,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,aAAa,CAkP9C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/cjs/button/button.js
CHANGED
|
@@ -42,172 +42,6 @@ var button = function button(type, styles) {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
|
-
var beforeLine = function beforeLine() {
|
|
46
|
-
return {
|
|
47
|
-
'&::before': {
|
|
48
|
-
position: 'absolute',
|
|
49
|
-
content: '" "',
|
|
50
|
-
height: 'calc(50% - 2px)',
|
|
51
|
-
top: 'calc(25% + 1px)',
|
|
52
|
-
width: 1,
|
|
53
|
-
background: _theme.default.buttonSplitlineFullBackgroundColor
|
|
54
|
-
},
|
|
55
|
-
'&[dir=ltr]::before': {
|
|
56
|
-
left: -1
|
|
57
|
-
},
|
|
58
|
-
'&[dir=rtl]::before': {
|
|
59
|
-
right: -1
|
|
60
|
-
},
|
|
61
|
-
'&$dashed:hover': {
|
|
62
|
-
'&::before': {
|
|
63
|
-
height: '100%',
|
|
64
|
-
top: 0,
|
|
65
|
-
bottom: 0,
|
|
66
|
-
borderLeft: '1px dashed currentColor',
|
|
67
|
-
background: 'none'
|
|
68
|
-
},
|
|
69
|
-
// 使用 ::after 在右侧创建分割线,颜色使用当前按钮的 currentColor
|
|
70
|
-
'&:not(:last-child)::after': {
|
|
71
|
-
content: '" "',
|
|
72
|
-
position: 'absolute',
|
|
73
|
-
height: '100%',
|
|
74
|
-
top: 0,
|
|
75
|
-
width: 1,
|
|
76
|
-
borderLeft: '1px dashed currentColor',
|
|
77
|
-
background: 'none',
|
|
78
|
-
zIndex: 1
|
|
79
|
-
},
|
|
80
|
-
'&:not(:last-child)[dir=ltr]::after': {
|
|
81
|
-
right: -1
|
|
82
|
-
},
|
|
83
|
-
'&:not(:last-child)[dir=rtl]::after': {
|
|
84
|
-
left: -1
|
|
85
|
-
},
|
|
86
|
-
// 隐藏相邻按钮的左侧分割线,因为已经被 ::after 覆盖了
|
|
87
|
-
'& + $button::before': {
|
|
88
|
-
opacity: 0
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
'&:not($disabled):not($dashed):hover': {
|
|
92
|
-
'&::before': {
|
|
93
|
-
background: 'transparent'
|
|
94
|
-
},
|
|
95
|
-
'& + $button,& + * $button': {
|
|
96
|
-
'&::before': {
|
|
97
|
-
background: 'transparent'
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
var outlineBeforeLine = function outlineBeforeLine(type, styles) {
|
|
104
|
-
return {
|
|
105
|
-
'&::before': {
|
|
106
|
-
position: 'absolute',
|
|
107
|
-
content: '" "',
|
|
108
|
-
height: 'calc(50% - 2px)',
|
|
109
|
-
top: 'calc(25% + 1px)',
|
|
110
|
-
width: 1,
|
|
111
|
-
background: _theme.default["button".concat(type).concat(styles, "BorderColor")]
|
|
112
|
-
},
|
|
113
|
-
'&[dir=ltr]::before': {
|
|
114
|
-
left: -1
|
|
115
|
-
},
|
|
116
|
-
'&[dir=rtl]::before': {
|
|
117
|
-
right: -1
|
|
118
|
-
},
|
|
119
|
-
'&:not(:disabled):hover': {
|
|
120
|
-
// before
|
|
121
|
-
'&::before': {
|
|
122
|
-
height: 'calc(100% + 1.8px)',
|
|
123
|
-
top: -0.8,
|
|
124
|
-
left: -1,
|
|
125
|
-
width: 1,
|
|
126
|
-
background: _theme.default["button".concat(type).concat(styles, "HoverBorderColor")]
|
|
127
|
-
},
|
|
128
|
-
'& + $button,& + * $button': {
|
|
129
|
-
'&::before': {
|
|
130
|
-
height: 'calc(100% + 1.8px)',
|
|
131
|
-
top: -0.8,
|
|
132
|
-
left: -1,
|
|
133
|
-
width: 1,
|
|
134
|
-
background: _theme.default["button".concat(type).concat(styles, "HoverBorderColor")]
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
// active
|
|
138
|
-
'&:active': {
|
|
139
|
-
'&::before': {
|
|
140
|
-
background: _theme.default["button".concat(type).concat(styles, "ActiveBorderColor")]
|
|
141
|
-
},
|
|
142
|
-
'& + $button,& + * $button': {
|
|
143
|
-
'&::before': {
|
|
144
|
-
background: _theme.default["button".concat(type).concat(styles, "ActiveBorderColor")]
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
'&$primary,&$success,&$warning,&$danger,$secondary': {
|
|
150
|
-
'&::before': {
|
|
151
|
-
height: 'calc(100% + 2px)',
|
|
152
|
-
top: -1,
|
|
153
|
-
left: -1,
|
|
154
|
-
width: 1,
|
|
155
|
-
bottom: -1,
|
|
156
|
-
background: "".concat(_theme.default["button".concat(type).concat(styles, "BorderColor")])
|
|
157
|
-
},
|
|
158
|
-
'& + :not(&)': {
|
|
159
|
-
'&::before': {
|
|
160
|
-
height: 'calc(100% + 2px)',
|
|
161
|
-
top: -1,
|
|
162
|
-
left: -1,
|
|
163
|
-
width: 1,
|
|
164
|
-
bottom: -1,
|
|
165
|
-
background: _theme.default["button".concat(type).concat(styles, "BorderColor")]
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
'&:disabled': {
|
|
169
|
-
'&::before': {
|
|
170
|
-
background: _theme.default["button".concat(type).concat(styles, "DisabledBorderColor")]
|
|
171
|
-
},
|
|
172
|
-
'& + :not(&)': {
|
|
173
|
-
'&::before': {
|
|
174
|
-
background: _theme.default["button".concat(type).concat(styles, "DisabledBorderColor")]
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
var textBeforeLine = function textBeforeLine() {
|
|
182
|
-
return {
|
|
183
|
-
'&::before': {
|
|
184
|
-
transition: 'all 0.3s',
|
|
185
|
-
position: 'absolute',
|
|
186
|
-
content: '" "',
|
|
187
|
-
height: 'calc(50% - 2px)',
|
|
188
|
-
top: 'calc(25% + 1px)',
|
|
189
|
-
width: 1,
|
|
190
|
-
background: _theme.default.buttonSplitlineOutlineBackgroundColor
|
|
191
|
-
},
|
|
192
|
-
'&[dir=ltr]::before': {
|
|
193
|
-
left: -1
|
|
194
|
-
},
|
|
195
|
-
'&[dir=rtl]::before': {
|
|
196
|
-
right: -1
|
|
197
|
-
},
|
|
198
|
-
'&:not($disabled):hover': {
|
|
199
|
-
'&::before': {
|
|
200
|
-
background: 'transparent'
|
|
201
|
-
},
|
|
202
|
-
'& + $button,& + * $button': {
|
|
203
|
-
'&::before': {
|
|
204
|
-
background: 'transparent'
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
|
|
211
45
|
// const loading = (type: ButtonTypeWithoutLink, styles: ButtonStyleType) => {
|
|
212
46
|
// const buttonStyle = button(type, styles);
|
|
213
47
|
|
|
@@ -391,143 +225,6 @@ var ButtonStyle = {
|
|
|
391
225
|
// ...loading('Secondary', ''),
|
|
392
226
|
// },
|
|
393
227
|
},
|
|
394
|
-
groupItem: {},
|
|
395
|
-
group: {
|
|
396
|
-
// 2.x 之前非 inline-block
|
|
397
|
-
display: 'inline-flex',
|
|
398
|
-
// 处理 dropdown 下的 button
|
|
399
|
-
'& [data-role="dropdown"]': {
|
|
400
|
-
'& $button': {
|
|
401
|
-
height: '100%'
|
|
402
|
-
},
|
|
403
|
-
'& [data-role="caret"]': {
|
|
404
|
-
margin: 0
|
|
405
|
-
}
|
|
406
|
-
},
|
|
407
|
-
'& > :first-child$button,& > :first-child $button': {
|
|
408
|
-
'&::before': {
|
|
409
|
-
display: 'none'
|
|
410
|
-
}
|
|
411
|
-
},
|
|
412
|
-
// 第一个元素下的所有 button 标签的元素
|
|
413
|
-
'& > :first-child:not(:last-child)$button,& > :first-child:not(:last-child) $button': {
|
|
414
|
-
'&[dir=ltr]': {
|
|
415
|
-
borderTopRightRadius: 0,
|
|
416
|
-
borderBottomRightRadius: 0,
|
|
417
|
-
borderRight: 'none'
|
|
418
|
-
},
|
|
419
|
-
'&[dir=rtl]': {
|
|
420
|
-
borderTopLeftRadius: 0,
|
|
421
|
-
borderBottomLeftRadius: 0,
|
|
422
|
-
borderRight: 'none'
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
// 最后一个元素下的所有 button 标签的元素
|
|
426
|
-
'& > :last-child:not(:first-child)$button,& > :last-child:not(:first-child) $button': {
|
|
427
|
-
'&[dir=ltr]': {
|
|
428
|
-
borderTopLeftRadius: 0,
|
|
429
|
-
borderBottomLeftRadius: 0,
|
|
430
|
-
borderLeft: 'none'
|
|
431
|
-
},
|
|
432
|
-
'&[dir=rtl]': {
|
|
433
|
-
borderTopRightRadius: 0,
|
|
434
|
-
borderBottomRightRadius: 0,
|
|
435
|
-
borderLeft: 'none'
|
|
436
|
-
}
|
|
437
|
-
},
|
|
438
|
-
'& > :not(:first-child):not(:last-child)$button,& > :not(:first-child):not(:last-child) $button': {
|
|
439
|
-
borderRadius: 0,
|
|
440
|
-
borderLeft: 'none',
|
|
441
|
-
borderRight: 'none'
|
|
442
|
-
},
|
|
443
|
-
// 填充型 button
|
|
444
|
-
'& $button:not($outline):not($text)': {
|
|
445
|
-
position: 'relative',
|
|
446
|
-
'&::before': {
|
|
447
|
-
transition: 'all 0.3s'
|
|
448
|
-
},
|
|
449
|
-
// secondary 比较特殊,单独拎出来写覆盖掉 &::before
|
|
450
|
-
'&$secondary': _objectSpread(_objectSpread({}, beforeLine()), {}, {
|
|
451
|
-
'&::before': {
|
|
452
|
-
position: 'absolute',
|
|
453
|
-
content: '" "',
|
|
454
|
-
height: 'calc(50% - 2px)',
|
|
455
|
-
top: 'calc(25% + 1px)',
|
|
456
|
-
width: 1,
|
|
457
|
-
background: _theme.default.buttonSplitlineOutlineBackgroundColor,
|
|
458
|
-
transition: 'none'
|
|
459
|
-
},
|
|
460
|
-
'&[dir=ltr]::before': {
|
|
461
|
-
left: -1
|
|
462
|
-
},
|
|
463
|
-
'&[dir=rtl]::before': {
|
|
464
|
-
right: -1
|
|
465
|
-
},
|
|
466
|
-
'& + :not(&),& + * $button:not(&)': {
|
|
467
|
-
'&::before': {
|
|
468
|
-
background: 'transparent'
|
|
469
|
-
}
|
|
470
|
-
},
|
|
471
|
-
'& + $groupItem $button:not(&)': {
|
|
472
|
-
'&::before': {
|
|
473
|
-
background: 'transparent'
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
}),
|
|
477
|
-
// primary, success, warning, danger 分割线样式
|
|
478
|
-
'&$primary,&$success,&$warning,&$danger': _objectSpread({}, beforeLine()),
|
|
479
|
-
// priamry success warning danger secondary 两两之间如果不是紧挨着,则去除中间的分割线
|
|
480
|
-
'&$primary,&$success,&$warning,&$danger,$secondary': {
|
|
481
|
-
'& + :not(&),& + * $button:not(&)': {
|
|
482
|
-
'&::before': {
|
|
483
|
-
background: 'transparent'
|
|
484
|
-
}
|
|
485
|
-
},
|
|
486
|
-
'& + $button:not(&)': {
|
|
487
|
-
'&::before': {
|
|
488
|
-
background: 'transparent'
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
},
|
|
493
|
-
// outline 型 button
|
|
494
|
-
'& $outline': {
|
|
495
|
-
position: 'relative',
|
|
496
|
-
'&::before': {
|
|
497
|
-
transition: 'all 0.3s'
|
|
498
|
-
},
|
|
499
|
-
// secondary 比较特殊,单独拎出来写覆盖掉 &::before
|
|
500
|
-
'&$secondary': _objectSpread(_objectSpread({}, outlineBeforeLine('Secondary', 'Outline')), {}, {
|
|
501
|
-
'&::before': {
|
|
502
|
-
position: 'absolute',
|
|
503
|
-
content: '" "',
|
|
504
|
-
height: 'calc(50% - 2px)',
|
|
505
|
-
top: 'calc(25% + 1px)',
|
|
506
|
-
width: 1,
|
|
507
|
-
background: _theme.default.buttonSplitlineOutlineBackgroundColor // Neutral-border-1
|
|
508
|
-
},
|
|
509
|
-
'&[dir=ltr]::before': {
|
|
510
|
-
left: -1
|
|
511
|
-
},
|
|
512
|
-
'&[dir=rtl]::before': {
|
|
513
|
-
right: -1
|
|
514
|
-
}
|
|
515
|
-
}),
|
|
516
|
-
'&$primary': _objectSpread({}, outlineBeforeLine('Primary', 'Outline')),
|
|
517
|
-
'&$success': _objectSpread({}, outlineBeforeLine('Success', 'Outline')),
|
|
518
|
-
'&$warning': _objectSpread({}, outlineBeforeLine('Warning', 'Outline')),
|
|
519
|
-
'&$danger': _objectSpread({}, outlineBeforeLine('Danger', 'Outline'))
|
|
520
|
-
},
|
|
521
|
-
// text 型 button
|
|
522
|
-
'& $text': _objectSpread({
|
|
523
|
-
position: 'relative'
|
|
524
|
-
}, textBeforeLine()),
|
|
525
|
-
// dashed 型 button
|
|
526
|
-
'&$dashed': {
|
|
527
|
-
position: 'relative',
|
|
528
|
-
borderStyle: 'none'
|
|
529
|
-
}
|
|
530
|
-
},
|
|
531
228
|
spin: {
|
|
532
229
|
display: 'inline-block',
|
|
533
230
|
marginRight: _theme.default.buttonSpinMargin,
|
package/cjs/button/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import buttonStyle from './button';
|
|
2
|
+
import buttonGroupStyle from './button-group';
|
|
2
3
|
declare const useButtonStyle: () => import("jss").Classes<keyof import("@sheinx/base").ButtonClasses>;
|
|
4
|
+
declare const useButtonGroupStyle: () => import("jss").Classes<keyof import("@sheinx/base").ButtonGroupClasses>;
|
|
3
5
|
export { buttonStyle, useButtonStyle };
|
|
6
|
+
export { buttonGroupStyle, useButtonGroupStyle };
|
|
4
7
|
export default useButtonStyle;
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,UAAU,CAAC;AACnC,OAAO,gBAAgB,MAAM,gBAAgB,CAAC;AAE9C,QAAA,MAAM,cAAc,yEAAgC,CAAC;AACrD,QAAA,MAAM,mBAAmB,8EAA2C,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,CAAC;AACjD,eAAe,cAAc,CAAC"}
|
package/cjs/button/index.js
CHANGED
|
@@ -4,15 +4,23 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
Object.defineProperty(exports, "buttonGroupStyle", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _buttonGroup.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
7
13
|
Object.defineProperty(exports, "buttonStyle", {
|
|
8
14
|
enumerable: true,
|
|
9
15
|
get: function get() {
|
|
10
16
|
return _button.default;
|
|
11
17
|
}
|
|
12
18
|
});
|
|
13
|
-
exports.useButtonStyle = exports.default = void 0;
|
|
19
|
+
exports.useButtonStyle = exports.useButtonGroupStyle = exports.default = void 0;
|
|
14
20
|
var _jssStyle = require("../jss-style");
|
|
15
21
|
var _button = _interopRequireDefault(require("./button"));
|
|
22
|
+
var _buttonGroup = _interopRequireDefault(require("./button-group"));
|
|
16
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
24
|
var useButtonStyle = exports.useButtonStyle = (0, _jssStyle.styled)(_button.default, 'button');
|
|
25
|
+
var useButtonGroupStyle = exports.useButtonGroupStyle = (0, _jssStyle.styled)(_buttonGroup.default, 'button-group');
|
|
18
26
|
var _default = exports.default = useButtonStyle;
|
package/cjs/jss-style/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JssProvider, SheetsRegistry, jss } from 'react-jss';
|
|
2
2
|
import { JssStyle, GenerateId, Classes } from 'jss';
|
|
3
3
|
export { JssProvider, SheetsRegistry, jss };
|
|
4
|
+
export declare const prefix = "soui";
|
|
4
5
|
export declare const setJssConfig: (newConfig: {
|
|
5
6
|
generateId?: GenerateId;
|
|
6
7
|
styleAttributes?: Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAIpD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAIpD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC;AAC5C,eAAO,MAAM,MAAM,SAAS,CAAC;AAO7B,eAAO,MAAM,YAAY,cAAe;IACtC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C,SAEA,CAAC;AAEF,eAAO,MAAM,YAAY;;;CAAe,CAAC;AAezC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAIzF;AAiBD,MAAM,MAAM,QAAQ,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC;AAEhG,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;KACrD,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,MAAM,6CAA8C,MAAM,qBAsCtE,CAAC"}
|
package/cjs/jss-style/index.js
CHANGED
|
@@ -24,7 +24,7 @@ Object.defineProperty(exports, "jss", {
|
|
|
24
24
|
return _reactJss.jss;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
exports.styled = exports.setJssConfig = void 0;
|
|
27
|
+
exports.styled = exports.setJssConfig = exports.prefix = void 0;
|
|
28
28
|
var _reactJss = require("react-jss");
|
|
29
29
|
var _handleStyle = _interopRequireDefault(require("./handleStyle"));
|
|
30
30
|
var _version = _interopRequireDefault(require("../version"));
|
|
@@ -35,7 +35,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
35
35
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
36
36
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
37
37
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
38
|
-
var prefix = 'soui';
|
|
38
|
+
var prefix = exports.prefix = 'soui';
|
|
39
39
|
var config = {};
|
|
40
40
|
var setJssConfig = exports.setJssConfig = function setJssConfig(newConfig) {
|
|
41
41
|
Object.assign(config, newConfig);
|