@kizmann/nano-ui 0.8.37 → 0.9.1

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 (66) hide show
  1. package/bun.lockb +0 -0
  2. package/demos/overview.html +5 -15
  3. package/demos/select.html +164 -0
  4. package/dist/nano-ui.css +1 -1
  5. package/dist/nano-ui.js +2 -2
  6. package/dist/nano-ui.js.map +1 -1
  7. package/dist/themes/light.css +1 -1
  8. package/docs/README.md +1 -2
  9. package/docs/_sidebar.md +19 -21
  10. package/docs/dist/docs.css +2 -0
  11. package/docs/{data → files/data}/table.md +40 -14
  12. package/docs/files/form/button.md +122 -0
  13. package/docs/{form → files/form}/form.md +14 -0
  14. package/docs/files/form/input.md +90 -0
  15. package/docs/files/form/switch.md +92 -0
  16. package/docs/index.html +163 -44
  17. package/docs/src/scss/docsify/basic/_layout.sass +3 -6
  18. package/docs/src/scss/docsify/syntax.scss +139 -0
  19. package/docs/src/scss/docsify/vue.sass +2 -15
  20. package/docs/src/scss/index.scss +428 -16
  21. package/package.json +1 -1
  22. package/src/button/src/button/button.js +1 -9
  23. package/src/mixins/src/ctor.js +0 -6
  24. package/src/popover/src/popover/popover.scss +4 -0
  25. package/src/radio/src/radio-group/radio-group.js +1 -1
  26. package/src/root/vars.scss +10 -10
  27. package/src/scrollbar/src/scrollbar/scrollbar.next.js +21 -1
  28. package/src/select/src/select/select.js +191 -78
  29. package/src/select/src/select/select.scss +4 -0
  30. package/src/select/src/select-option/select-option.js +6 -2
  31. package/src/table/src/table/table.scss +0 -1
  32. package/src/tags/src/tags-item/tags-item.js +17 -1
  33. package/src/virtualscroller/src/virtualscroller/virtualscroller.beta.js +12 -2
  34. package/themes/light/root/vars.scss +10 -10
  35. package/themes/light/switch/src/switch/switch.scss +1 -1
  36. package/themes/light/table/src/table/table.scss +1 -1
  37. package/themes/light/tags/src/tags-item/tags-item.scss +16 -0
  38. package/webpack.config.js +13 -13
  39. package/dist/themes/basic.css +0 -2029
  40. package/dist/themes/flat.css +0 -1806
  41. package/dist/themes/flat.dark.css +0 -1809
  42. package/docs/dist/index.css +0 -6977
  43. package/docs/form/button.md +0 -299
  44. package/docs/form/input.md +0 -205
  45. package/docs/form/switch.md +0 -166
  46. /package/docs/{data → files/data}/draggable.md +0 -0
  47. /package/docs/{data → files/data}/map.md +0 -0
  48. /package/docs/{data → files/data}/paginator.md +0 -0
  49. /package/docs/{data → files/data}/virtualscroller.md +0 -0
  50. /package/docs/{form → files/form}/cascader.md +0 -0
  51. /package/docs/{form → files/form}/checkbox.md +0 -0
  52. /package/docs/{form → files/form}/datepicker.md +0 -0
  53. /package/docs/{form → files/form}/radio.md +0 -0
  54. /package/docs/{form → files/form}/select.md +0 -0
  55. /package/docs/{form → files/form}/textarea.md +0 -0
  56. /package/docs/{form → files/form}/timepicker.md +0 -0
  57. /package/docs/{form → files/form}/transfer.md +0 -0
  58. /package/docs/{others → files/others}/config.md +0 -0
  59. /package/docs/{others → files/others}/confirm.md +0 -0
  60. /package/docs/{others → files/others}/loader.md +0 -0
  61. /package/docs/{others → files/others}/modal.md +0 -0
  62. /package/docs/{others → files/others}/notification.md +0 -0
  63. /package/docs/{others → files/others}/popover.md +0 -0
  64. /package/docs/{others → files/others}/resizer.md +0 -0
  65. /package/docs/{others → files/others}/scrollbar.md +0 -0
  66. /package/docs/{others → files/others}/tabs.md +0 -0
