@kizmann/nano-ui 1.0.14 → 1.0.15

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.
@@ -1,4 +1,4 @@
1
- import { UUID } from "@kizmann/pico-js";
1
+ import { Arr, UUID } from "@kizmann/pico-js";
2
2
 
3
3
  export default {
4
4
 
@@ -107,27 +107,32 @@ export default {
107
107
 
108
108
  },
109
109
 
110
+ data()
111
+ {
112
+ return {
113
+ uid: UUID(), tempValue: this.modelValue, items: []
114
+ };
115
+ },
116
+
117
+ provide()
118
+ {
119
+ return { NFormGroup: this };
120
+ },
121
+
110
122
  mounted()
111
123
  {
112
124
  if ( this.NForm ) {
113
- this.NForm.registerGroup(this);
125
+ this.NForm.appendGroup(this);
114
126
  }
115
127
  },
116
128
 
117
129
  unmounted()
118
130
  {
119
131
  if ( this.NForm ) {
120
- this.NForm.unregisterGroup(this);
132
+ this.NForm.removeGroup(this);
121
133
  }
122
134
  },
123
135
 
124
- data()
125
- {
126
- return {
127
- tempValue: this.modelValue
128
- };
129
- },
130
-
131
136
  watch: {
132
137
 
133
138
  modelValue(value)
@@ -141,6 +146,21 @@ export default {
141
146
 
142
147
  methods: {
143
148
 
149
+ getItems()
150
+ {
151
+ return this.items;
152
+ },
153
+
154
+ appendItem(item)
155
+ {
156
+ this.items[item.uid] = item;
157
+ },
158
+
159
+ removeItem(item)
160
+ {
161
+ delete this.items[item.uid];
162
+ },
163
+
144
164
  toggleGroup()
145
165
  {
146
166
  this.$emit('update:modelValue', this.tempValue = ! this.tempValue);
@@ -154,7 +174,7 @@ export default {
154
174
  closeGroup()
155
175
  {
156
176
  this.$emit('update:modelValue', this.tempValue = true);
157
- }
177
+ },
158
178
 
159
179
  },
160
180
 
@@ -6,11 +6,15 @@ export default {
6
6
 
7
7
  inject: {
8
8
 
9
+ NTabs: {
10
+ default: undefined
11
+ },
12
+
9
13
  NForm: {
10
14
  default: undefined
11
15
  },
12
16
 
13
- NTabs: {
17
+ NFormGroup: {
14
18
  default: undefined
15
19
  },
16
20
 
@@ -175,8 +179,8 @@ export default {
175
179
 
176
180
  beforeMount()
177
181
  {
178
- if ( this.NForm ) {
179
- this.NForm.addItem(this);
182
+ if ( this.NFormGroup ) {
183
+ this.NFormGroup.appendItem(this);
180
184
  }
181
185
  },
182
186
 
@@ -189,8 +193,8 @@ export default {
189
193
 
190
194
  beforeUnmount()
191
195
  {
192
- if ( this.NForm ) {
193
- this.NForm.removeItem(this);
196
+ if ( this.NFormGroup ) {
197
+ this.NFormGroup.removeItem(this);
194
198
  }
195
199
  },
196
200
 
@@ -83,7 +83,7 @@ export default {
83
83
  computed: {
84
84
 
85
85
  touch() {
86
- return !! ('ontouchstart' in window ||
86
+ return !! ('ontouchstart' in window ||
87
87
  navigator.msMaxTouchPoints);
88
88
  },
89
89
 
@@ -140,6 +140,8 @@ export default {
140
140
  Dom.find(window).on('resize', Any.debounce((...args) => {
141
141
  this.onResize(...args)
142
142
  }, 500), this._.uid);
143
+
144
+ this.updateHandle();
143
145
  },
144
146
 
145
147
  updated()
@@ -153,10 +155,10 @@ export default {
153
155
  this.unbindSizechange();
154
156
  }
155
157
 
156
- Event.unbind('NResizer:move',
158
+ Event.unbind('NResizer:move',
157
159
  this._.uid);
158
-
159
- Dom.find(window).off('resize',
160
+
161
+ Dom.find(window).off('resize',
160
162
  null, this._.uid);
161
163
  },
162
164
 
@@ -167,7 +169,7 @@ export default {
167
169
  if ( ! Arr.has(group, this.group) ) {
168
170
  return;
169
171
  }
170
-
172
+
171
173
  if ( ! this.tempValue || ! this.group.length ) {
172
174
  return;
173
175
  }
@@ -190,9 +192,9 @@ export default {
190
192
  return;
191
193
  }
192
194
 
193
- this.$emit('update:modelValue',
195
+ this.$emit('update:modelValue',
194
196
  this.tempValue = width);
195
-
197
+
196
198
  this.updateHandle();
197
199
  },
198
200
 
@@ -203,7 +205,7 @@ export default {
203
205
  if ( this.position === 'left' ) {
204
206
  style.transform =`translateX(-${this.tempValue - this.resizerWidth}px)`
205
207
  }
206
-
208
+
207
209
  if ( this.position === 'right' ) {
208
210
  style.transform = `translateX(${this.tempValue - this.resizerWidth}px)`
209
211
  }
@@ -213,7 +215,7 @@ export default {
213
215
 
214
216
  bindSizechange()
215
217
  {
216
- Dom.find(this.NScrollbar.$el).on('resized',
218
+ Dom.find(this.NScrollbar.$el).on('resized',
217
219
  Any.debounce(this.updateWidth, 50), this._.uid);
218
220
  },
219
221
 
@@ -267,7 +269,7 @@ export default {
267
269
 
268
270
  onLeftMousemove(event)
269
271
  {
270
- this.clientX = (window.innerWidth -
272
+ this.clientX = (window.innerWidth -
271
273
  this.getTouchEvent(event).clientX);
272
274
 
273
275
  let offsetX = Dom.find(this.$el)
@@ -462,7 +464,7 @@ export default {
462
464
  if ( this.disabled ) {
463
465
  return null;
464
466
  }
465
-
467
+
466
468
  let classList = [
467
469
  'n-resizer__handle',
468
470
  ];
@@ -503,6 +505,10 @@ export default {
503
505
  style['flex-basis'] = this.width + 'px';
504
506
  }
505
507
 
508
+ if ( this.modelValue == this.tempValue ) {
509
+ style['flex-basis'] = this.modelValue + 'px';
510
+ }
511
+
506
512
  if ( this.minWidth ) {
507
513
  style['min-width'] = this.minWidth + 'px';
508
514
  }
@@ -381,7 +381,7 @@ export default {
381
381
  minWidth: this.minWidth,
382
382
  maxWidth: this.maxWidth,
383
383
  disabled: !!this.fixedWidth,
384
- group: [this.NTable.uid],
384
+ group: ['n-table', this.NTable.uid],
385
385
  };
386
386
 
387
387
  props['onUpdate:modelValue'] = (value) => {
@@ -31,7 +31,7 @@ export default {
31
31
  return (
32
32
  <NForm>
33
33
  <NFormItem>
34
- <NDatepicker size="sm" vModel={this.filter.value} format={this.column.datetimeFormat} />
34
+ <NDatepicker size="sm" vModel={this.filter.value} />
35
35
  </NFormItem>
36
36
  <NFormItem>
37
37
  <NSelect size="sm" vModel={this.filter.operator} options={options} />
@@ -5,12 +5,36 @@
5
5
  opacity: 0.7;
6
6
  }
7
7
 
8
- .n-button--default:not(.n-button--link) {
9
- color: $color-foreground;
10
- background: rgba($color-foreground, 0.05);
8
+ .n-button--default:not(.n-button--link,.n-button--glass) {
9
+ color: rgba($color-foreground, 0.8);
10
+ background: rgba($color-foreground, 0.1);
11
11
  }
12
12
 
13
- .n-button--default:not(.n-button--link):hover {
13
+ .n-button--default:not(.n-button--link,.n-button--glass):hover {
14
+ color: rgba($color-foreground, 0.9);
15
+ background: rgba($color-foreground, 0.15);
16
+ }
17
+
18
+ .n-button--default:not(.n-button--link,.n-button--glass).n-disabled {
19
+ color: rgba($color-foreground, 0.8);
20
+ background: rgba($color-foreground, 0.1);
21
+ }
22
+
23
+ .n-button--default.n-button--link:not(.n-disabled) {
24
+ color: rgba($color-foreground, 0.8);
25
+ }
26
+
27
+ .n-button--default.n-button--link:not(.n-disabled):hover {
28
+ color: rgba($color-foreground, 0.9);
29
+ }
30
+
31
+ .n-button--default.n-button--glass:not(.n-disabled) {
32
+ color: rgba($color-foreground, 0.8);
33
+ background: rgba($color-foreground, 0.1);
34
+ }
35
+
36
+ .n-button--default.n-button--glass:not(.n-disabled):hover {
37
+ color: rgba($color-foreground, 0.9);
14
38
  background: rgba($color-foreground, 0.15);
15
39
  }
16
40
 
@@ -24,23 +48,23 @@
24
48
  * Button primary
25
49
  */
26
50
 
27
- .n-button--#{$color}:not(.n-button--link) {
51
+ .n-button--#{$color}:not(.n-button--link,.n-button--glass) {
28
52
  color: $color-white;
29
53
  background: $-color-base;
30
54
  border-color: $-color-base;
31
55
  }
32
56
 
33
- .n-button--#{$color}:not(.n-button--link):hover {
57
+ .n-button--#{$color}:not(.n-button--link,.n-button--glass):hover {
34
58
  background: $-color-light;
35
59
  border-color: $-color-light;
36
60
  }
37
61
 
38
- .n-button--#{$color}:not(.n-button--link):focus {
62
+ .n-button--#{$color}:not(.n-button--link,.n-button--glass):focus {
39
63
  background: $-color-dark;
40
64
  border-color: $-color-dark;
41
65
  }
42
66
 
43
- .n-button--#{$color}:not(.n-button--link).n-disabled {
67
+ .n-button--#{$color}:not(.n-button--link,.n-button--glass).n-disabled {
44
68
  background: $-color-base;
45
69
  border-color: $-color-base;
46
70
  }
@@ -57,4 +81,18 @@
57
81
  color: $-color-dark;
58
82
  }
59
83
 
84
+ .n-button--#{$color}:not(.n-disabled).n-button--glass {
85
+ color: $-color-base;
86
+ background: rgba($-color-base, 0.25);
87
+ }
88
+
89
+ .n-button--#{$color}:not(.n-disabled).n-button--glass:hover {
90
+ color: $-color-dark;
91
+ background: rgba($-color-base, 0.35);
92
+ }
93
+
94
+ .n-button--#{$color}:not(.n-disabled).n-button--glass:focus {
95
+ color: $-color-dark;
96
+ }
97
+
60
98
  }
@@ -19,7 +19,7 @@
19
19
  background: $-color-base;
20
20
  }
21
21
 
22
- .n-form-frame__menu--#{$color}.is-first {
22
+ .n-form-frame__menu--#{$color}.is-star {
23
23
  background: rgba($-color-base, 0.15);
24
24
  }
25
25
 
@@ -27,7 +27,7 @@
27
27
  color: $-color-base;
28
28
  }
29
29
 
30
- .n-form-frame__menu--#{$color}.is-visible span {
30
+ .n-form-frame__menu--#{$color}.is-star span {
31
31
  color: $-color-base;
32
32
  }
33
33