Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
daec90af
Commit
daec90af
authored
Dec 26, 2016
by
qingwei.li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SSR feature
parent
e181fec7
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
35 additions
and
25 deletions
+35
-25
build/deploy-ci.sh
build/deploy-ci.sh
+1
-1
packages/date-picker/src/picker.vue
packages/date-picker/src/picker.vue
+1
-0
packages/input-number/src/input-number.vue
packages/input-number/src/input-number.vue
+5
-10
packages/input/src/input.vue
packages/input/src/input.vue
+2
-3
packages/loading/src/directive.js
packages/loading/src/directive.js
+1
-0
packages/loading/src/index.js
packages/loading/src/index.js
+1
-0
packages/message-box/src/main.js
packages/message-box/src/main.js
+1
-0
packages/message/src/main.js
packages/message/src/main.js
+1
-0
packages/notification/src/main.js
packages/notification/src/main.js
+1
-0
packages/select/src/select.vue
packages/select/src/select.vue
+1
-0
packages/table/src/dropdown.js
packages/table/src/dropdown.js
+2
-1
packages/table/src/table-header.js
packages/table/src/table-header.js
+3
-1
packages/table/src/util.js
packages/table/src/util.js
+1
-1
packages/upload/src/iframe-upload.vue
packages/upload/src/iframe-upload.vue
+2
-2
packages/upload/src/index.vue
packages/upload/src/index.vue
+1
-1
src/utils/clickoutside.js
src/utils/clickoutside.js
+2
-1
src/utils/resize-event.js
src/utils/resize-event.js
+8
-4
src/utils/vue-popper.js
src/utils/vue-popper.js
+1
-0
No files found.
build/deploy-ci.sh
View file @
daec90af
...
@@ -42,7 +42,7 @@ if [ "$TRAVIS_TAG" ]; then
...
@@ -42,7 +42,7 @@ if [ "$TRAVIS_TAG" ]; then
export
SUB_FOLDER
=
$(
echo
"
$TRAVIS_TAG
"
|
grep
-o
-E
"
\d
+
\.\d
+"
)
export
SUB_FOLDER
=
$(
echo
"
$TRAVIS_TAG
"
|
grep
-o
-E
"
\d
+
\.\d
+"
)
echo
$SUB_FOLDER
echo
$SUB_FOLDER
SUB_FOLDER
=
'1.
0
'
SUB_FOLDER
=
'1.
1
'
mkdir
$SUB_FOLDER
mkdir
$SUB_FOLDER
rm
-rf
*
.js
*
.css
*
.map static
rm
-rf
*
.js
*
.css
*
.map static
rm
-rf
$SUB_FOLDER
/
**
rm
-rf
$SUB_FOLDER
/
**
...
...
packages/date-picker/src/picker.vue
View file @
daec90af
...
@@ -375,6 +375,7 @@ export default {
...
@@ -375,6 +375,7 @@ export default {
},
},
showPicker
()
{
showPicker
()
{
if
(
this
.
$isServer
)
return
;
if
(
!
this
.
picker
)
{
if
(
!
this
.
picker
)
{
this
.
panel
.
defaultValue
=
this
.
internalValue
;
this
.
panel
.
defaultValue
=
this
.
internalValue
;
this
.
picker
=
new
Vue
(
this
.
panel
).
$mount
(
document
.
createElement
(
'
div
'
));
this
.
picker
=
new
Vue
(
this
.
panel
).
$mount
(
document
.
createElement
(
'
div
'
));
...
...
packages/input-number/src/input-number.vue
View file @
daec90af
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</
template
>
</
template
>
<
template
slot=
"append"
v-if=
"$slots.append"
>
<
template
slot=
"append"
v-if=
"$slots.append"
>
<slot
name=
"append"
></slot>
<slot
name=
"append"
></slot>
</
template
>
</
template
>
</el-input>
</el-input>
<span
<span
v-if=
"controls"
v-if=
"controls"
...
@@ -79,11 +79,8 @@
...
@@ -79,11 +79,8 @@
let
interval
=
null
;
let
interval
=
null
;
let
startTime
;
let
startTime
;
const
handler
=
()
=>
{
const
handler
=
()
=>
vnode
.
context
[
binding
.
expression
]();
vnode
.
context
[
binding
.
expression
]();
const
clear
=
()
=>
{
};
const
clear
=
function
()
{
if
(
new
Date
()
-
startTime
<
100
)
{
if
(
new
Date
()
-
startTime
<
100
)
{
handler
();
handler
();
}
}
...
@@ -91,12 +88,10 @@
...
@@ -91,12 +88,10 @@
interval
=
null
;
interval
=
null
;
};
};
on
(
el
,
'
mousedown
'
,
function
()
{
on
(
el
,
'
mousedown
'
,
()
=>
{
startTime
=
new
Date
();
startTime
=
new
Date
();
once
(
document
,
'
mouseup
'
,
clear
);
once
(
document
,
'
mouseup
'
,
clear
);
interval
=
setInterval
(
function
()
{
interval
=
setInterval
(
handler
,
100
);
handler
();
},
100
);
});
});
}
}
}
}
...
...
packages/input/src/input.vue
View file @
daec90af
...
@@ -117,10 +117,9 @@
...
@@ -117,10 +117,9 @@
this
.
$refs
.
input
.
select
();
this
.
$refs
.
input
.
select
();
},
},
resizeTextarea
()
{
resizeTextarea
()
{
if
(
this
.
$isServer
)
return
;
var
{
autosize
,
type
}
=
this
;
var
{
autosize
,
type
}
=
this
;
if
(
!
autosize
||
type
!==
'
textarea
'
)
{
if
(
!
autosize
||
type
!==
'
textarea
'
)
return
;
return
;
}
const
minRows
=
autosize
.
minRows
;
const
minRows
=
autosize
.
minRows
;
const
maxRows
=
autosize
.
maxRows
;
const
maxRows
=
autosize
.
maxRows
;
...
...
packages/loading/src/directive.js
View file @
daec90af
...
@@ -3,6 +3,7 @@ import { addClass, removeClass } from 'wind-dom/src/class';
...
@@ -3,6 +3,7 @@ import { addClass, removeClass } from 'wind-dom/src/class';
let
Mask
=
Vue
.
extend
(
require
(
'
./loading.vue
'
));
let
Mask
=
Vue
.
extend
(
require
(
'
./loading.vue
'
));
exports
.
install
=
Vue
=>
{
exports
.
install
=
Vue
=>
{
if
(
Vue
.
prototype
.
$isServer
)
return
;
let
toggleLoading
=
(
el
,
binding
)
=>
{
let
toggleLoading
=
(
el
,
binding
)
=>
{
if
(
binding
.
value
)
{
if
(
binding
.
value
)
{
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
(()
=>
{
...
...
packages/loading/src/index.js
View file @
daec90af
...
@@ -61,6 +61,7 @@ const addStyle = (options, parent, instance) => {
...
@@ -61,6 +61,7 @@ const addStyle = (options, parent, instance) => {
};
};
const
Loading
=
(
options
=
{})
=>
{
const
Loading
=
(
options
=
{})
=>
{
if
(
Vue
.
prototype
.
$isServer
)
return
;
options
=
merge
({},
defaults
,
options
);
options
=
merge
({},
defaults
,
options
);
if
(
typeof
options
.
target
===
'
string
'
)
{
if
(
typeof
options
.
target
===
'
string
'
)
{
options
.
target
=
document
.
querySelector
(
options
.
target
);
options
.
target
=
document
.
querySelector
(
options
.
target
);
...
...
packages/message-box/src/main.js
View file @
daec90af
...
@@ -102,6 +102,7 @@ const showNextMsg = () => {
...
@@ -102,6 +102,7 @@ const showNextMsg = () => {
};
};
const
MessageBox
=
function
(
options
,
callback
)
{
const
MessageBox
=
function
(
options
,
callback
)
{
if
(
Vue
.
prototype
.
$isServer
)
return
;
if
(
typeof
options
===
'
string
'
)
{
if
(
typeof
options
===
'
string
'
)
{
options
=
{
options
=
{
message
:
options
message
:
options
...
...
packages/message/src/main.js
View file @
daec90af
...
@@ -7,6 +7,7 @@ let instances = [];
...
@@ -7,6 +7,7 @@ let instances = [];
let
seed
=
1
;
let
seed
=
1
;
var
Message
=
function
(
options
)
{
var
Message
=
function
(
options
)
{
if
(
Vue
.
prototype
.
$isServer
)
return
;
options
=
options
||
{};
options
=
options
||
{};
if
(
typeof
options
===
'
string
'
)
{
if
(
typeof
options
===
'
string
'
)
{
options
=
{
options
=
{
...
...
packages/notification/src/main.js
View file @
daec90af
...
@@ -7,6 +7,7 @@ let instances = [];
...
@@ -7,6 +7,7 @@ let instances = [];
let
seed
=
1
;
let
seed
=
1
;
var
Notification
=
function
(
options
)
{
var
Notification
=
function
(
options
)
{
if
(
Vue
.
prototype
.
$isServer
)
return
;
options
=
options
||
{};
options
=
options
||
{};
let
userOnClose
=
options
.
onClose
;
let
userOnClose
=
options
.
onClose
;
let
id
=
'
notification_
'
+
seed
++
;
let
id
=
'
notification_
'
+
seed
++
;
...
...
packages/select/src/select.vue
View file @
daec90af
...
@@ -299,6 +299,7 @@
...
@@ -299,6 +299,7 @@
},
},
options
(
val
)
{
options
(
val
)
{
if
(
this
.
$isServer
)
return
;
this
.
optionsAllDisabled
=
val
.
length
===
val
.
filter
(
item
=>
item
.
disabled
===
true
).
length
;
this
.
optionsAllDisabled
=
val
.
length
===
val
.
filter
(
item
=>
item
.
disabled
===
true
).
length
;
if
(
this
.
multiple
)
{
if
(
this
.
multiple
)
{
this
.
resetInputHeight
();
this
.
resetInputHeight
();
...
...
packages/table/src/dropdown.js
View file @
daec90af
import
Vue
from
'
vue
'
;
var
dropdowns
=
[];
var
dropdowns
=
[];
document
.
addEventListener
(
'
click
'
,
function
(
event
)
{
!
Vue
.
prototype
.
$isServer
&&
document
.
addEventListener
(
'
click
'
,
function
(
event
)
{
dropdowns
.
forEach
(
function
(
dropdown
)
{
dropdowns
.
forEach
(
function
(
dropdown
)
{
var
target
=
event
.
target
;
var
target
=
event
.
target
;
if
(
!
dropdown
||
!
dropdown
.
$el
)
return
;
if
(
!
dropdown
||
!
dropdown
.
$el
)
return
;
...
...
packages/table/src/table-header.js
View file @
daec90af
...
@@ -226,7 +226,7 @@ export default {
...
@@ -226,7 +226,7 @@ export default {
filterPanel
.
table
=
table
;
filterPanel
.
table
=
table
;
filterPanel
.
cell
=
cell
;
filterPanel
.
cell
=
cell
;
filterPanel
.
column
=
column
;
filterPanel
.
column
=
column
;
filterPanel
.
$mount
(
document
.
createElement
(
'
div
'
));
!
this
.
$isServer
&&
filterPanel
.
$mount
(
document
.
createElement
(
'
div
'
));
}
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -239,6 +239,7 @@ export default {
...
@@ -239,6 +239,7 @@ export default {
},
},
handleMouseDown
(
event
,
column
)
{
handleMouseDown
(
event
,
column
)
{
if
(
this
.
$isServer
)
return
;
if
(
column
.
children
&&
column
.
children
.
length
>
0
)
return
;
if
(
column
.
children
&&
column
.
children
.
length
>
0
)
return
;
/* istanbul ignore if */
/* istanbul ignore if */
if
(
this
.
draggingColumn
&&
this
.
border
)
{
if
(
this
.
draggingColumn
&&
this
.
border
)
{
...
@@ -329,6 +330,7 @@ export default {
...
@@ -329,6 +330,7 @@ export default {
},
},
handleMouseOut
()
{
handleMouseOut
()
{
if
(
this
.
$isServer
)
return
;
document
.
body
.
style
.
cursor
=
''
;
document
.
body
.
style
.
cursor
=
''
;
},
},
...
...
packages/table/src/util.js
View file @
daec90af
...
@@ -99,7 +99,7 @@ export const getColumnByCell = function(table, cell) {
...
@@ -99,7 +99,7 @@ export const getColumnByCell = function(table, cell) {
return
null
;
return
null
;
};
};
const
isFirefox
=
navigator
.
userAgent
.
toLowerCase
().
indexOf
(
'
firefox
'
)
>
-
1
;
const
isFirefox
=
typeof
navigator
!==
'
undefined
'
&&
navigator
.
userAgent
.
toLowerCase
().
indexOf
(
'
firefox
'
)
>
-
1
;
export
const
mousewheel
=
function
(
element
,
callback
)
{
export
const
mousewheel
=
function
(
element
,
callback
)
{
if
(
element
&&
element
.
addEventListener
)
{
if
(
element
&&
element
.
addEventListener
)
{
...
...
packages/upload/src/iframe-upload.vue
View file @
daec90af
...
@@ -113,7 +113,7 @@ export default {
...
@@ -113,7 +113,7 @@ export default {
},
},
mounted
()
{
mounted
()
{
window
.
addEventListener
(
'
message
'
,
(
event
)
=>
{
!
this
.
$isServer
&&
window
.
addEventListener
(
'
message
'
,
(
event
)
=>
{
var
targetOrigin
=
new
URL
(
this
.
action
).
origin
;
var
targetOrigin
=
new
URL
(
this
.
action
).
origin
;
if
(
event
.
origin
!==
targetOrigin
)
{
if
(
event
.
origin
!==
targetOrigin
)
{
return
false
;
return
false
;
...
@@ -158,7 +158,7 @@ export default {
...
@@ -158,7 +158,7 @@ export default {
on
-
change
=
{
this
.
handleChange
}
on
-
change
=
{
this
.
handleChange
}
accept
=
{
this
.
accept
}
>
accept
=
{
this
.
accept
}
>
<
/input
>
<
/input
>
<
input
type
=
"
hidden
"
name
=
"
documentDomain
"
value
=
{
document
.
domain
}
/
>
<
input
type
=
"
hidden
"
name
=
"
documentDomain
"
value
=
{
this
.
$isServer
?
''
:
document
.
domain
}
/
>
<
span
ref
=
"
data
"
><
/span
>
<
span
ref
=
"
data
"
><
/span
>
<
/form
>
<
/form
>
{
!
this
.
showCover
?
this
.
$slots
.
default
:
cover
}
{
!
this
.
showCover
?
this
.
$slots
.
default
:
cover
}
...
...
packages/upload/src/index.vue
View file @
daec90af
...
@@ -209,7 +209,7 @@ export default {
...
@@ -209,7 +209,7 @@ export default {
ref
:
'
upload-inner
'
ref
:
'
upload-inner
'
};
};
var
uploadComponent
=
typeof
FormData
!==
'
undefined
'
var
uploadComponent
=
t
his
.
$isServer
?
''
:
t
ypeof
FormData
!==
'
undefined
'
?
<
upload
{...
props
}
>
{
this
.
$slots
.
default
}
<
/upload
>
?
<
upload
{...
props
}
>
{
this
.
$slots
.
default
}
<
/upload
>
:
<
iframeUpload
{...
props
}
>
{
this
.
$slots
.
default
}
<
/iframeUpload>
;
:
<
iframeUpload
{...
props
}
>
{
this
.
$slots
.
default
}
<
/iframeUpload>
;
...
...
src/utils/clickoutside.js
View file @
daec90af
import
Vue
from
'
vue
'
;
import
{
on
}
from
'
wind-dom/src/event
'
;
import
{
on
}
from
'
wind-dom/src/event
'
;
const
nodeList
=
[];
const
nodeList
=
[];
const
ctx
=
'
@@clickoutsideContext
'
;
const
ctx
=
'
@@clickoutsideContext
'
;
on
(
document
,
'
click
'
,
e
=>
{
!
Vue
.
prototype
.
$isServer
&&
on
(
document
,
'
click
'
,
e
=>
{
nodeList
.
forEach
(
node
=>
node
[
ctx
].
documentHandler
(
e
));
nodeList
.
forEach
(
node
=>
node
[
ctx
].
documentHandler
(
e
));
});
});
/**
/**
...
...
src/utils/resize-event.js
View file @
daec90af
...
@@ -3,9 +3,11 @@
...
@@ -3,9 +3,11 @@
*
*
* version: 0.5.3
* version: 0.5.3
**/
**/
const
isServer
=
typeof
window
===
'
undefined
'
;
/* istanbul ignore next */
/* istanbul ignore next */
const
requestFrame
=
(
function
()
{
const
requestFrame
=
(
function
()
{
if
(
isServer
)
return
;
const
raf
=
window
.
requestAnimationFrame
||
window
.
mozRequestAnimationFrame
||
window
.
webkitRequestAnimationFrame
||
const
raf
=
window
.
requestAnimationFrame
||
window
.
mozRequestAnimationFrame
||
window
.
webkitRequestAnimationFrame
||
function
(
fn
)
{
function
(
fn
)
{
return
window
.
setTimeout
(
fn
,
20
);
return
window
.
setTimeout
(
fn
,
20
);
...
@@ -17,6 +19,7 @@ const requestFrame = (function() {
...
@@ -17,6 +19,7 @@ const requestFrame = (function() {
/* istanbul ignore next */
/* istanbul ignore next */
const
cancelFrame
=
(
function
()
{
const
cancelFrame
=
(
function
()
{
if
(
isServer
)
return
;
const
cancel
=
window
.
cancelAnimationFrame
||
window
.
mozCancelAnimationFrame
||
window
.
webkitCancelAnimationFrame
||
window
.
clearTimeout
;
const
cancel
=
window
.
cancelAnimationFrame
||
window
.
mozCancelAnimationFrame
||
window
.
webkitCancelAnimationFrame
||
window
.
clearTimeout
;
return
function
(
id
)
{
return
function
(
id
)
{
return
cancel
(
id
);
return
cancel
(
id
);
...
@@ -59,7 +62,7 @@ const scrollListener = function(event) {
...
@@ -59,7 +62,7 @@ const scrollListener = function(event) {
};
};
/* Detect CSS Animations support to detect element display/re-attach */
/* Detect CSS Animations support to detect element display/re-attach */
const
attachEvent
=
document
.
attachEvent
;
const
attachEvent
=
isServer
?
{}
:
document
.
attachEvent
;
const
DOM_PREFIXES
=
'
Webkit Moz O ms
'
.
split
(
'
'
);
const
DOM_PREFIXES
=
'
Webkit Moz O ms
'
.
split
(
'
'
);
const
START_EVENTS
=
'
webkitAnimationStart animationstart oAnimationStart MSAnimationStart
'
.
split
(
'
'
);
const
START_EVENTS
=
'
webkitAnimationStart animationstart oAnimationStart MSAnimationStart
'
.
split
(
'
'
);
const
RESIZE_ANIMATION_NAME
=
'
resizeanim
'
;
const
RESIZE_ANIMATION_NAME
=
'
resizeanim
'
;
...
@@ -68,7 +71,7 @@ let keyFramePrefix = '';
...
@@ -68,7 +71,7 @@ let keyFramePrefix = '';
let
animationStartEvent
=
'
animationstart
'
;
let
animationStartEvent
=
'
animationstart
'
;
/* istanbul ignore next */
/* istanbul ignore next */
if
(
!
attachEvent
)
{
if
(
!
attachEvent
&&
!
isServer
)
{
const
testElement
=
document
.
createElement
(
'
fakeelement
'
);
const
testElement
=
document
.
createElement
(
'
fakeelement
'
);
if
(
testElement
.
style
.
animationName
!==
undefined
)
{
if
(
testElement
.
style
.
animationName
!==
undefined
)
{
animation
=
true
;
animation
=
true
;
...
@@ -91,7 +94,7 @@ if (!attachEvent) {
...
@@ -91,7 +94,7 @@ if (!attachEvent) {
let
stylesCreated
=
false
;
let
stylesCreated
=
false
;
/* istanbul ignore next */
/* istanbul ignore next */
const
createStyles
=
function
()
{
const
createStyles
=
function
()
{
if
(
!
stylesCreated
)
{
if
(
!
stylesCreated
&&
!
isServer
)
{
const
animationKeyframes
=
`@
${
keyFramePrefix
}
keyframes
${
RESIZE_ANIMATION_NAME
}
{ from { opacity: 0; } to { opacity: 0; } } `
;
const
animationKeyframes
=
`@
${
keyFramePrefix
}
keyframes
${
RESIZE_ANIMATION_NAME
}
{ from { opacity: 0; } to { opacity: 0; } } `
;
const
animationStyle
=
`
${
keyFramePrefix
}
animation: 1ms
${
RESIZE_ANIMATION_NAME
}
;`
;
const
animationStyle
=
`
${
keyFramePrefix
}
animation: 1ms
${
RESIZE_ANIMATION_NAME
}
;`
;
...
@@ -119,6 +122,7 @@ const createStyles = function() {
...
@@ -119,6 +122,7 @@ const createStyles = function() {
/* istanbul ignore next */
/* istanbul ignore next */
export
const
addResizeListener
=
function
(
element
,
fn
)
{
export
const
addResizeListener
=
function
(
element
,
fn
)
{
if
(
isServer
)
return
;
if
(
attachEvent
)
{
if
(
attachEvent
)
{
element
.
attachEvent
(
'
onresize
'
,
fn
);
element
.
attachEvent
(
'
onresize
'
,
fn
);
}
else
{
}
else
{
...
@@ -162,4 +166,4 @@ export const removeResizeListener = function(element, fn) {
...
@@ -162,4 +166,4 @@ export const removeResizeListener = function(element, fn) {
element
.
__resizeTrigger__
=
!
element
.
removeChild
(
element
.
__resizeTrigger__
);
element
.
__resizeTrigger__
=
!
element
.
removeChild
(
element
.
__resizeTrigger__
);
}
}
}
}
};
};
\ No newline at end of file
src/utils/vue-popper.js
View file @
daec90af
...
@@ -66,6 +66,7 @@ export default {
...
@@ -66,6 +66,7 @@ export default {
methods
:
{
methods
:
{
createPopper
()
{
createPopper
()
{
if
(
this
.
$isServer
)
return
;
if
(
!
/^
(
top|bottom|left|right
)(
-start|-end
)?
$/g
.
test
(
this
.
placement
))
{
if
(
!
/^
(
top|bottom|left|right
)(
-start|-end
)?
$/g
.
test
(
this
.
placement
))
{
return
;
return
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment