@plusscommunities/pluss-core-web 1.1.4 → 1.1.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/dist/index.cjs.js +269 -269
- package/dist/index.esm.js +269 -269
- package/dist/index.umd.js +269 -269
- package/package.json +4 -4
- package/src/components/AnalyticsFilter.js +2 -1
- package/src/components/AudienceIncluder.js +2 -1
- package/src/components/AudienceSelector.js +3 -2
- package/src/components/ImageInput.js +2 -1
- package/src/components/MakerPopup.js +1 -1
- package/src/components/OptionsSection.js +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -8391,10 +8391,271 @@ function _createSuper$4(Derived) { var hasNativeReflectConstruct = _isNativeRefl
|
|
|
8391
8391
|
|
|
8392
8392
|
function _isNativeReflectConstruct$4() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
8393
8393
|
|
|
8394
|
+
var DropdownInput = /*#__PURE__*/function (_Component) {
|
|
8395
|
+
_inherits(DropdownInput, _Component);
|
|
8396
|
+
|
|
8397
|
+
var _super = _createSuper$4(DropdownInput);
|
|
8398
|
+
|
|
8399
|
+
function DropdownInput(props) {
|
|
8400
|
+
var _this;
|
|
8401
|
+
|
|
8402
|
+
_classCallCheck(this, DropdownInput);
|
|
8403
|
+
|
|
8404
|
+
_this = _super.call(this, props);
|
|
8405
|
+
_this.state = {
|
|
8406
|
+
width: 0,
|
|
8407
|
+
height: 0,
|
|
8408
|
+
open: false
|
|
8409
|
+
};
|
|
8410
|
+
_this.setWrapperRef = _this.setWrapperRef.bind(_assertThisInitialized(_this));
|
|
8411
|
+
_this.handleClickOutside = _this.handleClickOutside.bind(_assertThisInitialized(_this));
|
|
8412
|
+
return _this;
|
|
8413
|
+
}
|
|
8414
|
+
|
|
8415
|
+
_createClass(DropdownInput, [{
|
|
8416
|
+
key: "componentDidMount",
|
|
8417
|
+
value: function componentDidMount() {
|
|
8418
|
+
document.addEventListener('mousedown', this.handleClickOutside);
|
|
8419
|
+
}
|
|
8420
|
+
}, {
|
|
8421
|
+
key: "componentWillUnmount",
|
|
8422
|
+
value: function componentWillUnmount() {
|
|
8423
|
+
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
8424
|
+
}
|
|
8425
|
+
}, {
|
|
8426
|
+
key: "setWrapperRef",
|
|
8427
|
+
value: function setWrapperRef(node) {
|
|
8428
|
+
this.wrapperRef = node;
|
|
8429
|
+
}
|
|
8430
|
+
}, {
|
|
8431
|
+
key: "handleClickOutside",
|
|
8432
|
+
value: function handleClickOutside(event) {
|
|
8433
|
+
if (this.wrapperRef && !this.wrapperRef.contains(event.target)) {
|
|
8434
|
+
this.setState({
|
|
8435
|
+
open: false
|
|
8436
|
+
});
|
|
8437
|
+
}
|
|
8438
|
+
}
|
|
8439
|
+
}, {
|
|
8440
|
+
key: "getAutoComplete",
|
|
8441
|
+
value: function getAutoComplete() {
|
|
8442
|
+
if (!_.isUndefined(this.props.autoComplete)) {
|
|
8443
|
+
return this.props.autoComplete ? 'on' : 'off';
|
|
8444
|
+
}
|
|
8445
|
+
|
|
8446
|
+
return 'off';
|
|
8447
|
+
}
|
|
8448
|
+
}, {
|
|
8449
|
+
key: "getClassNames",
|
|
8450
|
+
value: function getClassNames() {
|
|
8451
|
+
var string = '';
|
|
8452
|
+
|
|
8453
|
+
if (this.props.className) {
|
|
8454
|
+
string += "".concat(this.props.className, " ");
|
|
8455
|
+
}
|
|
8456
|
+
|
|
8457
|
+
if (!_.isUndefined(this.props.disabled) && this.props.disabled) {
|
|
8458
|
+
string = 'genericInput-disabled ';
|
|
8459
|
+
}
|
|
8460
|
+
|
|
8461
|
+
if (this.props.large) {
|
|
8462
|
+
string += 'genericInput-large ';
|
|
8463
|
+
}
|
|
8464
|
+
|
|
8465
|
+
if (!_.isUndefined(this.props.showError) && this.props.showError()) {
|
|
8466
|
+
return string + 'genericInput-error';
|
|
8467
|
+
}
|
|
8468
|
+
|
|
8469
|
+
if (!_.isUndefined(this.props.isValid) && this.props.isValid()) {
|
|
8470
|
+
return string + 'genericInput-valid';
|
|
8471
|
+
}
|
|
8472
|
+
|
|
8473
|
+
return string;
|
|
8474
|
+
}
|
|
8475
|
+
}, {
|
|
8476
|
+
key: "getLabelStyle",
|
|
8477
|
+
value: function getLabelStyle() {
|
|
8478
|
+
var style = {};
|
|
8479
|
+
|
|
8480
|
+
if (_.isEmpty(this.props.value) && !this.props.alwaysShowLabel) {
|
|
8481
|
+
style.opacity = 0;
|
|
8482
|
+
}
|
|
8483
|
+
|
|
8484
|
+
if (!_.isUndefined(this.props.ignoreValue) && this.props.value === this.props.ignoreValue && !this.props.alwaysShowLabel) {
|
|
8485
|
+
style.opacity = 0;
|
|
8486
|
+
} // if (this.props.isRequired) {
|
|
8487
|
+
// style.marginLeft = 12;
|
|
8488
|
+
// }
|
|
8489
|
+
|
|
8490
|
+
|
|
8491
|
+
return style;
|
|
8492
|
+
}
|
|
8493
|
+
}, {
|
|
8494
|
+
key: "renderError",
|
|
8495
|
+
value: function renderError() {
|
|
8496
|
+
if (!_.isUndefined(this.props.showError) && this.props.showError()) {
|
|
8497
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8498
|
+
className: 'fieldLabel fieldLabel-warning'
|
|
8499
|
+
}, this.props.errorMessage ? this.props.errorMessage : 'Required');
|
|
8500
|
+
}
|
|
8501
|
+
|
|
8502
|
+
return null;
|
|
8503
|
+
}
|
|
8504
|
+
}, {
|
|
8505
|
+
key: "renderHelp",
|
|
8506
|
+
value: function renderHelp() {
|
|
8507
|
+
if (!_.isUndefined(this.props.help)) {
|
|
8508
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8509
|
+
className: "genericInput-help"
|
|
8510
|
+
}, this.props.help);
|
|
8511
|
+
}
|
|
8512
|
+
|
|
8513
|
+
return null;
|
|
8514
|
+
}
|
|
8515
|
+
}, {
|
|
8516
|
+
key: "open",
|
|
8517
|
+
value: function open() {
|
|
8518
|
+
if (this.props.disabled) {
|
|
8519
|
+
return;
|
|
8520
|
+
}
|
|
8521
|
+
|
|
8522
|
+
this.setState({
|
|
8523
|
+
open: !this.state.open
|
|
8524
|
+
});
|
|
8525
|
+
}
|
|
8526
|
+
}, {
|
|
8527
|
+
key: "renderOption",
|
|
8528
|
+
value: function renderOption() {
|
|
8529
|
+
var _this2 = this;
|
|
8530
|
+
|
|
8531
|
+
if (!this.state.open) {
|
|
8532
|
+
return null;
|
|
8533
|
+
}
|
|
8534
|
+
|
|
8535
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8536
|
+
style: styles.dropdownItemsWrapper
|
|
8537
|
+
}, _.values(this.props.options).map(function (cat) {
|
|
8538
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8539
|
+
key: cat.Key,
|
|
8540
|
+
className: "subtleHover fontRegular fontSize-16 text-dark",
|
|
8541
|
+
style: styles.dropDownOption,
|
|
8542
|
+
onClick: function onClick() {
|
|
8543
|
+
_this2.props.onSelect(cat.Key);
|
|
8544
|
+
}
|
|
8545
|
+
}, cat.Title);
|
|
8546
|
+
}));
|
|
8547
|
+
}
|
|
8548
|
+
}, {
|
|
8549
|
+
key: "getBottomBorder",
|
|
8550
|
+
value: function getBottomBorder() {
|
|
8551
|
+
if (!_.isUndefined(this.props.disabled) && this.props.disabled) {
|
|
8552
|
+
return 'dropdownInput-bottomBorder--disabled';
|
|
8553
|
+
}
|
|
8554
|
+
|
|
8555
|
+
if (!_.isUndefined(this.props.showError) && this.props.showError()) {
|
|
8556
|
+
return 'dropdownInput-bottomBorder--error';
|
|
8557
|
+
}
|
|
8558
|
+
|
|
8559
|
+
return '';
|
|
8560
|
+
}
|
|
8561
|
+
}, {
|
|
8562
|
+
key: "renderInput",
|
|
8563
|
+
value: function renderInput() {
|
|
8564
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8565
|
+
style: styles.row
|
|
8566
|
+
}, this.props.isRequired && /*#__PURE__*/React.createElement("div", {
|
|
8567
|
+
className: "inputRequired "
|
|
8568
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
8569
|
+
onClick: this.open.bind(this),
|
|
8570
|
+
className: "dropdownInput-bottomBorder ".concat(this.getBottomBorder(), " ").concat(!this.props.disabled ? 'pointer' : '')
|
|
8571
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
8572
|
+
id: this.props.id,
|
|
8573
|
+
placeholder: !_.isUndefined(this.props.placeholder) ? this.props.placeholder : this.props.label,
|
|
8574
|
+
type: !_.isUndefined(this.props.type) ? this.props.type : 'text',
|
|
8575
|
+
className: "genericInput ".concat(!this.props.disabled ? 'pointer' : ''),
|
|
8576
|
+
value: this.props.value,
|
|
8577
|
+
onChange: this.props.onChange,
|
|
8578
|
+
onKeyPress: this.props.onEnter,
|
|
8579
|
+
style: _objectSpread$2({}, this.props.inputStyle),
|
|
8580
|
+
disabled: true,
|
|
8581
|
+
autoComplete: "false"
|
|
8582
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
8583
|
+
style: styles.chevronWrapper
|
|
8584
|
+
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
8585
|
+
style: _objectSpread$2(_objectSpread$2({}, styles.chevron), {}, {
|
|
8586
|
+
color: !_.isUndefined(this.props.disabled) && this.props.disabled ? 'transparent' : INACTIVE_TEXT
|
|
8587
|
+
}),
|
|
8588
|
+
name: this.state.open ? 'chevron-up' : 'chevron-down'
|
|
8589
|
+
})), this.renderOption()));
|
|
8590
|
+
}
|
|
8591
|
+
}, {
|
|
8592
|
+
key: "render",
|
|
8593
|
+
value: function render() {
|
|
8594
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8595
|
+
ref: this.setWrapperRef,
|
|
8596
|
+
className: "dropdownInput ".concat(this.getClassNames()),
|
|
8597
|
+
style: _objectSpread$2({
|
|
8598
|
+
marginBottom: 16,
|
|
8599
|
+
position: 'relative'
|
|
8600
|
+
}, this.props.style)
|
|
8601
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
8602
|
+
style: _objectSpread$2(_objectSpread$2({}, styles.row), {}, {
|
|
8603
|
+
marginBottom: 0,
|
|
8604
|
+
justifyContent: 'space-between'
|
|
8605
|
+
})
|
|
8606
|
+
}, !_.isUndefined(this.props.label) && /*#__PURE__*/React.createElement("div", {
|
|
8607
|
+
className: "fieldLabel",
|
|
8608
|
+
style: this.getLabelStyle()
|
|
8609
|
+
}, this.props.label), this.renderError()), this.renderInput(), this.renderHelp());
|
|
8610
|
+
}
|
|
8611
|
+
}]);
|
|
8612
|
+
|
|
8613
|
+
return DropdownInput;
|
|
8614
|
+
}(Component);
|
|
8615
|
+
|
|
8616
|
+
var styles = {
|
|
8617
|
+
row: {
|
|
8618
|
+
display: 'flex',
|
|
8619
|
+
flexDirection: 'row',
|
|
8620
|
+
alignItems: 'center'
|
|
8621
|
+
},
|
|
8622
|
+
chevronWrapper: {
|
|
8623
|
+
display: 'flex',
|
|
8624
|
+
flexDirection: 'column',
|
|
8625
|
+
justifyContent: 'center'
|
|
8626
|
+
},
|
|
8627
|
+
chevron: {
|
|
8628
|
+
fontSize: 12,
|
|
8629
|
+
paddingBottom: 4
|
|
8630
|
+
},
|
|
8631
|
+
dropdownItemsWrapper: {
|
|
8632
|
+
backgroundColor: '#fff',
|
|
8633
|
+
position: 'absolute',
|
|
8634
|
+
width: '100%',
|
|
8635
|
+
top: 35,
|
|
8636
|
+
boxShadow: '2px 2px 10px rgba(106, 163, 216, 0.7)',
|
|
8637
|
+
zIndex: 90,
|
|
8638
|
+
borderRadius: 4,
|
|
8639
|
+
paddingTop: 4,
|
|
8640
|
+
paddingBottom: 4
|
|
8641
|
+
},
|
|
8642
|
+
dropDownOption: {
|
|
8643
|
+
padding: '4px 16px'
|
|
8644
|
+
}
|
|
8645
|
+
};
|
|
8646
|
+
|
|
8647
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
8648
|
+
|
|
8649
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8650
|
+
|
|
8651
|
+
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8652
|
+
|
|
8653
|
+
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
8654
|
+
|
|
8394
8655
|
var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
8395
8656
|
_inherits(AudienceSelector, _Component);
|
|
8396
8657
|
|
|
8397
|
-
var _super = _createSuper$
|
|
8658
|
+
var _super = _createSuper$3(AudienceSelector);
|
|
8398
8659
|
|
|
8399
8660
|
function AudienceSelector() {
|
|
8400
8661
|
var _this;
|
|
@@ -8519,7 +8780,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
|
|
|
8519
8780
|
profileActions.getUserTagsBySite(this.props.auth.site).then(function (res) {
|
|
8520
8781
|
_this3.setState({
|
|
8521
8782
|
tagList: res.data.map(function (t) {
|
|
8522
|
-
return _objectSpread$
|
|
8783
|
+
return _objectSpread$1(_objectSpread$1({}, t), {}, {
|
|
8523
8784
|
Key: t.Id
|
|
8524
8785
|
});
|
|
8525
8786
|
})
|
|
@@ -9061,14 +9322,14 @@ var toExport = connect(null, {
|
|
|
9061
9322
|
withRef: true
|
|
9062
9323
|
})(AudienceSelector);
|
|
9063
9324
|
|
|
9064
|
-
function _createSuper$
|
|
9325
|
+
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9065
9326
|
|
|
9066
|
-
function _isNativeReflectConstruct$
|
|
9327
|
+
function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
9067
9328
|
|
|
9068
9329
|
var TextFormatPopup = /*#__PURE__*/function (_Component) {
|
|
9069
9330
|
_inherits(TextFormatPopup, _Component);
|
|
9070
9331
|
|
|
9071
|
-
var _super = _createSuper$
|
|
9332
|
+
var _super = _createSuper$2(TextFormatPopup);
|
|
9072
9333
|
|
|
9073
9334
|
function TextFormatPopup() {
|
|
9074
9335
|
_classCallCheck(this, TextFormatPopup);
|
|
@@ -9174,14 +9435,14 @@ var TextFormatPopup = /*#__PURE__*/function (_Component) {
|
|
|
9174
9435
|
return TextFormatPopup;
|
|
9175
9436
|
}(Component);
|
|
9176
9437
|
|
|
9177
|
-
function _createSuper$
|
|
9438
|
+
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9178
9439
|
|
|
9179
|
-
function _isNativeReflectConstruct$
|
|
9440
|
+
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
9180
9441
|
|
|
9181
9442
|
var OptionsSection = /*#__PURE__*/function (_Component) {
|
|
9182
9443
|
_inherits(OptionsSection, _Component);
|
|
9183
9444
|
|
|
9184
|
-
var _super = _createSuper$
|
|
9445
|
+
var _super = _createSuper$1(OptionsSection);
|
|
9185
9446
|
|
|
9186
9447
|
function OptionsSection() {
|
|
9187
9448
|
_classCallCheck(this, OptionsSection);
|
|
@@ -9259,267 +9520,6 @@ var OptionsSection = /*#__PURE__*/function (_Component) {
|
|
|
9259
9520
|
return OptionsSection;
|
|
9260
9521
|
}(Component);
|
|
9261
9522
|
|
|
9262
|
-
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
9263
|
-
|
|
9264
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
9265
|
-
|
|
9266
|
-
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9267
|
-
|
|
9268
|
-
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
9269
|
-
|
|
9270
|
-
var DropdownInput = /*#__PURE__*/function (_Component) {
|
|
9271
|
-
_inherits(DropdownInput, _Component);
|
|
9272
|
-
|
|
9273
|
-
var _super = _createSuper$1(DropdownInput);
|
|
9274
|
-
|
|
9275
|
-
function DropdownInput(props) {
|
|
9276
|
-
var _this;
|
|
9277
|
-
|
|
9278
|
-
_classCallCheck(this, DropdownInput);
|
|
9279
|
-
|
|
9280
|
-
_this = _super.call(this, props);
|
|
9281
|
-
_this.state = {
|
|
9282
|
-
width: 0,
|
|
9283
|
-
height: 0,
|
|
9284
|
-
open: false
|
|
9285
|
-
};
|
|
9286
|
-
_this.setWrapperRef = _this.setWrapperRef.bind(_assertThisInitialized(_this));
|
|
9287
|
-
_this.handleClickOutside = _this.handleClickOutside.bind(_assertThisInitialized(_this));
|
|
9288
|
-
return _this;
|
|
9289
|
-
}
|
|
9290
|
-
|
|
9291
|
-
_createClass(DropdownInput, [{
|
|
9292
|
-
key: "componentDidMount",
|
|
9293
|
-
value: function componentDidMount() {
|
|
9294
|
-
document.addEventListener('mousedown', this.handleClickOutside);
|
|
9295
|
-
}
|
|
9296
|
-
}, {
|
|
9297
|
-
key: "componentWillUnmount",
|
|
9298
|
-
value: function componentWillUnmount() {
|
|
9299
|
-
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
9300
|
-
}
|
|
9301
|
-
}, {
|
|
9302
|
-
key: "setWrapperRef",
|
|
9303
|
-
value: function setWrapperRef(node) {
|
|
9304
|
-
this.wrapperRef = node;
|
|
9305
|
-
}
|
|
9306
|
-
}, {
|
|
9307
|
-
key: "handleClickOutside",
|
|
9308
|
-
value: function handleClickOutside(event) {
|
|
9309
|
-
if (this.wrapperRef && !this.wrapperRef.contains(event.target)) {
|
|
9310
|
-
this.setState({
|
|
9311
|
-
open: false
|
|
9312
|
-
});
|
|
9313
|
-
}
|
|
9314
|
-
}
|
|
9315
|
-
}, {
|
|
9316
|
-
key: "getAutoComplete",
|
|
9317
|
-
value: function getAutoComplete() {
|
|
9318
|
-
if (!_.isUndefined(this.props.autoComplete)) {
|
|
9319
|
-
return this.props.autoComplete ? 'on' : 'off';
|
|
9320
|
-
}
|
|
9321
|
-
|
|
9322
|
-
return 'off';
|
|
9323
|
-
}
|
|
9324
|
-
}, {
|
|
9325
|
-
key: "getClassNames",
|
|
9326
|
-
value: function getClassNames() {
|
|
9327
|
-
var string = '';
|
|
9328
|
-
|
|
9329
|
-
if (this.props.className) {
|
|
9330
|
-
string += "".concat(this.props.className, " ");
|
|
9331
|
-
}
|
|
9332
|
-
|
|
9333
|
-
if (!_.isUndefined(this.props.disabled) && this.props.disabled) {
|
|
9334
|
-
string = 'genericInput-disabled ';
|
|
9335
|
-
}
|
|
9336
|
-
|
|
9337
|
-
if (this.props.large) {
|
|
9338
|
-
string += 'genericInput-large ';
|
|
9339
|
-
}
|
|
9340
|
-
|
|
9341
|
-
if (!_.isUndefined(this.props.showError) && this.props.showError()) {
|
|
9342
|
-
return string + 'genericInput-error';
|
|
9343
|
-
}
|
|
9344
|
-
|
|
9345
|
-
if (!_.isUndefined(this.props.isValid) && this.props.isValid()) {
|
|
9346
|
-
return string + 'genericInput-valid';
|
|
9347
|
-
}
|
|
9348
|
-
|
|
9349
|
-
return string;
|
|
9350
|
-
}
|
|
9351
|
-
}, {
|
|
9352
|
-
key: "getLabelStyle",
|
|
9353
|
-
value: function getLabelStyle() {
|
|
9354
|
-
var style = {};
|
|
9355
|
-
|
|
9356
|
-
if (_.isEmpty(this.props.value) && !this.props.alwaysShowLabel) {
|
|
9357
|
-
style.opacity = 0;
|
|
9358
|
-
}
|
|
9359
|
-
|
|
9360
|
-
if (!_.isUndefined(this.props.ignoreValue) && this.props.value === this.props.ignoreValue && !this.props.alwaysShowLabel) {
|
|
9361
|
-
style.opacity = 0;
|
|
9362
|
-
} // if (this.props.isRequired) {
|
|
9363
|
-
// style.marginLeft = 12;
|
|
9364
|
-
// }
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
return style;
|
|
9368
|
-
}
|
|
9369
|
-
}, {
|
|
9370
|
-
key: "renderError",
|
|
9371
|
-
value: function renderError() {
|
|
9372
|
-
if (!_.isUndefined(this.props.showError) && this.props.showError()) {
|
|
9373
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
9374
|
-
className: 'fieldLabel fieldLabel-warning'
|
|
9375
|
-
}, this.props.errorMessage ? this.props.errorMessage : 'Required');
|
|
9376
|
-
}
|
|
9377
|
-
|
|
9378
|
-
return null;
|
|
9379
|
-
}
|
|
9380
|
-
}, {
|
|
9381
|
-
key: "renderHelp",
|
|
9382
|
-
value: function renderHelp() {
|
|
9383
|
-
if (!_.isUndefined(this.props.help)) {
|
|
9384
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
9385
|
-
className: "genericInput-help"
|
|
9386
|
-
}, this.props.help);
|
|
9387
|
-
}
|
|
9388
|
-
|
|
9389
|
-
return null;
|
|
9390
|
-
}
|
|
9391
|
-
}, {
|
|
9392
|
-
key: "open",
|
|
9393
|
-
value: function open() {
|
|
9394
|
-
if (this.props.disabled) {
|
|
9395
|
-
return;
|
|
9396
|
-
}
|
|
9397
|
-
|
|
9398
|
-
this.setState({
|
|
9399
|
-
open: !this.state.open
|
|
9400
|
-
});
|
|
9401
|
-
}
|
|
9402
|
-
}, {
|
|
9403
|
-
key: "renderOption",
|
|
9404
|
-
value: function renderOption() {
|
|
9405
|
-
var _this2 = this;
|
|
9406
|
-
|
|
9407
|
-
if (!this.state.open) {
|
|
9408
|
-
return null;
|
|
9409
|
-
}
|
|
9410
|
-
|
|
9411
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
9412
|
-
style: styles.dropdownItemsWrapper
|
|
9413
|
-
}, _.values(this.props.options).map(function (cat) {
|
|
9414
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
9415
|
-
key: cat.Key,
|
|
9416
|
-
className: "subtleHover fontRegular fontSize-16 text-dark",
|
|
9417
|
-
style: styles.dropDownOption,
|
|
9418
|
-
onClick: function onClick() {
|
|
9419
|
-
_this2.props.onSelect(cat.Key);
|
|
9420
|
-
}
|
|
9421
|
-
}, cat.Title);
|
|
9422
|
-
}));
|
|
9423
|
-
}
|
|
9424
|
-
}, {
|
|
9425
|
-
key: "getBottomBorder",
|
|
9426
|
-
value: function getBottomBorder() {
|
|
9427
|
-
if (!_.isUndefined(this.props.disabled) && this.props.disabled) {
|
|
9428
|
-
return 'dropdownInput-bottomBorder--disabled';
|
|
9429
|
-
}
|
|
9430
|
-
|
|
9431
|
-
if (!_.isUndefined(this.props.showError) && this.props.showError()) {
|
|
9432
|
-
return 'dropdownInput-bottomBorder--error';
|
|
9433
|
-
}
|
|
9434
|
-
|
|
9435
|
-
return '';
|
|
9436
|
-
}
|
|
9437
|
-
}, {
|
|
9438
|
-
key: "renderInput",
|
|
9439
|
-
value: function renderInput() {
|
|
9440
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
9441
|
-
style: styles.row
|
|
9442
|
-
}, this.props.isRequired && /*#__PURE__*/React.createElement("div", {
|
|
9443
|
-
className: "inputRequired "
|
|
9444
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
9445
|
-
onClick: this.open.bind(this),
|
|
9446
|
-
className: "dropdownInput-bottomBorder ".concat(this.getBottomBorder(), " ").concat(!this.props.disabled ? 'pointer' : '')
|
|
9447
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
9448
|
-
id: this.props.id,
|
|
9449
|
-
placeholder: !_.isUndefined(this.props.placeholder) ? this.props.placeholder : this.props.label,
|
|
9450
|
-
type: !_.isUndefined(this.props.type) ? this.props.type : 'text',
|
|
9451
|
-
className: "genericInput ".concat(!this.props.disabled ? 'pointer' : ''),
|
|
9452
|
-
value: this.props.value,
|
|
9453
|
-
onChange: this.props.onChange,
|
|
9454
|
-
onKeyPress: this.props.onEnter,
|
|
9455
|
-
style: _objectSpread$1({}, this.props.inputStyle),
|
|
9456
|
-
disabled: true,
|
|
9457
|
-
autoComplete: "false"
|
|
9458
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
9459
|
-
style: styles.chevronWrapper
|
|
9460
|
-
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
9461
|
-
style: _objectSpread$1(_objectSpread$1({}, styles.chevron), {}, {
|
|
9462
|
-
color: !_.isUndefined(this.props.disabled) && this.props.disabled ? 'transparent' : INACTIVE_TEXT
|
|
9463
|
-
}),
|
|
9464
|
-
name: this.state.open ? 'chevron-up' : 'chevron-down'
|
|
9465
|
-
})), this.renderOption()));
|
|
9466
|
-
}
|
|
9467
|
-
}, {
|
|
9468
|
-
key: "render",
|
|
9469
|
-
value: function render() {
|
|
9470
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
9471
|
-
ref: this.setWrapperRef,
|
|
9472
|
-
className: "dropdownInput ".concat(this.getClassNames()),
|
|
9473
|
-
style: _objectSpread$1({
|
|
9474
|
-
marginBottom: 16,
|
|
9475
|
-
position: 'relative'
|
|
9476
|
-
}, this.props.style)
|
|
9477
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
9478
|
-
style: _objectSpread$1(_objectSpread$1({}, styles.row), {}, {
|
|
9479
|
-
marginBottom: 0,
|
|
9480
|
-
justifyContent: 'space-between'
|
|
9481
|
-
})
|
|
9482
|
-
}, !_.isUndefined(this.props.label) && /*#__PURE__*/React.createElement("div", {
|
|
9483
|
-
className: "fieldLabel",
|
|
9484
|
-
style: this.getLabelStyle()
|
|
9485
|
-
}, this.props.label), this.renderError()), this.renderInput(), this.renderHelp());
|
|
9486
|
-
}
|
|
9487
|
-
}]);
|
|
9488
|
-
|
|
9489
|
-
return DropdownInput;
|
|
9490
|
-
}(Component);
|
|
9491
|
-
|
|
9492
|
-
var styles = {
|
|
9493
|
-
row: {
|
|
9494
|
-
display: 'flex',
|
|
9495
|
-
flexDirection: 'row',
|
|
9496
|
-
alignItems: 'center'
|
|
9497
|
-
},
|
|
9498
|
-
chevronWrapper: {
|
|
9499
|
-
display: 'flex',
|
|
9500
|
-
flexDirection: 'column',
|
|
9501
|
-
justifyContent: 'center'
|
|
9502
|
-
},
|
|
9503
|
-
chevron: {
|
|
9504
|
-
fontSize: 12,
|
|
9505
|
-
paddingBottom: 4
|
|
9506
|
-
},
|
|
9507
|
-
dropdownItemsWrapper: {
|
|
9508
|
-
backgroundColor: '#fff',
|
|
9509
|
-
position: 'absolute',
|
|
9510
|
-
width: '100%',
|
|
9511
|
-
top: 35,
|
|
9512
|
-
boxShadow: '2px 2px 10px rgba(106, 163, 216, 0.7)',
|
|
9513
|
-
zIndex: 90,
|
|
9514
|
-
borderRadius: 4,
|
|
9515
|
-
paddingTop: 4,
|
|
9516
|
-
paddingBottom: 4
|
|
9517
|
-
},
|
|
9518
|
-
dropDownOption: {
|
|
9519
|
-
padding: '4px 16px'
|
|
9520
|
-
}
|
|
9521
|
-
};
|
|
9522
|
-
|
|
9523
9523
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
9524
9524
|
|
|
9525
9525
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|