@kizmann/nano-ui 1.0.3 → 1.0.4
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/dist/nano-ui.css +1 -1
- package/dist/nano-ui.js +3 -3
- package/dist/nano-ui.js.map +1 -1
- package/package.json +1 -1
- package/src/alert/index.js +1 -1
- package/src/button/index.js +2 -2
- package/src/cascader/index.js +2 -2
- package/src/checkbox/index.js +2 -4
- package/src/collapse/index.js +2 -2
- package/src/config/index.js +5 -5
- package/src/confirm/index.js +1 -1
- package/src/datepicker/index.js +2 -2
- package/src/datetimepicker/index.js +1 -1
- package/src/draggable/index.js +5 -5
- package/src/draggable/src/draggrid/{draggrid.js → draggrid.jsx} +1 -1
- package/src/draggable/src/draglist/{draglist.js → draglist.jsx} +1 -1
- package/src/draggable/src/dropzone/{dropzone.js → dropzone.jsx} +1 -1
- package/src/drawer/index.js +1 -1
- package/src/durationpicker/index.js +1 -1
- package/src/empty/index.js +1 -1
- package/src/file/index.js +1 -1
- package/src/form/index.js +6 -6
- package/src/index.js +45 -45
- package/src/index.scss +0 -1
- package/src/info/index.js +7 -7
- package/src/info/src/info-field/{info-field.js → info-field.jsx} +0 -1
- package/src/info/src/info-field/types/{info-field-boolean.js → info-field-boolean.jsx} +1 -1
- package/src/info/src/info-field/types/{info-field-datetime.js → info-field-datetime.jsx} +1 -1
- package/src/info/src/info-field/types/{info-field-image.js → info-field-image.jsx} +1 -1
- package/src/info/src/info-field/types/{info-field-option.js → info-field-option.jsx} +1 -1
- package/src/info/src/info-field/types/{info-field-string.js → info-field-string.jsx} +1 -1
- package/src/input/index.js +1 -1
- package/src/input-number/index.js +1 -1
- package/src/loader/index.js +1 -1
- package/src/map/index.js +2 -2
- package/src/mixins/src/cslo.js +1 -1
- package/src/modal/index.js +1 -1
- package/src/notification/index.js +1 -1
- package/src/paginator/index.js +1 -1
- package/src/popover/index.js +3 -3
- package/src/preview/index.js +4 -4
- package/src/radio/index.js +2 -2
- package/src/rating/index.js +1 -1
- package/src/resizer/index.js +1 -1
- package/src/scrollbar/index.js +1 -1
- package/src/select/index.js +2 -4
- package/src/slider/index.js +1 -3
- package/src/switch/index.js +1 -3
- package/src/table/index.js +13 -13
- package/src/table/src/table/{table.js → table.jsx} +0 -1
- package/src/table/src/table-cell/types/{table-cell-boolean.js → table-cell-boolean.jsx} +1 -1
- package/src/table/src/table-cell/types/{table-cell-datetime.js → table-cell-datetime.jsx} +1 -1
- package/src/table/src/table-cell/types/{table-cell-image.js → table-cell-image.jsx} +1 -1
- package/src/table/src/table-cell/types/{table-cell-matrix.js → table-cell-matrix.jsx} +1 -1
- package/src/table/src/table-cell/types/{table-cell-option.js → table-cell-option.jsx} +1 -1
- package/src/table/src/table-cell/types/{table-cell-select.js → table-cell-select.jsx} +1 -1
- package/src/table/src/table-cell/types/{table-cell-string.js → table-cell-string.jsx} +1 -1
- package/src/table/src/table-filter/types/{table-filter-boolean.js → table-filter-boolean.jsx} +1 -1
- package/src/table/src/table-filter/types/{table-filter-datetime.js → table-filter-datetime.jsx} +1 -1
- package/src/table/src/table-filter/types/{table-filter-option.js → table-filter-option.jsx} +1 -1
- package/src/table/src/table-filter/types/{table-filter-string.js → table-filter-string.jsx} +1 -1
- package/src/tabs/index.js +2 -2
- package/src/tags/index.js +2 -2
- package/src/textarea/index.js +1 -1
- package/src/timepicker/index.js +2 -2
- package/src/transfer/index.js +1 -1
- package/src/virtualscroller/index.js +1 -1
- package/src/file-list/index.js +0 -10
- package/src/file-list/index.scss +0 -2
- package/src/file-list/src/file-list/file-list.js +0 -187
- package/src/file-list/src/file-list/file-list.scss +0 -47
- package/src/file-list/src/file-list-item/file-list-item.js +0 -168
- package/src/file-list/src/file-list-item/file-list-item.scss +0 -134
- package/src/file-list/src/file-list-item/types/file-list-item-image.js +0 -58
- package/src/scrollbar/src/scrollbar/scrollbar.js +0 -311
- package/src/virtualscroller/src/virtualscroller/virtualscroller.js +0 -267
- /package/src/button/src/button/{button.js → button.jsx} +0 -0
- /package/src/button/src/button-group/{button-group.js → button-group.jsx} +0 -0
- /package/src/cascader/src/cascader/{cascader.js → cascader.jsx} +0 -0
- /package/src/cascader/src/cascader-panel/{cascader-panel.js → cascader-panel.jsx} +0 -0
- /package/src/checkbox/src/checkbox/{checkbox.js → checkbox.jsx} +0 -0
- /package/src/checkbox/src/checkbox-group/{checkbox-group.js → checkbox-group.jsx} +0 -0
- /package/src/collapse/src/collapse/{collapse.js → collapse.jsx} +0 -0
- /package/src/collapse/src/collapse-item/{collapse-item.js → collapse-item.jsx} +0 -0
- /package/src/config/src/builder/{builder.js → builder.jsx} +0 -0
- /package/src/config/src/config/{config-next.js → config-next.jsx} +0 -0
- /package/src/config/src/config/{config.js → config.jsx} +0 -0
- /package/src/config/src/reference-panel/{reference-panel.js → reference-panel.jsx} +0 -0
- /package/src/config/src/reference-picker/{reference-picker.js → reference-picker.jsx} +0 -0
- /package/src/confirm/src/confirm/{confirm.js → confirm.jsx} +0 -0
- /package/src/datepicker/src/datepicker/{datepicker.js → datepicker.jsx} +0 -0
- /package/src/datepicker/src/datepicker-panel/{datepicker-panel.js → datepicker-panel.jsx} +0 -0
- /package/src/datetimepicker/src/datetimepicker/{datetimepicker.js → datetimepicker.jsx} +0 -0
- /package/src/draggable/src/draggrid-item/{draggrid-item.js → draggrid-item.jsx} +0 -0
- /package/src/draggable/src/draglist-item/{draglist-item.js → draglist-item.jsx} +0 -0
- /package/src/drawer/src/drawer/{drawer.js → drawer.jsx} +0 -0
- /package/src/durationpicker/src/durationpicker/{durationpicker.js → durationpicker.jsx} +0 -0
- /package/src/empty/src/empty-icon/{empty-icon.js → empty-icon.jsx} +0 -0
- /package/src/file/src/file/{file.js → file.jsx} +0 -0
- /package/src/form/src/form/{form.js → form.jsx} +0 -0
- /package/src/form/src/form-frame/{form-frame.js → form-frame.jsx} +0 -0
- /package/src/form/src/form-frame-item/{form-frame-item.js → form-frame-item.jsx} +0 -0
- /package/src/form/src/form-group/{form-group.js → form-group.jsx} +0 -0
- /package/src/form/src/form-item/{form-item.js → form-item.jsx} +0 -0
- /package/src/form/src/form-menu/{form-menu.js → form-menu.jsx} +0 -0
- /package/src/info/src/info/{info.js → info.jsx} +0 -0
- /package/src/info/src/info-column/{info-column.js → info-column.jsx} +0 -0
- /package/src/input/src/input/{input.js → input.jsx} +0 -0
- /package/src/input-number/src/input-number/{input-number.js → input-number.jsx} +0 -0
- /package/src/loader/src/loader/{loader.js → loader.jsx} +0 -0
- /package/src/map/src/map/{map.js → map.jsx} +0 -0
- /package/src/map/src/map-marker/{map-marker.js → map-marker.jsx} +0 -0
- /package/src/modal/src/modal/{modal.js → modal.jsx} +0 -0
- /package/src/paginator/src/paginator/{paginator.js → paginator.jsx} +0 -0
- /package/src/popover/src/popover/{popover.js → popover.jsx} +0 -0
- /package/src/popover/src/popover-group/{popover-group.js → popover-group.jsx} +0 -0
- /package/src/popover/src/popover-option/{popover-option.js → popover-option.jsx} +0 -0
- /package/src/preview/src/preview/{preview.js → preview.jsx} +0 -0
- /package/src/preview/src/preview-image/{preview-image.js → preview-image.jsx} +0 -0
- /package/src/preview/src/preview-plain/{preview-plain.js → preview-plain.jsx} +0 -0
- /package/src/preview/src/preview-video/{preview-video.js → preview-video.jsx} +0 -0
- /package/src/radio/src/radio/{radio.js → radio.jsx} +0 -0
- /package/src/radio/src/radio-group/{radio-group.js → radio-group.jsx} +0 -0
- /package/src/rating/src/rating/{rating.js → rating.jsx} +0 -0
- /package/src/resizer/src/resizer/{resizer.js → resizer.jsx} +0 -0
- /package/src/scrollbar/src/scrollbar/{scrollbar.next.js → scrollbar.jsx} +0 -0
- /package/src/select/src/select/{select.js → select.jsx} +0 -0
- /package/src/select/src/select-option/{select-option.js → select-option.jsx} +0 -0
- /package/src/slider/src/slider/{slider.js → slider.jsx} +0 -0
- /package/src/switch/src/switch/{switch.js → switch.jsx} +0 -0
- /package/src/table/src/table-cell/{table-cell.js → table-cell.jsx} +0 -0
- /package/src/table/src/table-column/{table-column.js → table-column.jsx} +0 -0
- /package/src/table/src/table-filter/{table-filter.js → table-filter.jsx} +0 -0
- /package/src/tabs/src/tabs/{tabs.js → tabs.jsx} +0 -0
- /package/src/tabs/src/tabs-item/{tabs-item.js → tabs-item.jsx} +0 -0
- /package/src/tags/src/tags/{tags.js → tags.jsx} +0 -0
- /package/src/tags/src/tags-item/{tags-item.js → tags-item.jsx} +0 -0
- /package/src/textarea/src/textarea/{textarea.js → textarea.jsx} +0 -0
- /package/src/timepicker/src/timepicker/{timepicker.js → timepicker.jsx} +0 -0
- /package/src/timepicker/src/timepicker-panel/{timepicker-panel.js → timepicker-panel.jsx} +0 -0
- /package/src/transfer/src/transfer/{transfer.js → transfer.jsx} +0 -0
- /package/src/virtualscroller/src/virtualscroller/{virtualscroller.beta.js → virtualscroller.jsx} +0 -0
package/src/tabs/index.js
CHANGED
package/src/tags/index.js
CHANGED
package/src/textarea/index.js
CHANGED
package/src/timepicker/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import TimepickerPanel from "./src/timepicker-panel/timepicker-panel";
|
2
|
-
import Timepicker from "./src/timepicker/timepicker";
|
1
|
+
import TimepickerPanel from "./src/timepicker-panel/timepicker-panel.jsx";
|
2
|
+
import Timepicker from "./src/timepicker/timepicker.jsx";
|
3
3
|
|
4
4
|
export default function (App) {
|
5
5
|
App.component(TimepickerPanel.name, TimepickerPanel);
|
package/src/transfer/index.js
CHANGED
package/src/file-list/index.js
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import Vue from "vue";
|
2
|
-
|
3
|
-
import FileList from './src/file-list/file-list';
|
4
|
-
Vue.component(FileList.name, FileList);
|
5
|
-
|
6
|
-
import FileListItem from './src/file-list-item/file-list-item';
|
7
|
-
Vue.component(FileListItem.name, FileListItem);
|
8
|
-
|
9
|
-
import FileListItemImage from './src/file-list-item/types/file-list-item-image';
|
10
|
-
Vue.component(FileListItemImage.name, FileListItemImage);
|
package/src/file-list/index.scss
DELETED
@@ -1,187 +0,0 @@
|
|
1
|
-
import { Arr, Obj, Any } from "@kizmann/pico-js";
|
2
|
-
|
3
|
-
export default {
|
4
|
-
|
5
|
-
name: 'NFileList',
|
6
|
-
|
7
|
-
model: {
|
8
|
-
prop: 'items'
|
9
|
-
},
|
10
|
-
|
11
|
-
props: {
|
12
|
-
|
13
|
-
items: {
|
14
|
-
default()
|
15
|
-
{
|
16
|
-
return [];
|
17
|
-
},
|
18
|
-
type: [Array]
|
19
|
-
},
|
20
|
-
|
21
|
-
useProgress: {
|
22
|
-
default()
|
23
|
-
{
|
24
|
-
return true;
|
25
|
-
},
|
26
|
-
type: [Boolean]
|
27
|
-
},
|
28
|
-
|
29
|
-
fileProp: {
|
30
|
-
default()
|
31
|
-
{
|
32
|
-
return 'file';
|
33
|
-
},
|
34
|
-
type: [String]
|
35
|
-
},
|
36
|
-
|
37
|
-
uniqueProp: {
|
38
|
-
default()
|
39
|
-
{
|
40
|
-
return 'id';
|
41
|
-
},
|
42
|
-
type: [String]
|
43
|
-
},
|
44
|
-
|
45
|
-
doneProp: {
|
46
|
-
default()
|
47
|
-
{
|
48
|
-
return 'done';
|
49
|
-
},
|
50
|
-
type: [String]
|
51
|
-
},
|
52
|
-
|
53
|
-
errorProp: {
|
54
|
-
default()
|
55
|
-
{
|
56
|
-
return 'error';
|
57
|
-
},
|
58
|
-
type: [String]
|
59
|
-
},
|
60
|
-
|
61
|
-
progressProp: {
|
62
|
-
default()
|
63
|
-
{
|
64
|
-
return 'progress';
|
65
|
-
},
|
66
|
-
type: [String]
|
67
|
-
},
|
68
|
-
|
69
|
-
imageLimit: {
|
70
|
-
default()
|
71
|
-
{
|
72
|
-
return 16000;
|
73
|
-
},
|
74
|
-
type: [Number]
|
75
|
-
},
|
76
|
-
|
77
|
-
fileLimit: {
|
78
|
-
default()
|
79
|
-
{
|
80
|
-
return 0;
|
81
|
-
},
|
82
|
-
type: [Number]
|
83
|
-
},
|
84
|
-
|
85
|
-
casts: {
|
86
|
-
default()
|
87
|
-
{
|
88
|
-
return [
|
89
|
-
{ match: 'image/*', use: 'NFileListItemImage' }
|
90
|
-
];
|
91
|
-
},
|
92
|
-
type: [Array]
|
93
|
-
},
|
94
|
-
|
95
|
-
defaultCast: {
|
96
|
-
default()
|
97
|
-
{
|
98
|
-
return 'NFileListItem';
|
99
|
-
},
|
100
|
-
type: [String]
|
101
|
-
},
|
102
|
-
|
103
|
-
threshold: {
|
104
|
-
default()
|
105
|
-
{
|
106
|
-
return 20;
|
107
|
-
},
|
108
|
-
type: [Number]
|
109
|
-
}
|
110
|
-
|
111
|
-
},
|
112
|
-
|
113
|
-
provide()
|
114
|
-
{
|
115
|
-
return {
|
116
|
-
NFileList: this
|
117
|
-
};
|
118
|
-
},
|
119
|
-
|
120
|
-
methods: {
|
121
|
-
|
122
|
-
removeFile(unique)
|
123
|
-
{
|
124
|
-
if ( ! Any.isString(unique) ) {
|
125
|
-
unique = unique[this.uniqueProp]
|
126
|
-
}
|
127
|
-
|
128
|
-
Arr.remove(this.items, {
|
129
|
-
[this.uniqueProp]: unique
|
130
|
-
});
|
131
|
-
}
|
132
|
-
|
133
|
-
},
|
134
|
-
|
135
|
-
renderFile(value)
|
136
|
-
{
|
137
|
-
let file = Obj.get(value, this.fileProp);
|
138
|
-
|
139
|
-
let component = Arr.find(this.casts, (cast) => {
|
140
|
-
return file.type.match(
|
141
|
-
new RegExp('^' + cast.match.replace('*', '.*?') + '$')
|
142
|
-
);
|
143
|
-
});
|
144
|
-
|
145
|
-
let props = { value };
|
146
|
-
|
147
|
-
if ( this.threshold ) {
|
148
|
-
props.renderPreview = true;
|
149
|
-
}
|
150
|
-
|
151
|
-
return (
|
152
|
-
this.$render(component ? component.use : 'NFileListItem', {
|
153
|
-
key: value[this.uniqueProp], props: props
|
154
|
-
})
|
155
|
-
);
|
156
|
-
},
|
157
|
-
|
158
|
-
renderEmpty()
|
159
|
-
{
|
160
|
-
return (
|
161
|
-
<div class="n-file-list__empty">
|
162
|
-
<span>{ this.$slots.empty || this.trans('No entries') }</span>
|
163
|
-
</div>
|
164
|
-
);
|
165
|
-
},
|
166
|
-
|
167
|
-
renderBody()
|
168
|
-
{
|
169
|
-
return (
|
170
|
-
<NScrollbar class="n-file-list">
|
171
|
-
{ Arr.each(this.items, this.ctor('renderFile')) }
|
172
|
-
</NScrollbar>
|
173
|
-
);
|
174
|
-
},
|
175
|
-
|
176
|
-
render($render)
|
177
|
-
{
|
178
|
-
this.$render = $render;
|
179
|
-
|
180
|
-
return (
|
181
|
-
<div class="n-file-list__wrapper">
|
182
|
-
{ this.items.length ? this.ctor('renderBody')() : this.ctor('renderEmpty')() }
|
183
|
-
</div>
|
184
|
-
);
|
185
|
-
}
|
186
|
-
|
187
|
-
}
|
@@ -1,47 +0,0 @@
|
|
1
|
-
@import "../../../root/vars";
|
2
|
-
|
3
|
-
.n-file-list__wrapper {
|
4
|
-
display: flex;
|
5
|
-
flex-direction: column;
|
6
|
-
align-items: stretch;
|
7
|
-
justify-content: stretch;
|
8
|
-
}
|
9
|
-
|
10
|
-
.n-file-list__empty {
|
11
|
-
flex: 1 1 auto;
|
12
|
-
display: flex;
|
13
|
-
flex-direction: column;
|
14
|
-
align-items: center;
|
15
|
-
justify-content: center;
|
16
|
-
}
|
17
|
-
|
18
|
-
.n-file-list__empty span {
|
19
|
-
color: $color-gray-50;
|
20
|
-
}
|
21
|
-
|
22
|
-
.n-file-list {
|
23
|
-
display: flex;
|
24
|
-
flex-direction: row;
|
25
|
-
flex-wrap: wrap;
|
26
|
-
padding: 5px;
|
27
|
-
}
|
28
|
-
|
29
|
-
.n-file-list > div {
|
30
|
-
flex: 0 0 auto;
|
31
|
-
display: flex;
|
32
|
-
flex-direction: column;
|
33
|
-
width: 25%;
|
34
|
-
padding: 5px;
|
35
|
-
}
|
36
|
-
|
37
|
-
@media (max-width: 640px) {
|
38
|
-
.n-file-list > div {
|
39
|
-
width: 50%;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
@media (max-width: 420px) {
|
44
|
-
.n-file-list > div {
|
45
|
-
width: 100%;
|
46
|
-
}
|
47
|
-
}
|
@@ -1,168 +0,0 @@
|
|
1
|
-
import { Arr, Obj, Str, Any } from "@kizmann/pico-js";
|
2
|
-
|
3
|
-
export default {
|
4
|
-
|
5
|
-
name: 'NFileListItem',
|
6
|
-
|
7
|
-
inject: {
|
8
|
-
|
9
|
-
NFileList: {
|
10
|
-
default: undefined
|
11
|
-
}
|
12
|
-
|
13
|
-
},
|
14
|
-
|
15
|
-
props: {
|
16
|
-
|
17
|
-
value: {
|
18
|
-
default()
|
19
|
-
{
|
20
|
-
return {};
|
21
|
-
},
|
22
|
-
type: [Object]
|
23
|
-
},
|
24
|
-
|
25
|
-
renderPreview: {
|
26
|
-
default()
|
27
|
-
{
|
28
|
-
return false;
|
29
|
-
},
|
30
|
-
type: [Boolean]
|
31
|
-
}
|
32
|
-
|
33
|
-
},
|
34
|
-
|
35
|
-
computed: {
|
36
|
-
|
37
|
-
file()
|
38
|
-
{
|
39
|
-
return Obj.get(this.value, this.NFileList.fileProp);
|
40
|
-
},
|
41
|
-
|
42
|
-
done()
|
43
|
-
{
|
44
|
-
return Obj.get(this.value, this.NFileList.doneProp);
|
45
|
-
},
|
46
|
-
|
47
|
-
error()
|
48
|
-
{
|
49
|
-
return Obj.get(this.value, this.NFileList.errorProp);
|
50
|
-
},
|
51
|
-
|
52
|
-
progress()
|
53
|
-
{
|
54
|
-
return Obj.get(this.value, this.NFileList.progressProp);
|
55
|
-
},
|
56
|
-
|
57
|
-
exceed()
|
58
|
-
{
|
59
|
-
return this.NFileList.fileLimit &&
|
60
|
-
(this.value.file.size / 1024) > this.NFileList.fileLimit;
|
61
|
-
}
|
62
|
-
|
63
|
-
},
|
64
|
-
|
65
|
-
methods: {
|
66
|
-
|
67
|
-
remove()
|
68
|
-
{
|
69
|
-
this.NFileList.removeFile(this.value);
|
70
|
-
}
|
71
|
-
|
72
|
-
},
|
73
|
-
|
74
|
-
data()
|
75
|
-
{
|
76
|
-
return {
|
77
|
-
classList: []
|
78
|
-
};
|
79
|
-
},
|
80
|
-
|
81
|
-
renderPreview()
|
82
|
-
{
|
83
|
-
return (
|
84
|
-
<span class="fa fad fa-file"></span>
|
85
|
-
);
|
86
|
-
},
|
87
|
-
|
88
|
-
renderName()
|
89
|
-
{
|
90
|
-
if ( ! this.file ) {
|
91
|
-
return null;
|
92
|
-
}
|
93
|
-
|
94
|
-
return (
|
95
|
-
<span>{ this.file.name }</span>
|
96
|
-
);
|
97
|
-
},
|
98
|
-
|
99
|
-
renderMeta()
|
100
|
-
{
|
101
|
-
let body = Str.filesize(this.file.size);
|
102
|
-
|
103
|
-
if ( ! this.file ) {
|
104
|
-
return null;
|
105
|
-
}
|
106
|
-
|
107
|
-
let limit = {
|
108
|
-
size: (this.NFileList.fileLimit || this.NFileList.imageLimit) / 1000
|
109
|
-
};
|
110
|
-
|
111
|
-
if ( this.exceed ) {
|
112
|
-
body = this.trans('File exceeds filelimit of :size mb', limit);
|
113
|
-
}
|
114
|
-
|
115
|
-
return (
|
116
|
-
<span>{ body }</span>
|
117
|
-
);
|
118
|
-
},
|
119
|
-
|
120
|
-
render($render)
|
121
|
-
{
|
122
|
-
this.$render = $render;
|
123
|
-
|
124
|
-
let classList = Arr.merge(['n-file-list-item'],
|
125
|
-
this.classList);
|
126
|
-
|
127
|
-
if ( this.exceed === true ) {
|
128
|
-
classList.push('n-file-list-item--exceed');
|
129
|
-
}
|
130
|
-
|
131
|
-
if ( this.done === true ) {
|
132
|
-
classList.push('n-file-list-item--done');
|
133
|
-
}
|
134
|
-
|
135
|
-
if ( this.error === true ) {
|
136
|
-
classList.push('n-file-list-item--error');
|
137
|
-
}
|
138
|
-
|
139
|
-
return (
|
140
|
-
<div class={classList}>
|
141
|
-
<div class="n-file-list-item__preview">
|
142
|
-
<div class="n-file-list-item__preview-inner">
|
143
|
-
{ this.ctor('renderPreview')() }
|
144
|
-
</div>
|
145
|
-
{ this.NFileList.useProgress &&
|
146
|
-
<div class="n-file-list-item__progress">
|
147
|
-
<span style={{ width: this.progress + '%' }}></span>
|
148
|
-
</div>
|
149
|
-
}
|
150
|
-
</div>
|
151
|
-
<div class="n-file-list-item__name">
|
152
|
-
<div class="n-file-list-item__name-inner">
|
153
|
-
{ this.ctor('renderName')() }
|
154
|
-
</div>
|
155
|
-
</div>
|
156
|
-
<div class="n-file-list-item__meta">
|
157
|
-
<div class="n-file-list-item__meta-inner">
|
158
|
-
{ this.ctor('renderMeta')() }
|
159
|
-
</div>
|
160
|
-
</div>
|
161
|
-
<a class="n-file-list-item__remove" href="javascript:void(0)" vOn:click={this.remove}>
|
162
|
-
<span class={nano.Icons.times}></span>
|
163
|
-
</a>
|
164
|
-
</div>
|
165
|
-
);
|
166
|
-
}
|
167
|
-
|
168
|
-
}
|
@@ -1,134 +0,0 @@
|
|
1
|
-
@import "../../../root/vars";
|
2
|
-
|
3
|
-
.n-file-list-item {
|
4
|
-
flex: 1 1 auto;
|
5
|
-
position: relative;
|
6
|
-
display: flex;
|
7
|
-
flex-direction: column;
|
8
|
-
}
|
9
|
-
|
10
|
-
.n-file-list-item__remove {
|
11
|
-
position: absolute;
|
12
|
-
top: 5px;
|
13
|
-
right: 5px;
|
14
|
-
display: flex;
|
15
|
-
justify-content: center;
|
16
|
-
align-items: center;
|
17
|
-
width: 25px;
|
18
|
-
height: 25px;
|
19
|
-
color: $color-gray-35;
|
20
|
-
background: rgba($color-white, 0.5);
|
21
|
-
}
|
22
|
-
|
23
|
-
.n-file-list-item__preview {
|
24
|
-
flex: 0 0 auto;
|
25
|
-
overflow: hidden;
|
26
|
-
position: relative;
|
27
|
-
width: 100%;
|
28
|
-
font-size: 5vw;
|
29
|
-
background: $color-background;
|
30
|
-
color: rgba($color-primary, 0.5);
|
31
|
-
border-radius: $md-radius;
|
32
|
-
}
|
33
|
-
|
34
|
-
.n-file-list-item.n-file-list-item--exceed .n-file-list-item__preview {
|
35
|
-
background: rgba($color-danger, 0.1);
|
36
|
-
color: rgba($color-danger, 0.5);
|
37
|
-
}
|
38
|
-
|
39
|
-
.n-file-list-item__preview:before {
|
40
|
-
content: '\00a0';
|
41
|
-
display: block;
|
42
|
-
height: 0;
|
43
|
-
padding-bottom: 100%;
|
44
|
-
}
|
45
|
-
|
46
|
-
.n-file-list-item__preview-inner {
|
47
|
-
position: absolute;
|
48
|
-
top: 0;
|
49
|
-
left: 0;
|
50
|
-
bottom: 0;
|
51
|
-
right: 0;
|
52
|
-
display: flex;
|
53
|
-
align-items: center;
|
54
|
-
justify-content: center;
|
55
|
-
//width: 100%;
|
56
|
-
//height: 100%;
|
57
|
-
}
|
58
|
-
|
59
|
-
.n-file-list-item__preview-inner img {
|
60
|
-
position: relative;
|
61
|
-
max-width: 100%;
|
62
|
-
max-height: 100%;
|
63
|
-
object-fit: contain;
|
64
|
-
}
|
65
|
-
|
66
|
-
.n-file-list-item__progress {
|
67
|
-
position: absolute;
|
68
|
-
bottom: 0;
|
69
|
-
left: 0;
|
70
|
-
display: flex;
|
71
|
-
width: 100%;
|
72
|
-
height: 4px;
|
73
|
-
background: $color-background-dark;
|
74
|
-
}
|
75
|
-
|
76
|
-
|
77
|
-
.n-file-list-item.n-file-list-item--exceed .n-file-list-item__progress {
|
78
|
-
background: rgba($color-danger, 0.15);
|
79
|
-
}
|
80
|
-
|
81
|
-
.n-file-list-item__progress > span {
|
82
|
-
height: 4px;
|
83
|
-
background: $color-primary;
|
84
|
-
}
|
85
|
-
|
86
|
-
.n-file-list-item.n-file-list-item--done .n-file-list-item__progress > span {
|
87
|
-
background: $color-success;
|
88
|
-
}
|
89
|
-
|
90
|
-
.n-file-list-item.n-file-list-item--error .n-file-list-item__progress > span {
|
91
|
-
background: $color-danger;
|
92
|
-
}
|
93
|
-
|
94
|
-
.n-file-list-item__name {
|
95
|
-
flex: 0 0 auto;
|
96
|
-
display: flex;
|
97
|
-
flex-direction: row;
|
98
|
-
justify-content: center;
|
99
|
-
}
|
100
|
-
|
101
|
-
.n-file-list-item__name-inner {
|
102
|
-
flex: 0 1 auto;
|
103
|
-
overflow: hidden;
|
104
|
-
font-size: 15px;
|
105
|
-
text-overflow: ellipsis;
|
106
|
-
white-space: nowrap;
|
107
|
-
padding: 15px 5px 0;
|
108
|
-
color: $color-black;
|
109
|
-
}
|
110
|
-
|
111
|
-
.n-file-list-item.n-file-list-item--exceed .n-file-list-item__name-inner {
|
112
|
-
color: $color-danger;
|
113
|
-
}
|
114
|
-
|
115
|
-
.n-file-list-item__meta {
|
116
|
-
flex: 0 0 auto;
|
117
|
-
display: flex;
|
118
|
-
flex-direction: row;
|
119
|
-
justify-content: center;
|
120
|
-
}
|
121
|
-
|
122
|
-
.n-file-list-item.n-file-list-item--exceed .n-file-list-item__meta-inner {
|
123
|
-
color: rgba($color-danger, 0.5);
|
124
|
-
}
|
125
|
-
|
126
|
-
.n-file-list-item__meta-inner {
|
127
|
-
flex: 0 1 auto;
|
128
|
-
overflow: hidden;
|
129
|
-
font-size: 13px;
|
130
|
-
text-overflow: ellipsis;
|
131
|
-
white-space: nowrap;
|
132
|
-
padding: 0 5px 15px;
|
133
|
-
color: $color-gray-50;
|
134
|
-
}
|
@@ -1,58 +0,0 @@
|
|
1
|
-
import FileListItem from "../file-list-item";
|
2
|
-
import { Str } from "@kizmann/pico-js";
|
3
|
-
|
4
|
-
export default {
|
5
|
-
|
6
|
-
name: 'NFileListItemImage',
|
7
|
-
|
8
|
-
extends: FileListItem,
|
9
|
-
|
10
|
-
methods: {
|
11
|
-
|
12
|
-
getImagePreview()
|
13
|
-
{
|
14
|
-
let reader = new FileReader();
|
15
|
-
|
16
|
-
reader.onload = () => {
|
17
|
-
this.vePreview = reader.result;
|
18
|
-
};
|
19
|
-
|
20
|
-
reader.readAsDataURL(this.value.file);
|
21
|
-
},
|
22
|
-
|
23
|
-
},
|
24
|
-
|
25
|
-
computed: {
|
26
|
-
|
27
|
-
exceed()
|
28
|
-
{
|
29
|
-
return this.NFileList.imageLimit &&
|
30
|
-
(this.value.file.size / 1024) > this.NFileList.imageLimit;
|
31
|
-
}
|
32
|
-
|
33
|
-
},
|
34
|
-
|
35
|
-
data()
|
36
|
-
{
|
37
|
-
return {
|
38
|
-
vePreview: null
|
39
|
-
};
|
40
|
-
},
|
41
|
-
|
42
|
-
mounted()
|
43
|
-
{
|
44
|
-
if ( this.renderPreview && ! this.exceed ) {
|
45
|
-
this.getImagePreview();
|
46
|
-
}
|
47
|
-
},
|
48
|
-
|
49
|
-
renderPreview()
|
50
|
-
{
|
51
|
-
if ( this.vePreview ) {
|
52
|
-
return (<img src={this.vePreview} />);
|
53
|
-
}
|
54
|
-
|
55
|
-
return (<span class="fa fad fa-file-image"></span>);
|
56
|
-
}
|
57
|
-
|
58
|
-
}
|