@kigi/components 1.5.5 → 1.5.8
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/package.json +1 -1
- package/src/components/mbg-ace-editor/mbg-ace-editor.scss +1 -0
- package/src/components/mbg-ace-editor/mbg-ace-editor.ts +6 -3
- package/src/components/mbg-dropdown/mbg-dropdown.html +2 -1
- package/src/components/mbg-dropdown/mbg-dropdown.ts +2 -1
- package/src/index.html +3 -0
- package/src/index.ts +8 -0
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ class MbgAceEditorController {
|
|
|
7
7
|
private ngChange
|
|
8
8
|
private ngModel
|
|
9
9
|
private variables: IMbgAceEditorVariables[]
|
|
10
|
+
private editorRef
|
|
10
11
|
|
|
11
12
|
constructor(private $scope, private $element, private $attrs) {}
|
|
12
13
|
|
|
@@ -17,6 +18,7 @@ class MbgAceEditorController {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
onLoad(editor, variables) {
|
|
21
|
+
this.editorRef = editor
|
|
20
22
|
const ace = (<any>window).ace
|
|
21
23
|
const languageTools = ace.require('ace/ext/language_tools')
|
|
22
24
|
const customCompleter = {
|
|
@@ -25,8 +27,8 @@ class MbgAceEditorController {
|
|
|
25
27
|
},
|
|
26
28
|
}
|
|
27
29
|
languageTools.addCompleter(customCompleter)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
this.editorRef.completers = [customCompleter]
|
|
31
|
+
this.editorRef.setOptions({
|
|
30
32
|
enableBasicAutocompletion: true,
|
|
31
33
|
fontSize: '14px',
|
|
32
34
|
enableSnippets: true,
|
|
@@ -39,7 +41,7 @@ class MbgAceEditorController {
|
|
|
39
41
|
showGutter: false,
|
|
40
42
|
highlightActiveLine: false,
|
|
41
43
|
})
|
|
42
|
-
|
|
44
|
+
this.editorRef.$blockScrolling = Infinity
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
onLoadEditor = (editor) => {
|
|
@@ -55,6 +57,7 @@ const mbgAceEditor = {
|
|
|
55
57
|
ngModel: '=',
|
|
56
58
|
variables: '=?',
|
|
57
59
|
height: '@?',
|
|
60
|
+
editorRef: '=?',
|
|
58
61
|
},
|
|
59
62
|
template,
|
|
60
63
|
controller: MbgAceEditorController,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
uib-dropdown-toggle>
|
|
7
7
|
<span>{{$ctrl.label}}</span>
|
|
8
8
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
ng-show="!$ctrl.hidden"
|
|
9
10
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
10
11
|
version="1.1"
|
|
11
12
|
x="0px"
|
|
@@ -44,4 +45,4 @@
|
|
|
44
45
|
<input type="file"
|
|
45
46
|
accept="{{$ctrl.acceptFile ? $ctrl.acceptFile : '.xls,.xlsx'}}"
|
|
46
47
|
onchange="angular.element(this).scope().$ctrl.onFilesChoice(event)" />
|
|
47
|
-
</div>
|
|
48
|
+
</div>
|
|
@@ -30,7 +30,7 @@ class MbgDropdownController {
|
|
|
30
30
|
break
|
|
31
31
|
default:
|
|
32
32
|
if (option.callback) {
|
|
33
|
-
option.callback(this.item)
|
|
33
|
+
option.callback({ ...(this.item ? this.item : {}), dropDownItem: option })
|
|
34
34
|
}
|
|
35
35
|
break
|
|
36
36
|
}
|
|
@@ -84,6 +84,7 @@ const mbgDropdown = {
|
|
|
84
84
|
item: '=?',
|
|
85
85
|
direction: '@?',
|
|
86
86
|
acceptFile: '@?',
|
|
87
|
+
hidden: '=?',
|
|
87
88
|
},
|
|
88
89
|
template,
|
|
89
90
|
controller: MbgDropdownController,
|
package/src/index.html
CHANGED
|
@@ -987,7 +987,10 @@
|
|
|
987
987
|
<div class="panel-body">
|
|
988
988
|
<mbg-ace-editor ng-model="aceEditor"
|
|
989
989
|
height="104px"
|
|
990
|
+
editor-ref="uiAceRef"
|
|
990
991
|
variables="uiAceVariables"></mbg-ace-editor>
|
|
992
|
+
<button type="button"
|
|
993
|
+
ng-click="onPastEditor('Teste Label')"> Clique aqui!</button>
|
|
991
994
|
</div>
|
|
992
995
|
</div>
|
|
993
996
|
<div class="panel panel-default">
|
package/src/index.ts
CHANGED
|
@@ -39,6 +39,8 @@ const module = angular.module('demo', ['ngLocale', components]).controller('demo
|
|
|
39
39
|
onSave: (json) => {},
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
$scope.uiAceRef = null
|
|
43
|
+
|
|
42
44
|
$scope.addEvent = () => {
|
|
43
45
|
$timeout(() => {
|
|
44
46
|
$scope.events.push({
|
|
@@ -8881,6 +8883,12 @@ const module = angular.module('demo', ['ngLocale', components]).controller('demo
|
|
|
8881
8883
|
meta: 'Variável',
|
|
8882
8884
|
},
|
|
8883
8885
|
]
|
|
8886
|
+
|
|
8887
|
+
$scope.onPastEditor = (value) => {
|
|
8888
|
+
if ($scope.uiAceRef) {
|
|
8889
|
+
$scope.uiAceRef.insert(value)
|
|
8890
|
+
}
|
|
8891
|
+
}
|
|
8884
8892
|
},
|
|
8885
8893
|
])
|
|
8886
8894
|
angular.bootstrap(document, [module.name])
|