@kigi/components 1.59.0-beta.1 → 1.59.0-beta.3
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-input-number/mbg-input-number.ts +4 -0
- package/src/components/mbg-product-grid/mbg-product-grid.html +103 -94
- package/src/components/mbg-product-grid/mbg-product-grid.ts +0 -2
- package/src/components/mbg-product-inline/mbg-product-inline.html +19 -26
- package/src/components/mbg-product-inline/mbg-product-inline.ts +1 -8
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ class MbgInputNumberController {
|
|
|
6
6
|
private ngModel
|
|
7
7
|
private ngRequired
|
|
8
8
|
private ngDisabled
|
|
9
|
+
private maxLength
|
|
9
10
|
private props
|
|
10
11
|
|
|
11
12
|
constructor(public $scope, public $element, public $attrs, public $compile, public $timeout) {}
|
|
@@ -33,6 +34,9 @@ class MbgInputNumberController {
|
|
|
33
34
|
if (this.props.allowNegative) {
|
|
34
35
|
this.enableNegative()
|
|
35
36
|
}
|
|
37
|
+
if (this.$attrs.maxlength) {
|
|
38
|
+
this.maxLength = this.$attrs.maxlength
|
|
39
|
+
}
|
|
36
40
|
})
|
|
37
41
|
}
|
|
38
42
|
|
|
@@ -1,105 +1,114 @@
|
|
|
1
1
|
<div class="mbg-product-grid-wrapper">
|
|
2
2
|
<table class="table table-striped">
|
|
3
3
|
<thead>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
<tr>
|
|
5
|
+
<th class="grid-center-content">
|
|
6
|
+
<div class="border-list">
|
|
7
|
+
<label>{{ ::$ctrl.y.label }}</label>
|
|
8
|
+
</div>
|
|
9
|
+
</th>
|
|
10
|
+
<th class="grid-center-content"
|
|
11
|
+
colspan="{{ $ctrl.grid.x.length }}">
|
|
12
|
+
<div class="border-list">
|
|
13
|
+
<label>{{ ::$ctrl.x.label }}</label>
|
|
14
|
+
<a class="grid-adicional-link"
|
|
15
|
+
ng-click="$ctrl.onClickExtraButton()">
|
|
16
|
+
{{ ::$ctrl.extraButtonLabel }}
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
</th>
|
|
21
|
+
</tr>
|
|
22
|
+
<tr>
|
|
23
|
+
<td>
|
|
24
|
+
<div class="border-list">
|
|
25
|
+
</div>
|
|
26
|
+
</td>
|
|
27
|
+
<td ng-repeat="xItem in $ctrl.grid.x track by xItem.value"
|
|
28
|
+
class="grid-center-content">
|
|
29
|
+
<div class="border-list">
|
|
30
|
+
<label>{{ ::xItem.value }}</label>
|
|
31
|
+
</div>
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
</td>
|
|
34
|
+
</tr>
|
|
35
35
|
</thead>
|
|
36
36
|
<tbody>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
37
|
+
<!-- <tr>
|
|
38
|
+
<td></td>
|
|
39
|
+
<td ng-repeat="xItem in $ctrl.grid.x track by xItem.value"
|
|
40
|
+
class="grid-center-content">
|
|
41
|
+
<div class="testtr">
|
|
42
|
+
<label>Entrada</label>
|
|
43
|
+
<label>Estoque</label>
|
|
44
|
+
</div>
|
|
45
|
+
</td>
|
|
46
|
+
</tr> -->
|
|
47
|
+
<tr ng-repeat="yItem in $ctrl.grid.y track by yItem.value">
|
|
48
|
+
<td>
|
|
49
|
+
<div class="grid-product-item-name-wrapper border-list">
|
|
50
|
+
<div class="grid-product-item-circle"
|
|
51
|
+
ng-style="{'background': yItem.valueRef}"></div>
|
|
52
|
+
<span>{{ ::yItem.value }}</span>
|
|
53
|
+
</div>
|
|
54
|
+
</td>
|
|
55
|
+
<td ng-repeat="xItem in $ctrl.grid.x track by xItem.value">
|
|
56
|
+
<div class="grid-transclude-edit-wrapper">
|
|
57
|
+
<div ng-show="$ctrl.transcludeTemplate"
|
|
58
|
+
mbg-dynamic-html="$ctrl.transcludeTemplate"></div>
|
|
59
|
+
</div>
|
|
60
|
+
<div ng-class="{'has-divergent-price': $ctrl.gridValues[$index][$parent.$index].hasDivergentPrice}"
|
|
61
|
+
ng-show="!$ctrl.transcludeTemplate"
|
|
62
|
+
class="grid-product-edit-wrapper">
|
|
63
|
+
<svg tabindex="-1"
|
|
64
|
+
height="401pt"
|
|
65
|
+
viewBox="0 -1 401.52289 401"
|
|
66
|
+
width="401pt"
|
|
67
|
+
ng-click="$ctrl.onClickEditButton({ x: xItem, y: yItem })"
|
|
68
|
+
ng-show="$ctrl.activeEdit && $ctrl.gridValues[$index][$parent.$index].enable"
|
|
69
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
70
|
+
<path
|
|
71
|
+
d="m370.589844 250.972656c-5.523438 0-10 4.476563-10 10v88.789063c-.019532 16.5625-13.4375 29.984375-30 30h-280.589844c-16.5625-.015625-29.980469-13.4375-30-30v-260.589844c.019531-16.558594 13.4375-29.980469 30-30h88.789062c5.523438 0 10-4.476563 10-10 0-5.519531-4.476562-10-10-10h-88.789062c-27.601562.03125-49.96875 22.398437-50 50v260.59375c.03125 27.601563 22.398438 49.96875 50 50h280.589844c27.601562-.03125 49.96875-22.398437 50-50v-88.792969c0-5.523437-4.476563-10-10-10zm0 0" />
|
|
72
|
+
<path
|
|
73
|
+
d="m376.628906 13.441406c-17.574218-17.574218-46.066406-17.574218-63.640625 0l-178.40625 178.40625c-1.222656 1.222656-2.105469 2.738282-2.566406 4.402344l-23.460937 84.699219c-.964844 3.472656.015624 7.191406 2.5625 9.742187 2.550781 2.546875 6.269531 3.527344 9.742187 2.566406l84.699219-23.464843c1.664062-.460938 3.179687-1.34375 4.402344-2.566407l178.402343-178.410156c17.546875-17.585937 17.546875-46.054687 0-63.640625zm-220.257812 184.90625 146.011718-146.015625 47.089844 47.089844-146.015625 146.015625zm-9.40625 18.875 37.621094 37.625-52.039063 14.417969zm227.257812-142.546875-10.605468 10.605469-47.09375-47.09375 10.609374-10.605469c9.761719-9.761719 25.589844-9.761719 35.351563 0l11.738281 11.734375c9.746094 9.773438 9.746094 25.589844 0 35.359375zm0 0" />
|
|
74
|
+
</svg>
|
|
75
|
+
<a tabindex="-1"
|
|
76
|
+
class="link"
|
|
77
|
+
ng-show="$ctrl.activeAddOrRemove"
|
|
78
|
+
ng-click="$ctrl.toogleEnableItem($index, $parent.$index)">
|
|
79
|
+
{{ $ctrl.gridValues[$index][$parent.$index].enable ? 'Remover' : 'Adicionar'}}
|
|
80
|
+
</a>
|
|
81
|
+
<span tabindex="-1"
|
|
82
|
+
ng-show="$ctrl.enableCurrentStock">Estoque:
|
|
73
83
|
{{$ctrl.gridValues[$index][$parent.$index].currentStock || '0'}}</span>
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
<span tabindex="-1"
|
|
85
|
+
ng-class="{ 'grid-disable': $ctrl.activeAddOrRemove && !$ctrl.gridValues[$index][$parent.$index].enable }">
|
|
76
86
|
{{$ctrl.inputLabel ? $ctrl.inputLabel : $ctrl.showStock ? 'Estoque' : 'R$ Venda'}}</span>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
</
|
|
101
|
-
</
|
|
102
|
-
</tr>
|
|
87
|
+
<input tabindex="0"
|
|
88
|
+
type="number"
|
|
89
|
+
ng-show="$ctrl.showStock"
|
|
90
|
+
ng-model="$ctrl.gridValues[$index][$parent.$index].stock"
|
|
91
|
+
placeholder="0"
|
|
92
|
+
ng-keydown="$ctrl.onKeydown($event)"
|
|
93
|
+
ng-class="{ 'grid-disable': $ctrl.activeAddOrRemove && !$ctrl.gridValues[$index][$parent.$index].enable }"
|
|
94
|
+
ng-change="$ctrl.handleGridValues()"
|
|
95
|
+
ng-model-options="{ debounce: 500 }"
|
|
96
|
+
class="grid-product-stock"
|
|
97
|
+
onwheel="this.blur()" />
|
|
98
|
+
<input tabindex="-1"
|
|
99
|
+
type="text"
|
|
100
|
+
ng-model="$ctrl.gridValues[$index][$parent.$index].price"
|
|
101
|
+
ng-show="$ctrl.enablePrice"
|
|
102
|
+
ui-money-mask
|
|
103
|
+
ng-disabled="$ctrl.ngDisabled"
|
|
104
|
+
onclick="angular.element(this).scope().$ctrl.focusInput(this)"
|
|
105
|
+
ng-class="{ 'grid-disable': $ctrl.activeAddOrRemove && !$ctrl.gridValues[$index][$parent.$index].enable }"
|
|
106
|
+
ng-change="$ctrl.handleGridValues()"
|
|
107
|
+
class="grid-product-money"
|
|
108
|
+
placeholder="0" />
|
|
109
|
+
</div>
|
|
110
|
+
</td>
|
|
111
|
+
</tr>
|
|
103
112
|
</tbody>
|
|
104
113
|
</table>
|
|
105
|
-
</div>
|
|
114
|
+
</div>
|
|
@@ -102,7 +102,6 @@ class MbgProductGridController {
|
|
|
102
102
|
})
|
|
103
103
|
.forEach((item) => this.ngModel.push(item))
|
|
104
104
|
})
|
|
105
|
-
if (!!this.onUpdate) this.onUpdate({ data: this.ngModel })
|
|
106
105
|
})
|
|
107
106
|
}
|
|
108
107
|
|
|
@@ -151,7 +150,6 @@ const mbgProductGrid = {
|
|
|
151
150
|
showStock: '=?',
|
|
152
151
|
enablePrice: '=?',
|
|
153
152
|
enableCurrentStock: '=?',
|
|
154
|
-
onUpdate: '&?',
|
|
155
153
|
},
|
|
156
154
|
template,
|
|
157
155
|
controller: MbgProductGridController,
|
|
@@ -59,37 +59,30 @@
|
|
|
59
59
|
class="inline-product-barcode" />
|
|
60
60
|
</div>
|
|
61
61
|
<div class="stock-col">
|
|
62
|
-
<input
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
onwheel="this.blur()"
|
|
73
|
-
ng-change="$ctrl.handleUpdate(item)"
|
|
74
|
-
/>
|
|
62
|
+
<input tabindex="0"
|
|
63
|
+
type="number"
|
|
64
|
+
onclick="angular.element(this).scope().$ctrl.focusInput(this)"
|
|
65
|
+
ng-model="item.stock"
|
|
66
|
+
ng-keydown="$ctrl.onKeydown($event)"
|
|
67
|
+
placeholder="0"
|
|
68
|
+
placeholder="Estoque"
|
|
69
|
+
ng-model-options="{ debounce: 500 }"
|
|
70
|
+
class="inline-product-stock"
|
|
71
|
+
onwheel="this.blur()" />
|
|
75
72
|
</div>
|
|
76
73
|
<div class="price-col"
|
|
77
74
|
ng-hide="$ctrl.hidePrice">
|
|
78
|
-
<input
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
placeholder="0"
|
|
87
|
-
ng-change="$ctrl.handleUpdate(item)"
|
|
88
|
-
ng-model-options="{ debounce: 500 }"
|
|
89
|
-
/>
|
|
75
|
+
<input tabindex="-1"
|
|
76
|
+
type="text"
|
|
77
|
+
onclick="angular.element(this).scope().$ctrl.focusInput(this)"
|
|
78
|
+
ng-model="item.price"
|
|
79
|
+
ui-money-mask
|
|
80
|
+
ng-disabled="$ctrl.ngDisabled"
|
|
81
|
+
class="inline-product-money"
|
|
82
|
+
placeholder="0" />
|
|
90
83
|
</div>
|
|
91
84
|
</div>
|
|
92
85
|
</div>
|
|
93
86
|
</div>
|
|
94
87
|
</div>
|
|
95
|
-
</div>
|
|
88
|
+
</div>
|
|
@@ -11,8 +11,7 @@ class MbgProductInlineController {
|
|
|
11
11
|
private orderDirSizes: 'asc' | 'dir' = 'asc'
|
|
12
12
|
private orderDirColors: 'asc' | 'dir' = 'asc'
|
|
13
13
|
|
|
14
|
-
constructor(public $scope, public $element, public $attrs, public $timeout, public $transclude) {
|
|
15
|
-
}
|
|
14
|
+
constructor(public $scope, public $element, public $attrs, public $timeout, public $transclude) {}
|
|
16
15
|
|
|
17
16
|
$onInit() {
|
|
18
17
|
this.gridValues = {}
|
|
@@ -46,7 +45,6 @@ class MbgProductInlineController {
|
|
|
46
45
|
this.$timeout(() => (item.inputError = !!callBack))
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
|
-
this.handleUpdate(item)
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
orderSizes(a, b, dir) {
|
|
@@ -76,10 +74,6 @@ class MbgProductInlineController {
|
|
|
76
74
|
)
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
|
-
|
|
80
|
-
handleUpdate(item) {
|
|
81
|
-
if (this.onUpdate) this.onUpdate({ data: item })
|
|
82
|
-
}
|
|
83
77
|
}
|
|
84
78
|
|
|
85
79
|
MbgProductInlineController.$inject = ['$scope', '$element', '$attrs', '$timeout', '$transclude']
|
|
@@ -95,7 +89,6 @@ const mbgProductInline = {
|
|
|
95
89
|
activeAttr: '@?',
|
|
96
90
|
hidePrice: '=?',
|
|
97
91
|
hideBarcode: '=?',
|
|
98
|
-
onUpdate: '&?',
|
|
99
92
|
},
|
|
100
93
|
template,
|
|
101
94
|
controller: MbgProductInlineController,
|