@kizmann/nano-ui 1.0.0 → 1.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 -0
- package/dist/nano-ui.js +4 -0
- package/dist/nano-ui.js.map +1 -0
- package/dist/themes/dark.css +1 -0
- package/dist/themes/light.css +1 -0
- package/package.json +7 -1
- package/.github/workflows/compile-deploy-publish.yml +0 -65
- package/assets/nano-ui-dark.svg +0 -19
- package/assets/nano-ui-light.svg +0 -19
- package/assets/pico-js-dark.svg +0 -19
- package/assets/pico-js-light.svg +0 -19
- package/babel.config.js +0 -17
- package/demos/builder.html +0 -411
- package/demos/button/index.html +0 -129
- package/demos/cascader/index.html +0 -127
- package/demos/chart/index.html +0 -53
- package/demos/checkbox/index.html +0 -97
- package/demos/config/index.html +0 -95
- package/demos/confirm/index.html +0 -78
- package/demos/datepicker/index.html +0 -69
- package/demos/draggable/index.html +0 -127
- package/demos/form/index.html +0 -83
- package/demos/form.html +0 -462
- package/demos/grid.html +0 -321
- package/demos/input/index.html +0 -100
- package/demos/map/index.html +0 -81
- package/demos/matrix/index.html +0 -104
- package/demos/modal/index.html +0 -98
- package/demos/overview.html +0 -1468
- package/demos/paginator/index.html +0 -58
- package/demos/popover/index.html +0 -103
- package/demos/radio/index.html +0 -71
- package/demos/resizer/index.html +0 -106
- package/demos/scrollbar.html +0 -328
- package/demos/select/index.html +0 -174
- package/demos/select.html +0 -164
- package/demos/style.css +0 -50
- package/demos/switch/index.html +0 -69
- package/demos/table/index.html +0 -126
- package/demos/tabs/index.html +0 -110
- package/demos/tabs.html +0 -293
- package/demos/textarea/index.html +0 -77
- package/demos/timepicker/index.html +0 -66
- package/demos/transfer/index.html +0 -88
- package/demos/wysiwyg/index.html +0 -49
- package/docs/README.md +0 -34
- package/docs/_sidebar.md +0 -37
- package/docs/files/data/draggable.md +0 -143
- package/docs/files/data/map.md +0 -1
- package/docs/files/data/paginator.md +0 -23
- package/docs/files/data/table.md +0 -247
- package/docs/files/data/virtualscroller.md +0 -2
- package/docs/files/form/button.md +0 -131
- package/docs/files/form/cascader.md +0 -164
- package/docs/files/form/checkbox.md +0 -179
- package/docs/files/form/datepicker.md +0 -78
- package/docs/files/form/form.md +0 -52
- package/docs/files/form/input.md +0 -90
- package/docs/files/form/radio.md +0 -150
- package/docs/files/form/select.md +0 -202
- package/docs/files/form/switch.md +0 -98
- package/docs/files/form/textarea.md +0 -102
- package/docs/files/form/timepicker.md +0 -78
- package/docs/files/form/transfer.md +0 -30
- package/docs/files/others/config.md +0 -261
- package/docs/files/others/confirm.md +0 -51
- package/docs/files/others/drawer.md +0 -32
- package/docs/files/others/loader.md +0 -22
- package/docs/files/others/map.md +0 -32
- package/docs/files/others/modal.md +0 -32
- package/docs/files/others/notification.md +0 -52
- package/docs/files/others/popover.md +0 -36
- package/docs/files/others/resizer.md +0 -8
- package/docs/files/others/scrollbar.md +0 -8
- package/docs/files/others/tabs.md +0 -32
- package/docs/index.template.html +0 -76
- package/docs/src/js/backup.js +0 -128
- package/docs/src/js/helper/item-helper.js +0 -0
- package/docs/src/js/index.js +0 -21
- package/docs/src/js/plugin/title-plugin.js +0 -0
- package/docs/src/js/plugin/vue-demo-plugin.js +0 -97
- package/docs/src/js/theme/basic.js +0 -31
- package/docs/src/js/theme/docsify.js +0 -11
- package/docs/src/scss/index-dark.scss +0 -3
- package/docs/src/scss/index-light.scss +0 -3
- package/docs/src/scss/index.scss +0 -15
- package/docs/src/scss/mixins/base.scss +0 -14
- package/docs/src/scss/mixins/grid.scss +0 -213
- package/docs/src/scss/mixins/media.scss +0 -35
- package/docs/src/scss/mixins/space.scss +0 -61
- package/docs/src/scss/root/vars-dark.scss +0 -15
- package/docs/src/scss/root/vars-light.scss +0 -15
- package/docs/src/scss/root/vars.scss +0 -110
- package/docs/src/scss/theme/default.scss +0 -123
- package/docs/src/scss/theme/header.scss +0 -147
- package/docs/src/scss/theme/layout.scss +0 -186
- package/docs/src/scss/theme/loader.scss +0 -63
- package/docs/src/scss/theme/markdown.scss +0 -79
- package/docs/src/scss/theme/navigation.scss +0 -58
- package/docs/src/scss/theme/progress.scss +0 -9
- package/docs/src/scss/theme/search.scss +0 -119
- package/docs/src/scss/theme/syntax.scss +0 -142
- package/docs/src/scss/theme/table.scss +0 -63
- package/favicon/apple-touch-icon.png +0 -0
- package/favicon/favicon-96x96.png +0 -0
- package/favicon/favicon.ico +0 -0
- package/favicon/favicon.svg +0 -3
- package/favicon/site.webmanifest +0 -21
- package/favicon/web-app-manifest-192x192.png +0 -0
- package/favicon/web-app-manifest-512x512.png +0 -0
- package/mix-manifest.json +0 -4
- package/postcss.config.js +0 -14
- package/webpack.config.js +0 -211
- package/webservy.json +0 -8
- /package/{.nojekyll → dist/.ignore.js} +0 -0
@@ -1,164 +0,0 @@
|
|
1
|
-
# Cascader
|
2
|
-
Drag and drop list or tree.
|
3
|
-
|
4
|
-
```html
|
5
|
-
/*vue*/
|
6
|
-
<template>
|
7
|
-
<div>
|
8
|
-
<n-cascader v-model="value" :items="items" label-prop="label"></n-cascader>
|
9
|
-
</div>
|
10
|
-
</template>
|
11
|
-
<script>
|
12
|
-
export default {
|
13
|
-
methods: {
|
14
|
-
|
15
|
-
generator(count = 10, depth = 1)
|
16
|
-
{
|
17
|
-
if ( ! depth ) {
|
18
|
-
return [];
|
19
|
-
}
|
20
|
-
|
21
|
-
if ( ! this.total ) {
|
22
|
-
this.total = 0;
|
23
|
-
}
|
24
|
-
|
25
|
-
return pi.Arr.each(pi.Arr.make(count), () => {
|
26
|
-
|
27
|
-
this.total++;
|
28
|
-
|
29
|
-
return {
|
30
|
-
label: 'Item ' + this.total,
|
31
|
-
value: 'value-' + this.total,
|
32
|
-
children: this.generator(count, depth - 1)
|
33
|
-
};
|
34
|
-
})
|
35
|
-
}
|
36
|
-
|
37
|
-
},
|
38
|
-
data() {
|
39
|
-
return {
|
40
|
-
items: this.generator(10, 2), value: ['value-1']
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
44
|
-
</script>
|
45
|
-
```
|
46
|
-
|
47
|
-
### Properties
|
48
|
-
**items**
|
49
|
-
default: []
|
50
|
-
types: Array
|
51
|
-
_All items which will be cascader, needs to hold Objects_
|
52
|
-
|
53
|
-
**use**
|
54
|
-
default: null
|
55
|
-
types: String
|
56
|
-
_Component which will be rendered instead of default scoped slot (Cascader)_
|
57
|
-
|
58
|
-
**useBefore**
|
59
|
-
default: null
|
60
|
-
types: String
|
61
|
-
_Component which will be rendered instead of before scoped slot (Non cascader)_
|
62
|
-
|
63
|
-
**useAfter**
|
64
|
-
default: null
|
65
|
-
types: String
|
66
|
-
_Component which will be rendered instead of after scoped slot (Non cascader)_
|
67
|
-
|
68
|
-
**selected**
|
69
|
-
default: null
|
70
|
-
types: Array
|
71
|
-
_Array with all selected items can be passed with this prop aswell_
|
72
|
-
|
73
|
-
**depth**
|
74
|
-
default: 0
|
75
|
-
types: Number
|
76
|
-
_Current level of depth (used in tree)_
|
77
|
-
|
78
|
-
**group**
|
79
|
-
default: ['default']
|
80
|
-
types: Array
|
81
|
-
_Cascader group_
|
82
|
-
|
83
|
-
**safezone**
|
84
|
-
default: ['default']
|
85
|
-
types: Number, Function
|
86
|
-
_Safezone for before and after_
|
87
|
-
|
88
|
-
```javascript
|
89
|
-
/* height: 40px; before: 0-10px; inner: 10-30px; after: 30-40px */
|
90
|
-
(height) => height * 0.25;
|
91
|
-
```
|
92
|
-
|
93
|
-
**showEmpty**
|
94
|
-
default: true
|
95
|
-
types: Boolean
|
96
|
-
_Render empty field_
|
97
|
-
|
98
|
-
**itemHeight**
|
99
|
-
default: 34
|
100
|
-
types: Number
|
101
|
-
_Used for render list (loads 25 items in chunks to improve browser reactivity)_
|
102
|
-
|
103
|
-
**uniqueProp**
|
104
|
-
default: 'id'
|
105
|
-
types: String
|
106
|
-
_Unique prop for selected list_
|
107
|
-
|
108
|
-
**childProp**
|
109
|
-
default: null
|
110
|
-
types: String
|
111
|
-
_Children property for tree_
|
112
|
-
|
113
|
-
**transformDrop**
|
114
|
-
default: (item) => item
|
115
|
-
types: Function
|
116
|
-
_Transform property on drop_
|
117
|
-
|
118
|
-
**insertNode**
|
119
|
-
default: true
|
120
|
-
types: Boolean, Function
|
121
|
-
_Determines if node will be added to list or just emits move_
|
122
|
-
|
123
|
-
**removeNode**
|
124
|
-
default: true
|
125
|
-
types: Boolean, Function
|
126
|
-
_Determines if node will be removed from list or just emits move_
|
127
|
-
|
128
|
-
**allowSelect**
|
129
|
-
default: (item, depth) => true
|
130
|
-
types: Boolean, Function
|
131
|
-
_Determines if node is selectable_
|
132
|
-
|
133
|
-
**allowDrag**
|
134
|
-
default: (item, depth) => true
|
135
|
-
types: Boolean, Function
|
136
|
-
_Determines if node is cascader_
|
137
|
-
|
138
|
-
**allowDrop**
|
139
|
-
default: (item, target, move, depth) => true
|
140
|
-
types: Boolean, Function
|
141
|
-
_Determines if node is droppable_
|
142
|
-
|
143
|
-
**className**
|
144
|
-
default: ['n-cascader']
|
145
|
-
types: Array
|
146
|
-
_CSS classes for cascader list_
|
147
|
-
|
148
|
-
### Events
|
149
|
-
```javascript
|
150
|
-
/* Emits on data change */
|
151
|
-
NCascader.$on('input', (input) => {
|
152
|
-
console.log(input);
|
153
|
-
});
|
154
|
-
|
155
|
-
/* Emits on move change */
|
156
|
-
NCascader.$on('input', (source, target, move) => {
|
157
|
-
console.log(source, target, move);
|
158
|
-
});
|
159
|
-
|
160
|
-
/* Emits on selected change */
|
161
|
-
NCascader.$on('update:selected', (selected) => {
|
162
|
-
console.log(selected);
|
163
|
-
});
|
164
|
-
```
|
@@ -1,179 +0,0 @@
|
|
1
|
-
# Checkbox
|
2
|
-
Checkbox with diffrent styles.
|
3
|
-
|
4
|
-
```vue
|
5
|
-
<n-checbox v-model="checked">Your label</n-checbox>
|
6
|
-
```
|
7
|
-
|
8
|
-
### Checkbox
|
9
|
-
|
10
|
-
```html
|
11
|
-
/*vue*/
|
12
|
-
|
13
|
-
<template>
|
14
|
-
<div class="grid grid--col grid--20-20">
|
15
|
-
<div class="col--1-1">
|
16
|
-
<n-checkbox v-model="checked">Check me</n-checkbox>
|
17
|
-
</div>
|
18
|
-
<div class="col--1-1">
|
19
|
-
<n-checkbox v-model="checked" :disabled="true">Can't check me</n-checkbox>
|
20
|
-
</div>
|
21
|
-
</div>
|
22
|
-
</template>
|
23
|
-
|
24
|
-
<script>
|
25
|
-
export default {
|
26
|
-
data()
|
27
|
-
{
|
28
|
-
return {
|
29
|
-
checked: true
|
30
|
-
};
|
31
|
-
}
|
32
|
-
}
|
33
|
-
</script>
|
34
|
-
|
35
|
-
```
|
36
|
-
|
37
|
-
### Grouped checkboxes
|
38
|
-
|
39
|
-
```html
|
40
|
-
/*vue*/
|
41
|
-
|
42
|
-
<template>
|
43
|
-
<div class="grid grid--col grid--20-20">
|
44
|
-
<div class="col--1-1">
|
45
|
-
<n-checkbox-group v-model="checked">
|
46
|
-
<n-checkbox :global="true">Check all</n-checkbox>
|
47
|
-
<n-checkbox value="berlin">Berlin</n-checkbox>
|
48
|
-
<n-checkbox value="hamburg">Hamburg</n-checkbox>
|
49
|
-
<n-checkbox value="munich">Munich</n-checkbox>
|
50
|
-
<n-checkbox value="cologne">Cologne</n-checkbox>
|
51
|
-
<n-checkbox value="frankfurt">Frankfurt</n-checkbox>
|
52
|
-
</n-checkbox-group>
|
53
|
-
</div>
|
54
|
-
<div class="col--1-1">
|
55
|
-
<pre class="pretty">{{ checked }}</pre>
|
56
|
-
</div>
|
57
|
-
</div>
|
58
|
-
</template>
|
59
|
-
|
60
|
-
<script>
|
61
|
-
export default {
|
62
|
-
data()
|
63
|
-
{
|
64
|
-
return {
|
65
|
-
checked: ['berlin']
|
66
|
-
};
|
67
|
-
}
|
68
|
-
}
|
69
|
-
</script>
|
70
|
-
|
71
|
-
```
|
72
|
-
|
73
|
-
### Vertical grouped checkboxes
|
74
|
-
|
75
|
-
```html
|
76
|
-
/*vue*/
|
77
|
-
|
78
|
-
<template>
|
79
|
-
<div class="grid grid--col grid--20-20">
|
80
|
-
<div class="col--1-1">
|
81
|
-
<n-checkbox-group v-model="checked" align="vertical">
|
82
|
-
<n-checkbox :global="true">Check all</n-checkbox>
|
83
|
-
<n-checkbox value="berlin">Berlin</n-checkbox>
|
84
|
-
<n-checkbox value="hamburg">Hamburg</n-checkbox>
|
85
|
-
<n-checkbox value="munich">Munich</n-checkbox>
|
86
|
-
<n-checkbox value="cologne">Cologne</n-checkbox>
|
87
|
-
<n-checkbox value="frankfurt">Frankfurt</n-checkbox>
|
88
|
-
</n-checkbox-group>
|
89
|
-
</div>
|
90
|
-
<div class="col--1-1">
|
91
|
-
<pre class="pretty">{{ checked }}</pre>
|
92
|
-
</div>
|
93
|
-
</div>
|
94
|
-
</template>
|
95
|
-
|
96
|
-
<script>
|
97
|
-
export default {
|
98
|
-
data()
|
99
|
-
{
|
100
|
-
return {
|
101
|
-
checked: ['berlin']
|
102
|
-
};
|
103
|
-
}
|
104
|
-
}
|
105
|
-
</script>
|
106
|
-
|
107
|
-
```
|
108
|
-
|
109
|
-
### Checkbox sizes
|
110
|
-
|
111
|
-
```html
|
112
|
-
/*vue*/
|
113
|
-
|
114
|
-
<template>
|
115
|
-
<div class="grid grid--col grid--20-20">
|
116
|
-
<div class="col--1-1">
|
117
|
-
<n-checkbox v-model="checked" size="small">Small</n-checkbox>
|
118
|
-
<n-checkbox v-model="checked">Default</n-checkbox>
|
119
|
-
<n-checkbox v-model="checked" size="large">Large</n-checkbox>
|
120
|
-
</div>
|
121
|
-
</div>
|
122
|
-
</template>
|
123
|
-
|
124
|
-
<script>
|
125
|
-
export default {
|
126
|
-
data()
|
127
|
-
{
|
128
|
-
return {
|
129
|
-
checked: true
|
130
|
-
};
|
131
|
-
}
|
132
|
-
}
|
133
|
-
</script>
|
134
|
-
|
135
|
-
```
|
136
|
-
|
137
|
-
### Properties
|
138
|
-
**value**
|
139
|
-
default: null
|
140
|
-
types: String
|
141
|
-
_Input value_
|
142
|
-
|
143
|
-
**size**
|
144
|
-
default: 'default'
|
145
|
-
types: String
|
146
|
-
_Button size (small, default, large)_
|
147
|
-
|
148
|
-
**round**
|
149
|
-
default: false
|
150
|
-
types: Boolean
|
151
|
-
_If button is rounded_
|
152
|
-
|
153
|
-
**disabled**
|
154
|
-
default: false
|
155
|
-
types: Boolean
|
156
|
-
_If button uses disabled style and mode_
|
157
|
-
|
158
|
-
**icon**
|
159
|
-
default: ''
|
160
|
-
types: String
|
161
|
-
_Icon class (fa fa-times)_
|
162
|
-
|
163
|
-
**iconDisabled**
|
164
|
-
default: false
|
165
|
-
types: Boolen
|
166
|
-
_If icon button will be disabled_
|
167
|
-
|
168
|
-
**nativeType**
|
169
|
-
default: 'button'
|
170
|
-
types: String
|
171
|
-
_Native button type (a, button, div etc.)_
|
172
|
-
|
173
|
-
### Events
|
174
|
-
```javascript
|
175
|
-
/* Allows all types which are supported by native type, but overrides default input event */
|
176
|
-
NDraggable.$on('input', (value) => {
|
177
|
-
console.log(value);
|
178
|
-
});
|
179
|
-
```
|
@@ -1,78 +0,0 @@
|
|
1
|
-
# Datepicker
|
2
|
-
Datepicker with diffrent styles.
|
3
|
-
|
4
|
-
```vue
|
5
|
-
<n-datepicker v-model="text"></n-datepicker>
|
6
|
-
```
|
7
|
-
|
8
|
-
### Datepicker
|
9
|
-
|
10
|
-
```html
|
11
|
-
/*vue*/
|
12
|
-
|
13
|
-
<template>
|
14
|
-
<div class="grid grid--col grid--20-20">
|
15
|
-
<div class="col--1-1">
|
16
|
-
<n-datepicker v-model="timestamp" placeholder="Select date" />
|
17
|
-
</div>
|
18
|
-
<div class="col--1-1">
|
19
|
-
<n-datepicker v-model="timestamp" placeholder="Select date" :disabled="true" />
|
20
|
-
</div>
|
21
|
-
</div>
|
22
|
-
</template>
|
23
|
-
|
24
|
-
<script>
|
25
|
-
export default {
|
26
|
-
data()
|
27
|
-
{
|
28
|
-
return { timestamp: 'now+2days' };
|
29
|
-
}
|
30
|
-
}
|
31
|
-
</script>
|
32
|
-
|
33
|
-
```
|
34
|
-
|
35
|
-
|
36
|
-
### Properties
|
37
|
-
**value**
|
38
|
-
default: null
|
39
|
-
types: String
|
40
|
-
_Datepicker value_
|
41
|
-
|
42
|
-
**size**
|
43
|
-
default: 'default'
|
44
|
-
types: String
|
45
|
-
_Button size (small, default, large)_
|
46
|
-
|
47
|
-
**round**
|
48
|
-
default: false
|
49
|
-
types: Boolean
|
50
|
-
_If button is rounded_
|
51
|
-
|
52
|
-
**disabled**
|
53
|
-
default: false
|
54
|
-
types: Boolean
|
55
|
-
_If button uses disabled style and mode_
|
56
|
-
|
57
|
-
**icon**
|
58
|
-
default: ''
|
59
|
-
types: String
|
60
|
-
_Icon class (fa fa-times)_
|
61
|
-
|
62
|
-
**iconDisabled**
|
63
|
-
default: false
|
64
|
-
types: Boolen
|
65
|
-
_If icon button will be disabled_
|
66
|
-
|
67
|
-
**nativeType**
|
68
|
-
default: 'button'
|
69
|
-
types: String
|
70
|
-
_Native button type (a, button, div etc.)_
|
71
|
-
|
72
|
-
### Events
|
73
|
-
```javascript
|
74
|
-
/* Allows all types which are supported by native type, but overrides default datepicker event */
|
75
|
-
NDraggable.$on('datepicker', (value) => {
|
76
|
-
console.log(value);
|
77
|
-
});
|
78
|
-
```
|
package/docs/files/form/form.md
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
# Form
|
2
|
-
Form you know.
|
3
|
-
|
4
|
-
```js [demo]
|
5
|
-
pi.Obj.assign(window.VueData, {
|
6
|
-
form: {
|
7
|
-
size: 'md', icon: null, square: false, link: false, disabled: false,
|
8
|
-
},
|
9
|
-
sizes: {
|
10
|
-
'sm': 'Small', 'md': 'Medium', 'lg': 'Large'
|
11
|
-
},
|
12
|
-
icons: {
|
13
|
-
'fa fa-ghost': 'Ghost', 'fa fa-plus': 'Plus', 'fa fa-minus': 'Minus'
|
14
|
-
}
|
15
|
-
});
|
16
|
-
```
|
17
|
-
|
18
|
-
```html
|
19
|
-
/*vue*/
|
20
|
-
<template>
|
21
|
-
<n-form :form="form" :errors="errors">
|
22
|
-
<n-form-item label="Value 01" prop="val1">
|
23
|
-
<n-input v-model="form.val1"></n-input>
|
24
|
-
</n-form-item>
|
25
|
-
<n-form-item label="Value 02" prop="val2">
|
26
|
-
<n-input v-model="form.val2"></n-input>
|
27
|
-
</n-form-item>
|
28
|
-
</n-form>
|
29
|
-
</template>
|
30
|
-
<script>
|
31
|
-
export default {
|
32
|
-
data()
|
33
|
-
{
|
34
|
-
let form = {
|
35
|
-
val1: '', val2: ''
|
36
|
-
};
|
37
|
-
|
38
|
-
let errors = {
|
39
|
-
val1: 'Some random error'
|
40
|
-
};
|
41
|
-
|
42
|
-
return { form: form, errors: errors }
|
43
|
-
}
|
44
|
-
}
|
45
|
-
</script>
|
46
|
-
```
|
47
|
-
|
48
|
-
### Properties
|
49
|
-
coming soon
|
50
|
-
|
51
|
-
### Events
|
52
|
-
coming soon
|
package/docs/files/form/input.md
DELETED
@@ -1,90 +0,0 @@
|
|
1
|
-
# NInput
|
2
|
-
|
3
|
-
The `<n-input>` component provides a customizable input field with optional icon support.
|
4
|
-
|
5
|
-
## Demo
|
6
|
-
|
7
|
-
```js [demo]
|
8
|
-
pi.Obj.assign(window.VueData, {
|
9
|
-
inputBinds: {
|
10
|
-
size: 'md', type: 'primary', icon: null, iconPosition: 'after', disabled: false, placeholder: 'Enter your text'
|
11
|
-
},
|
12
|
-
inputReact: {
|
13
|
-
model: ''
|
14
|
-
},
|
15
|
-
positions: {
|
16
|
-
'before': 'Before', 'after': 'After'
|
17
|
-
}
|
18
|
-
});
|
19
|
-
```
|
20
|
-
|
21
|
-
```html [demo]
|
22
|
-
<n-form>
|
23
|
-
<div class="demo-options">
|
24
|
-
<div class="grid grid--row grid--wrap grid--20-20">
|
25
|
-
<n-form-item class="col--1-1 col--6-12@sm col--3-12@lg" label="Type">
|
26
|
-
<n-select v-model="inputBinds.type" :options="types" />
|
27
|
-
</n-form-item>
|
28
|
-
<n-form-item class="col--1-1 col--6-12@sm col--3-12@lg" label="Size">
|
29
|
-
<n-select v-model="inputBinds.size" :options="sizes" />
|
30
|
-
</n-form-item>
|
31
|
-
<n-form-item class="col--1-1 col--6-12@sm col--3-12@lg" label="Icon">
|
32
|
-
<n-select v-model="inputBinds.icon" placeholder="Icon" :clearable="true" :options="icons" />
|
33
|
-
</n-form-item>
|
34
|
-
<n-form-item class="col--1-1 col--6-12@sm col--3-12@lg" label="Disabled">
|
35
|
-
<n-switch v-model="inputBinds.disabled">Activate disable state</n-switch>
|
36
|
-
</n-form-item>
|
37
|
-
</div>
|
38
|
-
</div>
|
39
|
-
<div class="demo-display">
|
40
|
-
<div class="grid grid--row grid--wrap grid--40-40 grid--middle">
|
41
|
-
<div class="col--auto">
|
42
|
-
<n-input v-model="inputReact.model" v-bind="inputBinds" placeholder="Enter your text" />
|
43
|
-
</div>
|
44
|
-
<div class="col--flex-1-1">
|
45
|
-
<code style="white-space: initial">{{ inputReact }}</code>
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
</n-form>
|
50
|
-
```
|
51
|
-
|
52
|
-
## Example
|
53
|
-
|
54
|
-
```vue
|
55
|
-
<template>
|
56
|
-
<n-input v-model="modelValue" placeholder="Enter text" />
|
57
|
-
</template>
|
58
|
-
|
59
|
-
<script>
|
60
|
-
export default {
|
61
|
-
data() {
|
62
|
-
return {
|
63
|
-
modelValue: 'foobar',
|
64
|
-
};
|
65
|
-
},
|
66
|
-
};
|
67
|
-
</script>
|
68
|
-
```
|
69
|
-
|
70
|
-
In this example, an `NInput` component is used to create an input field. The value of the input is bound to the `modelValue` data property using `v-model`.
|
71
|
-
|
72
|
-
## Properties
|
73
|
-
|
74
|
-
| Prop | Type | Default | Description |
|
75
|
-
|-------------------|-----------|------------|------------------------------------------------------------------------------------------------------|
|
76
|
-
| `modelValue` | `String` | `null` | The value of the input field. |
|
77
|
-
| `type` | `String` | `'primary'` | The type of the input field. |
|
78
|
-
| `size` | `String` | `'md'` | The size of the input field. Can be `'sm'`, `'md'`, or `'lg'`. |
|
79
|
-
| `disabled` | `Boolean` | `false` | Whether the input field is disabled. |
|
80
|
-
| `placeholder` | `String` | `''` | The placeholder text for the input field. |
|
81
|
-
| `icon` | `String` | `''` | The name of the icon to display. |
|
82
|
-
| `iconPosition` | `String` | `'after'` | The position of the icon relative to the input field (`'before'` or `'after'`). |
|
83
|
-
| `iconDisabled` | `Boolean` | `null` | Whether the icon is disabled. If `null`, it will use the input's disabled state. |
|
84
|
-
| `nativeType` | `String` | `'text'` | The native type of the input field (`'text'`, `'password'`, `'email'`, etc.). |
|
85
|
-
|
86
|
-
## Events
|
87
|
-
|
88
|
-
| Event Name | Description |
|
89
|
-
|----------------|-------------------------------------------------------------------------------------------------------|
|
90
|
-
| `icon-click` | Emitted when the icon is clicked. |
|
package/docs/files/form/radio.md
DELETED
@@ -1,150 +0,0 @@
|
|
1
|
-
# Radio
|
2
|
-
Radio with diffrent styles.
|
3
|
-
|
4
|
-
```vue
|
5
|
-
<n-radio-group v-model="checked">
|
6
|
-
<n-radio value="berlin">Berlin</n-radio>
|
7
|
-
<n-radio value="hamburg">Hamburg</n-radio>
|
8
|
-
</n-radio-group>
|
9
|
-
```
|
10
|
-
|
11
|
-
### Radios
|
12
|
-
|
13
|
-
```html
|
14
|
-
/*vue*/
|
15
|
-
|
16
|
-
<template>
|
17
|
-
<div class="grid grid--col grid--20-20">
|
18
|
-
<div class="col--1-1">
|
19
|
-
<n-radio-group v-model="checked">
|
20
|
-
<n-radio value="berlin">Berlin</n-radio>
|
21
|
-
<n-radio value="hamburg">Hamburg</n-radio>
|
22
|
-
</n-radio-group>
|
23
|
-
</div>
|
24
|
-
<div class="col--1-1">
|
25
|
-
<pre class="pretty">{{ checked }}</pre>
|
26
|
-
</div>
|
27
|
-
</div>
|
28
|
-
</template>
|
29
|
-
|
30
|
-
<script>
|
31
|
-
export default {
|
32
|
-
data()
|
33
|
-
{
|
34
|
-
return {
|
35
|
-
checked: 'berlin'
|
36
|
-
};
|
37
|
-
}
|
38
|
-
}
|
39
|
-
</script>
|
40
|
-
|
41
|
-
```
|
42
|
-
|
43
|
-
### Vertical radios
|
44
|
-
|
45
|
-
```html
|
46
|
-
/*vue*/
|
47
|
-
|
48
|
-
<template>
|
49
|
-
<div class="grid grid--col grid--20-20">
|
50
|
-
<div class="col--1-1">
|
51
|
-
<n-radio-group v-model="checked" align="vertical">
|
52
|
-
<n-radio value="berlin">Berlin</n-radio>
|
53
|
-
<n-radio value="hamburg">Hamburg</n-radio>
|
54
|
-
</n-radio-group>
|
55
|
-
</div>
|
56
|
-
<div class="col--1-1">
|
57
|
-
<pre class="pretty">{{ checked }}</pre>
|
58
|
-
</div>
|
59
|
-
</div>
|
60
|
-
</template>
|
61
|
-
|
62
|
-
<script>
|
63
|
-
export default {
|
64
|
-
data()
|
65
|
-
{
|
66
|
-
return {
|
67
|
-
checked: 'berlin'
|
68
|
-
};
|
69
|
-
}
|
70
|
-
}
|
71
|
-
</script>
|
72
|
-
|
73
|
-
```
|
74
|
-
|
75
|
-
### Radio sizes
|
76
|
-
|
77
|
-
```html
|
78
|
-
/*vue*/
|
79
|
-
|
80
|
-
<template>
|
81
|
-
<div class="grid grid--col grid--20-20">
|
82
|
-
<div class="col--1-1">
|
83
|
-
<n-radio-group v-model="checked">
|
84
|
-
<n-radio value="berlin" size="small">Berlin</n-radio>
|
85
|
-
<n-radio value="hamburg">Hamburg</n-radio>
|
86
|
-
<n-radio value="munich" size="large">Munich</n-radio>
|
87
|
-
</n-radio-group>
|
88
|
-
</div>
|
89
|
-
<div class="col--1-1">
|
90
|
-
<pre class="pretty">{{ checked }}</pre>
|
91
|
-
</div>
|
92
|
-
</div>
|
93
|
-
</template>
|
94
|
-
|
95
|
-
<script>
|
96
|
-
export default {
|
97
|
-
data()
|
98
|
-
{
|
99
|
-
return {
|
100
|
-
checked: 'berlin'
|
101
|
-
};
|
102
|
-
}
|
103
|
-
}
|
104
|
-
</script>
|
105
|
-
|
106
|
-
```
|
107
|
-
|
108
|
-
### Properties
|
109
|
-
**value**
|
110
|
-
default: null
|
111
|
-
types: String
|
112
|
-
_Input value_
|
113
|
-
|
114
|
-
**size**
|
115
|
-
default: 'default'
|
116
|
-
types: String
|
117
|
-
_Button size (small, default, large)_
|
118
|
-
|
119
|
-
**round**
|
120
|
-
default: false
|
121
|
-
types: Boolean
|
122
|
-
_If button is rounded_
|
123
|
-
|
124
|
-
**disabled**
|
125
|
-
default: false
|
126
|
-
types: Boolean
|
127
|
-
_If button uses disabled style and mode_
|
128
|
-
|
129
|
-
**icon**
|
130
|
-
default: ''
|
131
|
-
types: String
|
132
|
-
_Icon class (fa fa-times)_
|
133
|
-
|
134
|
-
**iconDisabled**
|
135
|
-
default: false
|
136
|
-
types: Boolen
|
137
|
-
_If icon button will be disabled_
|
138
|
-
|
139
|
-
**nativeType**
|
140
|
-
default: 'button'
|
141
|
-
types: String
|
142
|
-
_Native button type (a, button, div etc.)_
|
143
|
-
|
144
|
-
### Events
|
145
|
-
```javascript
|
146
|
-
/* Allows all types which are supported by native type, but overrides default input event */
|
147
|
-
NDraggable.$on('input', (value) => {
|
148
|
-
console.log(value);
|
149
|
-
});
|
150
|
-
```
|