@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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { PropType, defineComponent } from "vue";
|
|
2
|
+
import { Props } from "../../../root/index.ts";
|
|
3
|
+
import { NProgressController } from "./NProgressController.ts";
|
|
4
|
+
|
|
5
|
+
export const NProgressProps = {
|
|
6
|
+
|
|
7
|
+
...Props.Size,
|
|
8
|
+
...Props.Type,
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @type {PropType<number>}
|
|
12
|
+
*/
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: [Number], default: 0
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @type {PropType<number>}
|
|
19
|
+
*/
|
|
20
|
+
state: {
|
|
21
|
+
type: [Number], default: 0
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @type {PropType<boolean>}
|
|
26
|
+
*/
|
|
27
|
+
changeState: {
|
|
28
|
+
type: [Boolean], default: false
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default defineComponent({
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @type {string}
|
|
37
|
+
*/
|
|
38
|
+
name: 'NProgress',
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @type {typeof NProgressProps}
|
|
42
|
+
*/
|
|
43
|
+
props: NProgressProps,
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @type {string[]}
|
|
47
|
+
*/
|
|
48
|
+
emits: [
|
|
49
|
+
//
|
|
50
|
+
],
|
|
51
|
+
|
|
52
|
+
setup(props, context)
|
|
53
|
+
{
|
|
54
|
+
let ncx = new NProgressController(props, context);
|
|
55
|
+
|
|
56
|
+
ncx.dispose(() => {
|
|
57
|
+
ncx = null;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
return ncx.render();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SetupContext } from "vue";
|
|
2
|
+
import { ProtoController } from "../../../root/index.ts";
|
|
3
|
+
import { NProgressView } from "./NProgressView.ts";
|
|
4
|
+
import { NProgressData } from "./NProgressData.ts";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export class NProgressController extends ProtoController
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* @type {NProgressController}
|
|
11
|
+
*/
|
|
12
|
+
declare scope : NProgressController;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @type {NProgressData}
|
|
16
|
+
*/
|
|
17
|
+
declare data: NProgressData;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @type {NProgressView}
|
|
21
|
+
*/
|
|
22
|
+
declare view: NProgressView;
|
|
23
|
+
|
|
24
|
+
constructor(props:any, context:SetupContext)
|
|
25
|
+
{
|
|
26
|
+
super(props, context);
|
|
27
|
+
|
|
28
|
+
[this.view, this.data] = [
|
|
29
|
+
new NProgressView(this),
|
|
30
|
+
new NProgressData(this),
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
this.setup();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
setup()
|
|
37
|
+
{
|
|
38
|
+
super.setup();
|
|
39
|
+
|
|
40
|
+
this.makeRef('el');
|
|
41
|
+
this.cloneProp('modelValue');
|
|
42
|
+
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default NProgressController;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ProtoData } from "../../../root/index.ts";
|
|
2
|
+
import NProgressController from "./NProgressController.ts";
|
|
3
|
+
|
|
4
|
+
export class NProgressData extends ProtoData
|
|
5
|
+
{
|
|
6
|
+
/**
|
|
7
|
+
* @type {NProgressController}
|
|
8
|
+
*/
|
|
9
|
+
declare scope : NProgressController;
|
|
10
|
+
|
|
11
|
+
get classList() : string[]
|
|
12
|
+
{
|
|
13
|
+
const { view } = this.scope;
|
|
14
|
+
|
|
15
|
+
const classList = [
|
|
16
|
+
view.bem,
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
if ( this.size != null ) {
|
|
20
|
+
classList.push(`n-size-${this.size}`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let type = this.type || 'primary';
|
|
24
|
+
|
|
25
|
+
if ( this.state === 0 ) {
|
|
26
|
+
type = 'neutral';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if ( this.state === 2 ) {
|
|
30
|
+
type = 'success';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if ( this.state === 3 ) {
|
|
34
|
+
type = 'danger';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
classList.push(`n-type-${type}`);
|
|
38
|
+
|
|
39
|
+
if ( this.state === 0 ) {
|
|
40
|
+
classList.push('n-await');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if ( this.state === 1 ) {
|
|
44
|
+
classList.push('n-active');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if ( this.state === 2 ) {
|
|
48
|
+
classList.push('n-done');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if ( this.state === 3 ) {
|
|
52
|
+
classList.push('n-abort');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return classList;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get model() : number
|
|
59
|
+
{
|
|
60
|
+
return this.scope.get('modelValue');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get value() : number
|
|
64
|
+
{
|
|
65
|
+
return Math.min(100, Math.max(0, this.model));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get state() : number
|
|
69
|
+
{
|
|
70
|
+
return this.scope.get('state');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default NProgressData;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { h } from "vue";
|
|
2
|
+
import { ProtoView } from "../../../root/index.ts";
|
|
3
|
+
import { NProgressController } from "./NProgressController.ts";
|
|
4
|
+
|
|
5
|
+
export class NProgressView extends ProtoView
|
|
6
|
+
{
|
|
7
|
+
/**
|
|
8
|
+
* @type {NProgressController}
|
|
9
|
+
*/
|
|
10
|
+
declare scope : NProgressController;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
bem : string = 'n-progress';
|
|
16
|
+
|
|
17
|
+
default() : any
|
|
18
|
+
{
|
|
19
|
+
let { scope, data } = this.scope;
|
|
20
|
+
|
|
21
|
+
let props : any = {
|
|
22
|
+
ref: scope.ref('el'),
|
|
23
|
+
class: data.classList,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return h('div', props, [
|
|
27
|
+
this.bar()
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
bar() : any
|
|
32
|
+
{
|
|
33
|
+
const { data } = this.scope;
|
|
34
|
+
|
|
35
|
+
let props : any = {
|
|
36
|
+
class: data.classPart('bar')
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
props.style = {
|
|
40
|
+
'--n-progress-width': data.value + '%'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return h('div', props);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default NProgressView;
|
|
@@ -23,4 +23,17 @@
|
|
|
23
23
|
|
|
24
24
|
.n-checkbox.n-checked:not(.n-disabled) .n-checkbox__label {
|
|
25
25
|
color: color('base-color');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.n-checkbox.n-checkbox--button {
|
|
29
|
+
border-color: color('gray-15');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.n-checkbox.n-checkbox--button:hover {
|
|
33
|
+
background: color('gray-50', 0.05);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.n-checkbox.n-checkbox--button.n-checked {
|
|
37
|
+
border-color: color('primary-color');
|
|
38
|
+
background: color('primary-color', 0.1);
|
|
26
39
|
}
|
|
@@ -5,22 +5,10 @@
|
|
|
5
5
|
border: 1px solid color('gray-15');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.n-input-number.n-disabled
|
|
8
|
+
.n-input-number.n-disabled {
|
|
9
9
|
background: color('form-disabled');
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
.n-input-number .n-button {
|
|
13
|
-
color: color('gray-60');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.n-input-number:not(.n-disabled) .n-button {
|
|
17
|
-
background: color('gray-15', 0.5);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.n-input-number:not(.n-disabled) .n-button:not(.n-disabled):hover {
|
|
21
|
-
color: color('base-color');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
12
|
.n-input-number:not(.n-disabled):hover {
|
|
25
13
|
border-color: color('base-color-bg-30');
|
|
26
14
|
}
|
|
@@ -28,3 +16,8 @@
|
|
|
28
16
|
.n-input-number:not(.n-disabled).n-focus {
|
|
29
17
|
border-color: color('base-color');
|
|
30
18
|
}
|
|
19
|
+
|
|
20
|
+
.n-input-number .n-input-number__increase i,
|
|
21
|
+
.n-input-number .n-input-number__decrease i {
|
|
22
|
+
color: color('gray-40');
|
|
23
|
+
}
|
|
@@ -26,10 +26,19 @@
|
|
|
26
26
|
transform: scale(1);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
.n-preview:hover .n-preview__hover span {
|
|
30
|
+
color: color('foreground', 0.7);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.n-preview.n-preview-image .n-preview__title span {
|
|
34
|
+
color: color('white');
|
|
35
|
+
text-shadow: 0 0 6px color('shadow', 0.7);
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
.n-preview__mime {
|
|
30
|
-
color: color('
|
|
39
|
+
color: color('foreground', 0.5);
|
|
31
40
|
}
|
|
32
41
|
|
|
33
42
|
.n-preview__path {
|
|
34
|
-
color: color('
|
|
43
|
+
color: color('foreground', 0.75);
|
|
35
44
|
}
|
|
@@ -29,4 +29,17 @@
|
|
|
29
29
|
|
|
30
30
|
.n-radio.n-checked:not(.n-disabled) .n-radio__label {
|
|
31
31
|
color: color('base-color');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.n-radio.n-radio--button {
|
|
35
|
+
border-color: color('gray-15');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.n-radio.n-radio--button:hover {
|
|
39
|
+
background: color('gray-50', 0.05);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.n-radio.n-radio--button.n-checked {
|
|
43
|
+
border-color: color('primary-color');
|
|
44
|
+
background: color('primary-color', 0.1);
|
|
32
45
|
}
|
|
@@ -452,11 +452,12 @@ $color-list: (
|
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
+
@include css-remaps($color-base-primary, '-color-light-primary', '-color-base');
|
|
455
456
|
@include css-remaps($colors, '-color-light', '-color');
|
|
456
457
|
}
|
|
457
458
|
|
|
458
459
|
@mixin default() {
|
|
459
460
|
@each $name, $values in $color-list {
|
|
460
|
-
@include css-remaps($values, '-color-
|
|
461
|
+
@include css-remaps($values, '-color-light-#{$name}', '-color-#{$name}');
|
|
461
462
|
}
|
|
462
463
|
}
|
|
@@ -452,11 +452,12 @@ $color-list: (
|
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
+
@include css-remaps($color-base-primary, '-color-light-primary', '-color-base');
|
|
455
456
|
@include css-remaps($colors, '-color-light', '-color');
|
|
456
457
|
}
|
|
457
458
|
|
|
458
459
|
@mixin default() {
|
|
459
460
|
@each $name, $values in $color-list {
|
|
460
|
-
@include css-remaps($values, '-color-
|
|
461
|
+
@include css-remaps($values, '-color-light-#{$name}', '-color-#{$name}');
|
|
461
462
|
}
|
|
462
463
|
}
|