@kizmann/nano-ui 1.1.4 → 2.0.0
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/README.md +4 -4
- package/dist/nano-ui.css +1 -1
- package/dist/nano-ui.esm.js +2 -0
- package/dist/nano-ui.esm.js.map +1 -0
- package/dist/themes/default.css +1 -1
- package/dist/themes/webservy.css +1 -1
- package/package.json +10 -7
- package/src/alert/src/alert/alert-handler.mjs +6 -6
- package/src/cascader/src/cascader/cascader.jsx +5 -5
- package/src/cascader/src/cascader-panel/cascader-panel.jsx +4 -4
- package/src/chart/src/chart-bar/chart-bar.jsx +3 -3
- package/src/chart/src/chart-donut/chart-donut.jsx +6 -6
- package/src/chart/src/chart-item/chart-item.jsx +3 -3
- package/src/checkbox/src/checkbox/checkbox.jsx +2 -2
- package/src/checkbox/src/checkbox-group/checkbox-group.jsx +1 -1
- package/src/collapse/src/collapse/collapse.jsx +2 -2
- package/src/collapse/src/collapse-item/collapse-item.jsx +1 -1
- package/src/config/index.js +6 -6
- package/src/config/src/builder/builder.jsx +35 -35
- package/src/config/src/builder/prototypes/switch/n-switch.js +3 -3
- package/src/config/src/config/config-next.jsx +20 -20
- package/src/config/src/config/config.jsx +10 -10
- package/src/config/src/reference-panel/reference-panel.jsx +4 -4
- package/src/config/src/reference-picker/reference-picker.jsx +1 -1
- package/src/confirm/src/confirm/confirm-handler.mjs +9 -8
- package/src/confirm/src/confirm/confirm.jsx +4 -4
- package/src/datepicker/src/datepicker-panel/datepicker-panel.jsx +16 -16
- package/src/datetimepicker/src/datetimepicker/datetimepicker.jsx +1 -1
- package/src/draggable/src/draggrid/draggrid.jsx +5 -5
- package/src/draggable/src/draghandler/draghandler.js +65 -52
- package/src/draggable/src/draglist/draglist.jsx +11 -11
- package/src/draggable/src/draglist-item/draglist-item.jsx +2 -0
- package/src/draggable/src/dropzone/dropzone.jsx +5 -5
- package/src/drawer/src/drawer/drawer.jsx +5 -5
- package/src/durationpicker/src/durationpicker/durationpicker.jsx +7 -7
- package/src/file/src/file/file.jsx +3 -3
- package/src/form/src/form/form-rules.mjs +20 -21
- package/src/form/src/form/form.jsx +9 -9
- package/src/form/src/form/form.scss +5 -3
- package/src/form/src/form-bag/form-bag.jsx +3 -3
- package/src/form/src/form-frame/form-frame.jsx +11 -11
- package/src/form/src/form-group/form-group.jsx +3 -3
- package/src/form/src/form-item/form-item.jsx +3 -3
- package/src/index.scss +3 -0
- package/src/info/src/info/info.jsx +6 -6
- package/src/info/src/info-column/info-column.jsx +2 -2
- package/src/info/src/info-field/types/info-field-boolean.jsx +2 -2
- package/src/info/src/info-field/types/info-field-datetime.jsx +2 -2
- package/src/info/src/info-field/types/info-field-option.jsx +3 -3
- package/src/info/src/info-field/types/info-field-string.jsx +2 -2
- package/src/input-number/src/input-number/input-number.jsx +7 -8
- package/src/loader/src/loader/loader.jsx +3 -3
- package/src/map/src/map/map.jsx +3 -3
- package/src/map/src/map-marker/map-marker.jsx +4 -4
- package/src/mixins/src/cmer.js +7 -7
- package/src/mixins/src/cslo.js +1 -1
- package/src/modal/src/modal/modal.jsx +5 -5
- package/src/notification/src/notification/notification-handler.mjs +3 -3
- package/src/paginator/src/paginator/paginator.jsx +3 -3
- package/src/popover/src/popover/popover-element.mjs +12 -12
- package/src/popover/src/popover/popover-handler.mjs +5 -5
- package/src/popover/src/popover/popover.jsx +5 -4
- package/src/popover/src/popover-option/popover-option.jsx +1 -1
- package/src/preview/src/preview/preview-handler.mjs +6 -6
- package/src/preview/src/preview/preview-helper.mjs +6 -6
- package/src/preview/src/preview/preview.jsx +3 -3
- package/src/preview/src/preview-image/preview-image.jsx +3 -3
- package/src/preview/src/preview-modal/preview-modal.jsx +3 -3
- package/src/preview/src/preview-plain/preview-plain.jsx +1 -1
- package/src/preview/src/preview-video/preview-video.jsx +2 -2
- package/src/radio/src/radio/radio.jsx +1 -1
- package/src/radio/src/radio-group/radio-group.jsx +1 -1
- package/src/rating/src/rating/rating.jsx +2 -2
- package/src/resizer/src/resizer/resizer-next.jsx +19 -19
- package/src/resizer/src/resizer/resizer.jsx +17 -17
- package/src/scrollbar/src/scrollbar/scrollbar.jsx +17 -17
- package/src/select/src/select/select.jsx +25 -25
- package/src/select/src/select-option/select-option.jsx +4 -4
- package/src/slider/src/slider/slider.jsx +18 -16
- package/src/slider/src/slider/slider.scss +6 -25
- package/src/switch/src/switch/switch.jsx +1 -1
- package/src/table/src/table/table.jsx +21 -18
- package/src/table/src/table-cell/types/table-cell-boolean.jsx +2 -2
- package/src/table/src/table-cell/types/table-cell-datetime.jsx +2 -2
- package/src/table/src/table-cell/types/table-cell-image.jsx +1 -1
- package/src/table/src/table-cell/types/table-cell-matrix.jsx +5 -5
- package/src/table/src/table-cell/types/table-cell-option.jsx +3 -3
- package/src/table/src/table-cell/types/table-cell-select.jsx +5 -5
- package/src/table/src/table-cell/types/table-cell-string.jsx +2 -4
- package/src/table/src/table-column/table-column.jsx +5 -5
- package/src/table/src/table-filter/table-filter.jsx +5 -5
- package/src/table/src/table-filter/types/table-filter-boolean.jsx +1 -1
- package/src/table/src/table-filter/types/table-filter-option.jsx +2 -2
- package/src/table/src/table-filter/types/table-filter-string.jsx +1 -1
- package/src/tabs/src/tabs/tabs.jsx +2 -2
- package/src/tags/src/tags/tags.jsx +1 -1
- package/src/tags/src/tags-item/tags-item.jsx +2 -2
- package/src/textarea/src/textarea/textarea.jsx +1 -1
- package/src/timepicker/src/timepicker/timepicker.jsx +4 -4
- package/src/timepicker/src/timepicker-panel/timepicker-panel.jsx +6 -6
- package/src/transfer/src/transfer/transfer.jsx +4 -4
- package/src/transfer/src/transfer/transfer.scss +4 -0
- package/src/virtualscroller/src/virtualscroller/virtualscroller.jsx +8 -5
- package/themes/default/datepicker/src/datepicker/datepicker.scss +1 -1
- package/themes/default/datepicker/src/datepicker-panel/datepicker-panel.scss +2 -2
- package/themes/default/datetimepicker/src/datetimepicker/datetimepicker.scss +1 -1
- package/themes/default/draggable/src/draglist-item/draglist-item.scss +1 -1
- package/themes/default/durationpicker/src/durationpicker/durationpicker.scss +1 -1
- package/themes/default/popover/src/popover/popover.scss +1 -1
- package/themes/default/preview/src/preview-modal/preview-modal.scss +1 -1
- package/themes/default/slider/src/slider/slider.scss +2 -3
- package/themes/default/timepicker/src/timepicker/timepicker.scss +1 -1
- package/themes/default/transfer/src/transfer/transfer.scss +1 -0
- package/themes/webservy/confirm/src/confirm/confirm.scss +1 -1
- package/themes/webservy/datepicker/src/datepicker/datepicker.scss +1 -1
- package/themes/webservy/datetimepicker/src/datetimepicker/datetimepicker.scss +1 -1
- package/themes/webservy/draggable/src/draggrid-item/draggrid-item.scss +1 -1
- package/themes/webservy/drawer/src/drawer/drawer.scss +1 -1
- package/themes/webservy/durationpicker/src/durationpicker/durationpicker.scss +1 -1
- package/themes/webservy/modal/src/modal/modal.scss +1 -1
- package/themes/webservy/preview/src/preview-modal/preview-modal.scss +1 -1
- package/themes/webservy/timepicker/src/timepicker/timepicker.scss +1 -1
- package/dist/nano-ui.js +0 -2
- package/dist/nano-ui.js.map +0 -1
- /package/src/{index.js → index.esm.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Hash, Run, Arr, Obj, Dom, Mix, Event, Locale } from "@kizmann/pico-js";
|
|
2
2
|
import NDraghandler from "../draghandler/draghandler.js";
|
|
3
3
|
|
|
4
4
|
window.DEBUG_NDLIST = false;
|
|
@@ -315,7 +315,7 @@ export default {
|
|
|
315
315
|
data()
|
|
316
316
|
{
|
|
317
317
|
return {
|
|
318
|
-
uid:
|
|
318
|
+
uid: Hash.uuid(),
|
|
319
319
|
modifier: [],
|
|
320
320
|
virtuals: [],
|
|
321
321
|
visible: [],
|
|
@@ -478,7 +478,7 @@ export default {
|
|
|
478
478
|
scrollTo(x = 0, y = 0)
|
|
479
479
|
{
|
|
480
480
|
if ( ! this.$refs.virtualscroller ) {
|
|
481
|
-
return
|
|
481
|
+
return Run.delay(() => this.scrollTo(x, y));
|
|
482
482
|
}
|
|
483
483
|
|
|
484
484
|
this.$refs.virtualscroller.scrollTo(x, y);
|
|
@@ -487,7 +487,7 @@ export default {
|
|
|
487
487
|
scrollToIndex(index)
|
|
488
488
|
{
|
|
489
489
|
if ( ! this.$refs.virtualscroller ) {
|
|
490
|
-
return
|
|
490
|
+
return Run.delay(() => this.scrollToIndex(index));
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
this.$refs.virtualscroller.scrollIntoView(index);
|
|
@@ -497,7 +497,7 @@ export default {
|
|
|
497
497
|
{
|
|
498
498
|
let canDrag = this.allowDrag;
|
|
499
499
|
|
|
500
|
-
if ( !
|
|
500
|
+
if ( ! Mix.isFunction(canDrag) ) {
|
|
501
501
|
canDrag = () => this.allowDrag;
|
|
502
502
|
}
|
|
503
503
|
|
|
@@ -520,11 +520,11 @@ export default {
|
|
|
520
520
|
|
|
521
521
|
let val = node;
|
|
522
522
|
|
|
523
|
-
if ( !
|
|
523
|
+
if ( !Mix.isEmpty(key) ) {
|
|
524
524
|
val = Obj.get(val, key);
|
|
525
525
|
}
|
|
526
526
|
|
|
527
|
-
if ( !
|
|
527
|
+
if ( ! Mix.isFunction(value) ) {
|
|
528
528
|
value = (val) => val === value;
|
|
529
529
|
}
|
|
530
530
|
|
|
@@ -668,7 +668,7 @@ export default {
|
|
|
668
668
|
{
|
|
669
669
|
let canSelect = this.allowSelect;
|
|
670
670
|
|
|
671
|
-
if ( !
|
|
671
|
+
if ( ! Mix.isFunction(canSelect) ) {
|
|
672
672
|
canSelect = () => this.allowSelect;
|
|
673
673
|
}
|
|
674
674
|
|
|
@@ -711,7 +711,7 @@ export default {
|
|
|
711
711
|
let children = Obj.get(this.tempCurrent,
|
|
712
712
|
this.childProp);
|
|
713
713
|
|
|
714
|
-
if (
|
|
714
|
+
if ( Mix.isEmpty(children) ) {
|
|
715
715
|
return;
|
|
716
716
|
}
|
|
717
717
|
|
|
@@ -755,7 +755,7 @@ export default {
|
|
|
755
755
|
{
|
|
756
756
|
let indexies = [0, -1], reversed = false;
|
|
757
757
|
|
|
758
|
-
if ( !
|
|
758
|
+
if ( ! Mix.isEmpty(this.lastSelected) ) {
|
|
759
759
|
indexies[1] = this.getIndex(this.lastSelected);
|
|
760
760
|
}
|
|
761
761
|
|
|
@@ -794,7 +794,7 @@ export default {
|
|
|
794
794
|
|
|
795
795
|
let canSelect = this.allowSelect;
|
|
796
796
|
|
|
797
|
-
if ( !
|
|
797
|
+
if ( ! Mix.isFunction(canSelect) ) {
|
|
798
798
|
canSelect = () => this.allowSelect;
|
|
799
799
|
}
|
|
800
800
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Hash, Num, Arr, Obj, Dom, Mix, Event, Locale } from "@kizmann/pico-js";
|
|
2
2
|
import NDraghandler from "../draghandler/draghandler.js";
|
|
3
3
|
|
|
4
4
|
window.DEBUG_NDLIST = false;
|
|
@@ -131,7 +131,7 @@ export default {
|
|
|
131
131
|
data()
|
|
132
132
|
{
|
|
133
133
|
return {
|
|
134
|
-
uid:
|
|
134
|
+
uid: Hash.uuid(),
|
|
135
135
|
};
|
|
136
136
|
},
|
|
137
137
|
|
|
@@ -152,7 +152,7 @@ export default {
|
|
|
152
152
|
|
|
153
153
|
renderItem()
|
|
154
154
|
{
|
|
155
|
-
if (
|
|
155
|
+
if ( Mix.isEmpty(this.item) ) {
|
|
156
156
|
return null;
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -161,7 +161,7 @@ export default {
|
|
|
161
161
|
|
|
162
162
|
renderEmpty()
|
|
163
163
|
{
|
|
164
|
-
if ( !
|
|
164
|
+
if ( ! Mix.isEmpty(this.item) ) {
|
|
165
165
|
return null;
|
|
166
166
|
}
|
|
167
167
|
|
|
@@ -180,7 +180,7 @@ export default {
|
|
|
180
180
|
'n-dropzone--' + this.type
|
|
181
181
|
];
|
|
182
182
|
|
|
183
|
-
if (
|
|
183
|
+
if ( Mix.isEmpty(this.item) ) {
|
|
184
184
|
classList.push('n-empty');
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Run, Arr, Obj, Mix, Dom, Locale } from "@kizmann/pico-js";
|
|
2
2
|
|
|
3
3
|
window.NDrawerStack = [];
|
|
4
4
|
|
|
@@ -146,7 +146,7 @@ export default {
|
|
|
146
146
|
mounted()
|
|
147
147
|
{
|
|
148
148
|
this.target = Dom.find(this.selector || this.$el)
|
|
149
|
-
.
|
|
149
|
+
.prev().get(0);
|
|
150
150
|
|
|
151
151
|
Dom.find(document.body).on('mousedown',
|
|
152
152
|
this.eventClick, this._.uid);
|
|
@@ -159,7 +159,7 @@ export default {
|
|
|
159
159
|
};
|
|
160
160
|
|
|
161
161
|
if ( this.modelValue ) {
|
|
162
|
-
|
|
162
|
+
Run.delay(showDrawer, 100);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
Dom.find(document.body).append(this.$el);
|
|
@@ -215,7 +215,7 @@ export default {
|
|
|
215
215
|
{
|
|
216
216
|
clearTimeout(this.refresh);
|
|
217
217
|
|
|
218
|
-
Dom.find(this.$el).
|
|
218
|
+
Dom.find(this.$el).remClass('n-ready');
|
|
219
219
|
},
|
|
220
220
|
|
|
221
221
|
startRefreshTimeout()
|
|
@@ -229,7 +229,7 @@ export default {
|
|
|
229
229
|
Dom.find(this.$el).attr('data-drawer',
|
|
230
230
|
window.zIndex);
|
|
231
231
|
|
|
232
|
-
Dom.find(this.$el).
|
|
232
|
+
Dom.find(this.$el).style({
|
|
233
233
|
'z-index': window.zIndex
|
|
234
234
|
});
|
|
235
235
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mix, Obj, Arr, Locale } from "@kizmann/pico-js";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
|
|
@@ -192,7 +192,7 @@ export default {
|
|
|
192
192
|
|
|
193
193
|
humanizeValue(value)
|
|
194
194
|
{
|
|
195
|
-
if (
|
|
195
|
+
if ( Mix.isEmpty(value) ) {
|
|
196
196
|
return '';
|
|
197
197
|
}
|
|
198
198
|
|
|
@@ -238,7 +238,7 @@ export default {
|
|
|
238
238
|
|
|
239
239
|
digitizeValue(text)
|
|
240
240
|
{
|
|
241
|
-
if (
|
|
241
|
+
if ( Mix.isEmpty(text) ) {
|
|
242
242
|
return this.clearValue;
|
|
243
243
|
}
|
|
244
244
|
|
|
@@ -247,25 +247,25 @@ export default {
|
|
|
247
247
|
let dmatch = this.findPattern(text, this.days);
|
|
248
248
|
|
|
249
249
|
if ( dmatch && dmatch.length === 3 ) {
|
|
250
|
-
value +=
|
|
250
|
+
value += Mix.float(dmatch[1].replace(',', '.')) * 24 * 60 * 60;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
let hmatch = this.findPattern(text, this.hours);
|
|
254
254
|
|
|
255
255
|
if ( hmatch && hmatch.length === 3 ) {
|
|
256
|
-
value +=
|
|
256
|
+
value += Mix.float(hmatch[1].replace(',', '.')) * 60 * 60;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
let mmatch = this.findPattern(text, this.minutes);
|
|
260
260
|
|
|
261
261
|
if ( mmatch && mmatch.length === 3 ) {
|
|
262
|
-
value +=
|
|
262
|
+
value += Mix.float(mmatch[1].replace(',', '.')) * 60;
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
let smatch = this.findPattern(text, this.seconds);
|
|
266
266
|
|
|
267
267
|
if ( smatch && smatch.length === 3 ) {
|
|
268
|
-
value +=
|
|
268
|
+
value += Mix.float(smatch[1].replace(',', '.'));
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
return value;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arr, Obj,
|
|
1
|
+
import { Arr, Obj, Mix, Locale } from "@kizmann/pico-js";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
|
|
@@ -105,7 +105,7 @@ export default {
|
|
|
105
105
|
|
|
106
106
|
tempValue()
|
|
107
107
|
{
|
|
108
|
-
if (
|
|
108
|
+
if ( Mix.isEmpty(this.tempValue) ) {
|
|
109
109
|
this.$refs.input.value = null;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -158,7 +158,7 @@ export default {
|
|
|
158
158
|
this.tempValue.length);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
if ( this.clearable && !
|
|
161
|
+
if ( this.clearable && !Mix.isEmpty(this.tempValue) ) {
|
|
162
162
|
props.icon = this.clearableIcon;
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mix, Arr, Locale, Obj } from "@kizmann/pico-js";
|
|
2
2
|
|
|
3
3
|
export const FormMessage = {
|
|
4
4
|
|
|
@@ -21,7 +21,6 @@ export const FormMessage = {
|
|
|
21
21
|
|
|
22
22
|
required_unless(field, value, key = '')
|
|
23
23
|
{
|
|
24
|
-
|
|
25
24
|
let label = Arr.find(this.elements, (item) => {
|
|
26
25
|
return item.prop === key;
|
|
27
26
|
});
|
|
@@ -89,41 +88,41 @@ export const FormRules = {
|
|
|
89
88
|
|
|
90
89
|
required(field, value)
|
|
91
90
|
{
|
|
92
|
-
if (
|
|
91
|
+
if ( Mix.isBool(value) ) {
|
|
93
92
|
return value === true;
|
|
94
93
|
}
|
|
95
94
|
|
|
96
|
-
return !
|
|
95
|
+
return !Mix.isEmpty(value);
|
|
97
96
|
},
|
|
98
97
|
|
|
99
98
|
required_if(field, value, key = '')
|
|
100
99
|
{
|
|
101
100
|
let target = Obj.get(this.form, key);
|
|
102
101
|
|
|
103
|
-
if (
|
|
102
|
+
if ( Mix.isEmpty(target) ) {
|
|
104
103
|
return true;
|
|
105
104
|
}
|
|
106
105
|
|
|
107
|
-
if (
|
|
106
|
+
if ( Mix.isBool(value) ) {
|
|
108
107
|
return value === true;
|
|
109
108
|
}
|
|
110
109
|
|
|
111
|
-
return !
|
|
110
|
+
return !Mix.isEmpty(value);
|
|
112
111
|
},
|
|
113
112
|
|
|
114
113
|
required_unless(field, value, key = '')
|
|
115
114
|
{
|
|
116
115
|
let target = Obj.get(this.form, key);
|
|
117
116
|
|
|
118
|
-
if ( !
|
|
117
|
+
if ( !Mix.isEmpty(target) ) {
|
|
119
118
|
return true;
|
|
120
119
|
}
|
|
121
120
|
|
|
122
|
-
if (
|
|
121
|
+
if ( Mix.isBool(value) ) {
|
|
123
122
|
return value === true;
|
|
124
123
|
}
|
|
125
124
|
|
|
126
|
-
return !
|
|
125
|
+
return !Mix.isEmpty(value);
|
|
127
126
|
},
|
|
128
127
|
|
|
129
128
|
same(field, value, key = '')
|
|
@@ -138,7 +137,7 @@ export const FormRules = {
|
|
|
138
137
|
|
|
139
138
|
value(field, value, val = 'foobar')
|
|
140
139
|
{
|
|
141
|
-
if (
|
|
140
|
+
if ( Mix.isString(value) ) {
|
|
142
141
|
return value === val;
|
|
143
142
|
}
|
|
144
143
|
|
|
@@ -147,11 +146,11 @@ export const FormRules = {
|
|
|
147
146
|
|
|
148
147
|
min(field, value, min = Number.MIN_VALUE)
|
|
149
148
|
{
|
|
150
|
-
if (
|
|
149
|
+
if ( Mix.isEmpty(value) ) {
|
|
151
150
|
return true;
|
|
152
151
|
}
|
|
153
152
|
|
|
154
|
-
if (
|
|
153
|
+
if ( Mix.isNumber(value) ) {
|
|
155
154
|
return value >= min;
|
|
156
155
|
}
|
|
157
156
|
|
|
@@ -160,11 +159,11 @@ export const FormRules = {
|
|
|
160
159
|
|
|
161
160
|
max(field, value, max = Number.MAX_VALUE)
|
|
162
161
|
{
|
|
163
|
-
if (
|
|
162
|
+
if ( Mix.isEmpty(value) ) {
|
|
164
163
|
return true;
|
|
165
164
|
}
|
|
166
165
|
|
|
167
|
-
if (
|
|
166
|
+
if ( Mix.isNumber(value) ) {
|
|
168
167
|
return value <= max;
|
|
169
168
|
}
|
|
170
169
|
|
|
@@ -173,11 +172,11 @@ export const FormRules = {
|
|
|
173
172
|
|
|
174
173
|
minlength(field, value, min = Number.MIN_VALUE)
|
|
175
174
|
{
|
|
176
|
-
if (
|
|
175
|
+
if ( Mix.isEmpty(value) ) {
|
|
177
176
|
return true;
|
|
178
177
|
}
|
|
179
178
|
|
|
180
|
-
if (
|
|
179
|
+
if ( Mix.isString(value) || Mix.isArray(value) ) {
|
|
181
180
|
return value.length > min;
|
|
182
181
|
}
|
|
183
182
|
|
|
@@ -186,11 +185,11 @@ export const FormRules = {
|
|
|
186
185
|
|
|
187
186
|
maxlength(field, value, max = Number.MAX_VALUE)
|
|
188
187
|
{
|
|
189
|
-
if (
|
|
188
|
+
if ( Mix.isEmpty(value) ) {
|
|
190
189
|
return true;
|
|
191
190
|
}
|
|
192
191
|
|
|
193
|
-
if (
|
|
192
|
+
if ( Mix.isString(value) || Mix.isArray(value) ) {
|
|
194
193
|
return value.length < max;
|
|
195
194
|
}
|
|
196
195
|
|
|
@@ -199,11 +198,11 @@ export const FormRules = {
|
|
|
199
198
|
|
|
200
199
|
email(field, value)
|
|
201
200
|
{
|
|
202
|
-
if (
|
|
201
|
+
if ( Mix.isEmpty(value) ) {
|
|
203
202
|
return true;
|
|
204
203
|
}
|
|
205
204
|
|
|
206
|
-
if (
|
|
205
|
+
if ( Mix.isString(value) ) {
|
|
207
206
|
return value.match(/^.*?@.*?\.[a-z]{2,}$/);
|
|
208
207
|
}
|
|
209
208
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Hash, Run, Arr, Obj, Mix, Dom, Locale } from "@kizmann/pico-js";
|
|
2
2
|
import { h } from "vue";
|
|
3
3
|
import {FormMessage, FormRules} from "./form-rules.mjs";
|
|
4
4
|
|
|
@@ -120,7 +120,7 @@ export default {
|
|
|
120
120
|
return [];
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
return
|
|
123
|
+
return Mix.isArray(this.$attrs) ? this.$attrs.class :
|
|
124
124
|
[this.$attrs.class];
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -129,7 +129,7 @@ export default {
|
|
|
129
129
|
data()
|
|
130
130
|
{
|
|
131
131
|
return {
|
|
132
|
-
uid:
|
|
132
|
+
uid: Hash.uuid(), elements: [], rules: [], groups: {}, ruleErrors: {}, blocked: true,
|
|
133
133
|
};
|
|
134
134
|
},
|
|
135
135
|
|
|
@@ -142,7 +142,7 @@ export default {
|
|
|
142
142
|
|
|
143
143
|
mounted()
|
|
144
144
|
{
|
|
145
|
-
|
|
145
|
+
Run.delay(this.ctor('ready'), 500);
|
|
146
146
|
},
|
|
147
147
|
|
|
148
148
|
ready()
|
|
@@ -256,7 +256,7 @@ export default {
|
|
|
256
256
|
|
|
257
257
|
let message = FormMessage[name].call(this, field, value, ...args);
|
|
258
258
|
|
|
259
|
-
if (
|
|
259
|
+
if ( Mix.isEmpty(message) ) {
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
262
262
|
|
|
@@ -275,7 +275,7 @@ export default {
|
|
|
275
275
|
});
|
|
276
276
|
|
|
277
277
|
this.ruleErrors = Obj.filter(errors, (err) => {
|
|
278
|
-
return !
|
|
278
|
+
return ! Mix.isEmpty(err);
|
|
279
279
|
});
|
|
280
280
|
|
|
281
281
|
return this.ruleErrors;
|
|
@@ -285,10 +285,10 @@ export default {
|
|
|
285
285
|
{
|
|
286
286
|
this.validate();
|
|
287
287
|
|
|
288
|
-
let count =
|
|
288
|
+
let count = Mix.keys(this.ruleErrors).length;
|
|
289
289
|
|
|
290
290
|
if ( includeErrors ) {
|
|
291
|
-
count +=
|
|
291
|
+
count += Mix.keys(this.errors).length;
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
return count === 0;
|
|
@@ -300,7 +300,7 @@ export default {
|
|
|
300
300
|
|
|
301
301
|
Obj.each(this.errors, (err, key) => {
|
|
302
302
|
|
|
303
|
-
if ( !
|
|
303
|
+
if ( ! Mix.isArray(err) ) {
|
|
304
304
|
err = [err];
|
|
305
305
|
}
|
|
306
306
|
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
top: 50%;
|
|
20
20
|
left: 50%;
|
|
21
21
|
transform: translate(-50%, -50%);
|
|
22
|
-
width: size('base-hgt', 'calc($ -
|
|
23
|
-
height: size('base-hgt', 'calc($ -
|
|
22
|
+
width: size('base-hgt', 'calc($ - 12px)');
|
|
23
|
+
height: size('base-hgt', 'calc($ - 12px)');
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.n-form-clear i,
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
display: inline-flex;
|
|
29
29
|
align-items: center;
|
|
30
30
|
justify-content: center;
|
|
31
|
-
|
|
31
|
+
text-align: center;
|
|
32
|
+
font-size: size('base-fnt-icon');
|
|
33
|
+
line-height: 10px;
|
|
32
34
|
border-radius: size('base-rad-circle');
|
|
33
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mix, Arr, Obj, Hash } from "@kizmann/pico-js";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
data()
|
|
16
16
|
{
|
|
17
17
|
return {
|
|
18
|
-
uid:
|
|
18
|
+
uid: Hash.uuid()
|
|
19
19
|
};
|
|
20
20
|
},
|
|
21
21
|
|
|
@@ -37,7 +37,7 @@ export default {
|
|
|
37
37
|
|
|
38
38
|
console.log('err', field.prop, errors)
|
|
39
39
|
|
|
40
|
-
if (
|
|
40
|
+
if ( Mix.isEmpty(errors) ) {
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arr,
|
|
1
|
+
import { Run, Arr, Mix, Dom, Str, Locale } from "@kizmann/pico-js";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
|
|
@@ -89,7 +89,7 @@ export default {
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
if ( !
|
|
92
|
+
if ( ! Mix.isEmpty(this.timeout) ) {
|
|
93
93
|
clearTimeout(this.timeout);
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -107,7 +107,7 @@ export default {
|
|
|
107
107
|
this.block = block;
|
|
108
108
|
|
|
109
109
|
Dom.find(this.$el).find(`[data-menu-key]`).each((el) => {
|
|
110
|
-
Dom.find(el).
|
|
110
|
+
Dom.find(el).remClass('is-star');
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
Dom.find(this.$el).find(`[data-menu-key="${id}"]`)
|
|
@@ -116,11 +116,11 @@ export default {
|
|
|
116
116
|
|
|
117
117
|
onMoveEvent()
|
|
118
118
|
{
|
|
119
|
-
Dom.find(window).on('mousemove',
|
|
119
|
+
Dom.find(window).on('mousemove', Run.debounce(e => {
|
|
120
120
|
|
|
121
121
|
let el = Dom.find(e.target).closest('[data-group-key]');
|
|
122
122
|
|
|
123
|
-
if (
|
|
123
|
+
if ( Mix.isEmpty(el) ) {
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -132,7 +132,7 @@ export default {
|
|
|
132
132
|
onScrollEvent()
|
|
133
133
|
{
|
|
134
134
|
Dom.find(this.$el).find('[data-menu-key]').each((el) => {
|
|
135
|
-
Dom.find(el).
|
|
135
|
+
Dom.find(el).remClass(['is-visible', 'is-first']);
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
let options = {
|
|
@@ -165,9 +165,9 @@ export default {
|
|
|
165
165
|
let search = Str.lower(this.search);
|
|
166
166
|
|
|
167
167
|
Dom.find(this.$el).find(`[data-menu-key]`)
|
|
168
|
-
.
|
|
168
|
+
.remClass('on-search');
|
|
169
169
|
|
|
170
|
-
if (
|
|
170
|
+
if ( Mix.isEmpty(search) ) {
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -187,7 +187,7 @@ export default {
|
|
|
187
187
|
|
|
188
188
|
onClickEvent(item, event = null)
|
|
189
189
|
{
|
|
190
|
-
if ( !
|
|
190
|
+
if ( ! Mix.isEmpty(event) ) {
|
|
191
191
|
event.preventDefault();
|
|
192
192
|
}
|
|
193
193
|
|
|
@@ -216,7 +216,7 @@ export default {
|
|
|
216
216
|
placeholder: this.searchPlaceholder
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
if ( !
|
|
219
|
+
if ( ! Mix.isEmpty(this.search) ) {
|
|
220
220
|
searchProps.icon = this.searchIcon;
|
|
221
221
|
}
|
|
222
222
|
|
|
@@ -300,7 +300,7 @@ export default {
|
|
|
300
300
|
'n-form-frame--' + this.NForm.size
|
|
301
301
|
];
|
|
302
302
|
|
|
303
|
-
if ( !
|
|
303
|
+
if ( ! Mix.isEmpty(this.search) ) {
|
|
304
304
|
classList.push('n-form-frame--search')
|
|
305
305
|
}
|
|
306
306
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arr,
|
|
1
|
+
import { Arr, Hash } from "@kizmann/pico-js";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
|
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
name: {
|
|
30
30
|
default()
|
|
31
31
|
{
|
|
32
|
-
return
|
|
32
|
+
return Hash.uuid();
|
|
33
33
|
},
|
|
34
34
|
type: [String]
|
|
35
35
|
},
|
|
@@ -118,7 +118,7 @@ export default {
|
|
|
118
118
|
data()
|
|
119
119
|
{
|
|
120
120
|
return {
|
|
121
|
-
uid:
|
|
121
|
+
uid: Hash.uuid(), tempValue: this.modelValue, items: []
|
|
122
122
|
};
|
|
123
123
|
},
|
|
124
124
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arr, Obj,
|
|
1
|
+
import { Arr, Obj, Mix, Dom, Hash, Locale } from "@kizmann/pico-js";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
|
|
@@ -136,7 +136,7 @@ export default {
|
|
|
136
136
|
data()
|
|
137
137
|
{
|
|
138
138
|
return {
|
|
139
|
-
uid:
|
|
139
|
+
uid: Hash.uuid()
|
|
140
140
|
};
|
|
141
141
|
},
|
|
142
142
|
|
|
@@ -261,7 +261,7 @@ export default {
|
|
|
261
261
|
let errors = Obj.get(this.NForm.getErrors(),
|
|
262
262
|
this.prop, []);
|
|
263
263
|
|
|
264
|
-
if (
|
|
264
|
+
if ( Mix.isEmpty(errors) ) {
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
267
|
|