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
Show 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
export
SUB_FOLDER
=
$(
echo
"
$TRAVIS_TAG
"
|
grep
-o
-E
"
\d
+
\.\d
+"
)
echo
$SUB_FOLDER
SUB_FOLDER
=
'1.
0
'
SUB_FOLDER
=
'1.
1
'
mkdir
$SUB_FOLDER
rm
-rf
*
.js
*
.css
*
.map static
rm
-rf
$SUB_FOLDER
/
**
...
...
packages/date-picker/src/picker.vue
View file @
daec90af
...
...
@@ -375,6 +375,7 @@ export default {
},
showPicker
()
{
if
(
this
.
$isServer
)
return
;
if
(
!
this
.
picker
)
{
this
.
panel
.
defaultValue
=
this
.
internalValue
;
this
.
picker
=
new
Vue
(
this
.
panel
).
$mount
(
document
.
createElement
(
'
div
'
));
...
...
packages/input-number/src/input-number.vue
View file @
daec90af
...
...
@@ -79,11 +79,8 @@
let
interval
=
null
;
let
startTime
;
const
handler
=
()
=>
{
vnode
.
context
[
binding
.
expression
]();
};
const
clear
=
function
()
{
const
handler
=
()
=>
vnode
.
context
[
binding
.
expression
]();
const
clear
=
()
=>
{
if
(
new
Date
()
-
startTime
<
100
)
{
handler
();
}
...
...
@@ -91,12 +88,10 @@
interval
=
null
;
};
on
(
el
,
'
mousedown
'
,
function
()
{
on
(
el
,
'
mousedown
'
,
()
=>
{
startTime
=
new
Date
();
once
(
document
,
'
mouseup
'
,
clear
);
interval
=
setInterval
(
function
()
{
handler
();
},
100
);
interval
=
setInterval
(
handler
,
100
);
});
}
}
...
...
packages/input/src/input.vue
View file @
daec90af
...
...
@@ -117,10 +117,9 @@
this
.
$refs
.
input
.
select
();
},
resizeTextarea
()
{
if
(
this
.
$isServer
)
return
;
var
{
autosize
,
type
}
=
this
;
if
(
!
autosize
||
type
!==
'
textarea
'
)
{
return
;
}
if
(
!
autosize
||
type
!==
'
textarea
'
)
return
;
const
minRows
=
autosize
.
minRows
;
const
maxRows
=
autosize
.
maxRows
;
...
...
packages/loading/src/directive.js
View file @
daec90af
...
...
@@ -3,6 +3,7 @@ import { addClass, removeClass } from 'wind-dom/src/class';
let
Mask
=
Vue
.
extend
(
require
(
'
./loading.vue
'
));
exports
.
install
=
Vue
=>
{
if
(
Vue
.
prototype
.
$isServer
)
return
;
let
toggleLoading
=
(
el
,
binding
)
=>
{
if
(
binding
.
value
)
{
Vue
.
nextTick
(()
=>
{
...
...
packages/loading/src/index.js
View file @
daec90af
...
...
@@ -61,6 +61,7 @@ const addStyle = (options, parent, instance) => {
};
const
Loading
=
(
options
=
{})
=>
{
if
(
Vue
.
prototype
.
$isServer
)
return
;
options
=
merge
({},
defaults
,
options
);
if
(
typeof
options
.
target
===
'
string
'
)
{
options
.
target
=
document
.
querySelector
(
options
.
target
);
...
...
packages/message-box/src/main.js
View file @
daec90af
...
...
@@ -102,6 +102,7 @@ const showNextMsg = () => {
};
const
MessageBox
=
function
(
options
,
callback
)
{
if
(
Vue
.
prototype
.
$isServer
)
return
;
if
(
typeof
options
===
'
string
'
)
{
options
=
{
message
:
options
...
...
packages/message/src/main.js
View file @
daec90af
...
...
@@ -7,6 +7,7 @@ let instances = [];
let
seed
=
1
;
var
Message
=
function
(
options
)
{
if
(
Vue
.
prototype
.
$isServer
)
return
;
options
=
options
||
{};
if
(
typeof
options
===
'
string
'
)
{
options
=
{
...
...
packages/notification/src/main.js
View file @
daec90af
...
...
@@ -7,6 +7,7 @@ let instances = [];
let
seed
=
1
;
var
Notification
=
function
(
options
)
{
if
(
Vue
.
prototype
.
$isServer
)
return
;
options
=
options
||
{};
let
userOnClose
=
options
.
onClose
;
let
id
=
'
notification_
'
+
seed
++
;
...
...
packages/select/src/select.vue
View file @
daec90af
...
...
@@ -299,6 +299,7 @@
},
options
(
val
)
{
if
(
this
.
$isServer
)
return
;
this
.
optionsAllDisabled
=
val
.
length
===
val
.
filter
(
item
=>
item
.
disabled
===
true
).
length
;
if
(
this
.
multiple
)
{
this
.
resetInputHeight
();
...
...
packages/table/src/dropdown.js
View file @
daec90af
import
Vue
from
'
vue
'
;
var
dropdowns
=
[];
document
.
addEventListener
(
'
click
'
,
function
(
event
)
{
!
Vue
.
prototype
.
$isServer
&&
document
.
addEventListener
(
'
click
'
,
function
(
event
)
{
dropdowns
.
forEach
(
function
(
dropdown
)
{
var
target
=
event
.
target
;
if
(
!
dropdown
||
!
dropdown
.
$el
)
return
;
...
...
packages/table/src/table-header.js
View file @
daec90af
...
...
@@ -226,7 +226,7 @@ export default {
filterPanel
.
table
=
table
;
filterPanel
.
cell
=
cell
;
filterPanel
.
column
=
column
;
filterPanel
.
$mount
(
document
.
createElement
(
'
div
'
));
!
this
.
$isServer
&&
filterPanel
.
$mount
(
document
.
createElement
(
'
div
'
));
}
setTimeout
(()
=>
{
...
...
@@ -239,6 +239,7 @@ export default {
},
handleMouseDown
(
event
,
column
)
{
if
(
this
.
$isServer
)
return
;
if
(
column
.
children
&&
column
.
children
.
length
>
0
)
return
;
/* istanbul ignore if */
if
(
this
.
draggingColumn
&&
this
.
border
)
{
...
...
@@ -329,6 +330,7 @@ export default {
},
handleMouseOut
()
{
if
(
this
.
$isServer
)
return
;
document
.
body
.
style
.
cursor
=
''
;
},
...
...
packages/table/src/util.js
View file @
daec90af
...
...
@@ -99,7 +99,7 @@ export const getColumnByCell = function(table, cell) {
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
)
{
if
(
element
&&
element
.
addEventListener
)
{
...
...
packages/upload/src/iframe-upload.vue
View file @
daec90af
...
...
@@ -113,7 +113,7 @@ export default {
},
mounted
()
{
window
.
addEventListener
(
'
message
'
,
(
event
)
=>
{
!
this
.
$isServer
&&
window
.
addEventListener
(
'
message
'
,
(
event
)
=>
{
var
targetOrigin
=
new
URL
(
this
.
action
).
origin
;
if
(
event
.
origin
!==
targetOrigin
)
{
return
false
;
...
...
@@ -158,7 +158,7 @@ export default {
on
-
change
=
{
this
.
handleChange
}
accept
=
{
this
.
accept
}
>
<
/input
>
<
input
type
=
"
hidden
"
name
=
"
documentDomain
"
value
=
{
document
.
domain
}
/
>
<
input
type
=
"
hidden
"
name
=
"
documentDomain
"
value
=
{
this
.
$isServer
?
''
:
document
.
domain
}
/
>
<
span
ref
=
"
data
"
><
/span
>
<
/form
>
{
!
this
.
showCover
?
this
.
$slots
.
default
:
cover
}
...
...
packages/upload/src/index.vue
View file @
daec90af
...
...
@@ -209,7 +209,7 @@ export default {
ref
:
'
upload-inner
'
};
var
uploadComponent
=
typeof
FormData
!==
'
undefined
'
var
uploadComponent
=
t
his
.
$isServer
?
''
:
t
ypeof
FormData
!==
'
undefined
'
?
<
upload
{...
props
}
>
{
this
.
$slots
.
default
}
<
/upload
>
:
<
iframeUpload
{...
props
}
>
{
this
.
$slots
.
default
}
<
/iframeUpload>
;
...
...
src/utils/clickoutside.js
View file @
daec90af
import
Vue
from
'
vue
'
;
import
{
on
}
from
'
wind-dom/src/event
'
;
const
nodeList
=
[];
const
ctx
=
'
@@clickoutsideContext
'
;
on
(
document
,
'
click
'
,
e
=>
{
!
Vue
.
prototype
.
$isServer
&&
on
(
document
,
'
click
'
,
e
=>
{
nodeList
.
forEach
(
node
=>
node
[
ctx
].
documentHandler
(
e
));
});
/**
...
...
src/utils/resize-event.js
View file @
daec90af
...
...
@@ -3,9 +3,11 @@
*
* version: 0.5.3
**/
const
isServer
=
typeof
window
===
'
undefined
'
;
/* istanbul ignore next */
const
requestFrame
=
(
function
()
{
if
(
isServer
)
return
;
const
raf
=
window
.
requestAnimationFrame
||
window
.
mozRequestAnimationFrame
||
window
.
webkitRequestAnimationFrame
||
function
(
fn
)
{
return
window
.
setTimeout
(
fn
,
20
);
...
...
@@ -17,6 +19,7 @@ const requestFrame = (function() {
/* istanbul ignore next */
const
cancelFrame
=
(
function
()
{
if
(
isServer
)
return
;
const
cancel
=
window
.
cancelAnimationFrame
||
window
.
mozCancelAnimationFrame
||
window
.
webkitCancelAnimationFrame
||
window
.
clearTimeout
;
return
function
(
id
)
{
return
cancel
(
id
);
...
...
@@ -59,7 +62,7 @@ const scrollListener = function(event) {
};
/* 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
START_EVENTS
=
'
webkitAnimationStart animationstart oAnimationStart MSAnimationStart
'
.
split
(
'
'
);
const
RESIZE_ANIMATION_NAME
=
'
resizeanim
'
;
...
...
@@ -68,7 +71,7 @@ let keyFramePrefix = '';
let
animationStartEvent
=
'
animationstart
'
;
/* istanbul ignore next */
if
(
!
attachEvent
)
{
if
(
!
attachEvent
&&
!
isServer
)
{
const
testElement
=
document
.
createElement
(
'
fakeelement
'
);
if
(
testElement
.
style
.
animationName
!==
undefined
)
{
animation
=
true
;
...
...
@@ -91,7 +94,7 @@ if (!attachEvent) {
let
stylesCreated
=
false
;
/* istanbul ignore next */
const
createStyles
=
function
()
{
if
(
!
stylesCreated
)
{
if
(
!
stylesCreated
&&
!
isServer
)
{
const
animationKeyframes
=
`@
${
keyFramePrefix
}
keyframes
${
RESIZE_ANIMATION_NAME
}
{ from { opacity: 0; } to { opacity: 0; } } `
;
const
animationStyle
=
`
${
keyFramePrefix
}
animation: 1ms
${
RESIZE_ANIMATION_NAME
}
;`
;
...
...
@@ -119,6 +122,7 @@ const createStyles = function() {
/* istanbul ignore next */
export
const
addResizeListener
=
function
(
element
,
fn
)
{
if
(
isServer
)
return
;
if
(
attachEvent
)
{
element
.
attachEvent
(
'
onresize
'
,
fn
);
}
else
{
...
...
src/utils/vue-popper.js
View file @
daec90af
...
...
@@ -66,6 +66,7 @@ export default {
methods
:
{
createPopper
()
{
if
(
this
.
$isServer
)
return
;
if
(
!
/^
(
top|bottom|left|right
)(
-start|-end
)?
$/g
.
test
(
this
.
placement
))
{
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