sling-web-business-merchant-contacts
Advanced tools
Comparing version 0.2.28 to 0.2.29
@@ -10,4 +10,8 @@ 'use strict'; | ||
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; | ||
var _templateObject = _taggedTemplateLiteral(['\n <sling-table srcdata="', '"\n srccolumns="', '">\n </sling-table>\n '], ['\n <sling-table srcdata="', '"\n srccolumns="', '">\n </sling-table>\n ']); | ||
var _redux = require('redux'); | ||
var _cjs = require('sling-web-framework/dist/cjs'); | ||
@@ -27,22 +31,5 @@ | ||
var columns = [{ | ||
title: 'Nome', | ||
field: 'name' | ||
}, { | ||
title: 'Cargo', | ||
field: 'type' | ||
}, { | ||
title: 'E-mail', | ||
field: 'email' | ||
}, { | ||
title: 'Telefone', | ||
field: 'phone_number' | ||
}, { | ||
title: 'Celular', | ||
field: 'mobile_phone_number' | ||
}]; | ||
var SlingMerchantContacts = exports.SlingMerchantContacts = function (_SlingElement) { | ||
_inherits(SlingMerchantContacts, _SlingElement); | ||
var SlingMerchantContacts = exports.SlingMerchantContacts = function (_SlingBusinessElement) { | ||
_inherits(SlingMerchantContacts, _SlingBusinessElement); | ||
function SlingMerchantContacts() { | ||
@@ -55,14 +42,60 @@ _classCallCheck(this, SlingMerchantContacts); | ||
_createClass(SlingMerchantContacts, [{ | ||
key: 'connectedCallback', | ||
value: function connectedCallback() { | ||
var _this2 = this; | ||
if (_get(SlingMerchantContacts.prototype.__proto__ || Object.getPrototypeOf(SlingMerchantContacts.prototype), 'connectedCallback', this)) { | ||
_get(SlingMerchantContacts.prototype.__proto__ || Object.getPrototypeOf(SlingMerchantContacts.prototype), 'connectedCallback', this).call(this); | ||
} | ||
this.merchantdata = []; | ||
this.merchantheaders = [{ | ||
title: 'nome', | ||
field: 'name' | ||
}, { | ||
title: 'cargo', | ||
field: 'type' | ||
}, { | ||
title: 'email', | ||
field: 'email' | ||
}, { | ||
title: 'telefone', | ||
field: 'phone_number' | ||
}, { | ||
title: 'celular', | ||
field: 'mobile_phone_number' | ||
}]; | ||
(0, _cjs2.onSdkAvailable)().then(function () { | ||
_this2.getData(_this2.stonecode, _this2.apitoken); | ||
}); | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
return (0, _cjs.html)(_templateObject, this.apidata, columns); | ||
return (0, _cjs.html)(_templateObject, this.merchantdata, this.merchantheaders); | ||
} | ||
}], [{ | ||
key: 'properties', | ||
get: function get() { | ||
return { | ||
stonecode: { | ||
type: String, | ||
reflectToAttribute: true | ||
}, | ||
apitoken: { | ||
type: String, | ||
reflectToAttribute: true | ||
}, | ||
merchantdata: Array, | ||
merchantheaders: Array | ||
}; | ||
} | ||
}]); | ||
return SlingMerchantContacts; | ||
}(_cjs.SlingBusinessElement); | ||
}(_cjs.SlingElement); | ||
var mapStateToProps = exports.mapStateToProps = function mapStateToProps(state) { | ||
return { | ||
apidata: state.merchantReducer.merchantContacts | ||
merchantdata: state.merchantReducer.merchantContacts | ||
}; | ||
@@ -73,4 +106,4 @@ }; | ||
return { | ||
getdata: (0, _cjs2.bindActionCreators)(_cjs2.merchantActions.getMerchantContacts, dispatch) | ||
getData: (0, _redux.bindActionCreators)(_cjs2.merchantActions.getMerchantContacts, dispatch) | ||
}; | ||
}; |
@@ -1,27 +0,53 @@ | ||
import { html, SlingBusinessElement } from 'sling-web-framework/dist/es'; | ||
import { merchantActions, bindActionCreators } from 'sling-web-sdk/dist/es'; | ||
import { bindActionCreators } from 'redux'; | ||
import { html, SlingElement } from 'sling-web-framework/dist/es'; | ||
import { merchantActions, onSdkAvailable } from 'sling-web-sdk/dist/es'; | ||
import 'sling-web-component-table/dist/es'; | ||
const columns = [{ | ||
title: 'Nome', | ||
field: 'name' | ||
}, { | ||
title: 'Cargo', | ||
field: 'type' | ||
}, { | ||
title: 'E-mail', | ||
field: 'email' | ||
}, { | ||
title: 'Telefone', | ||
field: 'phone_number' | ||
}, { | ||
title: 'Celular', | ||
field: 'mobile_phone_number' | ||
}]; | ||
export class SlingMerchantContacts extends SlingElement { | ||
static get properties() { | ||
return { | ||
stonecode: { | ||
type: String, | ||
reflectToAttribute: true | ||
}, | ||
apitoken: { | ||
type: String, | ||
reflectToAttribute: true | ||
}, | ||
merchantdata: Array, | ||
merchantheaders: Array | ||
}; | ||
} | ||
export class SlingMerchantContacts extends SlingBusinessElement { | ||
connectedCallback() { | ||
if (super.connectedCallback) { | ||
super.connectedCallback(); | ||
} | ||
this.merchantdata = []; | ||
this.merchantheaders = [{ | ||
title: 'nome', | ||
field: 'name' | ||
}, { | ||
title: 'cargo', | ||
field: 'type' | ||
}, { | ||
title: 'email', | ||
field: 'email' | ||
}, { | ||
title: 'telefone', | ||
field: 'phone_number' | ||
}, { | ||
title: 'celular', | ||
field: 'mobile_phone_number' | ||
}]; | ||
onSdkAvailable().then(() => { | ||
this.getData(this.stonecode, this.apitoken); | ||
}); | ||
} | ||
render() { | ||
return html` | ||
<sling-table srcdata="${this.apidata}" | ||
srccolumns="${columns}"> | ||
<sling-table srcdata="${this.merchantdata}" | ||
srccolumns="${this.merchantheaders}"> | ||
</sling-table> | ||
@@ -33,7 +59,7 @@ `; | ||
export const mapStateToProps = state => ({ | ||
apidata: state.merchantReducer.merchantContacts | ||
merchantdata: state.merchantReducer.merchantContacts | ||
}); | ||
export const mapDispatchToProps = dispatch => ({ | ||
getdata: bindActionCreators(merchantActions.getMerchantContacts, dispatch) | ||
getData: bindActionCreators(merchantActions.getMerchantContacts, dispatch) | ||
}); |
{ | ||
"name": "sling-web-business-merchant-contacts", | ||
"version": "0.2.28", | ||
"version": "0.2.29", | ||
"description": "Merchant Contacts business component", | ||
@@ -28,7 +28,7 @@ "author": "Stone Pagamentos", | ||
"dependencies": { | ||
"sling-web-component-table": "^0.2.28", | ||
"sling-web-framework": "^0.2.28", | ||
"sling-web-component-table": "^0.2.29", | ||
"sling-web-framework": "^0.2.29", | ||
"sling-web-helpers": "^0.2.28", | ||
"sling-web-sdk": "^0.2.28" | ||
"sling-web-sdk": "^0.2.29" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9605
153
Updatedsling-web-framework@^0.2.29
Updatedsling-web-sdk@^0.2.29