@kizmann/nano-ui 1.0.3 → 1.0.5

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.
Files changed (148) hide show
  1. package/dist/218.nano-ui.js +2 -0
  2. package/dist/218.nano-ui.js.map +1 -0
  3. package/dist/933.nano-ui.js +2 -0
  4. package/dist/933.nano-ui.js.map +1 -0
  5. package/dist/nano-ui.css +1 -1
  6. package/dist/nano-ui.js +1 -3
  7. package/dist/nano-ui.js.map +1 -1
  8. package/package.json +2 -1
  9. package/src/alert/index.js +3 -3
  10. package/src/alert/src/alert/alert.js +16 -11
  11. package/src/button/index.js +2 -2
  12. package/src/cascader/index.js +2 -2
  13. package/src/checkbox/index.js +2 -4
  14. package/src/collapse/index.js +2 -2
  15. package/src/config/index.js +5 -5
  16. package/src/confirm/index.js +1 -1
  17. package/src/datepicker/index.js +2 -2
  18. package/src/datetimepicker/index.js +1 -1
  19. package/src/draggable/index.js +5 -5
  20. package/src/draggable/src/draggrid/{draggrid.js → draggrid.jsx} +1 -1
  21. package/src/draggable/src/draglist/{draglist.js → draglist.jsx} +1 -1
  22. package/src/draggable/src/dropzone/{dropzone.js → dropzone.jsx} +1 -1
  23. package/src/drawer/index.js +1 -1
  24. package/src/durationpicker/index.js +1 -1
  25. package/src/empty/index.js +1 -1
  26. package/src/file/index.js +1 -1
  27. package/src/form/index.js +6 -6
  28. package/src/index.js +91 -45
  29. package/src/index.scss +0 -1
  30. package/src/info/index.js +7 -7
  31. package/src/info/src/info-field/{info-field.js → info-field.jsx} +0 -1
  32. package/src/info/src/info-field/types/{info-field-boolean.js → info-field-boolean.jsx} +1 -1
  33. package/src/info/src/info-field/types/{info-field-datetime.js → info-field-datetime.jsx} +1 -1
  34. package/src/info/src/info-field/types/{info-field-image.js → info-field-image.jsx} +1 -1
  35. package/src/info/src/info-field/types/{info-field-option.js → info-field-option.jsx} +1 -1
  36. package/src/info/src/info-field/types/{info-field-string.js → info-field-string.jsx} +1 -1
  37. package/src/input/index.js +1 -1
  38. package/src/input-number/index.js +1 -1
  39. package/src/loader/index.js +1 -1
  40. package/src/map/index.js +2 -2
  41. package/src/mixins/src/cslo.js +1 -1
  42. package/src/modal/index.js +1 -1
  43. package/src/notification/index.js +3 -3
  44. package/src/notification/src/notification/notification.js +16 -10
  45. package/src/paginator/index.js +1 -1
  46. package/src/popover/index.js +3 -3
  47. package/src/preview/index.js +4 -4
  48. package/src/radio/index.js +2 -2
  49. package/src/rating/index.js +1 -1
  50. package/src/resizer/index.js +1 -1
  51. package/src/scrollbar/index.js +1 -1
  52. package/src/select/index.js +2 -4
  53. package/src/slider/index.js +1 -3
  54. package/src/switch/index.js +1 -3
  55. package/src/table/index.js +13 -13
  56. package/src/table/src/table/{table.js → table.jsx} +0 -1
  57. package/src/table/src/table-cell/types/{table-cell-boolean.js → table-cell-boolean.jsx} +1 -1
  58. package/src/table/src/table-cell/types/{table-cell-datetime.js → table-cell-datetime.jsx} +1 -1
  59. package/src/table/src/table-cell/types/{table-cell-image.js → table-cell-image.jsx} +1 -1
  60. package/src/table/src/table-cell/types/{table-cell-matrix.js → table-cell-matrix.jsx} +1 -1
  61. package/src/table/src/table-cell/types/{table-cell-option.js → table-cell-option.jsx} +1 -1
  62. package/src/table/src/table-cell/types/{table-cell-select.js → table-cell-select.jsx} +1 -1
  63. package/src/table/src/table-cell/types/{table-cell-string.js → table-cell-string.jsx} +1 -1
  64. package/src/table/src/table-filter/types/{table-filter-boolean.js → table-filter-boolean.jsx} +1 -1
  65. package/src/table/src/table-filter/types/{table-filter-datetime.js → table-filter-datetime.jsx} +1 -1
  66. package/src/table/src/table-filter/types/{table-filter-option.js → table-filter-option.jsx} +1 -1
  67. package/src/table/src/table-filter/types/{table-filter-string.js → table-filter-string.jsx} +1 -1
  68. package/src/tabs/index.js +2 -2
  69. package/src/tags/index.js +2 -2
  70. package/src/textarea/index.js +1 -1
  71. package/src/timepicker/index.js +2 -2
  72. package/src/transfer/index.js +1 -1
  73. package/src/virtualscroller/index.js +1 -1
  74. package/src/file-list/index.js +0 -10
  75. package/src/file-list/index.scss +0 -2
  76. package/src/file-list/src/file-list/file-list.js +0 -187
  77. package/src/file-list/src/file-list/file-list.scss +0 -47
  78. package/src/file-list/src/file-list-item/file-list-item.js +0 -168
  79. package/src/file-list/src/file-list-item/file-list-item.scss +0 -134
  80. package/src/file-list/src/file-list-item/types/file-list-item-image.js +0 -58
  81. package/src/scrollbar/src/scrollbar/scrollbar.js +0 -311
  82. package/src/virtualscroller/src/virtualscroller/virtualscroller.js +0 -267
  83. /package/src/button/src/button/{button.js → button.jsx} +0 -0
  84. /package/src/button/src/button-group/{button-group.js → button-group.jsx} +0 -0
  85. /package/src/cascader/src/cascader/{cascader.js → cascader.jsx} +0 -0
  86. /package/src/cascader/src/cascader-panel/{cascader-panel.js → cascader-panel.jsx} +0 -0
  87. /package/src/checkbox/src/checkbox/{checkbox.js → checkbox.jsx} +0 -0
  88. /package/src/checkbox/src/checkbox-group/{checkbox-group.js → checkbox-group.jsx} +0 -0
  89. /package/src/collapse/src/collapse/{collapse.js → collapse.jsx} +0 -0
  90. /package/src/collapse/src/collapse-item/{collapse-item.js → collapse-item.jsx} +0 -0
  91. /package/src/config/src/builder/{builder.js → builder.jsx} +0 -0
  92. /package/src/config/src/config/{config-next.js → config-next.jsx} +0 -0
  93. /package/src/config/src/config/{config.js → config.jsx} +0 -0
  94. /package/src/config/src/reference-panel/{reference-panel.js → reference-panel.jsx} +0 -0
  95. /package/src/config/src/reference-picker/{reference-picker.js → reference-picker.jsx} +0 -0
  96. /package/src/confirm/src/confirm/{confirm.js → confirm.jsx} +0 -0
  97. /package/src/datepicker/src/datepicker/{datepicker.js → datepicker.jsx} +0 -0
  98. /package/src/datepicker/src/datepicker-panel/{datepicker-panel.js → datepicker-panel.jsx} +0 -0
  99. /package/src/datetimepicker/src/datetimepicker/{datetimepicker.js → datetimepicker.jsx} +0 -0
  100. /package/src/draggable/src/draggrid-item/{draggrid-item.js → draggrid-item.jsx} +0 -0
  101. /package/src/draggable/src/draglist-item/{draglist-item.js → draglist-item.jsx} +0 -0
  102. /package/src/drawer/src/drawer/{drawer.js → drawer.jsx} +0 -0
  103. /package/src/durationpicker/src/durationpicker/{durationpicker.js → durationpicker.jsx} +0 -0
  104. /package/src/empty/src/empty-icon/{empty-icon.js → empty-icon.jsx} +0 -0
  105. /package/src/file/src/file/{file.js → file.jsx} +0 -0
  106. /package/src/form/src/form/{form.js → form.jsx} +0 -0
  107. /package/src/form/src/form-frame/{form-frame.js → form-frame.jsx} +0 -0
  108. /package/src/form/src/form-frame-item/{form-frame-item.js → form-frame-item.jsx} +0 -0
  109. /package/src/form/src/form-group/{form-group.js → form-group.jsx} +0 -0
  110. /package/src/form/src/form-item/{form-item.js → form-item.jsx} +0 -0
  111. /package/src/form/src/form-menu/{form-menu.js → form-menu.jsx} +0 -0
  112. /package/src/info/src/info/{info.js → info.jsx} +0 -0
  113. /package/src/info/src/info-column/{info-column.js → info-column.jsx} +0 -0
  114. /package/src/input/src/input/{input.js → input.jsx} +0 -0
  115. /package/src/input-number/src/input-number/{input-number.js → input-number.jsx} +0 -0
  116. /package/src/loader/src/loader/{loader.js → loader.jsx} +0 -0
  117. /package/src/map/src/map/{map.js → map.jsx} +0 -0
  118. /package/src/map/src/map-marker/{map-marker.js → map-marker.jsx} +0 -0
  119. /package/src/modal/src/modal/{modal.js → modal.jsx} +0 -0
  120. /package/src/paginator/src/paginator/{paginator.js → paginator.jsx} +0 -0
  121. /package/src/popover/src/popover/{popover.js → popover.jsx} +0 -0
  122. /package/src/popover/src/popover-group/{popover-group.js → popover-group.jsx} +0 -0
  123. /package/src/popover/src/popover-option/{popover-option.js → popover-option.jsx} +0 -0
  124. /package/src/preview/src/preview/{preview.js → preview.jsx} +0 -0
  125. /package/src/preview/src/preview-image/{preview-image.js → preview-image.jsx} +0 -0
  126. /package/src/preview/src/preview-plain/{preview-plain.js → preview-plain.jsx} +0 -0
  127. /package/src/preview/src/preview-video/{preview-video.js → preview-video.jsx} +0 -0
  128. /package/src/radio/src/radio/{radio.js → radio.jsx} +0 -0
  129. /package/src/radio/src/radio-group/{radio-group.js → radio-group.jsx} +0 -0
  130. /package/src/rating/src/rating/{rating.js → rating.jsx} +0 -0
  131. /package/src/resizer/src/resizer/{resizer.js → resizer.jsx} +0 -0
  132. /package/src/scrollbar/src/scrollbar/{scrollbar.next.js → scrollbar.jsx} +0 -0
  133. /package/src/select/src/select/{select.js → select.jsx} +0 -0
  134. /package/src/select/src/select-option/{select-option.js → select-option.jsx} +0 -0
  135. /package/src/slider/src/slider/{slider.js → slider.jsx} +0 -0
  136. /package/src/switch/src/switch/{switch.js → switch.jsx} +0 -0
  137. /package/src/table/src/table-cell/{table-cell.js → table-cell.jsx} +0 -0
  138. /package/src/table/src/table-column/{table-column.js → table-column.jsx} +0 -0
  139. /package/src/table/src/table-filter/{table-filter.js → table-filter.jsx} +0 -0
  140. /package/src/tabs/src/tabs/{tabs.js → tabs.jsx} +0 -0
  141. /package/src/tabs/src/tabs-item/{tabs-item.js → tabs-item.jsx} +0 -0
  142. /package/src/tags/src/tags/{tags.js → tags.jsx} +0 -0
  143. /package/src/tags/src/tags-item/{tags-item.js → tags-item.jsx} +0 -0
  144. /package/src/textarea/src/textarea/{textarea.js → textarea.jsx} +0 -0
  145. /package/src/timepicker/src/timepicker/{timepicker.js → timepicker.jsx} +0 -0
  146. /package/src/timepicker/src/timepicker-panel/{timepicker-panel.js → timepicker-panel.jsx} +0 -0
  147. /package/src/transfer/src/transfer/{transfer.js → transfer.jsx} +0 -0
  148. /package/src/virtualscroller/src/virtualscroller/{virtualscroller.beta.js → virtualscroller.jsx} +0 -0
