Updated to latest code
This commit is contained in:
BIN
dist/1.0.0/incentro.CustomGroupbox.mpk
vendored
Normal file
BIN
dist/1.0.0/incentro.CustomGroupbox.mpk
vendored
Normal file
Binary file not shown.
33
dist/tmp/widgets/CustomGroupbox.xml
vendored
Normal file
33
dist/tmp/widgets/CustomGroupbox.xml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<widget id="incentro.customgroupbox.CustomGroupbox" pluginWidget="true" needsEntityContext="true" offlineCapable="true"
|
||||||
|
supportedPlatform="Native"
|
||||||
|
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../node_modules/mendix/custom_widget.xsd">
|
||||||
|
<name>Custom Groupbox</name>
|
||||||
|
<description>Groupbox with content in the header</description>
|
||||||
|
<icon/>
|
||||||
|
<properties>
|
||||||
|
<propertyGroup caption="General">
|
||||||
|
<property key="header" type="widgets" required="true">
|
||||||
|
<caption>Header</caption>
|
||||||
|
<description>Content of the header</description>
|
||||||
|
</property>
|
||||||
|
<property key="content" type="widgets" required="false">
|
||||||
|
<caption>Content</caption>
|
||||||
|
<description>Content of the groupbox</description>
|
||||||
|
</property>
|
||||||
|
<property key="showDivider" type="boolean" defaultValue="false">
|
||||||
|
<caption>Divider</caption>
|
||||||
|
<description>Show a simple divider between items.</description>
|
||||||
|
</property>
|
||||||
|
<property key="expandIcon" type="icon" required="false">
|
||||||
|
<caption>Expand icon</caption>
|
||||||
|
<description>Icon used to indicate that the group box can be expanded.</description>
|
||||||
|
</property>
|
||||||
|
<property key="collapseIcon" type="icon" required="false">
|
||||||
|
<caption>Collapse icon</caption>
|
||||||
|
<description>Icon used to indicate that the group box can be collapsed.</description>
|
||||||
|
</property>
|
||||||
|
</propertyGroup>
|
||||||
|
</properties>
|
||||||
|
</widget>
|
||||||
332
dist/tmp/widgets/incentro/customgroupbox/CustomGroupbox.js
vendored
Normal file
332
dist/tmp/widgets/incentro/customgroupbox/CustomGroupbox.js
vendored
Normal file
@@ -0,0 +1,332 @@
|
|||||||
|
module.exports =
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // define __esModule on exports
|
||||||
|
/******/ __webpack_require__.r = function(exports) {
|
||||||
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||||
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||||
|
/******/ }
|
||||||
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // create a fake namespace object
|
||||||
|
/******/ // mode & 1: value is a module id, require it
|
||||||
|
/******/ // mode & 2: merge all properties of value into the ns
|
||||||
|
/******/ // mode & 4: return value when already ns object
|
||||||
|
/******/ // mode & 8|1: behave like require
|
||||||
|
/******/ __webpack_require__.t = function(value, mode) {
|
||||||
|
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||||
|
/******/ if(mode & 8) return value;
|
||||||
|
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||||
|
/******/ var ns = Object.create(null);
|
||||||
|
/******/ __webpack_require__.r(ns);
|
||||||
|
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||||
|
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||||
|
/******/ return ns;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = "./src/CustomGroupbox.tsx");
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
|
||||||
|
/*!*****************************************************************!*\
|
||||||
|
!*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
|
||||||
|
\*****************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}module.exports=_arrayLikeToArray;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":
|
||||||
|
/*!******************************************************************!*\
|
||||||
|
!*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
|
||||||
|
\******************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
var arrayLikeToArray=__webpack_require__(/*! ./arrayLikeToArray */ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");function _arrayWithoutHoles(arr){if(Array.isArray(arr))return arrayLikeToArray(arr);}module.exports=_arrayWithoutHoles;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
|
||||||
|
/*!***************************************************************!*\
|
||||||
|
!*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
|
||||||
|
\***************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}module.exports=_defineProperty;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@babel/runtime/helpers/extends.js":
|
||||||
|
/*!********************************************************!*\
|
||||||
|
!*** ./node_modules/@babel/runtime/helpers/extends.js ***!
|
||||||
|
\********************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
function _extends(){module.exports=_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}module.exports=_extends;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js":
|
||||||
|
/*!**********************************************************************!*\
|
||||||
|
!*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
|
||||||
|
\**********************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj};}module.exports=_interopRequireDefault;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js":
|
||||||
|
/*!****************************************************************!*\
|
||||||
|
!*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
|
||||||
|
\****************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&Symbol.iterator in Object(iter))return Array.from(iter);}module.exports=_iterableToArray;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js":
|
||||||
|
/*!******************************************************************!*\
|
||||||
|
!*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
|
||||||
|
\******************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}module.exports=_nonIterableSpread;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@babel/runtime/helpers/toConsumableArray.js":
|
||||||
|
/*!******************************************************************!*\
|
||||||
|
!*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
|
||||||
|
\******************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
var arrayWithoutHoles=__webpack_require__(/*! ./arrayWithoutHoles */ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js");var iterableToArray=__webpack_require__(/*! ./iterableToArray */ "./node_modules/@babel/runtime/helpers/iterableToArray.js");var unsupportedIterableToArray=__webpack_require__(/*! ./unsupportedIterableToArray */ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");var nonIterableSpread=__webpack_require__(/*! ./nonIterableSpread */ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js");function _toConsumableArray(arr){return arrayWithoutHoles(arr)||iterableToArray(arr)||unsupportedIterableToArray(arr)||nonIterableSpread();}module.exports=_toConsumableArray;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
|
||||||
|
/*!***************************************************************************!*\
|
||||||
|
!*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
|
||||||
|
\***************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
var arrayLikeToArray=__webpack_require__(/*! ./arrayLikeToArray */ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return arrayLikeToArray(o,minLen);}module.exports=_unsupportedIterableToArray;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@mendix/pluggable-widgets-tools/dist/index.js":
|
||||||
|
/*!********************************************************************!*\
|
||||||
|
!*** ./node_modules/@mendix/pluggable-widgets-tools/dist/index.js ***!
|
||||||
|
\********************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
var __createBinding=this&&this.__createBinding||(Object.create?function(o,m,k,k2){if(k2===undefined)k2=k;Object.defineProperty(o,k2,{enumerable:true,get:function get(){return m[k];}});}:function(o,m,k,k2){if(k2===undefined)k2=k;o[k2]=m[k];});var __exportStar=this&&this.__exportStar||function(m,exports){for(var p in m){if(p!=="default"&&!exports.hasOwnProperty(p))__createBinding(exports,m,p);}};Object.defineProperty(exports,"__esModule",{value:true});__exportStar(__webpack_require__(/*! ./native/common */ "./node_modules/@mendix/pluggable-widgets-tools/dist/native/common.js"),exports);__exportStar(__webpack_require__(/*! ./web/common */ "./node_modules/@mendix/pluggable-widgets-tools/dist/web/common.js"),exports);
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@mendix/pluggable-widgets-tools/dist/native/common.js":
|
||||||
|
/*!****************************************************************************!*\
|
||||||
|
!*** ./node_modules/@mendix/pluggable-widgets-tools/dist/native/common.js ***!
|
||||||
|
\****************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
var _interopRequireDefault=__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");var _defineProperty2=_interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js"));var _extends3=_interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/extends.js"));var _toConsumableArray2=_interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js"));Object.defineProperty(exports,"__esModule",{value:true});exports.mergeNativeStyles=void 0;function mergeNativeStyles(defaultStyle,overrideStyles){var styles=[defaultStyle].concat((0,_toConsumableArray2.default)(overrideStyles.filter(function(object){return object!==undefined;})));return Object.keys(defaultStyle).reduce(function(flattened,currentKey){var styleItems=styles.map(function(object){return object[currentKey];});return(0,_extends3.default)((0,_extends3.default)({},flattened),(0,_defineProperty2.default)({},currentKey,flattenObjects(styleItems)));},{});}exports.mergeNativeStyles=mergeNativeStyles;function flattenObjects(objects){return objects.reduce(function(merged,object){return(0,_extends3.default)((0,_extends3.default)({},merged),object);},{});}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/@mendix/pluggable-widgets-tools/dist/web/common.js":
|
||||||
|
/*!*************************************************************************!*\
|
||||||
|
!*** ./node_modules/@mendix/pluggable-widgets-tools/dist/web/common.js ***!
|
||||||
|
\*************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports,"__esModule",{value:true});exports.parseInlineStyle=void 0;function parseInlineStyle(){var style=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";try{return style.split(";").reduce(function(styleObject,line){var pair=line.split(":");if(pair.length===2){var name=pair[0].trim().replace(/(-.)/g,function(match){return match[1].toUpperCase();});styleObject[name]=pair[1].trim();}return styleObject;},{});}catch(_){return{};}}exports.parseInlineStyle=parseInlineStyle;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/CustomGroupbox.tsx":
|
||||||
|
/*!********************************!*\
|
||||||
|
!*** ./src/CustomGroupbox.tsx ***!
|
||||||
|
\********************************/
|
||||||
|
/*! exports provided: CustomGroupbox */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomGroupbox", function() { return CustomGroupbox; });
|
||||||
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
||||||
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var react_native__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-native */ "react-native");
|
||||||
|
/* harmony import */ var react_native__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_native__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var mendix_components_native_Icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mendix/components/native/Icon */ "mendix/components/native/Icon");
|
||||||
|
/* harmony import */ var mendix_components_native_Icon__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(mendix_components_native_Icon__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _mendix_pluggable_widgets_tools__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @mendix/pluggable-widgets-tools */ "./node_modules/@mendix/pluggable-widgets-tools/dist/index.js");
|
||||||
|
/* harmony import */ var _mendix_pluggable_widgets_tools__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_mendix_pluggable_widgets_tools__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const defaultStyle = {
|
||||||
|
headerContainer: {},
|
||||||
|
label: {},
|
||||||
|
innerContainer: {},
|
||||||
|
selectedContainer: {},
|
||||||
|
divider: {
|
||||||
|
backgroundColor: '#A2A2A2',
|
||||||
|
height: 1,
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
alignSelf: 'flex-end'
|
||||||
|
},
|
||||||
|
groupboxParent: {}
|
||||||
|
};
|
||||||
|
const defaultCollapseIconGlyph = "glyphicon-minus";
|
||||||
|
const defaultExpandIconGlyph = "glyphicon-plus";
|
||||||
|
class CustomGroupbox extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.styles = Object(_mendix_pluggable_widgets_tools__WEBPACK_IMPORTED_MODULE_3__["mergeNativeStyles"])(defaultStyle, this.props.style);
|
||||||
|
this.renderIcon = (glyph, toBeRenderedIcon) => {
|
||||||
|
const nativeIcon = toBeRenderedIcon && toBeRenderedIcon.status === "available" /* Available */
|
||||||
|
? toBeRenderedIcon.value
|
||||||
|
: { type: "glyph", iconClass: glyph };
|
||||||
|
return Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(mendix_components_native_Icon__WEBPACK_IMPORTED_MODULE_2__["Icon"], { icon: nativeIcon });
|
||||||
|
};
|
||||||
|
this.toggleContent = this.toggleContent.bind(this);
|
||||||
|
this.state = { showContent: false, };
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
const icons = {
|
||||||
|
collapseIcon: this.renderIcon(defaultCollapseIconGlyph, this.props.collapseIcon),
|
||||||
|
expandIcon: this.renderIcon(defaultExpandIconGlyph, this.props.expandIcon),
|
||||||
|
};
|
||||||
|
return (Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["View"], { style: this.styles.groupboxParent },
|
||||||
|
Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["TouchableOpacity"], { onPress: this.toggleContent },
|
||||||
|
Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["View"], { style: this.styles.headerContainer },
|
||||||
|
Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["View"], null, this.props.header),
|
||||||
|
Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["View"], { style: this.styles.icon }, this.state.showContent ? icons.collapseIcon : icons.expandIcon))),
|
||||||
|
Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["View"], { style: this.state.showContent ? this.styles.selectedContainer : null },
|
||||||
|
this.state.showContent && Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["View"], { style: this.styles.innerContainer }, this.props.content),
|
||||||
|
this.props.showDivider && Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_native__WEBPACK_IMPORTED_MODULE_1__["View"], { style: this.styles.divider }))));
|
||||||
|
}
|
||||||
|
toggleContent() {
|
||||||
|
this.setState({ showContent: !this.state.showContent });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "mendix/components/native/Icon":
|
||||||
|
/*!************************************************!*\
|
||||||
|
!*** external "mendix/components/native/Icon" ***!
|
||||||
|
\************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = require("mendix/components/native/Icon");
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "react":
|
||||||
|
/*!************************!*\
|
||||||
|
!*** external "react" ***!
|
||||||
|
\************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = require("react");
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "react-native":
|
||||||
|
/*!*******************************!*\
|
||||||
|
!*** external "react-native" ***!
|
||||||
|
\*******************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = require("react-native");
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
//# sourceMappingURL=CustomGroupbox.js.map
|
||||||
1
dist/tmp/widgets/incentro/customgroupbox/CustomGroupbox.js.map
vendored
Normal file
1
dist/tmp/widgets/incentro/customgroupbox/CustomGroupbox.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
11
dist/tmp/widgets/package.xml
vendored
Normal file
11
dist/tmp/widgets/package.xml
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<package xmlns="http://www.mendix.com/package/1.0/">
|
||||||
|
<clientModule name="CustomGroupbox" version="1.0.0" xmlns="http://www.mendix.com/clientModule/1.0/">
|
||||||
|
<widgetFiles>
|
||||||
|
<widgetFile path="CustomGroupbox.xml"/>
|
||||||
|
</widgetFiles>
|
||||||
|
<files>
|
||||||
|
<file path="incentro/customgroupbox"/>
|
||||||
|
</files>
|
||||||
|
</clientModule>
|
||||||
|
</package>
|
||||||
@@ -8,16 +8,17 @@ import { Style, mergeNativeStyles } from '@mendix/pluggable-widgets-tools';
|
|||||||
import { CustomGroupboxProps } from '../typings/CustomGroupboxProps';
|
import { CustomGroupboxProps } from '../typings/CustomGroupboxProps';
|
||||||
|
|
||||||
export interface CustomStyle extends Style {
|
export interface CustomStyle extends Style {
|
||||||
container: ViewStyle;
|
headerContainer: ViewStyle;
|
||||||
label: TextStyle;
|
label: TextStyle;
|
||||||
innerContainer: ViewStyle;
|
innerContainer: ViewStyle;
|
||||||
selectedContainer: ViewStyle;
|
selectedContainer: ViewStyle;
|
||||||
divider: ViewStyle;
|
divider: ViewStyle;
|
||||||
icon: ViewStyle;
|
icon: ViewStyle;
|
||||||
|
groupboxParent: ViewStyle
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultStyle: CustomStyle = {
|
const defaultStyle: CustomStyle = {
|
||||||
container: {},
|
headerContainer: {},
|
||||||
label: {},
|
label: {},
|
||||||
innerContainer: {},
|
innerContainer: {},
|
||||||
selectedContainer: {},
|
selectedContainer: {},
|
||||||
@@ -27,7 +28,8 @@ const defaultStyle: CustomStyle = {
|
|||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
alignSelf: 'flex-end'
|
alignSelf: 'flex-end'
|
||||||
}
|
},
|
||||||
|
groupboxParent: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
@@ -53,20 +55,25 @@ export class CustomGroupbox extends Component<CustomGroupboxProps<CustomStyle>,
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={this.state.showContent ? this.styles.selectedContainer : this.styles.container}>
|
<View style={this.styles.groupboxParent}>
|
||||||
<View style={this.styles.icon}>{this.state.showContent ? icons.collapseIcon : icons.expandIcon}</View>
|
<TouchableOpacity onPress={this.toggleContent}>
|
||||||
|
<View style={this.styles.headerContainer}>
|
||||||
<TouchableOpacity onPress={this.toggleContent}>{this.props.header}</TouchableOpacity>
|
<View>{this.props.header}</View>
|
||||||
|
<View style={this.styles.icon}>{this.state.showContent ? icons.collapseIcon : icons.expandIcon}</View>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<View style={this.state.showContent ? this.styles.selectedContainer : null}>
|
||||||
{this.state.showContent && <View style={this.styles.innerContainer}>{this.props.content}</View>}
|
{this.state.showContent && <View style={this.styles.innerContainer}>{this.props.content}</View>}
|
||||||
|
|
||||||
{this.props.showDivider && <View style={this.styles.divider}></View>}
|
{this.props.showDivider && <View style={this.styles.divider}></View>}
|
||||||
</View>
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleContent() {
|
toggleContent() {
|
||||||
this.setState({showContent: !this.state.showContent})
|
this.setState({ showContent: !this.state.showContent })
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderIcon = (glyph: string, toBeRenderedIcon?: DynamicValue<NativeIcon>) => {
|
private renderIcon = (glyph: string, toBeRenderedIcon?: DynamicValue<NativeIcon>) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user