@kizmann/nano-ui 0.9.3 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- package/demos/builder.html +411 -0
- package/demos/overview.html +1 -1
- package/dist/nano-ui.css +1 -1
- package/dist/nano-ui.js +3 -3
- package/dist/nano-ui.js.map +1 -1
- package/dist/themes/dark.css +2 -0
- package/dist/themes/light.css +1 -1
- package/package.json +2 -2
- package/src/config/index.js +6 -0
- package/src/config/index.scss +3 -0
- package/src/config/src/builder/builder.js +935 -0
- package/src/config/src/builder/builder.scss +280 -0
- package/src/config/src/builder/prototypes/button/n-button-group.js +11 -0
- package/src/config/src/builder/prototypes/button/n-button.js +37 -0
- package/src/config/src/builder/prototypes/cascader/n-cascader.js +11 -0
- package/src/config/src/builder/prototypes/checkbox/n-checkbox-group.js +11 -0
- package/src/config/src/builder/prototypes/checkbox/n-checkbox.js +11 -0
- package/src/config/src/builder/prototypes/confirm/n-confirm.js +11 -0
- package/src/config/src/builder/prototypes/datepicker/n-datepicker.js +11 -0
- package/src/config/src/builder/prototypes/datetimepicker/n-datetimepicker.js +11 -0
- package/src/config/src/builder/prototypes/durationpicker/n-durationpicker.js +11 -0
- package/src/config/src/builder/prototypes/empty/n-empty.js +11 -0
- package/src/config/src/builder/prototypes/form/n-form-group.js +13 -0
- package/src/config/src/builder/prototypes/form/n-form-item.js +13 -0
- package/src/config/src/builder/prototypes/form/n-form.js +11 -0
- package/src/config/src/builder/prototypes/html/div.js +13 -0
- package/src/config/src/builder/prototypes/html/nano.js +11 -0
- package/src/config/src/builder/prototypes/html/span.js +11 -0
- package/src/config/src/builder/prototypes/info/n-info-column.js +11 -0
- package/src/config/src/builder/prototypes/info/n-info.js +11 -0
- package/src/config/src/builder/prototypes/input/n-input.js +40 -0
- package/src/config/src/builder/prototypes/input-number/n-input-number.js +49 -0
- package/src/config/src/builder/prototypes/loader/n-loader.js +11 -0
- package/src/config/src/builder/prototypes/modal/n-modal.js +11 -0
- package/src/config/src/builder/prototypes/popover/n-popover-group.js +11 -0
- package/src/config/src/builder/prototypes/popover/n-popover-item.js +11 -0
- package/src/config/src/builder/prototypes/popover/n-popover.js +11 -0
- package/src/config/src/builder/prototypes/radio/n-radio-group.js +11 -0
- package/src/config/src/builder/prototypes/radio/n-radio.js +11 -0
- package/src/config/src/builder/prototypes/rating/n-rating.js +11 -0
- package/src/config/src/builder/prototypes/select/n-select.js +11 -0
- package/src/config/src/builder/prototypes/slider/n-slider.js +11 -0
- package/src/config/src/builder/prototypes/switch/n-switch.js +31 -0
- package/src/config/src/builder/prototypes/table/n-table-column.js +11 -0
- package/src/config/src/builder/prototypes/table/n-table.js +11 -0
- package/src/config/src/builder/prototypes/tabs/n-tabs-item.js +11 -0
- package/src/config/src/builder/prototypes/tabs/n-tabs.js +11 -0
- package/src/config/src/builder/prototypes/tags/n-tags-item.js +11 -0
- package/src/config/src/builder/prototypes/tags/n-tags.js +11 -0
- package/src/config/src/builder/prototypes/textarea/n-textarea.js +11 -0
- package/src/config/src/builder/prototypes/timepicker/n-timepicker.js +11 -0
- package/src/config/src/builder/prototypes/transfer/n-transfer.js +11 -0
- package/src/config/src/config/config-next.js +16 -2
- package/src/config/src/reference-panel/reference-panel.js +196 -0
- package/src/config/src/reference-panel/reference-panel.scss +194 -0
- package/src/config/src/reference-picker/reference-picker.js +146 -0
- package/src/config/src/reference-picker/reference-picker.scss +3 -0
- package/src/datetimepicker/src/datetimepicker/datetimepicker.scss +2 -2
- package/src/empty/src/empty-icon/empty-icon.js +12 -0
- package/src/empty/src/empty-icon/empty-icon.scss +10 -0
- package/src/form/src/form-group/form-group.js +5 -1
- package/src/index.scss +1 -0
- package/src/input/src/input/input.js +2 -0
- package/src/preview/src/preview/preview.js +19 -1
- package/src/preview/src/preview-image/preview-image.js +2 -1
- package/src/root/vars.scss +23 -0
- package/src/select/src/select/select.js +1 -1
- package/src/slider/src/slider/slider.scss +1 -6
- package/src/table/src/table/table.scss +4 -0
- package/src/tags/src/tags-item/tags-item.scss +1 -1
- package/themes/macos/alert/index.scss +1 -0
- package/themes/macos/alert/src/alert/alert.scss +26 -0
- package/themes/macos/button/index.scss +2 -0
- package/themes/macos/button/src/button/button.scss +46 -0
- package/themes/macos/button/src/button-group/button-group.scss +1 -0
- package/themes/macos/cascader/index.scss +2 -0
- package/themes/macos/cascader/src/cascader/cascader.scss +46 -0
- package/themes/macos/cascader/src/cascader-panel/cascader-panel.scss +14 -0
- package/themes/macos/checkbox/index.scss +2 -0
- package/themes/macos/checkbox/src/checkbox/checkbox.scss +44 -0
- package/themes/macos/checkbox/src/checkbox-group/checkbox-group.scss +1 -0
- package/themes/macos/collapse/index.scss +2 -0
- package/themes/macos/collapse/src/collapse/collapse.scss +21 -0
- package/themes/macos/collapse/src/collapse-item/collapse-item.scss +21 -0
- package/themes/macos/confirm/index.scss +1 -0
- package/themes/macos/confirm/src/confirm/confirm.scss +13 -0
- package/themes/macos/datepicker/index.scss +2 -0
- package/themes/macos/datepicker/src/datepicker/datepicker.scss +50 -0
- package/themes/macos/datepicker/src/datepicker-panel/datepicker-panel.scss +44 -0
- package/themes/macos/datetimepicker/index.scss +1 -0
- package/themes/macos/datetimepicker/src/datetimepicker/datetimepicker.scss +67 -0
- package/themes/macos/demo/index.scss +1 -0
- package/themes/macos/demo/src/demo/demo.scss +22 -0
- package/themes/macos/draggable/index.scss +9 -0
- package/themes/macos/draggable/src/draggrid/draggrid.scss +13 -0
- package/themes/macos/draggable/src/draggrid-item/draggrid-item.scss +65 -0
- package/themes/macos/draggable/src/draghandler/draghandler.scss +15 -0
- package/themes/macos/draggable/src/draglist/draglist.scss +13 -0
- package/themes/macos/draggable/src/draglist-item/draglist-item.scss +72 -0
- package/themes/macos/draggable/src/dropzone/dropzone.scss +13 -0
- package/themes/macos/durationpicker/index.scss +1 -0
- package/themes/macos/durationpicker/src/durationpicker/durationpicker.scss +52 -0
- package/themes/macos/empty/index.scss +1 -0
- package/themes/macos/empty/src/empty-icon/empty-icon.scss +13 -0
- package/themes/macos/file/index.scss +1 -0
- package/themes/macos/file/src/file/file.scss +38 -0
- package/themes/macos/form/index.scss +3 -0
- package/themes/macos/form/src/form/form.scss +1 -0
- package/themes/macos/form/src/form-group/form-group.scss +17 -0
- package/themes/macos/form/src/form-item/form-item.scss +29 -0
- package/themes/macos/index-dark.scss +41 -0
- package/themes/macos/index-light.scss +41 -0
- package/themes/macos/index.scss +41 -0
- package/themes/macos/info/index.scss +3 -0
- package/themes/macos/info/src/info/info.scss +5 -0
- package/themes/macos/info/src/info-column/info-column.scss +5 -0
- package/themes/macos/info/src/info-field/info-field.scss +5 -0
- package/themes/macos/input/index.scss +1 -0
- package/themes/macos/input/src/input/input.scss +38 -0
- package/themes/macos/input-number/index.scss +1 -0
- package/themes/macos/input-number/src/input-number/input-number.scss +47 -0
- package/themes/macos/loader/index.scss +1 -0
- package/themes/macos/loader/src/loader/loader.scss +21 -0
- package/themes/macos/map/index.scss +1 -0
- package/themes/macos/map/src/map/map.scss +1 -0
- package/themes/macos/modal/index.scss +1 -0
- package/themes/macos/modal/src/modal/modal.scss +34 -0
- package/themes/macos/notification/index.scss +1 -0
- package/themes/macos/notification/src/notification/notification.scss +24 -0
- package/themes/macos/paginator/index.scss +1 -0
- package/themes/macos/paginator/src/paginator/paginator.scss +5 -0
- package/themes/macos/popover/index.scss +1 -0
- package/themes/macos/popover/src/popover/popover.scss +83 -0
- package/themes/macos/radio/index.scss +2 -0
- package/themes/macos/radio/src/radio/radio.scss +45 -0
- package/themes/macos/radio/src/radio-group/radio-group.scss +1 -0
- package/themes/macos/rating/index.scss +1 -0
- package/themes/macos/rating/src/rating/rating.scss +18 -0
- package/themes/macos/resizer/index.scss +1 -0
- package/themes/macos/resizer/src/resizer/resizer.scss +5 -0
- package/themes/macos/root/image/empty-default.svg +30 -0
- package/themes/macos/root/image/empty-space.svg +34 -0
- package/themes/macos/root/image/star-default.svg +10 -0
- package/themes/macos/root/vars-dark.scss +220 -0
- package/themes/macos/root/vars-light.scss +220 -0
- package/themes/macos/root/vars.scss +220 -0
- package/themes/macos/scrollbar/index.scss +1 -0
- package/themes/macos/scrollbar/src/scrollbar/scrollbar.scss +6 -0
- package/themes/macos/select/index.scss +2 -0
- package/themes/macos/select/src/select/select.scss +48 -0
- package/themes/macos/select/src/select-option/select-option.scss +1 -0
- package/themes/macos/slider/index.scss +1 -0
- package/themes/macos/slider/src/slider/slider.scss +21 -0
- package/themes/macos/switch/index.scss +1 -0
- package/themes/macos/switch/src/switch/switch.scss +28 -0
- package/themes/macos/table/index.scss +4 -0
- package/themes/macos/table/src/table/table.scss +15 -0
- package/themes/macos/table/src/table-cell/table-cell.scss +50 -0
- package/themes/macos/table/src/table-column/table-column.scss +32 -0
- package/themes/macos/table/src/table-filter/table-filter.scss +1 -0
- package/themes/macos/tabs/index.scss +2 -0
- package/themes/macos/tabs/src/tabs/tabs.scss +21 -0
- package/themes/macos/tabs/src/tabs-item/tabs-item.scss +18 -0
- package/themes/macos/tags/index.scss +2 -0
- package/themes/macos/tags/src/tags/tags.scss +1 -0
- package/themes/macos/tags/src/tags-item/tags-item.scss +28 -0
- package/themes/macos/textarea/index.scss +1 -0
- package/themes/macos/textarea/src/textarea/textarea.scss +30 -0
- package/themes/macos/timepicker/index.scss +2 -0
- package/themes/macos/timepicker/src/timepicker/timepicker.scss +50 -0
- package/themes/macos/timepicker/src/timepicker-panel/timepicker-panel.scss +27 -0
- package/themes/macos/transfer/index.scss +1 -0
- package/themes/macos/transfer/src/transfer/transfer.scss +18 -0
- package/themes/macos/virtualscroller/index.scss +1 -0
- package/themes/macos/virtualscroller/src/virtualscroller/virtualscroller.scss +1 -0
- package/webpack.config.js +32 -86
- package/webservy.json +3 -1
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Locale } from "@kizmann/pico-js";
|
2
|
+
|
3
|
+
global.NanoBuilderTypes['NRadioGroup'] = Locale.trans('NRadioGroup');
|
4
|
+
|
5
|
+
global.NanoBuilderIndexies['NRadioGroup'] = {
|
6
|
+
childs: false, props: {}
|
7
|
+
};
|
8
|
+
|
9
|
+
global.NanoBuilderIndexies['NRadioGroup']['props'] = {
|
10
|
+
//
|
11
|
+
};
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { Locale } from "@kizmann/pico-js";
|
2
|
+
|
3
|
+
global.NanoBuilderTypes['NSwitch'] = Locale.trans('NSwitch');
|
4
|
+
|
5
|
+
global.NanoBuilderIndexies['NSwitch'] = {
|
6
|
+
childs: true, props: {}
|
7
|
+
};
|
8
|
+
|
9
|
+
global.NanoBuilderIndexies['NSwitch']['props'] = {
|
10
|
+
modelValue: {
|
11
|
+
for: ['binds', 'props'], type: 'Any'
|
12
|
+
},
|
13
|
+
onValue: {
|
14
|
+
for: ['binds', 'props'], type: 'Any'
|
15
|
+
},
|
16
|
+
offValue: {
|
17
|
+
for: ['binds', 'props'], type: 'Any'
|
18
|
+
},
|
19
|
+
onType: {
|
20
|
+
for: ['binds', 'props'], type: 'String', options: global.NanoPrototypeTypes
|
21
|
+
},
|
22
|
+
offType: {
|
23
|
+
for: ['binds', 'props'], type: 'String', options: global.NanoPrototypeTypes
|
24
|
+
},
|
25
|
+
size: {
|
26
|
+
for: ['binds', 'props'], type: 'String', options: global.NanoPrototypeSizes
|
27
|
+
},
|
28
|
+
disabled: {
|
29
|
+
for: ['binds', 'props'], type: 'Boolean', options: global.NanoPrototypeBools
|
30
|
+
},
|
31
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Locale } from "@kizmann/pico-js";
|
2
|
+
|
3
|
+
global.NanoBuilderTypes['NTableColumn'] = Locale.trans('NTableColumn');
|
4
|
+
|
5
|
+
global.NanoBuilderIndexies['NTableColumn'] = {
|
6
|
+
childs: false, props: {}
|
7
|
+
};
|
8
|
+
|
9
|
+
global.NanoBuilderIndexies['NTableColumn']['props'] = {
|
10
|
+
//
|
11
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Locale } from "@kizmann/pico-js";
|
2
|
+
|
3
|
+
global.NanoBuilderTypes['NTabsItem'] = Locale.trans('NTabsItem');
|
4
|
+
|
5
|
+
global.NanoBuilderIndexies['NTabsItem'] = {
|
6
|
+
childs: false, props: {}
|
7
|
+
};
|
8
|
+
|
9
|
+
global.NanoBuilderIndexies['NTabsItem']['props'] = {
|
10
|
+
//
|
11
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Locale } from "@kizmann/pico-js";
|
2
|
+
|
3
|
+
global.NanoBuilderTypes['NTagsItem'] = Locale.trans('NTagsItem');
|
4
|
+
|
5
|
+
global.NanoBuilderIndexies['NTagsItem'] = {
|
6
|
+
childs: false, props: {}
|
7
|
+
};
|
8
|
+
|
9
|
+
global.NanoBuilderIndexies['NTagsItem']['props'] = {
|
10
|
+
//
|
11
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Locale } from "@kizmann/pico-js";
|
2
|
+
|
3
|
+
global.NanoBuilderTypes['NTimepicker'] = Locale.trans('NTimepicker');
|
4
|
+
|
5
|
+
global.NanoBuilderIndexies['NTimepicker'] = {
|
6
|
+
childs: false, props: {}
|
7
|
+
};
|
8
|
+
|
9
|
+
global.NanoBuilderIndexies['NTimepicker']['props'] = {
|
10
|
+
//
|
11
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Locale } from "@kizmann/pico-js";
|
2
|
+
|
3
|
+
global.NanoBuilderTypes['NTransfer'] = Locale.trans('NTransfer');
|
4
|
+
|
5
|
+
global.NanoBuilderIndexies['NTransfer'] = {
|
6
|
+
childs: false, props: {}
|
7
|
+
};
|
8
|
+
|
9
|
+
global.NanoBuilderIndexies['NTransfer']['props'] = {
|
10
|
+
//
|
11
|
+
};
|
@@ -66,6 +66,20 @@ export default {
|
|
66
66
|
|
67
67
|
methods: {
|
68
68
|
|
69
|
+
getString(value)
|
70
|
+
{
|
71
|
+
let final = value.replace(/^@/, '')
|
72
|
+
.replace(/^\\@/, '@');
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
if ( value.match(/^@/) ) {
|
77
|
+
return this.trans(final);
|
78
|
+
}
|
79
|
+
|
80
|
+
return final;
|
81
|
+
},
|
82
|
+
|
69
83
|
propAwait(value)
|
70
84
|
{
|
71
85
|
if ( Any.isEmpty(value) ) {
|
@@ -180,7 +194,7 @@ export default {
|
|
180
194
|
}
|
181
195
|
|
182
196
|
if ( ! value.match(/(\$scope|\$model|\$global)/) ) {
|
183
|
-
return value;
|
197
|
+
return this.getString(value);
|
184
198
|
}
|
185
199
|
|
186
200
|
let sources = {
|
@@ -316,7 +330,7 @@ export default {
|
|
316
330
|
}
|
317
331
|
|
318
332
|
if ( Any.isString(setup.content) ) {
|
319
|
-
render = () => setup.content;
|
333
|
+
render = () => this.getString(setup.content);
|
320
334
|
}
|
321
335
|
|
322
336
|
return h(component, props, { default: render });
|
@@ -0,0 +1,196 @@
|
|
1
|
+
import { Arr, Obj, Any } from "@kizmann/pico-js";
|
2
|
+
|
3
|
+
export default {
|
4
|
+
|
5
|
+
name: 'NReferencePanel',
|
6
|
+
|
7
|
+
props: {
|
8
|
+
|
9
|
+
modelValue: {
|
10
|
+
default()
|
11
|
+
{
|
12
|
+
return "";
|
13
|
+
},
|
14
|
+
type: [String]
|
15
|
+
},
|
16
|
+
|
17
|
+
model: {
|
18
|
+
default()
|
19
|
+
{
|
20
|
+
return {};
|
21
|
+
},
|
22
|
+
type: [Object]
|
23
|
+
},
|
24
|
+
|
25
|
+
scope: {
|
26
|
+
default()
|
27
|
+
{
|
28
|
+
return {};
|
29
|
+
},
|
30
|
+
type: [Object]
|
31
|
+
},
|
32
|
+
|
33
|
+
},
|
34
|
+
|
35
|
+
data()
|
36
|
+
{
|
37
|
+
return {
|
38
|
+
expanded: [], selected: null, modelTree: this.buildTree(this.model, '$model'), scopeTree: this.buildTree(this.scope, '$scope')
|
39
|
+
};
|
40
|
+
},
|
41
|
+
|
42
|
+
methods: {
|
43
|
+
|
44
|
+
buildTree(value, path = '')
|
45
|
+
{
|
46
|
+
let result = {};
|
47
|
+
|
48
|
+
if ( ! Any.isPlain(value) && ! Obj.get(value, '__v_skip') ) {
|
49
|
+
return result;
|
50
|
+
}
|
51
|
+
|
52
|
+
for(var key in value) {
|
53
|
+
|
54
|
+
let [ref, val] = [
|
55
|
+
`${path}.${key}`, value[key]
|
56
|
+
];
|
57
|
+
|
58
|
+
if ( Any.isPlain(val) ) {
|
59
|
+
val = this.buildTree(val, ref);
|
60
|
+
}
|
61
|
+
|
62
|
+
let type = typeof val;
|
63
|
+
|
64
|
+
if ( Any.isArray(val) ) {
|
65
|
+
type = 'array';
|
66
|
+
}
|
67
|
+
|
68
|
+
result[key] = {
|
69
|
+
path: ref, value: val, type: type
|
70
|
+
};
|
71
|
+
|
72
|
+
}
|
73
|
+
|
74
|
+
return result;
|
75
|
+
},
|
76
|
+
|
77
|
+
submitItem(value)
|
78
|
+
{
|
79
|
+
this.$emit('update:modelValue', value.path);
|
80
|
+
},
|
81
|
+
|
82
|
+
selectItem(value)
|
83
|
+
{
|
84
|
+
this.selected = value;
|
85
|
+
},
|
86
|
+
|
87
|
+
expandItem(value)
|
88
|
+
{
|
89
|
+
if ( value.type === 'object' ) {
|
90
|
+
Arr.toggle(this.expanded, value.path);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
},
|
95
|
+
|
96
|
+
renderLeaf(value, key)
|
97
|
+
{
|
98
|
+
let classList = [
|
99
|
+
'n-reference-panel__item',
|
100
|
+
'n-reference-panel__item--' + value.type,
|
101
|
+
];
|
102
|
+
|
103
|
+
if ( Obj.get(this.selected, 'path') === value.path) {
|
104
|
+
classList.push('is-selected');
|
105
|
+
}
|
106
|
+
|
107
|
+
if ( value.type === 'object' ) {
|
108
|
+
classList.push('has-childs');
|
109
|
+
}
|
110
|
+
|
111
|
+
if ( Arr.has(this.expanded, value.path) ) {
|
112
|
+
classList.push('is-expanded');
|
113
|
+
}
|
114
|
+
|
115
|
+
return (
|
116
|
+
<div class={classList} onDblclick={() => this.submitItem(value)}>
|
117
|
+
<div class="n-reference-panel__expand" onClick={() => this.expandItem(value)}>
|
118
|
+
<i class="fa fa-angle-right"></i>
|
119
|
+
</div>
|
120
|
+
<div class="n-reference-panel__name" onClick={() => this.selectItem(value)}>
|
121
|
+
{key}
|
122
|
+
</div>
|
123
|
+
<div class="n-reference-panel__type" onClick={() => this.selectItem(value)}>
|
124
|
+
{value.type}
|
125
|
+
</div>
|
126
|
+
<div class="n-reference-panel__pick" onClick={() => this.submitItem(value)}>
|
127
|
+
<i class="fa fa-expand"></i>
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
);
|
131
|
+
},
|
132
|
+
|
133
|
+
renderTree(value, key)
|
134
|
+
{
|
135
|
+
let childItems = Arr.each(value.value, (value, key) => {
|
136
|
+
return this.ctor('renderItem')(value, key);
|
137
|
+
});
|
138
|
+
|
139
|
+
let childHtml = (
|
140
|
+
<div class="n-reference-panel__childs">
|
141
|
+
{childItems}
|
142
|
+
</div>
|
143
|
+
);
|
144
|
+
|
145
|
+
if ( ! Arr.has(this.expanded, value.path) ) {
|
146
|
+
childHtml = null;
|
147
|
+
}
|
148
|
+
|
149
|
+
return [this.ctor('renderLeaf')(value, key), childHtml];
|
150
|
+
},
|
151
|
+
|
152
|
+
renderItem(value, key)
|
153
|
+
{
|
154
|
+
if ( value.type === 'object' ) {
|
155
|
+
return this.ctor('renderTree')(value, key);
|
156
|
+
}
|
157
|
+
|
158
|
+
return this.ctor('renderLeaf')(value, key);
|
159
|
+
},
|
160
|
+
|
161
|
+
renderModel()
|
162
|
+
{
|
163
|
+
let modelHtml = Arr.each(this.modelTree, (value, key) => {
|
164
|
+
return this.ctor('renderItem')(value, key);
|
165
|
+
});
|
166
|
+
|
167
|
+
return (
|
168
|
+
<div class="n-reference-panel__model">
|
169
|
+
{modelHtml}
|
170
|
+
</div>
|
171
|
+
);
|
172
|
+
},
|
173
|
+
|
174
|
+
renderScope()
|
175
|
+
{
|
176
|
+
let scopeHtml = Arr.each(this.scopeTree, (value, key) => {
|
177
|
+
return this.ctor('renderItem')(value, key);
|
178
|
+
});
|
179
|
+
|
180
|
+
return (
|
181
|
+
<div class="n-reference-panel__scope">
|
182
|
+
{scopeHtml}
|
183
|
+
</div>
|
184
|
+
);
|
185
|
+
},
|
186
|
+
|
187
|
+
render()
|
188
|
+
{
|
189
|
+
return (
|
190
|
+
<div class="n-reference-panel">
|
191
|
+
{[this.ctor('renderModel')(), this.ctor('renderScope')()]}
|
192
|
+
</div>
|
193
|
+
);
|
194
|
+
}
|
195
|
+
|
196
|
+
}
|
@@ -0,0 +1,194 @@
|
|
1
|
+
.n-reference-panel {
|
2
|
+
position: relative;
|
3
|
+
display: flex;
|
4
|
+
flex-direction: row;
|
5
|
+
}
|
6
|
+
|
7
|
+
.n-reference-panel:not(.in-modal) {
|
8
|
+
border: 1px solid $color-gray-10;
|
9
|
+
}
|
10
|
+
|
11
|
+
.n-reference-panel.in-modal {
|
12
|
+
position: absolute;
|
13
|
+
top: 0;
|
14
|
+
left: 0;
|
15
|
+
width: 100%;
|
16
|
+
height: 100%;
|
17
|
+
}
|
18
|
+
|
19
|
+
.n-reference-panel:after {
|
20
|
+
content: '\00a0';
|
21
|
+
position: absolute;
|
22
|
+
top: 0;
|
23
|
+
left: 50%;
|
24
|
+
width: 6px;
|
25
|
+
height: 100%;
|
26
|
+
background: $color-gray-05;
|
27
|
+
border-left: 1px solid $color-gray-10;
|
28
|
+
border-right: 1px solid $color-gray-10;
|
29
|
+
transform: translateX(-50%);
|
30
|
+
}
|
31
|
+
|
32
|
+
.n-reference-panel__model,
|
33
|
+
.n-reference-panel__scope {
|
34
|
+
position: relative;
|
35
|
+
flex: 0 0 auto;
|
36
|
+
width: 50%;
|
37
|
+
display: flex;
|
38
|
+
align-items: flex-start;
|
39
|
+
flex-direction: column;
|
40
|
+
padding: 8px;
|
41
|
+
}
|
42
|
+
|
43
|
+
.n-reference-panel__model:before,
|
44
|
+
.n-reference-panel__scope:before {
|
45
|
+
position: absolute;
|
46
|
+
top: 10px;
|
47
|
+
display: inline-block;
|
48
|
+
font-size: 13px;
|
49
|
+
font-family: monospace;
|
50
|
+
color: rgba($color-black, 0.4);
|
51
|
+
}
|
52
|
+
|
53
|
+
.n-reference-panel__model {
|
54
|
+
padding-right: 11px;
|
55
|
+
}
|
56
|
+
|
57
|
+
.n-reference-panel__model:before {
|
58
|
+
content: '$model';
|
59
|
+
right: 13px;
|
60
|
+
}
|
61
|
+
|
62
|
+
.n-reference-panel__scope {
|
63
|
+
padding-left: 11px;
|
64
|
+
}
|
65
|
+
|
66
|
+
.n-reference-panel__scope:before {
|
67
|
+
content: '$scope';
|
68
|
+
right: 10px;
|
69
|
+
}
|
70
|
+
|
71
|
+
.n-reference-panel__item {
|
72
|
+
cursor: default;
|
73
|
+
user-select: none;
|
74
|
+
flex: 0 0 auto;
|
75
|
+
display: inline-flex;
|
76
|
+
flex-direction: row;
|
77
|
+
align-items: center;
|
78
|
+
padding: 5px 8px;
|
79
|
+
font-family: monospace;
|
80
|
+
border-radius: 3px;
|
81
|
+
}
|
82
|
+
|
83
|
+
.n-reference-panel__item.is-selected {
|
84
|
+
background: rgba($color-black, 0.1);
|
85
|
+
}
|
86
|
+
|
87
|
+
.n-reference-panel__item--function.is-selected {
|
88
|
+
background: rgba($color-success, 0.1);
|
89
|
+
}
|
90
|
+
|
91
|
+
.n-reference-panel__item--string.is-selected,
|
92
|
+
.n-reference-panel__item--boolean.is-selected,
|
93
|
+
.n-reference-panel__item--number.is-selected {
|
94
|
+
background: rgba($color-warning, 0.1);
|
95
|
+
}
|
96
|
+
|
97
|
+
.n-reference-panel__item--object.is-selected {
|
98
|
+
background: rgba($color-info, 0.1);
|
99
|
+
}
|
100
|
+
|
101
|
+
.n-reference-panel__item--array.is-selected {
|
102
|
+
background: rgba($color-danger, 0.1);
|
103
|
+
}
|
104
|
+
|
105
|
+
.n-reference-panel__expand,
|
106
|
+
.n-reference-panel__pick {
|
107
|
+
cursor: pointer;
|
108
|
+
display: inline-block;
|
109
|
+
text-align: center;
|
110
|
+
line-height: 16px;
|
111
|
+
width: 16px;
|
112
|
+
height: 16px;
|
113
|
+
}
|
114
|
+
|
115
|
+
.n-reference-panel__expand {
|
116
|
+
margin-right: 5px;
|
117
|
+
}
|
118
|
+
|
119
|
+
.n-reference-panel__item.is-expanded .n-reference-panel__expand {
|
120
|
+
transform: rotate(90deg);
|
121
|
+
}
|
122
|
+
|
123
|
+
.n-reference-panel__item:not(.has-childs) .n-reference-panel__expand {
|
124
|
+
cursor: not-allowed;
|
125
|
+
}
|
126
|
+
|
127
|
+
.n-reference-panel__pick {
|
128
|
+
margin-left: 5px;
|
129
|
+
}
|
130
|
+
|
131
|
+
.n-reference-panel__expand i,
|
132
|
+
.n-reference-panel__pick i {
|
133
|
+
font-size: 12px;
|
134
|
+
color: rgba($color-black, 0.4);
|
135
|
+
}
|
136
|
+
|
137
|
+
.n-reference-panel__item:not(.has-childs) .n-reference-panel__expand i {
|
138
|
+
opacity: 0.3;
|
139
|
+
}
|
140
|
+
|
141
|
+
.n-reference-panel__name {
|
142
|
+
margin-right: 5px;
|
143
|
+
font-size: 13px;
|
144
|
+
}
|
145
|
+
|
146
|
+
.n-reference-panel__type {
|
147
|
+
display: inline-block;
|
148
|
+
padding: 2px 6px 1px;
|
149
|
+
background: $color-gray-10;
|
150
|
+
border-radius: 3px;
|
151
|
+
font-size: 11px;
|
152
|
+
font-family: monospace;
|
153
|
+
}
|
154
|
+
|
155
|
+
.n-reference-panel__item--function .n-reference-panel__type {
|
156
|
+
color: rgba(darken($color-success, 20%), 0.7);
|
157
|
+
background: rgba($color-success, 0.2);
|
158
|
+
}
|
159
|
+
|
160
|
+
.n-reference-panel__item--string .n-reference-panel__type,
|
161
|
+
.n-reference-panel__item--boolean .n-reference-panel__type,
|
162
|
+
.n-reference-panel__item--number .n-reference-panel__type {
|
163
|
+
color: rgba(darken($color-warning, 20%), 0.7);
|
164
|
+
background: rgba($color-warning, 0.2);
|
165
|
+
}
|
166
|
+
|
167
|
+
.n-reference-panel__item--array .n-reference-panel__type {
|
168
|
+
color: rgba(darken($color-danger, 20%), 0.7);
|
169
|
+
background: rgba($color-danger, 0.2);
|
170
|
+
}
|
171
|
+
|
172
|
+
.n-reference-panel__item--object .n-reference-panel__type {
|
173
|
+
color: rgba(darken($color-info, 30%), 0.7);
|
174
|
+
background: rgba($color-info, 0.2);
|
175
|
+
}
|
176
|
+
|
177
|
+
.n-reference-panel__childs {
|
178
|
+
position: relative;
|
179
|
+
display: flex;
|
180
|
+
flex-direction: column;
|
181
|
+
align-items: flex-start;
|
182
|
+
padding-left: 19px;
|
183
|
+
}
|
184
|
+
|
185
|
+
.n-reference-panel__childs:before {
|
186
|
+
content: '\00a0';
|
187
|
+
position: absolute;
|
188
|
+
top: 3px;
|
189
|
+
left: 15px;
|
190
|
+
display: block;
|
191
|
+
width: 1px;
|
192
|
+
height: calc(100% - 6px);
|
193
|
+
background: $color-gray-05;
|
194
|
+
}
|