@kizmann/nano-ui 1.0.4 → 1.0.6
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/218.nano-ui.js +2 -0
- package/dist/218.nano-ui.js.map +1 -0
- package/dist/933.nano-ui.js +2 -0
- package/dist/933.nano-ui.js.map +1 -0
- package/dist/nano-ui.js +1 -3
- package/dist/nano-ui.js.map +1 -1
- package/package.json +2 -1
- package/src/alert/index.js +3 -3
- package/src/alert/src/alert/alert.js +16 -11
- package/src/index.js +89 -43
- package/src/notification/index.js +3 -3
- package/src/notification/src/notification/notification.js +16 -10
- package/types/index.d.ts +20 -3
package/package.json
CHANGED
package/src/alert/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import Alert from "./src/alert/alert.js";
|
2
|
-
|
3
1
|
export default function (App) {
|
4
|
-
|
2
|
+
import("./src/alert/alert.js").then(({ Alert }) => {
|
3
|
+
App.config.globalProperties[Alert.alias] = window[Alert.alias] = Alert.handle;
|
4
|
+
});
|
5
5
|
}
|
@@ -10,21 +10,24 @@ class AlertFrame {
|
|
10
10
|
|
11
11
|
type = '';
|
12
12
|
|
13
|
-
options = {
|
14
|
-
iconPrimary: nano.Icons.info,
|
15
|
-
iconSecondary: nano.Icons.info,
|
16
|
-
iconSuccess: nano.Icons.success,
|
17
|
-
iconWarning: nano.Icons.warning,
|
18
|
-
iconDanger: nano.Icons.danger,
|
19
|
-
iconInfo: nano.Icons.info
|
20
|
-
};
|
13
|
+
options = {};
|
21
14
|
|
22
15
|
constructor(text, type = 'primary', options = {})
|
23
16
|
{
|
17
|
+
let defaultIcons = {
|
18
|
+
iconPrimary: window.nano.Icons.info,
|
19
|
+
iconSecondary: window.nano.Icons.info,
|
20
|
+
iconSuccess: window.nano.Icons.success,
|
21
|
+
iconWarning: window.nano.Icons.warning,
|
22
|
+
iconDanger: window.nano.Icons.danger,
|
23
|
+
iconInfo: window.nano.Icons.info
|
24
|
+
};
|
25
|
+
|
24
26
|
this.text = text;
|
25
27
|
this.type = type;
|
26
28
|
|
27
|
-
this.options = Obj.assign(this.options,
|
29
|
+
this.options = Obj.assign(this.options,
|
30
|
+
defaultIcons, options);
|
28
31
|
|
29
32
|
this.render();
|
30
33
|
}
|
@@ -104,11 +107,11 @@ class AlertFrame {
|
|
104
107
|
|
105
108
|
}
|
106
109
|
|
107
|
-
export
|
110
|
+
export class Alert {
|
108
111
|
|
109
112
|
static alias = 'Alert';
|
110
113
|
|
111
|
-
static size = nano.Settings.notifySize;
|
114
|
+
static size = window.nano.Settings.notifySize;
|
112
115
|
|
113
116
|
static alert = null;
|
114
117
|
|
@@ -126,3 +129,5 @@ export default class Alert {
|
|
126
129
|
}
|
127
130
|
|
128
131
|
}
|
132
|
+
|
133
|
+
export default Alert;
|
package/src/index.js
CHANGED
@@ -4,6 +4,88 @@ import CtorMixin from "./mixins/src/ctor.js";
|
|
4
4
|
import CmerMixin from "./mixins/src/cmer.js";
|
5
5
|
import CsloMixin from "./mixins/src/cslo.js";
|
6
6
|
|
7
|
+
import Alert from "./alert/index.js";
|
8
|
+
import Notification from "./notification/index.js";
|
9
|
+
import Empty from "./empty/index.js";
|
10
|
+
import Config from "./config/index.js";
|
11
|
+
import Scrollbar from "./scrollbar/index.js";
|
12
|
+
import Virtualscroller from "./virtualscroller/index.js";
|
13
|
+
import Draggable from "./draggable/index.js";
|
14
|
+
import Loader from "./loader/index.js";
|
15
|
+
import Resizer from "./resizer/index.js";
|
16
|
+
import Popover from "./popover/index.js";
|
17
|
+
import Modal from "./modal/index.js";
|
18
|
+
import Button from "./button/index.js";
|
19
|
+
import Input from "./input/index.js";
|
20
|
+
import InputNumber from "./input-number/index.js";
|
21
|
+
import Textarea from "./textarea/index.js";
|
22
|
+
import Select from "./select/index.js";
|
23
|
+
import Checkbox from "./checkbox/index.js";
|
24
|
+
import Radio from "./radio/index.js";
|
25
|
+
import Slider from "./slider/index.js";
|
26
|
+
import Switch from "./switch/index.js";
|
27
|
+
import Confirm from "./confirm/index.js";
|
28
|
+
import Cascader from "./cascader/index.js";
|
29
|
+
import Datepicker from "./datepicker/index.js";
|
30
|
+
import Timepicker from "./timepicker/index.js";
|
31
|
+
import Datetimepicker from "./datetimepicker/index.js";
|
32
|
+
import Durationpicker from "./durationpicker/index.js";
|
33
|
+
import Transfer from "./transfer/index.js";
|
34
|
+
import Form from "./form/index.js";
|
35
|
+
import Tabs from "./tabs/index.js";
|
36
|
+
import Tags from "./tags/index.js";
|
37
|
+
import Collapse from "./collapse/index.js";
|
38
|
+
import Table from "./table/index.js";
|
39
|
+
import Paginator from "./paginator/index.js";
|
40
|
+
import Info from "./info/index.js";
|
41
|
+
import Preview from "./preview/index.js";
|
42
|
+
import Map from "./map/index.js";
|
43
|
+
import File from "./file/index.js";
|
44
|
+
import Rating from "./rating/index.js";
|
45
|
+
import Drawer from "./drawer/index.js";
|
46
|
+
|
47
|
+
const NanoImports = [
|
48
|
+
Alert,
|
49
|
+
Notification,
|
50
|
+
Empty,
|
51
|
+
Config,
|
52
|
+
Scrollbar,
|
53
|
+
Virtualscroller,
|
54
|
+
Draggable,
|
55
|
+
Loader,
|
56
|
+
Resizer,
|
57
|
+
Popover,
|
58
|
+
Modal,
|
59
|
+
Button,
|
60
|
+
Input,
|
61
|
+
InputNumber,
|
62
|
+
Textarea,
|
63
|
+
Select,
|
64
|
+
Checkbox,
|
65
|
+
Radio,
|
66
|
+
Slider,
|
67
|
+
Switch,
|
68
|
+
Confirm,
|
69
|
+
Cascader,
|
70
|
+
Datepicker,
|
71
|
+
Timepicker,
|
72
|
+
Datetimepicker,
|
73
|
+
Durationpicker,
|
74
|
+
Transfer,
|
75
|
+
Form,
|
76
|
+
Tabs,
|
77
|
+
Tags,
|
78
|
+
Collapse,
|
79
|
+
Table,
|
80
|
+
Paginator,
|
81
|
+
Info,
|
82
|
+
Preview,
|
83
|
+
Map,
|
84
|
+
File,
|
85
|
+
Rating,
|
86
|
+
Drawer
|
87
|
+
];
|
88
|
+
|
7
89
|
export const Icons = {
|
8
90
|
handle: 'fa fa-ellipsis-v',
|
9
91
|
checked: 'fa fa-check',
|
@@ -31,7 +113,7 @@ export const Settings = {
|
|
31
113
|
notifyPosition: 'bottom-start'
|
32
114
|
};
|
33
115
|
|
34
|
-
export function Install(App, Icons = {})
|
116
|
+
export function Install(App, Icons = {}, Settings = {})
|
35
117
|
{
|
36
118
|
/**
|
37
119
|
* @const window.pi
|
@@ -52,48 +134,12 @@ export function Install(App, Icons = {})
|
|
52
134
|
App.config.globalProperties.trans = Locale.trans;
|
53
135
|
App.config.globalProperties.choice = Locale.choice;
|
54
136
|
|
55
|
-
window.nano.Icons = Obj.assign(
|
56
|
-
window.nano.Settings = Obj.assign(
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
require('./config/index.js').default(App); //!complex 17.1
|
62
|
-
require('./scrollbar/index.js').default(App);
|
63
|
-
require('./virtualscroller/index.js').default(App);
|
64
|
-
require('./draggable/index.js').default(App);
|
65
|
-
require('./loader/index.js').default(App);
|
66
|
-
require('./resizer/index.js').default(App);
|
67
|
-
require('./popover/index.js').default(App);
|
68
|
-
require('./modal/index.js').default(App);
|
69
|
-
require('./button/index.js').default(App);
|
70
|
-
require('./input/index.js').default(App);
|
71
|
-
require('./input-number/index.js').default(App);
|
72
|
-
require('./textarea/index.js').default(App);
|
73
|
-
require('./select/index.js').default(App);
|
74
|
-
require('./checkbox/index.js').default(App);
|
75
|
-
require('./radio/index.js').default(App);
|
76
|
-
require('./slider/index.js').default(App);
|
77
|
-
require('./switch/index.js').default(App);
|
78
|
-
require('./confirm/index.js').default(App);
|
79
|
-
require('./cascader/index.js').default(App);
|
80
|
-
require('./datepicker/index.js').default(App);
|
81
|
-
require('./timepicker/index.js').default(App);
|
82
|
-
require('./datetimepicker/index.js').default(App);
|
83
|
-
require('./durationpicker/index.js').default(App);
|
84
|
-
require('./transfer/index.js').default(App);
|
85
|
-
require('./form/index.js').default(App); // check
|
86
|
-
require('./tabs/index.js').default(App);
|
87
|
-
require('./tags/index.js').default(App);
|
88
|
-
require('./collapse/index.js').default(App);
|
89
|
-
require('./table/index.js').default(App); // 18.1 options
|
90
|
-
require('./paginator/index.js').default(App);
|
91
|
-
require('./info/index.js').default(App); //!complex 16.1
|
92
|
-
require('./preview/index.js').default(App);
|
93
|
-
require('./map/index.js').default(App);
|
94
|
-
require('./file/index.js').default(App);
|
95
|
-
require('./rating/index.js').default(App);
|
96
|
-
require('./drawer/index.js').default(App);
|
137
|
+
window.nano.Icons = Obj.assign(window.nano.Icons, Icons);
|
138
|
+
window.nano.Settings = Obj.assign(window.nano.Settings, Settings);
|
139
|
+
|
140
|
+
Arr.each(NanoImports, (NanoModule) => {
|
141
|
+
NanoModule(App);
|
142
|
+
});
|
97
143
|
|
98
144
|
// require('./chart/index.js'); // Ignore
|
99
145
|
// require('./wysiwyg/index.js'); // Ignore
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import Notifcation from "./src/notification/notification.js";
|
2
|
-
|
3
1
|
export default function (App) {
|
4
|
-
|
2
|
+
import("./src/notification/notification.js").then(({ Notify }) => {
|
3
|
+
App.config.globalProperties[Notify.alias] = window[Notify.alias] = Notify.handle;
|
4
|
+
});
|
5
5
|
}
|
@@ -12,20 +12,24 @@ class Notification {
|
|
12
12
|
|
13
13
|
options = {
|
14
14
|
duration: 4500,
|
15
|
-
iconPrimary: nano.Icons.info,
|
16
|
-
iconSecondary: nano.Icons.info,
|
17
|
-
iconSuccess: nano.Icons.success,
|
18
|
-
iconWarning: nano.Icons.warning,
|
19
|
-
iconDanger: nano.Icons.danger,
|
20
|
-
iconInfo: nano.Icons.info
|
21
15
|
};
|
22
16
|
|
23
17
|
constructor(text, type = 'primary', options = {})
|
24
18
|
{
|
19
|
+
let defaultIcons = {
|
20
|
+
iconPrimary: window.nano.Icons.info,
|
21
|
+
iconSecondary: window.nano.Icons.info,
|
22
|
+
iconSuccess: window.nano.Icons.success,
|
23
|
+
iconWarning: window.nano.Icons.warning,
|
24
|
+
iconDanger: window.nano.Icons.danger,
|
25
|
+
iconInfo: window.nano.Icons.info
|
26
|
+
};
|
27
|
+
|
25
28
|
this.text = text;
|
26
29
|
this.type = type;
|
27
30
|
|
28
|
-
this.options = Obj.assign(this.options,
|
31
|
+
this.options = Obj.assign(this.options,
|
32
|
+
defaultIcons, options);
|
29
33
|
|
30
34
|
this.render();
|
31
35
|
}
|
@@ -85,13 +89,13 @@ class Notification {
|
|
85
89
|
|
86
90
|
}
|
87
91
|
|
88
|
-
export
|
92
|
+
export class Notify {
|
89
93
|
|
90
94
|
static alias = 'Notify';
|
91
95
|
|
92
|
-
static size = nano.Settings.notifySize;
|
96
|
+
static size = window.nano.Settings.notifySize;
|
93
97
|
|
94
|
-
static position = nano.Settings.notifyPosition;
|
98
|
+
static position = window.nano.Settings.notifyPosition;
|
95
99
|
|
96
100
|
static notifications = {};
|
97
101
|
|
@@ -157,3 +161,5 @@ export default class Notify {
|
|
157
161
|
}
|
158
162
|
|
159
163
|
}
|
164
|
+
|
165
|
+
export default Notify;
|
package/types/index.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
// types/index.d.ts
|
2
|
-
// import Cookie from "./library/cookie";
|
3
2
|
|
4
3
|
declare interface IconsInterface {
|
5
4
|
handle: string;
|
@@ -23,9 +22,16 @@ declare interface IconsInterface {
|
|
23
22
|
[key: string]: string;
|
24
23
|
}
|
25
24
|
|
25
|
+
declare interface SettingsInterface {
|
26
|
+
iconPosition: string;
|
27
|
+
notifySize: string;
|
28
|
+
notifyPosition: string;
|
29
|
+
[key: string]: string;
|
30
|
+
}
|
31
|
+
|
26
32
|
export declare module "@kizmann/nano-ui" {
|
27
33
|
|
28
|
-
function Install(App: any, Icons?: Partial<IconsInterface>): void;
|
34
|
+
function Install(App: any, Icons?: Partial<IconsInterface>, Settings?: Partial<SettingsInterface>): void;
|
29
35
|
|
30
36
|
const Icons: typeof IconsInterface;
|
31
37
|
const Settings: typeof SettingsInterface;
|
@@ -41,4 +47,15 @@ export declare module "@kizmann/nano-ui" {
|
|
41
47
|
Settings,
|
42
48
|
Install
|
43
49
|
};
|
44
|
-
}
|
50
|
+
}
|
51
|
+
|
52
|
+
export declare module '@vue/runtime-core' {
|
53
|
+
interface ComponentCustomProperties {
|
54
|
+
ctor: (key: string, fallback?: any) => () => any
|
55
|
+
cmer: (classList: any) => () => any
|
56
|
+
cslo: (slot: string, props?: object) => () => any
|
57
|
+
|
58
|
+
trans: (key: string, values?: object) => string;
|
59
|
+
choice: (key: string, count?: number, values?: object) => () => any
|
60
|
+
}
|
61
|
+
}
|