@kizmann/nano-ui 3.0.0 → 3.0.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.
- package/dist/nano-ui.css +1 -1
- package/dist/nano-ui.esm.js +1 -1
- package/dist/nano-ui.esm.js.map +1 -1
- package/dist/themes/default.css +1 -1
- package/package.json +3 -3
- package/src/button/js/button/NButtonView.ts +1 -1
- package/src/cascader/css/cascader-panel.scss +1 -1
- package/src/cascader/js/cascader/NCascaderController.ts +32 -16
- package/src/cascader/js/cascader/NCascaderView.ts +1 -1
- package/src/cascader/js/cascader-panel/NCascaderPanelController.ts +55 -24
- package/src/cascader/js/cascader-panel/NCascaderPanelView.ts +10 -9
- package/src/cascader/js/helper/NCascaderHelper.ts +3 -7
- package/src/checkbox/css/checkbox-group.scss +0 -8
- package/src/checkbox/css/checkbox.scss +6 -0
- package/src/checkbox/js/checkbox/NCheckbox.ts +7 -0
- package/src/checkbox/js/checkbox/NCheckboxData.ts +8 -1
- package/src/checkbox/js/checkbox-group/NCheckboxGroup.ts +7 -0
- package/src/checkbox/js/checkbox-group/NCheckboxGroupData.ts +5 -0
- package/src/collapse/css/collapse-item.scss +1 -1
- package/src/collapse/js/collapse-item/NCollapseItem.ts +5 -0
- package/src/collapse/js/collapse-item/NCollapseItemView.ts +6 -3
- package/src/config/js/config/NConfig.ts +5 -0
- package/src/config/js/config/NConfigController.ts +2 -2
- package/src/config/js/config/NConfigView.ts +5 -1
- package/src/draggable/css/draghandler.scss +11 -8
- package/src/draggable/js/drag/NDragIndicator.ts +4 -0
- package/src/draggable/js/drag/NDragReciever.ts +2 -2
- package/src/draggable/js/draglist/NDraglist.ts +6 -0
- package/src/draggable/js/draglist/NDraglistController.ts +157 -24
- package/src/draggable/js/draglist/NDraglistView.ts +43 -12
- package/src/draggable/js/dropzone/NDropzone.ts +14 -0
- package/src/draggable/js/dropzone/NDropzoneController.ts +27 -1
- package/src/draggable/js/dropzone/NDropzoneData.ts +10 -0
- package/src/draggable/js/dropzone/NDropzoneView.ts +3 -7
- package/src/empty/js/empty-icon/NEmptyIcon.ts +1 -1
- package/src/form/js/form/NForm.ts +1 -1
- package/src/form/js/form/NFormController.ts +20 -1
- package/src/form/js/form-bag/NFormBagController.ts +4 -0
- package/src/form/js/form-bag/NFormBagView.ts +2 -1
- package/src/form/js/form-item/NFormItemView.ts +1 -1
- package/src/form/js/form-rules/module/NFormRuleRequiredIf.ts +4 -0
- package/src/form/js/form-rules/module/NFormRuleRequiredUnless.ts +4 -0
- package/src/index.scss +1 -1
- package/src/info/css/info-field.scss +4 -4
- package/src/info/js/info/NInfoView.ts +1 -4
- package/src/info/js/info-column/NInfoColumnView.ts +6 -2
- package/src/input/css/input-number.scss +5 -0
- package/src/input/js/input-number/NInputNumberController.ts +4 -4
- package/src/input/js/textarea/NTextareaView.ts +3 -3
- package/src/modal/css/modal.scss +4 -0
- package/src/modal/js/drawer/NDrawerController.ts +16 -3
- package/src/modal/js/handler/NModalElement.ts +14 -0
- package/src/modal/js/handler/NModalHandler.ts +13 -0
- package/src/modal/js/modal/NModal.ts +7 -0
- package/src/modal/js/modal/NModalController.ts +20 -2
- package/src/modal/js/modal/NModalData.ts +18 -2
- package/src/modal/js/modal/NModalView.ts +7 -9
- package/src/popover/css/popover.scss +5 -10
- package/src/popover/js/handler/NPopoverElement.ts +4 -0
- package/src/popover/js/popover/NPopover.ts +7 -0
- package/src/popover/js/popover/NPopoverController.ts +10 -2
- package/src/popover/js/popover/NPopoverData.ts +5 -0
- package/src/popover/js/popover/NPopoverView.ts +22 -3
- package/src/popover/js/popover-panel/NPopoverPanelController.ts +3 -1
- package/src/preview/css/preview.scss +0 -6
- package/src/preview/js/handler/NPreviewHandler.ts +3 -3
- package/src/preview/js/preview/NPreview.ts +2 -2
- package/src/preview/js/preview/NPreviewController.ts +7 -8
- package/src/preview/js/preview/NPreviewData.ts +8 -1
- package/src/preview/js/preview/NPreviewView.ts +15 -12
- package/src/preview/js/preview-module/NPreviewFileModule.ts +1 -1
- package/src/radio/css/radio-group.scss +0 -8
- package/src/radio/css/radio.scss +6 -0
- package/src/radio/js/radio/NRadio.ts +9 -2
- package/src/radio/js/radio/NRadioData.ts +8 -1
- package/src/radio/js/radio-group/NRadioGroup.ts +9 -2
- package/src/radio/js/radio-group/NRadioGroupData.ts +5 -0
- package/src/resizer/css/resizer.scss +4 -0
- package/src/resizer/js/resizer/NResizerController.ts +5 -1
- package/src/resizer/js/resizer/NResizerData.ts +0 -35
- package/src/resizer/js/resizer/NResizerView.ts +4 -0
- package/src/root/css/helpers.scss +20 -0
- package/src/root/css/tooltip.scss +39 -49
- package/src/root/js/controller/GroupController.ts +1 -1
- package/src/root/js/data/DragData.ts +8 -0
- package/src/root/js/module/Pointer.ts +18 -0
- package/src/root/js/module/Styler.ts +4 -0
- package/src/root/js/prop/BaseProps.ts +33 -0
- package/src/root/js/prop/DragProps.ts +7 -0
- package/src/root/js/proto/ProtoView.ts +5 -2
- package/src/scrollbar/css/scrollbar.scss +6 -1
- package/src/scrollbar/js/handler/NScrollbarElement.ts +4 -0
- package/src/scrollbar/js/virtualbar/NVirtualbar.ts +3 -0
- package/src/scrollbar/js/virtualbar/NVirtualbarController.ts +1 -1
- package/src/scrollbar/js/virtualbar/NVirtualbarView.ts +53 -51
- package/src/select/js/select/NSelectController.ts +3 -1
- package/src/signal/js/alert/NAlertElement.ts +4 -2
- package/src/signal/js/confirm/NConfirmElement.ts +4 -4
- package/src/signal/js/notify/NNotifyElement.ts +1 -1
- package/src/switch/js/switch/NSwitchController.ts +20 -4
- package/src/table/css/table.scss +39 -6
- package/src/table/js/table/NTable.ts +3 -0
- package/src/table/js/table/NTableController.ts +6 -4
- package/src/table/js/table/NTableView.ts +62 -14
- package/src/table/js/table-cell/NTableCellImage.ts +1 -1
- package/src/table/js/table-cell/NTableCellOption.ts +1 -1
- package/src/table/js/table-column/NTableColumn.ts +7 -0
- package/src/table/js/table-column/NTableColumnData.ts +5 -0
- package/src/table/js/table-filter/NTableFilterOption.ts +5 -7
- package/src/table/js/table-filter/NTableFilterString.ts +1 -1
- package/src/tabs/js/tabs/NTabsController.ts +5 -1
- package/src/tabs/js/tabs/NTabsView.ts +4 -0
- package/src/tabs/js/tabs-item/NTabsItemController.ts +17 -3
- package/src/tabs/js/tabs-item/NTabsItemView.ts +12 -9
- package/src/transfer/js/transfer/NTransferController.ts +14 -10
- package/src/transfer/js/transfer/NTransferView.ts +2 -2
- package/src/visuals/css/message.scss +99 -0
- package/src/visuals/css/progress.scss +39 -0
- package/src/visuals/index.scss +2 -0
- package/src/visuals/index.ts +4 -0
- package/src/visuals/js/message/NMessage.ts +65 -0
- package/src/visuals/js/message/NMessageController.ts +96 -0
- package/src/visuals/js/message/NMessageData.ts +43 -0
- package/src/visuals/js/message/NMessageView.ts +101 -0
- package/src/visuals/js/progress/NProgress.ts +63 -0
- package/src/visuals/js/progress/NProgressController.ts +48 -0
- package/src/visuals/js/progress/NProgressData.ts +75 -0
- package/src/visuals/js/progress/NProgressView.ts +48 -0
- package/themes/default/checkbox/src/checkbox/checkbox.scss +13 -0
- package/themes/default/input-number/src/input-number/input-number.scss +6 -13
- package/themes/default/preview/src/preview/preview.scss +11 -2
- package/themes/default/radio/src/radio/radio.scss +13 -0
- package/themes/default/root/vars/colors-dark-bluish.scss +1 -0
- package/themes/default/root/vars/colors-dark.scss +1 -0
- package/themes/default/root/vars/colors-light-bluish.scss +2 -1
- package/themes/default/root/vars/colors-light.scss +2 -1
- package/themes/default/scrollbar/src/scrollbar/scrollbar.scss +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
.n-info-cell {
|
|
4
4
|
position: relative;
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: stretch;
|
|
8
|
-
justify-content: stretch;
|
|
5
|
+
//display: flex;
|
|
6
|
+
//flex-direction: column;
|
|
7
|
+
//align-items: stretch;
|
|
8
|
+
//justify-content: stretch;
|
|
9
9
|
font-size: size('base-fnt');
|
|
10
10
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
|
-
import { Arr } from "@kizmann/pico-js";
|
|
3
2
|
import { ProtoView } from "../../../root/index.ts";
|
|
4
3
|
import { NInfoController } from "./NInfoController.ts";
|
|
5
4
|
|
|
@@ -44,9 +43,7 @@ export class NInfoView extends ProtoView
|
|
|
44
43
|
return this.div('body', [this.slot()]);
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
return this.
|
|
48
|
-
this.empty({ inline: false })
|
|
49
|
-
]);
|
|
46
|
+
return this.empty({ inline: false })
|
|
50
47
|
}
|
|
51
48
|
|
|
52
49
|
}
|
|
@@ -58,15 +58,19 @@ export class NInfoColumnView extends ProtoView
|
|
|
58
58
|
class: ['n-info-cell']
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
+
const item = Obj.get(...[
|
|
62
|
+
scope.ncx('info'), ['data', 'item'], {}
|
|
63
|
+
]);
|
|
64
|
+
|
|
61
65
|
const input = Obj.get(...[
|
|
62
|
-
|
|
66
|
+
item, data.prop
|
|
63
67
|
]);
|
|
64
68
|
|
|
65
69
|
const cell = {
|
|
66
70
|
bem: 'n-info-cell',
|
|
67
71
|
props: props,
|
|
68
72
|
input: input,
|
|
69
|
-
|
|
73
|
+
node: { item },
|
|
70
74
|
column: scope,
|
|
71
75
|
info: scope.ncx('info'),
|
|
72
76
|
comp: this.comp,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SetupContext } from "vue";
|
|
2
|
-
import { Mix } from "@kizmann/pico-js";
|
|
2
|
+
import { Locale, Mix } from "@kizmann/pico-js";
|
|
3
3
|
import { ProtoController } from "../../../root/index.ts";
|
|
4
4
|
import { NInputNumberData } from "./NInputNumberData.ts";
|
|
5
5
|
import { NInputNumberView } from "./NInputNumberView.ts";
|
|
@@ -57,17 +57,17 @@ export class NInputNumberController extends ProtoController
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
const match = input.match(...[
|
|
60
|
-
/[
|
|
60
|
+
/[\s.,0-9]+/
|
|
61
61
|
]);
|
|
62
62
|
|
|
63
63
|
let value = data.model;
|
|
64
64
|
|
|
65
65
|
if ( match && data.precision > 0 ) {
|
|
66
|
-
value =
|
|
66
|
+
value = Locale.num(match[0]);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
if ( match && data.precision < 1 ) {
|
|
70
|
-
value =
|
|
70
|
+
value = Locale.int(match[0]);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
if ( value < this.data.min ) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
|
-
import { Obj } from "@kizmann/pico-js";
|
|
2
|
+
import { Mix, Obj } from "@kizmann/pico-js";
|
|
3
3
|
import { ProtoView } from "../../../root/index.ts";
|
|
4
4
|
import { NTextareaController } from "./NTextareaController.ts";
|
|
5
5
|
|
|
@@ -61,14 +61,14 @@ export class NTextareaView extends ProtoView
|
|
|
61
61
|
props.maxLength = data.maxLength;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
let currentRows = (data.model.match(/\n/g) || []).length + 1;
|
|
64
|
+
let currentRows = (Mix.str(data.model).match(/\n/g) || []).length + 1;
|
|
65
65
|
|
|
66
66
|
if ( data.autoRows && props.rows < currentRows ) {
|
|
67
67
|
props.rows = currentRows <= data.maxRows ? currentRows : data.maxRows;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
props.onInput = (e : any) => {
|
|
71
|
-
|
|
71
|
+
scope.update('modelValue', e.target.value);
|
|
72
72
|
scope.emit('input', e);
|
|
73
73
|
};
|
|
74
74
|
|
package/src/modal/css/modal.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SetupContext, provide } from "vue";
|
|
1
|
+
import { SetupContext, provide, onUnmounted } from "vue";
|
|
2
2
|
import { Dom } from "@kizmann/pico-js";
|
|
3
3
|
import { ProtoController } from "../../../root/index.ts";
|
|
4
4
|
import { NDrawerView } from "./NDrawerView.ts";
|
|
@@ -37,7 +37,9 @@ export class NDrawerController extends ProtoController
|
|
|
37
37
|
new NDrawerData(this),
|
|
38
38
|
];
|
|
39
39
|
|
|
40
|
-
this.
|
|
40
|
+
if ( this.constructor.name === 'NDrawerController' ) {
|
|
41
|
+
this.setup();
|
|
42
|
+
}
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
setup()
|
|
@@ -52,6 +54,10 @@ export class NDrawerController extends ProtoController
|
|
|
52
54
|
|
|
53
55
|
provide('NModal', this.instance);
|
|
54
56
|
|
|
57
|
+
onUnmounted(() => {
|
|
58
|
+
this.el?.remove();
|
|
59
|
+
});
|
|
60
|
+
|
|
55
61
|
return this;
|
|
56
62
|
}
|
|
57
63
|
|
|
@@ -78,11 +84,19 @@ export class NDrawerController extends ProtoController
|
|
|
78
84
|
this.onClose();
|
|
79
85
|
});
|
|
80
86
|
|
|
87
|
+
if ( data.model ) {
|
|
88
|
+
this.modal.open();
|
|
89
|
+
}
|
|
90
|
+
|
|
81
91
|
Dom.find(el).appendTo(document.body);
|
|
82
92
|
}
|
|
83
93
|
|
|
84
94
|
onUnmounted()
|
|
85
95
|
{
|
|
96
|
+
if ( this.modal.visible ) {
|
|
97
|
+
this.modal.close(true, true);
|
|
98
|
+
}
|
|
99
|
+
|
|
86
100
|
NModalHandler.remove({ uid: this.uid });
|
|
87
101
|
}
|
|
88
102
|
|
|
@@ -108,7 +122,6 @@ export class NDrawerController extends ProtoController
|
|
|
108
122
|
this.modal.close(forceClose);
|
|
109
123
|
}
|
|
110
124
|
|
|
111
|
-
|
|
112
125
|
}
|
|
113
126
|
|
|
114
127
|
export default NDrawerController;
|
|
@@ -89,6 +89,10 @@ export class NModalElement
|
|
|
89
89
|
|
|
90
90
|
onMousedown(event : any)
|
|
91
91
|
{
|
|
92
|
+
if ( event.which !== 1 ) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
92
96
|
let { src, tgt } = this.getEventEls(event);
|
|
93
97
|
|
|
94
98
|
if ( !this.visible && !tgt && !src ) {
|
|
@@ -132,6 +136,16 @@ export class NModalElement
|
|
|
132
136
|
|
|
133
137
|
state(state : any)
|
|
134
138
|
{
|
|
139
|
+
const { uid } = this.options;
|
|
140
|
+
|
|
141
|
+
const chain = Arr.last(Pointer.chains, [
|
|
142
|
+
uid
|
|
143
|
+
]);
|
|
144
|
+
|
|
145
|
+
if ( ! state && chain[0] !== uid ) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
135
149
|
if ( !this.visible && state ) {
|
|
136
150
|
this.open();
|
|
137
151
|
}
|
|
@@ -2,6 +2,11 @@ import { Arr, Dom, Mix } from "@kizmann/pico-js";
|
|
|
2
2
|
import { Pointer } from "../../../root/index.ts";
|
|
3
3
|
import NModalElement from "./NModalElement.ts";
|
|
4
4
|
|
|
5
|
+
globalThis.NModalIgnore = [
|
|
6
|
+
'.fr-popup',
|
|
7
|
+
'.fr-tooltip',
|
|
8
|
+
];
|
|
9
|
+
|
|
5
10
|
export class NModalHandler
|
|
6
11
|
{
|
|
7
12
|
/**
|
|
@@ -40,6 +45,14 @@ export class NModalHandler
|
|
|
40
45
|
|
|
41
46
|
static mousedown(event : any)
|
|
42
47
|
{
|
|
48
|
+
const ignore = Arr.each(globalThis.NModalIgnore, (selector : string) => {
|
|
49
|
+
return !! Dom.find(event.target).inside(selector);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
if ( Arr.has(ignore, true) ) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
43
56
|
Arr.each(this.modals, (modal : NModalElement) => {
|
|
44
57
|
modal.onMousedown(event);
|
|
45
58
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SetupContext, provide } from "vue";
|
|
1
|
+
import { SetupContext, provide, onUnmounted } from "vue";
|
|
2
2
|
import { Dom } from "@kizmann/pico-js";
|
|
3
3
|
import { ProtoController } from "../../../root/index.ts";
|
|
4
4
|
import { NModalView } from "./NModalView.ts";
|
|
@@ -37,7 +37,9 @@ export class NModalController extends ProtoController
|
|
|
37
37
|
new NModalData(this),
|
|
38
38
|
];
|
|
39
39
|
|
|
40
|
-
this.
|
|
40
|
+
if ( this.constructor.name === 'NModalController' ) {
|
|
41
|
+
this.setup();
|
|
42
|
+
}
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
setup()
|
|
@@ -54,6 +56,10 @@ export class NModalController extends ProtoController
|
|
|
54
56
|
|
|
55
57
|
provide('NModal', this.instance);
|
|
56
58
|
|
|
59
|
+
onUnmounted(() => {
|
|
60
|
+
this.el?.remove();
|
|
61
|
+
});
|
|
62
|
+
|
|
57
63
|
return this;
|
|
58
64
|
}
|
|
59
65
|
|
|
@@ -78,11 +84,23 @@ export class NModalController extends ProtoController
|
|
|
78
84
|
this.onClose();
|
|
79
85
|
});
|
|
80
86
|
|
|
87
|
+
if ( data.model ) {
|
|
88
|
+
this.modal.open();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
this.watchProp('modelValue', (value : boolean) => {
|
|
92
|
+
value ? this.modal.open() : this.modal.close();
|
|
93
|
+
});
|
|
94
|
+
|
|
81
95
|
Dom.find(el).appendTo(document.body);
|
|
82
96
|
}
|
|
83
97
|
|
|
84
98
|
onUnmounted()
|
|
85
99
|
{
|
|
100
|
+
if ( this.modal.visible ) {
|
|
101
|
+
this.modal.close(true, true);
|
|
102
|
+
}
|
|
103
|
+
|
|
86
104
|
NModalHandler.remove(this.modal);
|
|
87
105
|
}
|
|
88
106
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ProtoData } from "../../../root/index.ts";
|
|
2
2
|
import { NModalController } from "./NModalController.ts";
|
|
3
|
+
import { Mix } from "@kizmann/pico-js";
|
|
3
4
|
|
|
4
5
|
export class NModalData extends ProtoData
|
|
5
6
|
{
|
|
@@ -24,6 +25,11 @@ export class NModalData extends ProtoData
|
|
|
24
25
|
return this.scope.get('modelValue');
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
get keep() : boolean
|
|
29
|
+
{
|
|
30
|
+
return this.scope.get('keep');
|
|
31
|
+
}
|
|
32
|
+
|
|
27
33
|
get listen() : boolean
|
|
28
34
|
{
|
|
29
35
|
return this.scope.get('listen');
|
|
@@ -39,16 +45,26 @@ export class NModalData extends ProtoData
|
|
|
39
45
|
return this.scope.get('scrollbar');
|
|
40
46
|
}
|
|
41
47
|
|
|
42
|
-
get width() : number
|
|
48
|
+
get width() : number | string
|
|
43
49
|
{
|
|
44
50
|
return this.scope.get('width');
|
|
45
51
|
}
|
|
46
52
|
|
|
47
|
-
get
|
|
53
|
+
get safeWidth() : string
|
|
54
|
+
{
|
|
55
|
+
return Mix.isNum(this.width) ? this.width + 'px' : Mix.str(this.width);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get height() : number | string
|
|
48
59
|
{
|
|
49
60
|
return this.scope.get('height');
|
|
50
61
|
}
|
|
51
62
|
|
|
63
|
+
get safeHeight() : string
|
|
64
|
+
{
|
|
65
|
+
return Mix.isNum(this.height) ? this.height + 'px' : Mix.str(this.height);
|
|
66
|
+
}
|
|
67
|
+
|
|
52
68
|
get target() : any
|
|
53
69
|
{
|
|
54
70
|
return this.scope.get('target');
|
|
@@ -36,28 +36,26 @@ export class NModalView extends ProtoView
|
|
|
36
36
|
{
|
|
37
37
|
const { scope, data } = this.scope;
|
|
38
38
|
|
|
39
|
-
if ( !data.model ) {
|
|
39
|
+
if ( !data.keep && !data.model ) {
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const props : any = {
|
|
44
|
-
name: 'frame',
|
|
44
|
+
name: 'frame', style: {}
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
let style = [];
|
|
48
|
-
|
|
49
47
|
if ( data.width ) {
|
|
50
|
-
style.
|
|
48
|
+
props.style.width = data.safeWidth;
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
if ( data.height ) {
|
|
54
|
-
style.
|
|
52
|
+
props.style.height = data.safeHeight;
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
const { slots } = this.scope.context;
|
|
58
56
|
|
|
59
57
|
if ( slots.raw ) {
|
|
60
|
-
return slots.raw();
|
|
58
|
+
return slots.raw({ props });
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
const html = [];
|
|
@@ -74,7 +72,7 @@ export class NModalView extends ProtoView
|
|
|
74
72
|
html.push(this.div('footer', this.slot('footer')));
|
|
75
73
|
}
|
|
76
74
|
|
|
77
|
-
return this.div(
|
|
75
|
+
return this.div(props, html);
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
content() : any
|
|
@@ -85,7 +83,7 @@ export class NModalView extends ProtoView
|
|
|
85
83
|
class: data.classPart('content')
|
|
86
84
|
};
|
|
87
85
|
|
|
88
|
-
if ( !
|
|
86
|
+
if ( !data.scrollbar ) {
|
|
89
87
|
return h('div', props, this.slot('default'));
|
|
90
88
|
}
|
|
91
89
|
|
|
@@ -252,7 +252,8 @@
|
|
|
252
252
|
padding: size('base-pad-vertical') size('base-pad');
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
.n-popover .n-popover__body
|
|
255
|
+
.n-popover .n-popover__body:not(.n-scrollbar),
|
|
256
|
+
.n-popover .n-popover__body.n-scrollbar > .n-scrollbar-content > .n-scrollbar__wrap {
|
|
256
257
|
padding: size('base-pad-vertical') size('base-pad');
|
|
257
258
|
}
|
|
258
259
|
|
|
@@ -276,17 +277,11 @@
|
|
|
276
277
|
margin: 0 size('base-pad', 'calc($ * -1)');
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
.n-popover-option .n-
|
|
280
|
-
width: size('base-pad', 'calc($ * 2)');
|
|
281
|
-
height: size('base-pad', 'calc($ * 2)');
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.n-popover-option .n-image--before,
|
|
285
|
-
.n-popover-option .n-icon--before {
|
|
280
|
+
.n-popover-option.n-icon-before .n-icon {
|
|
286
281
|
margin-right: size('base-pad');
|
|
287
282
|
}
|
|
288
283
|
|
|
289
|
-
.n-popover-option .n-
|
|
290
|
-
.n-popover-option .n-icon--after {
|
|
284
|
+
.n-popover-option.n-icon-after .n-icon {
|
|
291
285
|
margin-left: size('base-pad');
|
|
292
286
|
}
|
|
287
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SetupContext,
|
|
1
|
+
import { SetupContext, onUnmounted, onMounted, provide } from "vue";
|
|
2
2
|
import { Dom } from "@kizmann/pico-js";
|
|
3
3
|
import { ProtoController } from "../../../root/index.ts";
|
|
4
4
|
import { NPopoverView } from "./NPopoverView.ts";
|
|
@@ -49,6 +49,10 @@ export class NPopoverController extends ProtoController
|
|
|
49
49
|
|
|
50
50
|
provide('NPopover', this.instance);
|
|
51
51
|
|
|
52
|
+
onUnmounted(() => {
|
|
53
|
+
this.el?.remove();
|
|
54
|
+
});
|
|
55
|
+
|
|
52
56
|
return this;
|
|
53
57
|
}
|
|
54
58
|
|
|
@@ -83,7 +87,11 @@ export class NPopoverController extends ProtoController
|
|
|
83
87
|
|
|
84
88
|
onUnmounted()
|
|
85
89
|
{
|
|
86
|
-
|
|
90
|
+
if ( this.popel.visible ) {
|
|
91
|
+
this.popel.close(true, true);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
NPopoverHandler.remove(this);
|
|
87
95
|
}
|
|
88
96
|
|
|
89
97
|
onOpen()
|
|
@@ -28,11 +28,11 @@ export class NPopoverView extends ProtoView
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
return h('div', props, [
|
|
31
|
-
this.
|
|
31
|
+
this.frame(),
|
|
32
32
|
]);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
frame() : any
|
|
36
36
|
{
|
|
37
37
|
const { data } = this.scope;
|
|
38
38
|
|
|
@@ -61,7 +61,7 @@ export class NPopoverView extends ProtoView
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
if ( slots.default ) {
|
|
64
|
-
html.push(this.
|
|
64
|
+
html.push(this.body());
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
if ( slots.footer ) {
|
|
@@ -71,6 +71,25 @@ export class NPopoverView extends ProtoView
|
|
|
71
71
|
return this.div(props, html);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
body() : any
|
|
75
|
+
{
|
|
76
|
+
const { data } = this.scope;
|
|
77
|
+
|
|
78
|
+
const slots = [
|
|
79
|
+
this.slot('default')
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
if ( ! data.scrollbar ) {
|
|
83
|
+
return this.div('body', slots)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let props : any = {
|
|
87
|
+
class: data.classPart('body')
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return this.comp('n-scrollbar', props, () => slots);
|
|
91
|
+
}
|
|
92
|
+
|
|
74
93
|
}
|
|
75
94
|
|
|
76
95
|
export default NPopoverView;
|
|
@@ -196,12 +196,6 @@
|
|
|
196
196
|
text-overflow: ellipsis;
|
|
197
197
|
white-space: nowrap;
|
|
198
198
|
font-size: size('base-fnt');
|
|
199
|
-
color: color('white', 0.7);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.n-preview.n-preview-image .n-preview__title span {
|
|
203
|
-
color: color('white');
|
|
204
|
-
text-shadow: 0 0 6px color('shadow', 0.7);
|
|
205
199
|
}
|
|
206
200
|
|
|
207
201
|
.n-preview__meta li {
|
|
@@ -121,12 +121,12 @@ export class NPreviewHandler
|
|
|
121
121
|
this.root.addClass('n-multi');
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
const zIndex = Pointer.zindex();
|
|
125
|
-
|
|
126
124
|
Pointer.prevent(...[
|
|
127
125
|
this.uid, 'preview', this.uid
|
|
128
126
|
]);
|
|
129
127
|
|
|
128
|
+
const zIndex = Pointer.zindex();
|
|
129
|
+
|
|
130
130
|
this.root.style({
|
|
131
131
|
'z-index': zIndex
|
|
132
132
|
});
|
|
@@ -164,7 +164,7 @@ export class NPreviewHandler
|
|
|
164
164
|
static render(): [Dom, Dom]
|
|
165
165
|
{
|
|
166
166
|
const root = Dom.make('div', {
|
|
167
|
-
class: 'n-preview-modal',
|
|
167
|
+
class: 'n-preview-modal n-theme-dark',
|
|
168
168
|
});
|
|
169
169
|
|
|
170
170
|
const close = Dom.make('div', {
|
|
@@ -8,7 +8,7 @@ export const NPreviewProps = {
|
|
|
8
8
|
...Props.Load,
|
|
9
9
|
...Props.Size,
|
|
10
10
|
...Props.Type,
|
|
11
|
-
...Props.
|
|
11
|
+
...Props.ThemeNone,
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @type {PropType<any>}
|
|
@@ -49,7 +49,7 @@ export const NPreviewProps = {
|
|
|
49
49
|
* @type {PropType<string>}
|
|
50
50
|
*/
|
|
51
51
|
fit: {
|
|
52
|
-
type: [String], default: '
|
|
52
|
+
type: [String], default: 'contain'
|
|
53
53
|
},
|
|
54
54
|
|
|
55
55
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SetupContext, provide } from "vue";
|
|
2
2
|
import { Dom, Run } from "@kizmann/pico-js";
|
|
3
|
-
import { ProtoController } from "../../../root/index.ts";
|
|
3
|
+
import { Pointer, ProtoController } from "../../../root/index.ts";
|
|
4
4
|
import { NPreviewView } from "./NPreviewView.ts";
|
|
5
5
|
import { NPreviewData } from "./NPreviewData.ts";
|
|
6
6
|
import NPreviewHandler from "../handler/NPreviewHandler.ts";
|
|
@@ -45,12 +45,9 @@ export class NPreviewController extends ProtoController
|
|
|
45
45
|
|
|
46
46
|
this.makeUID();
|
|
47
47
|
|
|
48
|
-
this
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
this
|
|
53
|
-
.makeData('visible', false);
|
|
48
|
+
this.makeRef('preview');
|
|
49
|
+
this.makeRef('portal');
|
|
50
|
+
this.makeData('visible', false);
|
|
54
51
|
|
|
55
52
|
this.watchProp('index', () => {
|
|
56
53
|
this.onChange();
|
|
@@ -94,7 +91,9 @@ export class NPreviewController extends ProtoController
|
|
|
94
91
|
|
|
95
92
|
openPreview()
|
|
96
93
|
{
|
|
97
|
-
|
|
94
|
+
Pointer.wait(() => {
|
|
95
|
+
NPreviewHandler.open(this.preview);
|
|
96
|
+
});
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
openPortal(el : Dom)
|
|
@@ -12,11 +12,18 @@ export class NPreviewData extends ProtoData
|
|
|
12
12
|
|
|
13
13
|
get classList() : string[]
|
|
14
14
|
{
|
|
15
|
-
let classList = [
|
|
15
|
+
let classList = [
|
|
16
|
+
`${this.scope.view.bem}--${this.fit}`
|
|
17
|
+
];
|
|
16
18
|
|
|
17
19
|
return this.classRoot(classList);
|
|
18
20
|
}
|
|
19
21
|
|
|
22
|
+
get fit() : string
|
|
23
|
+
{
|
|
24
|
+
return this.scope.get('fit');
|
|
25
|
+
}
|
|
26
|
+
|
|
20
27
|
get index(): number
|
|
21
28
|
{
|
|
22
29
|
return this.scope.get('index');
|