2020-06-10 16:16:33 +02:00
|
|
|
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/index.ts");
|
|
|
|
/******/ })
|
|
|
|
/************************************************************************/
|
|
|
|
/******/ ({
|
|
|
|
|
|
|
|
/***/ "./src/components/Discord/Button.tsx":
|
|
|
|
/*!*******************************************!*\
|
|
|
|
!*** ./src/components/Discord/Button.tsx ***!
|
|
|
|
\*******************************************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
|
2020-06-14 19:23:40 +02:00
|
|
|
let ButtonModules;
|
2020-06-10 16:16:33 +02:00
|
|
|
class Button extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
if (props.color) {
|
|
|
|
props.color = props.color.toLowerCase();
|
|
|
|
if (!["brand", "grey", "red", "green", "yellow", "primary", "link", "white", "black", "transparent"].includes(props.color)) {
|
|
|
|
props.color = "brand";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
props.color = "brand";
|
|
|
|
}
|
|
|
|
props.onClick = typeof props.onClick === "function" ? props.onClick : () => { };
|
|
|
|
super(props);
|
|
|
|
}
|
2020-06-14 19:23:40 +02:00
|
|
|
get modules() {
|
|
|
|
return ButtonModules || (ButtonModules = [
|
|
|
|
WebpackLoader_1.default.findByUniqueProperties(["_horizontal"]),
|
|
|
|
WebpackLoader_1.default.findByUniqueProperties(["colorTransparent"]),
|
|
|
|
WebpackLoader_1.default.findByUniqueProperties(["buttonWrapper"]),
|
|
|
|
WebpackLoader_1.default.findByUniqueProperties(["ButtonColors"]),
|
|
|
|
]);
|
|
|
|
}
|
2020-06-10 16:16:33 +02:00
|
|
|
render() {
|
2020-06-14 19:23:40 +02:00
|
|
|
let [flexModule, euhModule1, buttonModule, colorsModule,] = this.modules;
|
2020-06-10 16:16:33 +02:00
|
|
|
return (React.createElement("div", { className: buttonModule.buttonWrapper },
|
|
|
|
React.createElement("button", { type: "button", className: `${flexModule.flexChild} ${euhModule1.button} ${euhModule1.lookFilled} ${colorsModule.ButtonColors[this.props.color.toUpperCase()]} ${euhModule1.sizeSmall} ${euhModule1.grow}`, style: { flex: "0 1 auto" }, onClick: this.props.onClick },
|
|
|
|
React.createElement("div", { className: euhModule1.contents }, this.props.text))));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.default = Button;
|
|
|
|
|
|
|
|
|
2020-06-14 19:23:40 +02:00
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "./src/components/Discord/RadioGroup.tsx":
|
|
|
|
/*!***********************************************!*\
|
|
|
|
!*** ./src/components/Discord/RadioGroup.tsx ***!
|
|
|
|
\***********************************************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
|
|
|
|
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
|
|
|
|
let RadioGroupModule;
|
|
|
|
class RadioGroup extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
props = RadioGroup.normalizeProps(props);
|
|
|
|
super(props);
|
|
|
|
this.state = props;
|
|
|
|
this.onChange = this.onChange.bind(this);
|
|
|
|
}
|
|
|
|
static normalizeProps(props) {
|
|
|
|
if (!props || typeof props !== "object")
|
|
|
|
props = {};
|
|
|
|
let defaultOptions = false;
|
|
|
|
if (!props.options || !Array.isArray(props.options)) {
|
|
|
|
props.options = [{
|
|
|
|
value: "none",
|
|
|
|
name: "No options",
|
|
|
|
desc: "No options was passed to Choices. If you meant to display no options at all, please pass an empty array.",
|
|
|
|
color: "#f04747"
|
|
|
|
}];
|
|
|
|
defaultOptions = true;
|
|
|
|
}
|
|
|
|
if (!props.value || typeof props.value !== "string") {
|
|
|
|
if (defaultOptions) {
|
|
|
|
props.value = "none";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
props.value = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (typeof props.disabled !== "boolean")
|
|
|
|
props.disabled = false;
|
|
|
|
if (typeof props.size !== "string" || !["small", "medium"].includes(props.size.toLowerCase()))
|
|
|
|
props.size = "medium";
|
|
|
|
if (typeof props.itemType !== "string" || !["bar", "panel"].includes(props.itemType))
|
|
|
|
props.itemType = "bar";
|
|
|
|
if (typeof props.infoClassName !== "string")
|
|
|
|
props.infoClassName = "";
|
|
|
|
if (!props.onChange || typeof props.onChange !== "function")
|
|
|
|
props.onChange = noop_1.default;
|
|
|
|
return props;
|
|
|
|
}
|
|
|
|
onChange(ev) {
|
|
|
|
this.state.onChange(ev.value);
|
|
|
|
this.setState({
|
|
|
|
value: ev.value
|
|
|
|
});
|
|
|
|
}
|
|
|
|
get modules() {
|
|
|
|
return RadioGroupModule || (RadioGroupModule = [
|
|
|
|
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "RadioGroup").default
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
render() {
|
|
|
|
let [RadioGroupComponent] = this.modules;
|
|
|
|
let props = RadioGroup.normalizeProps(this.state || this.props);
|
|
|
|
if (!this.state) {
|
|
|
|
this.state = Object.create(props);
|
|
|
|
}
|
|
|
|
return React.createElement(RadioGroupComponent, { options: props.options, onChange: this.onChange, value: props.value, disabled: props.disabled, size: RadioGroupComponent.Sizes[props.size.toUpperCase()], itemType: RadioGroupComponent.ItemTypes[props.itemType.toUpperCase()], infoClassName: props.infoClassName });
|
|
|
|
}
|
|
|
|
get value() {
|
|
|
|
return this.state.value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.default = RadioGroup;
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "./src/components/Discord/Switch.tsx":
|
|
|
|
/*!*******************************************!*\
|
|
|
|
!*** ./src/components/Discord/Switch.tsx ***!
|
|
|
|
\*******************************************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
|
|
|
|
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
|
|
|
|
let SwitchModules;
|
|
|
|
class Switch extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
props = Switch.normalizeProps(props);
|
|
|
|
super(props);
|
|
|
|
this.state = Object.create(props);
|
|
|
|
this.onChange = this.onChange.bind(this);
|
|
|
|
}
|
|
|
|
static normalizeProps(props) {
|
|
|
|
if (!props)
|
|
|
|
props = {};
|
|
|
|
if (!props.id || typeof props.id !== "string")
|
|
|
|
props.id = null;
|
|
|
|
if (!props.onChange || typeof props.onChange !== "function")
|
|
|
|
props.onChange = noop_1.default;
|
|
|
|
if (!props.value || typeof props.value !== "boolean")
|
|
|
|
props.value = false;
|
|
|
|
if (!props.fill || typeof props.fill !== "string")
|
|
|
|
props.fill = null;
|
|
|
|
if (!props.theme || !["default", "clear"].includes(props.theme.toLowerCase()))
|
|
|
|
props.theme = "default";
|
|
|
|
if (!("disabled" in props) || typeof props.disabled !== "boolean")
|
|
|
|
props.disabled = false;
|
|
|
|
if (!props.className || typeof props.className !== "string")
|
|
|
|
props.className = "";
|
|
|
|
if (!props.size || !["default", "mini"].includes(props.size.toLowerCase()))
|
|
|
|
props.size = "default";
|
|
|
|
if (!props.style || typeof props.style !== "object")
|
|
|
|
props.style = {};
|
|
|
|
return props;
|
|
|
|
}
|
|
|
|
get modules() {
|
|
|
|
return SwitchModules || (SwitchModules = [
|
|
|
|
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "Switch").default
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
render() {
|
|
|
|
let [SwitchComponent] = this.modules;
|
|
|
|
let props = Switch.normalizeProps(this.state || this.props);
|
|
|
|
if (!this.state) {
|
|
|
|
this.state = Object.create(props);
|
|
|
|
}
|
|
|
|
return (React.createElement(SwitchComponent, { id: props.id, onChange: this.onChange, value: this.state.value || false, fill: props.fill, theme: SwitchComponent.Themes[props.theme.toUpperCase()], disabled: props.disabled, className: props.className, size: SwitchComponent.Sizes[props.size.toUpperCase()], style: props.style }));
|
|
|
|
}
|
|
|
|
onChange(value) {
|
|
|
|
this.props.onChange(!this.state.value);
|
|
|
|
this.setState({
|
|
|
|
value: !this.state.value
|
|
|
|
});
|
|
|
|
}
|
|
|
|
get value() {
|
|
|
|
return this.state.value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.default = Switch;
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "./src/components/Discord/TextArea.tsx":
|
|
|
|
/*!*********************************************!*\
|
|
|
|
!*** ./src/components/Discord/TextArea.tsx ***!
|
|
|
|
\*********************************************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
|
|
|
|
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
|
|
|
|
let TextAreaModules;
|
|
|
|
class TextArea extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
props = TextArea.normalizeProps(props);
|
|
|
|
super(props);
|
|
|
|
this.state = Object.create(props);
|
|
|
|
this.onChange = this.onChange.bind(this);
|
|
|
|
this.onFocus = this.onFocus.bind(this);
|
|
|
|
this.onBlur = this.onBlur.bind(this);
|
|
|
|
this.onKeyDown = this.onKeyDown.bind(this);
|
|
|
|
}
|
|
|
|
static normalizeProps(props) {
|
|
|
|
if (!props)
|
|
|
|
props = {};
|
|
|
|
if (!props.name || typeof props.name !== "string")
|
|
|
|
props.name = "";
|
|
|
|
if (!props.disabled || typeof props.disabled !== "boolean")
|
|
|
|
props.disabled = false;
|
|
|
|
if (typeof props.placeholder !== "string")
|
|
|
|
props.placeholder = "";
|
|
|
|
if (typeof props.autoFocus !== "boolean")
|
|
|
|
props.autoFocus = false;
|
|
|
|
if (typeof props.resizeable !== "boolean")
|
|
|
|
props.resizeable = false;
|
|
|
|
if (typeof props.flex !== "boolean")
|
|
|
|
props.flex = false;
|
|
|
|
if (typeof props.autosize !== "boolean")
|
|
|
|
props.autosize = false;
|
|
|
|
if (typeof props.rows !== "number")
|
|
|
|
props.rows = 3;
|
|
|
|
if (typeof props.value !== "string")
|
|
|
|
props.value = "";
|
|
|
|
if (typeof props.error !== "string")
|
|
|
|
props.error = null;
|
|
|
|
if (props.maxLength && typeof props.maxLength !== "number")
|
|
|
|
props.maxLength = 999;
|
|
|
|
if (typeof props.className !== "string")
|
|
|
|
props.className = "";
|
|
|
|
if (typeof props.id !== "string")
|
|
|
|
props.id = null;
|
|
|
|
if (typeof props.onChange !== "function")
|
|
|
|
props.onChange = noop_1.default;
|
|
|
|
if (typeof props.onFocus !== "function")
|
|
|
|
props.onFocus = noop_1.default;
|
|
|
|
if (typeof props.onBlur !== "function")
|
|
|
|
props.onBlur = noop_1.default;
|
|
|
|
if (typeof props.onKeyDown !== "function")
|
|
|
|
props.onKeyDown = noop_1.default;
|
|
|
|
return props;
|
|
|
|
}
|
|
|
|
get modules() {
|
|
|
|
return TextAreaModules || (TextAreaModules = [
|
|
|
|
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "TextArea").default
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
onChange(value, name) {
|
|
|
|
this.state.onChange(value, name);
|
|
|
|
this.setState({
|
|
|
|
value
|
|
|
|
});
|
|
|
|
}
|
|
|
|
onFocus(ev, name) {
|
|
|
|
this.state.onFocus(ev, name);
|
|
|
|
}
|
|
|
|
onBlur(ev, name) {
|
|
|
|
this.state.onBlur(ev, name);
|
|
|
|
}
|
|
|
|
onKeyDown(ev) {
|
|
|
|
this.state.onKeyDown(ev);
|
|
|
|
}
|
|
|
|
render() {
|
|
|
|
let [TextAreaComponent] = this.modules;
|
|
|
|
let props = TextArea.normalizeProps(this.state || this.props);
|
|
|
|
if (!this.state) {
|
|
|
|
this.state = Object.create(props);
|
|
|
|
}
|
|
|
|
return React.createElement(TextAreaComponent, Object.assign({}, props, { onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown }));
|
|
|
|
}
|
|
|
|
get value() {
|
|
|
|
return this.state.value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.default = TextArea;
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "./src/components/Discord/TextInput.tsx":
|
|
|
|
/*!**********************************************!*\
|
|
|
|
!*** ./src/components/Discord/TextInput.tsx ***!
|
|
|
|
\**********************************************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
const WebpackLoader_1 = __webpack_require__(/*! ../../modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
|
|
|
|
const noop_1 = __webpack_require__(/*! ../../modules/noop */ "./src/modules/noop.ts");
|
|
|
|
let TextInputModules;
|
|
|
|
class TextInput extends React.PureComponent {
|
|
|
|
constructor(props) {
|
|
|
|
props = TextInput.normalizeProps(props);
|
|
|
|
super(props);
|
|
|
|
this.state = props;
|
|
|
|
this.onChange = this.onChange.bind(this);
|
|
|
|
this.onFocus = this.onFocus.bind(this);
|
|
|
|
this.onBlur = this.onBlur.bind(this);
|
|
|
|
}
|
|
|
|
static normalizeProps(props) {
|
|
|
|
if (!props)
|
|
|
|
props = {};
|
|
|
|
if (!props.name || typeof props.name !== "string")
|
|
|
|
props.name = "";
|
|
|
|
if (!props.size || !["default", "mini"].includes(props.size))
|
|
|
|
props.size = "default";
|
|
|
|
if (!props.disabled || typeof props.disabled !== "boolean")
|
|
|
|
props.disabled = false;
|
|
|
|
if (typeof props.placeholder !== "string")
|
|
|
|
props.placeholder = "";
|
|
|
|
if (typeof props.value !== "string")
|
|
|
|
props.value = "";
|
|
|
|
if (typeof props.error !== "string")
|
|
|
|
props.error = null;
|
|
|
|
if (props.maxLength && typeof props.maxLength !== "number")
|
|
|
|
props.maxLength = 999;
|
|
|
|
if (typeof props.className !== "string")
|
|
|
|
props.className = "";
|
|
|
|
if (typeof props.inputClassName !== "string")
|
|
|
|
props.inputClassName = "";
|
|
|
|
if (typeof props.id !== "string")
|
|
|
|
props.id = null;
|
|
|
|
if (typeof props.onChange !== "function")
|
|
|
|
props.onChange = noop_1.default;
|
|
|
|
if (typeof props.onFocus !== "function")
|
|
|
|
props.onFocus = noop_1.default;
|
|
|
|
if (typeof props.onBlur !== "function")
|
|
|
|
props.onBlur = noop_1.default;
|
|
|
|
return props;
|
|
|
|
}
|
|
|
|
get modules() {
|
|
|
|
return TextInputModules || (TextInputModules = [
|
|
|
|
WebpackLoader_1.default.find(e => e.default && e.default.displayName === "TextInput").default
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
onChange(value, name) {
|
|
|
|
this.hasSet = false;
|
|
|
|
this.state.onChange(value, name, this);
|
|
|
|
if (this.hasSet)
|
|
|
|
return; // prevent event if the onChange has changed the value.
|
|
|
|
this.setState({
|
|
|
|
value
|
|
|
|
});
|
|
|
|
this.forceUpdate();
|
|
|
|
}
|
|
|
|
onFocus(ev, name) {
|
|
|
|
this.state.onFocus(ev, name, this);
|
|
|
|
}
|
|
|
|
onBlur(ev, name) {
|
|
|
|
this.state.onBlur(ev, name, this);
|
|
|
|
}
|
|
|
|
render() {
|
|
|
|
let [TextAreaComponent] = this.modules;
|
|
|
|
let props = TextInput.normalizeProps(this.state || this.props);
|
|
|
|
if (!this.state) {
|
|
|
|
this.state = Object.create(props);
|
|
|
|
}
|
|
|
|
return React.createElement(TextAreaComponent, Object.assign({}, props, { onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur }));
|
|
|
|
}
|
|
|
|
get value() {
|
|
|
|
return this.state.value;
|
|
|
|
}
|
|
|
|
setValue(value) {
|
|
|
|
this.setState({
|
|
|
|
value: value
|
|
|
|
});
|
|
|
|
this.forceUpdate();
|
|
|
|
this.hasSet = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.default = TextInput;
|
|
|
|
|
|
|
|
|
2020-06-10 16:16:33 +02:00
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "./src/components/components.ts":
|
|
|
|
/*!**************************************!*\
|
|
|
|
!*** ./src/components/components.ts ***!
|
|
|
|
\**************************************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
const Button_1 = __webpack_require__(/*! ./Discord/Button */ "./src/components/Discord/Button.tsx");
|
2020-06-14 19:23:40 +02:00
|
|
|
const Switch_1 = __webpack_require__(/*! ./Discord/Switch */ "./src/components/Discord/Switch.tsx");
|
|
|
|
const RadioGroup_1 = __webpack_require__(/*! ./Discord/RadioGroup */ "./src/components/Discord/RadioGroup.tsx");
|
|
|
|
const TextArea_1 = __webpack_require__(/*! ./Discord/TextArea */ "./src/components/Discord/TextArea.tsx");
|
|
|
|
const TextInput_1 = __webpack_require__(/*! ./Discord/TextInput */ "./src/components/Discord/TextInput.tsx");
|
2020-06-10 16:16:33 +02:00
|
|
|
exports.default = {
|
2020-06-14 19:23:40 +02:00
|
|
|
inputs: {
|
|
|
|
Button: Button_1.default,
|
|
|
|
Switch: Switch_1.default,
|
|
|
|
Choices: RadioGroup_1.default,
|
|
|
|
RadioGroup: RadioGroup_1.default,
|
|
|
|
TextArea: TextArea_1.default,
|
|
|
|
TextInput: TextInput_1.default
|
2020-06-10 16:16:33 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "./src/index.ts":
|
|
|
|
/*!**********************!*\
|
|
|
|
!*** ./src/index.ts ***!
|
|
|
|
\**********************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
const WebpackLoader_1 = __webpack_require__(/*! ./modules/WebpackLoader */ "./src/modules/WebpackLoader.ts");
|
|
|
|
const components_1 = __webpack_require__(/*! ./components/components */ "./src/components/components.ts");
|
2020-06-14 19:23:40 +02:00
|
|
|
const uuid_1 = __webpack_require__(/*! ./modules/uuid */ "./src/modules/uuid.ts");
|
2020-06-10 16:16:33 +02:00
|
|
|
const LightcordApi = {
|
|
|
|
WebpackLoader: WebpackLoader_1.default,
|
2020-06-14 19:23:40 +02:00
|
|
|
Components: components_1.default,
|
|
|
|
uuid: uuid_1.default
|
2020-06-10 16:16:33 +02:00
|
|
|
};
|
|
|
|
exports.default = LightcordApi;
|
|
|
|
Object.assign(window.Lightcord.Api, LightcordApi);
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "./src/modules/WebpackLoader.ts":
|
|
|
|
/*!**************************************!*\
|
|
|
|
!*** ./src/modules/WebpackLoader.ts ***!
|
|
|
|
\**************************************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
const BDModules = window.BDModules;
|
|
|
|
exports.default = new class WebpackLoader {
|
|
|
|
constructor() { }
|
|
|
|
get(id) {
|
|
|
|
return BDModules.get(id);
|
|
|
|
}
|
|
|
|
find(filter) {
|
|
|
|
return BDModules.get(filter)[0];
|
|
|
|
}
|
|
|
|
findByUniqueProperties(props) {
|
|
|
|
return BDModules.get((mod) => {
|
|
|
|
if (mod.__esModule && ("default" in mod)) {
|
|
|
|
let doesMatch = true;
|
|
|
|
for (let prop of props) {
|
|
|
|
if (!Object.prototype.hasOwnProperty.call(mod.default, prop))
|
|
|
|
doesMatch = false;
|
|
|
|
}
|
|
|
|
if (doesMatch)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
for (let prop of props) {
|
|
|
|
if (!Object.prototype.hasOwnProperty.call(mod, prop))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
})[0];
|
|
|
|
}
|
|
|
|
filter(filter) {
|
|
|
|
return BDModules.get(filter);
|
|
|
|
}
|
|
|
|
filterByUniqueProperties(props) {
|
|
|
|
return BDModules.get((mod) => {
|
|
|
|
if (mod.__esModule && ("default" in mod)) {
|
|
|
|
let doesMatch = true;
|
|
|
|
for (let prop of props) {
|
|
|
|
if (!Object.prototype.hasOwnProperty.call(mod.default, prop))
|
|
|
|
doesMatch = false;
|
|
|
|
}
|
|
|
|
if (doesMatch)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
for (let prop of props) {
|
|
|
|
if (!Object.prototype.hasOwnProperty.call(mod, prop))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-06-14 19:23:40 +02:00
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "./src/modules/noop.ts":
|
|
|
|
/*!*****************************!*\
|
|
|
|
!*** ./src/modules/noop.ts ***!
|
|
|
|
\*****************************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
function NOOP() { }
|
|
|
|
exports.default = NOOP;
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "./src/modules/uuid.ts":
|
|
|
|
/*!*****************************!*\
|
|
|
|
!*** ./src/modules/uuid.ts ***!
|
|
|
|
\*****************************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
const uuidv1 = __webpack_require__(/*! uuid/v1 */ "uuid/v1");
|
|
|
|
const uuidv4 = __webpack_require__(/*! uuid/v4 */ "uuid/v4");
|
|
|
|
let uuid = Object.assign(function () {
|
|
|
|
return uuidv4();
|
|
|
|
}, { v1: () => uuidv1(), v4: () => uuidv4() });
|
|
|
|
exports.default = uuid;
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "uuid/v1":
|
|
|
|
/*!**************************!*\
|
|
|
|
!*** external "uuid/v1" ***!
|
|
|
|
\**************************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
module.exports = require("uuid/v1");
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "uuid/v4":
|
|
|
|
/*!**************************!*\
|
|
|
|
!*** external "uuid/v4" ***!
|
|
|
|
\**************************/
|
|
|
|
/*! no static exports found */
|
|
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
module.exports = require("uuid/v4");
|
|
|
|
|
2020-06-10 16:16:33 +02:00
|
|
|
/***/ })
|
|
|
|
|
|
|
|
/******/ });
|
2020-06-14 19:23:40 +02:00
|
|
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9MaWdodGNvcmRBcGkvd2VicG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