@@ -1,7 +1,5 @@
1
- import Vue from "vue";
2
-
3
- import Select from './src/select/select';
4
- import SelectOption from './src/select-option/select-option';
1
+ import Select from "./src/select/select.jsx";
2
+ import SelectOption from "./src/select-option/select-option.jsx";
5
3
 
6
4
  export default function (App) {
7
5
  App.component(Select.name, Select);
@@ -1,6 +1,4 @@
1
- import Vue from "vue";
2
-
3
- import Slider from './src/slider/slider';
1
+ import Slider from "./src/slider/slider.jsx";
4
2
 
5
3
  export default function (App) {
6
4
  App.component(Slider.name, Slider);
@@ -1,6 +1,4 @@
1
- import Vue from "vue";
2
-
3
- import Switch from './src/switch/switch';
1
+ import Switch from "./src/switch/switch.jsx";
4
2
 
5
3
  export default function (App) {
6
4
  App.component(Switch.name, Switch);
@@ -1,16 +1,16 @@
1
- import Table from './src/table/table';
2
- import TableColumn from './src/table-column/table-column';
3
- import TableCellString from './src/table-cell/types/table-cell-string';
4
- import TableCellBoolean from './src/table-cell/types/table-cell-boolean';
5
- import TableCellDatetime from './src/table-cell/types/table-cell-datetime';
6
- import TableCellOption from './src/table-cell/types/table-cell-option';
7
- import TableCellImage from './src/table-cell/types/table-cell-image';
8
- import TableCellMatrix from './src/table-cell/types/table-cell-matrix';
9
- import TableCellSelect from './src/table-cell/types/table-cell-select';
10
- import TableFilterString from './src/table-filter/types/table-filter-string';
11
- import TableFilterBoolean from './src/table-filter/types/table-filter-boolean';
12
- import TableFilterDatetime from './src/table-filter/types/table-filter-datetime';
13
- import TableFilterOption from './src/table-filter/types/table-filter-option';
1
+ import Table from "./src/table/table.jsx";
2
+ import TableColumn from "./src/table-column/table-column.jsx";
3
+ import TableCellString from "./src/table-cell/types/table-cell-string.jsx";
4
+ import TableCellBoolean from "./src/table-cell/types/table-cell-boolean.jsx";
5
+ import TableCellDatetime from "./src/table-cell/types/table-cell-datetime.jsx";
6
+ import TableCellOption from "./src/table-cell/types/table-cell-option.jsx";
7
+ import TableCellImage from "./src/table-cell/types/table-cell-image.jsx";
8
+ import TableCellMatrix from "./src/table-cell/types/table-cell-matrix.jsx";
9
+ import TableCellSelect from "./src/table-cell/types/table-cell-select.jsx";
10
+ import TableFilterString from "./src/table-filter/types/table-filter-string.jsx";
11
+ import TableFilterBoolean from "./src/table-filter/types/table-filter-boolean.jsx";
12
+ import TableFilterDatetime from "./src/table-filter/types/table-filter-datetime.jsx";
13
+ import TableFilterOption from "./src/table-filter/types/table-filter-option.jsx";
14
14
 
15
15
 
16
16
  export default function (App) {
@@ -1,5 +1,4 @@
1
1
  import { Any, Arr, Obj, Dom, Event, UUID } from "@kizmann/pico-js";
2
- import { h, resolveComponent } from "vue";
3
2
 
4
3
  export default {
5
4
 
@@ -1,4 +1,4 @@
1
- import TableCell from "../table-cell";
1
+ import TableCell from "../table-cell.jsx";
2
2
  import { Any } from "@kizmann/pico-js";
3
3
 
4
4
  export default {
@@ -1,4 +1,4 @@
1
- import TableCell from "../table-cell";
1
+ import TableCell from "../table-cell.jsx";
2
2
  import { Any } from "@kizmann/pico-js";
3
3
 
4
4
  export default {
@@ -1,4 +1,4 @@
1
- import TableCell from "../table-cell";
1
+ import TableCell from "../table-cell.jsx";
2
2
  import { Obj, Any } from "@kizmann/pico-js";
3
3
 
4
4
  export default {
@@ -1,4 +1,4 @@
1
- import TableCell from "../table-cell";
1
+ import TableCell from "../table-cell.jsx";
2
2
  import { Num, Any, Obj, Arr, UUID } from "@kizmann/pico-js";
3
3
 
4
4
  export default {
@@ -1,4 +1,4 @@
1
- import TableCell from "../table-cell";
1
+ import TableCell from "../table-cell.jsx";
2
2
  import { Arr, Obj, Any } from "@kizmann/pico-js";
3
3
 
4
4
  export default {
@@ -1,4 +1,4 @@
1
- import TableCell from "../table-cell";
1
+ import TableCell from "../table-cell.jsx";
2
2
  import { Num, Any, Obj, Arr } from "@kizmann/pico-js";
3
3
 
4
4
  export default {
@@ -1,4 +1,4 @@
1
- import TableCell from "../table-cell";
1
+ import TableCell from "../table-cell.jsx";
2
2
  import { Any } from "@kizmann/pico-js";
3
3
 
4
4
  export default {
@@ -1,4 +1,4 @@
1
- import TableFilter from "../table-filter";
1
+ import TableFilter from "../table-filter.jsx";
2
2
  import { Any } from "@kizmann/pico-js";
3
3
 
4
4
  export default {
@@ -1,4 +1,4 @@
1
- import TableFilter from "../table-filter";
1
+ import TableFilter from "../table-filter.jsx";
2
2
 
3
3
  export default {
4
4
 
@@ -1,4 +1,4 @@
1
- import TableFilter from "../table-filter";
1
+ import TableFilter from "../table-filter.jsx";
2
2
  import { Arr, Obj, Any, Locale } from "@kizmann/pico-js";
3
3
 
4
4
  export default {
@@ -1,4 +1,4 @@
1
- import TableFilter from "../table-filter";
1
+ import TableFilter from "../table-filter.jsx";
2
2
  import { Dom, Any, Locale } from "@kizmann/pico-js";
3
3
 
4
4
  export default {
package/src/tabs/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import Tabs from './src/tabs/tabs';
2
- import TabsItem from './src/tabs-item/tabs-item';
1
+ import Tabs from "./src/tabs/tabs.jsx";
2
+ import TabsItem from "./src/tabs-item/tabs-item.jsx";
3
3
 
4
4
  export default function (App) {
5
5
  App.component(Tabs.name, Tabs);
package/src/tags/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import Tags from './src/tags/tags';
2
- import TagsItem from './src/tags-item/tags-item';
1
+ import Tags from "./src/tags/tags.jsx";
2
+ import TagsItem from "./src/tags-item/tags-item.jsx";
3
3
 
4
4
  export default function (App) {
5
5
  App.component(Tags.name, Tags);
@@ -1,4 +1,4 @@
1
- import Textarea from './src/textarea/textarea';
1
+ import Textarea from "./src/textarea/textarea.jsx";
2
2
 
3
3
  export default function (App) {
4
4
  App.component(Textarea.name, Textarea);
@@ -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);
@@ -1,4 +1,4 @@
1
- import Transfer from "./src/transfer/transfer";
1
+ import Transfer from "./src/transfer/transfer.jsx";
2
2
 
3
3
  export default function (App) {
4
4
  App.component(Transfer.name, Transfer);
@@ -1,4 +1,4 @@
1
- import Virtualscroller from './src/virtualscroller/virtualscroller.beta';
1
+ import Virtualscroller from "./src/virtualscroller/virtualscroller.jsx";
2
2
 
3
3
  export default function (App) {
4
4
  App.component(Virtualscroller.name, Virtualscroller);
@@ -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);
@@ -1,2 +0,0 @@
1
- @import "./src/file-list/file-list";
2
- @import "./src/file-list-item/file-list-item";
@@ -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
- }