@@ -4,33 +4,445 @@
4
4
  @import "./mixins/media";
5
5
  @import "./mixins/grid";
6
6
  @import "./mixins/space";
7
+ @import "./docsify/syntax";
8
+
9
+ ::selection {
10
+ background: rgba($color-primary, 0.15);
11
+ }
7
12
 
8
13
  * {
9
- outline: none;
14
+ outline: none !important;
15
+ }
16
+
17
+ div {
18
+ box-sizing: border-box;
10
19
  }
11
20
 
12
21
  html, body {
13
- -webkit-font-smoothing: subpixel-antialiased;
14
- -moz-osx-font-smoothing: grayscale;
22
+ font-family: 'Roboto', sans-serif;
23
+ font-size: 15px;
15
24
  font-variant-numeric: normal;
16
25
  font-feature-settings: normal;
17
26
  }
18
27
 
19
- pre.pretty {
20
- padding: 15px 20px;
21
- background: $--color-black !important;
22
- color: $--color-warning !important;
23
- border-radius: $radius-medium !important;
28
+ body {
29
+ background: #fff linear-gradient(110deg, rgba($color-info, 0.05) 0%, rgba($color-primary, 0.05) 100%);
30
+ }
31
+
32
+ body:before {
33
+ z-index: 9000;
34
+ content: '\00a0';
35
+ position: fixed;
36
+ top: 0;
37
+ left: 0;
38
+ width: 100%;
39
+ height: 100%;
40
+ background: #fff linear-gradient(110deg, $color-info 0%, $color-primary 100%);
41
+ transition: opacity 0.2s 0.4s, transform 0.4s 0.2s;
42
+ }
43
+
44
+ body.ready:before {
45
+ opacity: 0;
46
+ transform: translateY(-100vh);
47
+ }
48
+
49
+ body.ready header {
50
+ opacity: 1;
51
+ }
52
+
53
+ h1 {
54
+ font-size: 32px;
55
+ }
56
+
57
+ h2 {
58
+ font-size: 26px;
59
+ }
60
+
61
+ h3 {
62
+ font-weight: 500;
63
+ font-size: 16px;
64
+ }
65
+
66
+ p {
67
+ font-size: 15px;
68
+ }
69
+
70
+ code {
71
+ font-size: 13.5px;
72
+ }
73
+
74
+ h1, h2, h3, h4, h5, h6 {
75
+ color: $color-primary;
76
+ }
77
+
78
+ h1 a {
79
+ transition: color 0.2s;
80
+ }
81
+
82
+ h1 a, h1 a:active, h1 a:visited,
83
+ h2 a, h2 a:active, h2 a:visited {
84
+ color: $color-gray-90;
85
+ }
86
+
87
+ h1 a:hover, h2 a:hover {
88
+ color: $color-primary;
89
+ }
90
+
91
+ h1 a, h2 a {
92
+ display: inline-flex;
93
+ align-items: center;
94
+ }
95
+
96
+ h1 a:before, h2 a:before {
97
+ content: '#';
98
+ color: $color-primary;
99
+ margin-right: 15px;
100
+ font-size: 18px;
101
+ }
102
+
103
+ h1 a:before {
104
+ font-size: 18px;
105
+ }
106
+
107
+ h2 a:before {
108
+ font-size: 16px;
109
+ }
110
+
111
+ p {
112
+ color: $color-gray-65;
113
+ }
114
+
115
+ code {
116
+ font-family: 'Roboto Mono', Monaco, courier, monospace;
117
+ color: mix($color-gray-75, $color-primary, 25%);
118
+ background: mix($color-background, $color-primary, 95%);
119
+ }
120
+
121
+ a, a:active, a:visited {
122
+ color: $color-primary;
123
+ text-decoration: none;
124
+ }
125
+
126
+ a:hover {
127
+ color: $color-primary-dark;
128
+ }
129
+
130
+ table {
131
+ width: 100%;
132
+ background: $color-white;
133
+ border-radius: $lg-radius;
134
+ border-collapse: collapse;
135
+ box-shadow: 0 1px 14px rgba($color-shadow, 0.075);
136
+ }
137
+
138
+ table th,
139
+ table td {
140
+ min-width: 180px;
141
+ text-align: left;
142
+ }
143
+
144
+ table thead tr th {
145
+ padding: 19px 24px;
146
+ color: $color-gray-90;
147
+ font-size: 13px;
148
+ }
149
+
150
+ table thead tr th b,
151
+ table thead tr th strong {
152
+ font-weight: 500;
153
+ }
154
+
155
+ table thead tr:first-child th:first-child {
156
+ border-radius: $lg-radius 0 0 0;
157
+ }
158
+
159
+ table thead tr:first-child th:last-child {
160
+ border-radius: 0 $lg-radius 0 0;
161
+ }
162
+
163
+ table thead tr:last-child th {
164
+ border-bottom: 1px solid $color-gray-10;
165
+ }
166
+
167
+ table thead tr th:not(:last-child) {
168
+ border-right: 1px solid $color-gray-10;
169
+ }
170
+
171
+ table tbody tr td {
172
+ padding: 14px 24px;
173
+ color: $color-gray-65;
174
+ font-size: 15px;
175
+ }
176
+
177
+ table tbody tr td code {
178
+ //color: mix($color-gray-75, $color-info, 25%);
179
+ }
180
+
181
+ table tbody tr td:nth-child(1) code {
182
+ font-weight: 700;
183
+ color: mix($color-gray-90, $color-success, 10%);
184
+ background: mix($color-background, $color-success, 95%);
185
+ }
186
+
187
+ table tbody tr:not(:last-child) td {
188
+ border-bottom: 1px solid $color-gray-05;
189
+ }
190
+
191
+ header {
192
+ overflow: hidden;
193
+ position: relative;
194
+ width: 100%;
195
+ border-bottom: 1px solid rgba($color-black, 0.07);
196
+ }
197
+
198
+ header .wrapper {
199
+ z-index: 100;
200
+ position: relative;
201
+ display: flex;
202
+ flex-direction: row;
203
+ align-items: center;
204
+ width: 100%;
205
+ height: 140px;
206
+ max-width: 1490px;
207
+ margin: 0 auto;
208
+ padding: 0 40px;
209
+ }
210
+
211
+ header .logo {
212
+ text-align: center;
213
+ margin-right: auto;
214
+ }
215
+
216
+ header .logo a {
217
+ display: inline-block;
218
+ max-width: 130px;
219
+ }
220
+
221
+ header .logo img {
222
+ display: block;
223
+ width: 100%;
224
+ max-height: 100%;
225
+ }
226
+
227
+ header .social:not(:last-child) {
228
+ margin-right: 30px;
229
+ }
230
+
231
+ header .social a {
232
+ display: inline-flex;
233
+ align-items: center;
234
+ padding: 10px 14px;
235
+ font-size: 13px;
236
+ border-radius: 500px;
237
+ color: $color-gray-70;
238
+ //background: rgba($color-gray-50, 0.1);
239
+ }
240
+
241
+ header .social.black a {
242
+ color: rgba($color-white, 0.9);
243
+ background: $color-black;
244
+ }
245
+
246
+ header .social.blue a {
247
+ color: rgba($color-white, 0.9);
248
+ background: $color-primary;
249
+ }
250
+
251
+ header .social a i {
252
+ opacity: 0.8;
253
+ margin-right: 12px;
254
+ }
255
+
256
+ main {
257
+ z-index: 200;
258
+ position: relative;
259
+ overflow-x: hidden;
260
+ display: flex;
261
+ flex-direction: row;
262
+ justify-content: center;
263
+ padding: 35px 0;
264
+ }
265
+
266
+ .sidebar {
267
+ flex: 0 0 auto;
268
+ display: none;
269
+ flex-direction: column;
270
+ width: 320px;
271
+ padding: 10px 35px 10px 35px;
272
+ margin-right: 50px;
273
+ border-right: 1px solid rgba($color-black, 0.07);
274
+
275
+ @include media('lg') {
276
+ display: flex;
277
+ }
278
+ }
279
+
280
+ .content {
281
+ flex: 1 1 auto;
282
+ width: 100%;
283
+ max-width: 1120px;
284
+ padding: 10px 30px;
285
+ }
286
+
287
+ .app-name {
288
+ display: none;
289
+ order: 100;
290
+ width: 100%;
291
+ padding: 5px 0 20px;
292
+ text-align: center;
293
+ }
294
+
295
+ .app-name > a {
296
+ display: inline-block;
297
+ max-width: 120px;
298
+ }
299
+
300
+ .app-name > a > img {
301
+ width: 100%;
302
+ }
303
+
304
+ .search {
305
+ position: relative;
306
+ order: 200;
307
+ border: none !important;
308
+ padding: 8px 4px 12px 12px !important;
309
+ }
310
+
311
+ .search .input-wrap {
312
+ border-radius: 500px;
313
+ background: rgba($color-black, 0.05);
314
+ }
315
+
316
+ .search .input-wrap input {
317
+ height: 44px;
318
+ line-height: 44px;
319
+ padding: 0 0 0 24px;
320
+ }
321
+
322
+ .search .input-wrap input,
323
+ .search .input-wrap input:focus {
324
+ appearance: none;
325
+ background: transparent;
326
+ border: none;
327
+ box-shadow: none;
328
+ }
329
+
330
+ .results-panel {
331
+ position: absolute;
332
+ top: 100%;
333
+ left: 0;
334
+ }
335
+
336
+ .matching-post > p,
337
+ .matching-post > a > p {
338
+ //display: none !important;
339
+ }
340
+
341
+ .sidebar-nav {
342
+ order: 300;
343
+ }
344
+
345
+ .sidebar-nav p {
346
+ padding: 4px 12px;
347
+ font-size: 11px;
348
+ font-weight: 600;
349
+ color: $color-gray-80;
350
+ text-transform: uppercase;
351
+ }
352
+
353
+ .sidebar-nav ul ul {
354
+ padding: 4px 0 4px 14px;
355
+ }
356
+
357
+ .sidebar-nav a {
358
+ transition: color 0.2s, background 0.2s;
359
+ }
360
+
361
+ .sidebar-nav a, .sidebar-nav a:active, .sidebar-nav a:visited {
362
+ display: inline-block;
363
+ font-size: 14px;
364
+ color: $color-gray-55;
365
+ padding: 4px 12px;
366
+ border-radius: $md-radius;
367
+ }
368
+
369
+ .sidebar-nav ul ul ul > li > a:before {
370
+ content: '-';
371
+ color: $color-gray-20;
372
+ margin-right: 8px;
373
+ }
374
+
375
+ .sidebar-nav a:hover {
376
+ color: $color-gray-75;
377
+ }
378
+
379
+ .sidebar-nav li > a:has(+ .app-sub-sidebar),
380
+ .sidebar-nav li > a:active:has(+ .app-sub-sidebar),
381
+ .sidebar-nav li > a:visited:has(+ .app-sub-sidebar) {
382
+ color: $color-primary;
383
+ background: rgba($color-primary, 0.1);
384
+ }
385
+
386
+ .sidebar-nav ul ul ul li.active > a,
387
+ .sidebar-nav ul ul ul li.active > a:active,
388
+ .sidebar-nav ul ul ul li.active > a:visited {
389
+ color: $color-gray-90;
390
+ }
391
+
392
+ .markdown-section h1,
393
+ .markdown-section h2,
394
+ .markdown-section h3,
395
+ .markdown-section h4,
396
+ .markdown-section h5,
397
+ .markdown-section h6,
398
+ .markdown-section p {
399
+ margin-bottom: 30px;
400
+ }
401
+
402
+ .markdown-section code {
403
+ background-color: rgba($color-primary, 0.15);
404
+ border-radius: $md-radius;
405
+ font-size: 0.8rem;
406
+ margin: 0 2px;
407
+ padding: 3px 5px;
408
+ white-space: pre-wrap;
409
+ }
410
+
411
+ .markdown-section code[data-type] {
412
+ color: mix($color-gray-90, $color-gray-40, 10%);
413
+ background: mix($color-background, $color-gray-40, 95%);
414
+ }
415
+
416
+ .markdown-section table {
417
+ margin-bottom: 30px;
418
+ }
419
+
420
+ .demo-wrapper {
421
+ overflow: hidden;
422
+ position: relative;
423
+ margin-bottom: 30px;
424
+ border-radius: $lg-radius;
425
+ background: $color-white;
426
+ box-shadow: 0 1px 14px rgba($color-shadow, 0.075);
427
+ }
428
+
429
+ .markdown-section .demo-options {
430
+ padding: 20px 40px 24px;
431
+ border-bottom: 1px solid $color-gray-10;
432
+ }
433
+
434
+ .markdown-section .demo-options .n-form-item {
435
+ margin-bottom: 4px;
436
+ }
437
+
438
+ .markdown-section .demo-options .n-select {
439
+ //width: 220px;
24
440
  }
25
441
 
26
- .app-name img {
27
- width: 80px;
28
- height: 80px;
29
- margin: 0 auto 20px auto;
442
+ .markdown-section .demo-display {
443
+ padding: 40px;
30
444
  }
31
445
 
32
- .demo-box {
33
- border: 1px solid $color-gray-10;
34
- border-radius: $radius-medium;
35
- box-shadow: 0 1px 3px rgba($color-black, 0.05);
446
+ .markdown-section .demo-display > .grid:not(:last-child) {
447
+ margin-bottom: 20px;
36
448
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kizmann/nano-ui",
3
- "version": "0.8.37",
3
+ "version": "0.9.1",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "author": "Eduard Kizmann <kizmann@protonmail.ch>",
@@ -62,14 +62,6 @@ export default {
62
62
  type: [String]
63
63
  },
64
64
 
65
- buttonType: {
66
- default()
67
- {
68
- return 'button';
69
- },
70
- type: [String]
71
- },
72
-
73
65
  nativeType: {
74
66
  default()
75
67
  {
@@ -135,7 +127,7 @@ export default {
135
127
  }
136
128
 
137
129
  if ( this.$slots.default && ! this.square ) {
138
- innerHtml.push(<span>{ this.$slots.default() }</span>);
130
+ innerHtml.push(<span>{ this.$slots.default && this.$slots.default() }</span>);
139
131
  }
140
132
 
141
133
  if ( this.iconPosition === 'after' ) {
@@ -6,12 +6,6 @@ export default {
6
6
  {
7
7
  let ctor = Obj.get(this.$options, key.split('.'), -1);
8
8
 
9
-
10
-
11
- //console.log(this.$options, ctor);
12
-
13
- // console.log(ctor);
14
-
15
9
  // if ( ctor === -1 ) {
16
10
  // ctor = Obj.get(this.$vnode.componentOptions.Ctor,
17
11
  // Arr.merge(['options'], key.split('.')), -1);
@@ -49,6 +49,10 @@
49
49
  font-weight: bold;
50
50
  }
51
51
 
52
+ .n-popover-option {
53
+ width: 100%;
54
+ }
55
+
52
56
  .n-popover-option.n-disabled {
53
57
  cursor: not-allowed;
54
58
  opacity: 0.7;
@@ -101,7 +101,7 @@ export default {
101
101
 
102
102
  return (
103
103
  <div class={classList}>
104
- { this.$slots.default() }
104
+ { this.$slots.default && this.$slots.default() }
105
105
  </div>
106
106
  );
107
107
  }
@@ -21,15 +21,15 @@ $color-gray-85: mix($color-black, $color-white, 0.85 * 100%) !default;
21
21
  $color-gray-90: mix($color-black, $color-white, 0.90 * 100%) !default;
22
22
  $color-gray-95: mix($color-black, $color-white, 0.95 * 100%) !default;
23
23
 
24
- $color-primary: #4e7bff !default;
25
- $color-secondary: #683bff !default;
24
+ $color-secondary: #ca62f0 !default;
25
+ $color-primary: #6875ee !default;
26
26
 
27
- $color-success: #3ed786 !default;
28
- $color-warning: #ffac2f !default;
29
- $color-danger: #fd2f51 !default;
30
- $color-info: #37C4EF !default;
27
+ $color-success: #06C493 !default;
28
+ $color-warning: #FFBF3F !default;
29
+ $color-danger: #F9536E !default;
30
+ $color-info: #4BD6F9 !default;
31
31
 
32
- $color-background: #f0f3f7 !default;
32
+ $color-background: #FAFAFB !default;
33
33
 
34
34
  $color-shadow: mix($color-black, $color-primary, 80%) !default;
35
35
 
@@ -95,8 +95,8 @@ $color-background-darker: darken(mix($color-black, $color-background, 20%), 5%
95
95
 
96
96
  $xs-radius: 2px !default;
97
97
  $sm-radius: 2px !default;
98
- $md-radius: 3px !default;
99
- $lg-radius: 5px !default;
98
+ $md-radius: 4px !default;
99
+ $lg-radius: 6px !default;
100
100
  $xl-radius: 10px !default;
101
101
 
102
102
  $form: (
@@ -114,7 +114,7 @@ $form: (
114
114
  ),
115
115
  'md': (
116
116
  'size': 32px,
117
- 'font': 14px,
117
+ 'font': 15px,
118
118
  'radius': $md-radius,
119
119
  'ratio': 0.40,
120
120
  ),
@@ -277,10 +277,20 @@ export default {
277
277
  let innerHeight = this.$refs.content
278
278
  .scrollHeight || 0;
279
279
 
280
+ let virtualHeight = 0;
281
+
282
+ Dom.find(this.$refs.content).childs().each((el) => {
283
+ virtualHeight += Dom.find(el).height() || 0;
284
+ });
285
+
280
286
  if ( this.native && ! this.allowNative ) {
281
287
  innerHeight -= 16;
282
288
  }
283
289
 
290
+ if ( virtualHeight > innerHeight ) {
291
+ innerHeight = virtualHeight;
292
+ }
293
+
284
294
  // if ( offsetHeight === 0 && this.overflowX ) {
285
295
  // innerHeight -= 15;
286
296
  // }
@@ -363,10 +373,20 @@ export default {
363
373
  let innerWidth = this.$refs.content
364
374
  .scrollWidth || 0;
365
375
 
376
+ let virtualWidth = 0;
377
+
378
+ Dom.find(this.$refs.content).childs().each((el) => {
379
+ virtualWidth += Dom.find(el).width() || 0;
380
+ });
381
+
366
382
  if ( this.native && ! this.allowNative ) {
367
383
  innerWidth -= 16;
368
384
  }
369
385
 
386
+ if ( virtualWidth > innerWidth ) {
387
+ innerWidth = virtualWidth;
388
+ }
389
+
370
390
  // if ( offsetWidth === 0 && this.overflowY ) {
371
391
  // innerWidth -= 15;
372
392
  // }
@@ -437,7 +457,7 @@ export default {
437
457
  scroll.left = this.$refs.content.scrollLeft;
438
458
  }
439
459
 
440
- let vbarTop= Math.ceil((this.outerHeight / this.innerHeight) *
460
+ let vbarTop = Math.ceil((this.outerHeight / this.innerHeight) *
441
461
  scroll.top * this.heightRatio) || 0;
442
462
 
443
463
  if ( ! this.vbarTop || vbarTop !== this.vbarTop ) {