Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Toolkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
digital blueprint
Web Component Framework
Toolkit
Commits
12d2ca4a
Commit
12d2ca4a
authored
4 years ago
by
Steinwender, Tamara
Committed by
Reiter, Christoph
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Tabulator table shift select with mobile support
parent
e8f6564b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/file-handling/src/vpu-nextcloud-file-picker.js
+23
-10
23 additions, 10 deletions
packages/file-handling/src/vpu-nextcloud-file-picker.js
with
23 additions
and
10 deletions
packages/file-handling/src/vpu-nextcloud-file-picker.js
+
23
−
10
View file @
12d2ca4a
...
...
@@ -21,7 +21,6 @@ export class NextcloudFilePicker extends ScopedElementsMixin(VPULitElement) {
this
.
webDavUrl
=
''
;
this
.
loginWindow
=
null
;
this
.
isPickerActive
=
false
;
this
.
selectButtonText
=
i18n
.
t
(
'
nextcloud-file-picker.select-files
'
);
this
.
statusText
=
''
;
this
.
lastDirectoryPath
=
'
/
'
;
this
.
directoryPath
=
'
/
'
;
...
...
@@ -29,6 +28,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(VPULitElement) {
this
.
tabulatorTable
=
null
;
this
.
allowedMimeTypes
=
'
*/*
'
;
this
.
directoriesOnly
=
null
;
this
.
selectNum
=
true
;
this
.
_onReceiveWindowMessage
=
this
.
onReceiveWindowMessage
.
bind
(
this
);
}
...
...
@@ -53,7 +53,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(VPULitElement) {
directoryPath
:
{
type
:
String
,
attribute
:
false
},
allowedMimeTypes
:
{
type
:
String
,
attribute
:
'
allowed-mime-types
'
},
directoriesOnly
:
{
type
:
Boolean
,
attribute
:
'
directories-only
'
},
select
ButtonText
:
{
type
:
String
,
attribute
:
'
select-
button-text
'
},
select
Num
:
{
type
:
Number
,
attribute
:
'
select-
num
'
},
};
}
...
...
@@ -72,7 +72,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(VPULitElement) {
disconnectedCallback
()
{
window
.
removeEventListener
(
'
message
'
,
this
.
_onReceiveWindowMessage
);
super
.
disconnectedCallback
();
}
}
connectedCallback
()
{
super
.
connectedCallback
();
...
...
@@ -85,7 +85,8 @@ export class NextcloudFilePicker extends ScopedElementsMixin(VPULitElement) {
// TODO: translation of column headers
this
.
tabulatorTable
=
new
Tabulator
(
this
.
_
(
"
#directory-content-table
"
),
{
layout
:
"
fitDataStretch
"
,
selectable
:
true
,
selectable
:
this
.
selectNum
,
selectableRangeMode
:
"
drag
"
,
columns
:
[
{
title
:
"
Type
"
,
field
:
"
type
"
,
align
:
"
center
"
,
formatter
:
(
cell
,
formatterParams
,
onRendered
)
=>
{
const
icon_tag
=
that
.
constructor
.
getScopedTagName
(
"
vpu-icon
"
);
...
...
@@ -140,13 +141,18 @@ export class NextcloudFilePicker extends ScopedElementsMixin(VPULitElement) {
}
},
rowDblClick
:
(
e
,
row
)
=>
{
const
data
=
row
.
getData
();
if
(
this
.
directoriesOnly
)
{
const
data
=
row
.
getData
();
this
.
directoryClicked
(
e
,
data
);
}
}
});
console
.
log
(
"
table:
"
,
this
.
tabulatorTable
);
if
(
this
.
tabulatorTable
.
browserMobile
===
false
)
{
this
.
tabulatorTable
.
options
.
selectableRangeMode
=
"
click
"
;
}
function
checkFileType
(
data
,
filterParams
)
{
// check if file is allowed
if
(
typeof
data
.
mime
===
'
undefined
'
)
{
...
...
@@ -264,9 +270,9 @@ export class NextcloudFilePicker extends ScopedElementsMixin(VPULitElement) {
this
.
statusText
=
""
;
}).
catch
(
error
=>
{
console
.
error
(
error
.
message
);
this
.
statusText
=
error
.
message
;
});
console
.
error
(
error
.
message
);
this
.
statusText
=
error
.
message
;
});
}
/**
...
...
@@ -290,6 +296,13 @@ export class NextcloudFilePicker extends ScopedElementsMixin(VPULitElement) {
.block {
margin-bottom: 10px;
}
.force-no-select{
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
`
;
}
...
...
@@ -319,9 +332,9 @@ export class NextcloudFilePicker extends ScopedElementsMixin(VPULitElement) {
<button class="button is-small"
title="
${
i18n
.
t
(
'
nextcloud-file-picker.folder-up
'
)}
"
@click="
${()
=>
{
this
.
loadDirectory
(
this
.
getParentDirectoryPath
());
}}
">⇧</button>
<table id="directory-content-table"></table>
<table id="directory-content-table"
class="force-no-select"
></table>
<button class="button"
@click="
${()
=>
{
this
.
downloadFiles
(
this
.
tabulatorTable
.
getSelectedData
());
}}
">
${
this
.
selectButtonText
}
</button>
@click="
${()
=>
{
this
.
downloadFiles
(
this
.
tabulatorTable
.
getSelectedData
());
}}
">
${
i18n
.
t
(
'
nextcloud-file-picker.select-files
'
)
}
</button>
</div>
`
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment