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