@vnejs/plugins.view.coralina.choose 0.0.1 → 0.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.view.coralina.choose",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
package/view/index.jsx CHANGED
@@ -11,10 +11,15 @@ class Choose extends React.Component {
11
11
  onOptionClick = (e) =>
12
12
  this.props.emit(this.props.EVENTS.CHOOSE.OPTION, { index: Number(e.currentTarget.dataset.index) });
13
13
 
14
- renderOption = ({ text, disabled, hided, isCurrent }, index) =>
14
+ renderOption = ({ text, disabled, hided, coords: [x, y] }, index) =>
15
15
  !hided && (
16
16
  <div
17
- className={b("option", { disabled, isCurrent: index === this.state.currentItem }, ["textWrap_60"])}
17
+ className={b(
18
+ "option",
19
+ { disabled, isCurrent: index === this.state.currentItem, coords: Boolean(x) && Boolean(y) },
20
+ ["textWrap_60"]
21
+ )}
22
+ style={{ left: `${x}%`, top: `${y}%` }}
18
23
  data-index={index}
19
24
  key={index}
20
25
  onClick={disabled ? undefined : this.onOptionClick}
package/view/index.styl CHANGED
@@ -26,10 +26,18 @@
26
26
  color: rgba(255,255,255,0.6)
27
27
  transition: text-shadow 300ms, transform 300ms
28
28
 
29
+ &_coords
30
+ position: absolute
31
+ transform: translate(-50%, -50%)
32
+
29
33
  &:hover,
30
34
  &_isCurrent
31
35
  text-shadow: 0px 5px 25px rgba(255,255,255,0.75);
32
- transform: scale(1.5)
36
+ transform: scale(1.2)
37
+
38
+ &_coords:hover
39
+ &_coords&_isCurrent
40
+ transform: translate(-50%, -50%) scale(1.2)
33
41
 
34
42
  &_isShow
35
43
  opacity: 1