@kigi/components 1.5.4 → 1.5.5
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 +4 -2
- package/src/components/index.ts +6 -0
- package/src/components/mbg-ace-editor/index.ts +8 -0
- package/src/components/mbg-ace-editor/interface/mbg-ace-editor-variables.interface.ts +5 -0
- package/src/components/mbg-ace-editor/mbg-ace-editor.html +5 -0
- package/src/components/mbg-ace-editor/mbg-ace-editor.scss +15 -0
- package/src/components/mbg-ace-editor/mbg-ace-editor.ts +63 -0
- package/src/components/mbg-editor/index.ts +2 -3
- package/src/components/mbg-image-upload/index.ts +8 -10
- package/src/index.html +19 -5
- package/src/index.ts +8 -81
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kigi/components",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"description": "@kigi/components",
|
|
5
5
|
"main": "src/components/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"angular-sanitize": "1.7.9",
|
|
47
47
|
"angular-scroll-animate": "^0.9.9",
|
|
48
48
|
"angular-timeline": "^1.7.0",
|
|
49
|
+
"angular-ui-ace": "^0.2.3",
|
|
49
50
|
"angular-ui-bootstrap": "^2.5.6",
|
|
50
51
|
"angular-vs-repeat": "^2.0.14",
|
|
51
52
|
"cep-promise": "^3.0.3",
|
|
@@ -70,7 +71,8 @@
|
|
|
70
71
|
"progressbar.js": "^1.0.1",
|
|
71
72
|
"raphael": "^2.2.8",
|
|
72
73
|
"sugarss": "^2.0.0",
|
|
73
|
-
"webcamjs": "^1.0.25"
|
|
74
|
+
"webcamjs": "^1.0.25",
|
|
75
|
+
"ace-builds": "1.3.3"
|
|
74
76
|
},
|
|
75
77
|
"devDependencies": {
|
|
76
78
|
"@types/angular": "^1.6.27",
|
package/src/components/index.ts
CHANGED
|
@@ -8,6 +8,9 @@ import './common.scss'
|
|
|
8
8
|
import '../helpers/locale'
|
|
9
9
|
import 'progressbar.js/dist/progressbar.min.js'
|
|
10
10
|
import 'angular-vs-repeat'
|
|
11
|
+
import 'ace-builds/src-min-noconflict/ace'
|
|
12
|
+
import 'ace-builds/src-min-noconflict/ext-language_tools'
|
|
13
|
+
import 'angular-ui-ace'
|
|
11
14
|
import * as ngSanitize from 'angular-sanitize'
|
|
12
15
|
import * as ngAnimate from 'angular-animate'
|
|
13
16
|
import { MbgDynamicHTML } from '../helpers/dynamic-html/dynamic-html'
|
|
@@ -80,6 +83,7 @@ import { mbgRepasseModule } from './mbg-repasse'
|
|
|
80
83
|
import { mbgTextEditorModule } from './mbg-text-editor'
|
|
81
84
|
import 'jodit/src/langs/pt_br.js'
|
|
82
85
|
import { NgMaskIe } from '../helpers/ie-directive/ie-directive'
|
|
86
|
+
import { mbgAceEditorModule } from './mbg-ace-editor'
|
|
83
87
|
|
|
84
88
|
if (!window['$']) {
|
|
85
89
|
window['$'] = $
|
|
@@ -88,6 +92,7 @@ if (!window['$']) {
|
|
|
88
92
|
|
|
89
93
|
const mbgComponentsModule = angular
|
|
90
94
|
.module('mbg.components', [
|
|
95
|
+
'ui.ace',
|
|
91
96
|
'ui.utils.masks',
|
|
92
97
|
'ngEasyInfiniteScroll',
|
|
93
98
|
'ui.bootstrap',
|
|
@@ -143,6 +148,7 @@ const mbgComponentsModule = angular
|
|
|
143
148
|
mbgTimelineModule,
|
|
144
149
|
mbgRepasseModule,
|
|
145
150
|
mbgTextEditorModule,
|
|
151
|
+
mbgAceEditorModule,
|
|
146
152
|
])
|
|
147
153
|
.config(appConfig)
|
|
148
154
|
.service('mbgAlert', MbgAlert)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import './mbg-ace-editor.scss'
|
|
2
|
+
import template from './mbg-ace-editor.html'
|
|
3
|
+
import { IMbgAceEditorVariables } from './interface/mbg-ace-editor-variables.interface'
|
|
4
|
+
|
|
5
|
+
class MbgAceEditorController {
|
|
6
|
+
private aceConfig: any
|
|
7
|
+
private ngChange
|
|
8
|
+
private ngModel
|
|
9
|
+
private variables: IMbgAceEditorVariables[]
|
|
10
|
+
|
|
11
|
+
constructor(private $scope, private $element, private $attrs) {}
|
|
12
|
+
|
|
13
|
+
$onInit() {
|
|
14
|
+
this.aceConfig = {
|
|
15
|
+
onLoad: this.onLoadEditor,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
onLoad(editor, variables) {
|
|
20
|
+
const ace = (<any>window).ace
|
|
21
|
+
const languageTools = ace.require('ace/ext/language_tools')
|
|
22
|
+
const customCompleter = {
|
|
23
|
+
getCompletions: (_, __, ___, ____, callback) => {
|
|
24
|
+
callback(null, variables)
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
languageTools.addCompleter(customCompleter)
|
|
28
|
+
editor.completers = [customCompleter]
|
|
29
|
+
editor.setOptions({
|
|
30
|
+
enableBasicAutocompletion: true,
|
|
31
|
+
fontSize: '14px',
|
|
32
|
+
enableSnippets: true,
|
|
33
|
+
enableLiveAutocompletion: false,
|
|
34
|
+
showLineNumbers: false,
|
|
35
|
+
showFoldWidgets: false,
|
|
36
|
+
printMarginColumn: -1,
|
|
37
|
+
showPrintMargin: false,
|
|
38
|
+
displayIndentGuides: false,
|
|
39
|
+
showGutter: false,
|
|
40
|
+
highlightActiveLine: false,
|
|
41
|
+
})
|
|
42
|
+
editor.$blockScrolling = Infinity
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
onLoadEditor = (editor) => {
|
|
46
|
+
const variables = this.variables
|
|
47
|
+
this.onLoad(editor, variables)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
MbgAceEditorController['$inject'] = ['$scope', '$element', '$attrs']
|
|
52
|
+
|
|
53
|
+
const mbgAceEditor = {
|
|
54
|
+
bindings: {
|
|
55
|
+
ngModel: '=',
|
|
56
|
+
variables: '=?',
|
|
57
|
+
height: '@?',
|
|
58
|
+
},
|
|
59
|
+
template,
|
|
60
|
+
controller: MbgAceEditorController,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { mbgAceEditor }
|
|
@@ -2,8 +2,7 @@ import * as angular from 'angular'
|
|
|
2
2
|
import { mbgEditor } from './mbg-editor'
|
|
3
3
|
|
|
4
4
|
const mbgEditorModule = angular
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
.name
|
|
5
|
+
.module('mbg.components.mbgEditor', [])
|
|
6
|
+
.component('mbgEditor', mbgEditor).name
|
|
8
7
|
|
|
9
8
|
export { mbgEditorModule }
|
|
@@ -7,17 +7,15 @@ import { imageUploadNoImage } from './components/image-upload-no-image/image-upl
|
|
|
7
7
|
import { imageUploadLoading } from './components/image-upload-loading/image-upload-loading'
|
|
8
8
|
import { MbgImageUploadService } from './services/mbg-image-upload-service'
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
const mbgImageUploadModule = angular
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
.name
|
|
11
|
+
.module('mbg.components.imageUpload', [])
|
|
12
|
+
.service('mbgImageUploadService', MbgImageUploadService)
|
|
13
|
+
.component('mbgImageUpload', imageUpload)
|
|
14
|
+
.component('mbgImageUploadMain', imageUploadMain)
|
|
15
|
+
.component('mbgImageUploadChildren', imageUploadChildren)
|
|
16
|
+
.component('mbgImageUploadNoImage', imageUploadNoImage)
|
|
17
|
+
.component('mbgImageUploadLoading', imageUploadLoading)
|
|
18
|
+
.component('mbgImageCrop', imageCrop).name
|
|
21
19
|
|
|
22
20
|
export * from './interfaces'
|
|
23
21
|
export { mbgImageUploadModule }
|
package/src/index.html
CHANGED
|
@@ -176,9 +176,6 @@
|
|
|
176
176
|
label="Opções"></mbg-dropdown>
|
|
177
177
|
</div> -->
|
|
178
178
|
|
|
179
|
-
<!-- <mbg-input-text ng-model="asdasdasd"
|
|
180
|
-
ng-change="hhhsss($event)"></mbg-input-text> -->
|
|
181
|
-
|
|
182
179
|
<!-- <div style="padding: 24px;">
|
|
183
180
|
<div class="container">
|
|
184
181
|
<br />
|
|
@@ -795,7 +792,7 @@
|
|
|
795
792
|
</div>
|
|
796
793
|
</div> -->
|
|
797
794
|
|
|
798
|
-
<div style="padding: 100px">
|
|
795
|
+
<!-- <div style="padding: 100px">
|
|
799
796
|
<div class="panel panel-default">
|
|
800
797
|
<div class="panel-heading">Email</div>
|
|
801
798
|
<div class="panel-body">
|
|
@@ -809,7 +806,7 @@
|
|
|
809
806
|
<mbg-address ng-model="address"></mbg-address>
|
|
810
807
|
</div>
|
|
811
808
|
</div>
|
|
812
|
-
</div>
|
|
809
|
+
</div> -->
|
|
813
810
|
|
|
814
811
|
|
|
815
812
|
<!-- <form>
|
|
@@ -984,6 +981,23 @@
|
|
|
984
981
|
</div>
|
|
985
982
|
{{teste}}
|
|
986
983
|
</div> -->
|
|
984
|
+
<div style="padding: 100px">
|
|
985
|
+
<div class="panel panel-default">
|
|
986
|
+
<div class="panel-heading">Ace Editor</div>
|
|
987
|
+
<div class="panel-body">
|
|
988
|
+
<mbg-ace-editor ng-model="aceEditor"
|
|
989
|
+
height="104px"
|
|
990
|
+
variables="uiAceVariables"></mbg-ace-editor>
|
|
991
|
+
</div>
|
|
992
|
+
</div>
|
|
993
|
+
<div class="panel panel-default">
|
|
994
|
+
<div class="panel-heading">Text</div>
|
|
995
|
+
<div class="panel-body">
|
|
996
|
+
<mbg-input-text ng-model="asdasdasd"
|
|
997
|
+
ng-change="hhhsss($event)"></mbg-input-text>
|
|
998
|
+
</div>
|
|
999
|
+
</div>
|
|
1000
|
+
|
|
987
1001
|
</div>
|
|
988
1002
|
</body>
|
|
989
1003
|
|
package/src/index.ts
CHANGED
|
@@ -771,87 +771,6 @@ const module = angular.module('demo', ['ngLocale', components]).controller('demo
|
|
|
771
771
|
$scope.columnQntHidden = !$scope.columnQntHidden
|
|
772
772
|
}
|
|
773
773
|
|
|
774
|
-
$scope.produtos = [
|
|
775
|
-
{
|
|
776
|
-
code: '0',
|
|
777
|
-
product: 'Camiseta Adidas farm floral',
|
|
778
|
-
qnt: 20,
|
|
779
|
-
costValue: 200.0,
|
|
780
|
-
},
|
|
781
|
-
{
|
|
782
|
-
code: '1',
|
|
783
|
-
product: 'Blusa Adidas undeground',
|
|
784
|
-
qnt: 37,
|
|
785
|
-
costValue: 435.9,
|
|
786
|
-
},
|
|
787
|
-
{
|
|
788
|
-
code: '2',
|
|
789
|
-
product: 'Calça Nike undeground',
|
|
790
|
-
qnt: 25,
|
|
791
|
-
costValue: 348.9,
|
|
792
|
-
},
|
|
793
|
-
{
|
|
794
|
-
code: '3',
|
|
795
|
-
product: 'Shorts Nike undeground',
|
|
796
|
-
qnt: 25,
|
|
797
|
-
costValue: 348.9,
|
|
798
|
-
},
|
|
799
|
-
{
|
|
800
|
-
code: '0',
|
|
801
|
-
product: 'Camiseta Adidas farm floral',
|
|
802
|
-
qnt: 20,
|
|
803
|
-
costValue: 200.0,
|
|
804
|
-
},
|
|
805
|
-
{
|
|
806
|
-
code: '1',
|
|
807
|
-
product: 'Blusa Adidas undeground',
|
|
808
|
-
qnt: 37,
|
|
809
|
-
costValue: 435.9,
|
|
810
|
-
},
|
|
811
|
-
{
|
|
812
|
-
code: '2',
|
|
813
|
-
product: 'Calça Nike undeground',
|
|
814
|
-
qnt: 25,
|
|
815
|
-
costValue: 348.9,
|
|
816
|
-
},
|
|
817
|
-
{
|
|
818
|
-
code: '3',
|
|
819
|
-
product: 'Shorts Nike undeground',
|
|
820
|
-
qnt: 25,
|
|
821
|
-
costValue: 348.9,
|
|
822
|
-
},
|
|
823
|
-
{
|
|
824
|
-
code: '0',
|
|
825
|
-
product: 'Camiseta Adidas farm floral',
|
|
826
|
-
qnt: 20,
|
|
827
|
-
costValue: 200.0,
|
|
828
|
-
},
|
|
829
|
-
{
|
|
830
|
-
code: '1',
|
|
831
|
-
product: 'Blusa Adidas undeground',
|
|
832
|
-
qnt: 37,
|
|
833
|
-
costValue: 435.9,
|
|
834
|
-
},
|
|
835
|
-
{
|
|
836
|
-
code: '2',
|
|
837
|
-
product: 'Calça Nike undeground',
|
|
838
|
-
qnt: 25,
|
|
839
|
-
costValue: 348.9,
|
|
840
|
-
},
|
|
841
|
-
{
|
|
842
|
-
code: '3',
|
|
843
|
-
product: 'Shorts Nike undeground',
|
|
844
|
-
qnt: 25,
|
|
845
|
-
costValue: 348.9,
|
|
846
|
-
},
|
|
847
|
-
{
|
|
848
|
-
code: '0',
|
|
849
|
-
product: 'Camiseta Adidas farm floral',
|
|
850
|
-
qnt: 20,
|
|
851
|
-
costValue: 200.0,
|
|
852
|
-
},
|
|
853
|
-
]
|
|
854
|
-
|
|
855
774
|
$scope.lalala = () => {
|
|
856
775
|
console.log('aspodasdpoasdoasd')
|
|
857
776
|
}
|
|
@@ -8954,6 +8873,14 @@ const module = angular.module('demo', ['ngLocale', components]).controller('demo
|
|
|
8954
8873
|
$scope.testecons = () => {
|
|
8955
8874
|
console.log('asdihasoidashpid')
|
|
8956
8875
|
}
|
|
8876
|
+
|
|
8877
|
+
$scope.uiAceVariables = [
|
|
8878
|
+
{
|
|
8879
|
+
caption: 'Teste 1',
|
|
8880
|
+
value: '{teste1}',
|
|
8881
|
+
meta: 'Variável',
|
|
8882
|
+
},
|
|
8883
|
+
]
|
|
8957
8884
|
},
|
|
8958
8885
|
])
|
|
8959
8886
|
angular.bootstrap(document, [module.name])
|