@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 CHANGED
@@ -8418,10 +8418,271 @@ function _createSuper$4(Derived) { var hasNativeReflectConstruct = _isNativeRefl
8418
8418
 
8419
8419
  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; } }
8420
8420
 
8421
+ var DropdownInput = /*#__PURE__*/function (_Component) {
8422
+ _inherits__default['default'](DropdownInput, _Component);
8423
+
8424
+ var _super = _createSuper$4(DropdownInput);
8425
+
8426
+ function DropdownInput(props) {
8427
+ var _this;
8428
+
8429
+ _classCallCheck__default['default'](this, DropdownInput);
8430
+
8431
+ _this = _super.call(this, props);
8432
+ _this.state = {
8433
+ width: 0,
8434
+ height: 0,
8435
+ open: false
8436
+ };
8437
+ _this.setWrapperRef = _this.setWrapperRef.bind(_assertThisInitialized__default['default'](_this));
8438
+ _this.handleClickOutside = _this.handleClickOutside.bind(_assertThisInitialized__default['default'](_this));
8439
+ return _this;
8440
+ }
8441
+
8442
+ _createClass__default['default'](DropdownInput, [{
8443
+ key: "componentDidMount",
8444
+ value: function componentDidMount() {
8445
+ document.addEventListener('mousedown', this.handleClickOutside);
8446
+ }
8447
+ }, {
8448
+ key: "componentWillUnmount",
8449
+ value: function componentWillUnmount() {
8450
+ document.removeEventListener('mousedown', this.handleClickOutside);
8451
+ }
8452
+ }, {
8453
+ key: "setWrapperRef",
8454
+ value: function setWrapperRef(node) {
8455
+ this.wrapperRef = node;
8456
+ }
8457
+ }, {
8458
+ key: "handleClickOutside",
8459
+ value: function handleClickOutside(event) {
8460
+ if (this.wrapperRef && !this.wrapperRef.contains(event.target)) {
8461
+ this.setState({
8462
+ open: false
8463
+ });
8464
+ }
8465
+ }
8466
+ }, {
8467
+ key: "getAutoComplete",
8468
+ value: function getAutoComplete() {
8469
+ if (!___default['default'].isUndefined(this.props.autoComplete)) {
8470
+ return this.props.autoComplete ? 'on' : 'off';
8471
+ }
8472
+
8473
+ return 'off';
8474
+ }
8475
+ }, {
8476
+ key: "getClassNames",
8477
+ value: function getClassNames() {
8478
+ var string = '';
8479
+
8480
+ if (this.props.className) {
8481
+ string += "".concat(this.props.className, " ");
8482
+ }
8483
+
8484
+ if (!___default['default'].isUndefined(this.props.disabled) && this.props.disabled) {
8485
+ string = 'genericInput-disabled ';
8486
+ }
8487
+
8488
+ if (this.props.large) {
8489
+ string += 'genericInput-large ';
8490
+ }
8491
+
8492
+ if (!___default['default'].isUndefined(this.props.showError) && this.props.showError()) {
8493
+ return string + 'genericInput-error';
8494
+ }
8495
+
8496
+ if (!___default['default'].isUndefined(this.props.isValid) && this.props.isValid()) {
8497
+ return string + 'genericInput-valid';
8498
+ }
8499
+
8500
+ return string;
8501
+ }
8502
+ }, {
8503
+ key: "getLabelStyle",
8504
+ value: function getLabelStyle() {
8505
+ var style = {};
8506
+
8507
+ if (___default['default'].isEmpty(this.props.value) && !this.props.alwaysShowLabel) {
8508
+ style.opacity = 0;
8509
+ }
8510
+
8511
+ if (!___default['default'].isUndefined(this.props.ignoreValue) && this.props.value === this.props.ignoreValue && !this.props.alwaysShowLabel) {
8512
+ style.opacity = 0;
8513
+ } // if (this.props.isRequired) {
8514
+ // style.marginLeft = 12;
8515
+ // }
8516
+
8517
+
8518
+ return style;
8519
+ }
8520
+ }, {
8521
+ key: "renderError",
8522
+ value: function renderError() {
8523
+ if (!___default['default'].isUndefined(this.props.showError) && this.props.showError()) {
8524
+ return /*#__PURE__*/React__default['default'].createElement("div", {
8525
+ className: 'fieldLabel fieldLabel-warning'
8526
+ }, this.props.errorMessage ? this.props.errorMessage : 'Required');
8527
+ }
8528
+
8529
+ return null;
8530
+ }
8531
+ }, {
8532
+ key: "renderHelp",
8533
+ value: function renderHelp() {
8534
+ if (!___default['default'].isUndefined(this.props.help)) {
8535
+ return /*#__PURE__*/React__default['default'].createElement("div", {
8536
+ className: "genericInput-help"
8537
+ }, this.props.help);
8538
+ }
8539
+
8540
+ return null;
8541
+ }
8542
+ }, {
8543
+ key: "open",
8544
+ value: function open() {
8545
+ if (this.props.disabled) {
8546
+ return;
8547
+ }
8548
+
8549
+ this.setState({
8550
+ open: !this.state.open
8551
+ });
8552
+ }
8553
+ }, {
8554
+ key: "renderOption",
8555
+ value: function renderOption() {
8556
+ var _this2 = this;
8557
+
8558
+ if (!this.state.open) {
8559
+ return null;
8560
+ }
8561
+
8562
+ return /*#__PURE__*/React__default['default'].createElement("div", {
8563
+ style: styles.dropdownItemsWrapper
8564
+ }, ___default['default'].values(this.props.options).map(function (cat) {
8565
+ return /*#__PURE__*/React__default['default'].createElement("div", {
8566
+ key: cat.Key,
8567
+ className: "subtleHover fontRegular fontSize-16 text-dark",
8568
+ style: styles.dropDownOption,
8569
+ onClick: function onClick() {
8570
+ _this2.props.onSelect(cat.Key);
8571
+ }
8572
+ }, cat.Title);
8573
+ }));
8574
+ }
8575
+ }, {
8576
+ key: "getBottomBorder",
8577
+ value: function getBottomBorder() {
8578
+ if (!___default['default'].isUndefined(this.props.disabled) && this.props.disabled) {
8579
+ return 'dropdownInput-bottomBorder--disabled';
8580
+ }
8581
+
8582
+ if (!___default['default'].isUndefined(this.props.showError) && this.props.showError()) {
8583
+ return 'dropdownInput-bottomBorder--error';
8584
+ }
8585
+
8586
+ return '';
8587
+ }
8588
+ }, {
8589
+ key: "renderInput",
8590
+ value: function renderInput() {
8591
+ return /*#__PURE__*/React__default['default'].createElement("div", {
8592
+ style: styles.row
8593
+ }, this.props.isRequired && /*#__PURE__*/React__default['default'].createElement("div", {
8594
+ className: "inputRequired "
8595
+ }), /*#__PURE__*/React__default['default'].createElement("div", {
8596
+ onClick: this.open.bind(this),
8597
+ className: "dropdownInput-bottomBorder ".concat(this.getBottomBorder(), " ").concat(!this.props.disabled ? 'pointer' : '')
8598
+ }, /*#__PURE__*/React__default['default'].createElement("input", {
8599
+ id: this.props.id,
8600
+ placeholder: !___default['default'].isUndefined(this.props.placeholder) ? this.props.placeholder : this.props.label,
8601
+ type: !___default['default'].isUndefined(this.props.type) ? this.props.type : 'text',
8602
+ className: "genericInput ".concat(!this.props.disabled ? 'pointer' : ''),
8603
+ value: this.props.value,
8604
+ onChange: this.props.onChange,
8605
+ onKeyPress: this.props.onEnter,
8606
+ style: _objectSpread$2({}, this.props.inputStyle),
8607
+ disabled: true,
8608
+ autoComplete: "false"
8609
+ }), /*#__PURE__*/React__default['default'].createElement("div", {
8610
+ style: styles.chevronWrapper
8611
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
8612
+ style: _objectSpread$2(_objectSpread$2({}, styles.chevron), {}, {
8613
+ color: !___default['default'].isUndefined(this.props.disabled) && this.props.disabled ? 'transparent' : INACTIVE_TEXT
8614
+ }),
8615
+ name: this.state.open ? 'chevron-up' : 'chevron-down'
8616
+ })), this.renderOption()));
8617
+ }
8618
+ }, {
8619
+ key: "render",
8620
+ value: function render() {
8621
+ return /*#__PURE__*/React__default['default'].createElement("div", {
8622
+ ref: this.setWrapperRef,
8623
+ className: "dropdownInput ".concat(this.getClassNames()),
8624
+ style: _objectSpread$2({
8625
+ marginBottom: 16,
8626
+ position: 'relative'
8627
+ }, this.props.style)
8628
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
8629
+ style: _objectSpread$2(_objectSpread$2({}, styles.row), {}, {
8630
+ marginBottom: 0,
8631
+ justifyContent: 'space-between'
8632
+ })
8633
+ }, !___default['default'].isUndefined(this.props.label) && /*#__PURE__*/React__default['default'].createElement("div", {
8634
+ className: "fieldLabel",
8635
+ style: this.getLabelStyle()
8636
+ }, this.props.label), this.renderError()), this.renderInput(), this.renderHelp());
8637
+ }
8638
+ }]);
8639
+
8640
+ return DropdownInput;
8641
+ }(React.Component);
8642
+
8643
+ var styles = {
8644
+ row: {
8645
+ display: 'flex',
8646
+ flexDirection: 'row',
8647
+ alignItems: 'center'
8648
+ },
8649
+ chevronWrapper: {
8650
+ display: 'flex',
8651
+ flexDirection: 'column',
8652
+ justifyContent: 'center'
8653
+ },
8654
+ chevron: {
8655
+ fontSize: 12,
8656
+ paddingBottom: 4
8657
+ },
8658
+ dropdownItemsWrapper: {
8659
+ backgroundColor: '#fff',
8660
+ position: 'absolute',
8661
+ width: '100%',
8662
+ top: 35,
8663
+ boxShadow: '2px 2px 10px rgba(106, 163, 216, 0.7)',
8664
+ zIndex: 90,
8665
+ borderRadius: 4,
8666
+ paddingTop: 4,
8667
+ paddingBottom: 4
8668
+ },
8669
+ dropDownOption: {
8670
+ padding: '4px 16px'
8671
+ }
8672
+ };
8673
+
8674
+ 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; }
8675
+
8676
+ 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; }
8677
+
8678
+ 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); }; }
8679
+
8680
+ 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; } }
8681
+
8421
8682
  var AudienceSelector = /*#__PURE__*/function (_Component) {
8422
8683
  _inherits__default['default'](AudienceSelector, _Component);
8423
8684
 
8424
- var _super = _createSuper$4(AudienceSelector);
8685
+ var _super = _createSuper$3(AudienceSelector);
8425
8686
 
8426
8687
  function AudienceSelector() {
8427
8688
  var _this;
@@ -8546,7 +8807,7 @@ var AudienceSelector = /*#__PURE__*/function (_Component) {
8546
8807
  profileActions.getUserTagsBySite(this.props.auth.site).then(function (res) {
8547
8808
  _this3.setState({
8548
8809
  tagList: res.data.map(function (t) {
8549
- return _objectSpread$2(_objectSpread$2({}, t), {}, {
8810
+ return _objectSpread$1(_objectSpread$1({}, t), {}, {
8550
8811
  Key: t.Id
8551
8812
  });
8552
8813
  })
@@ -9088,14 +9349,14 @@ var toExport = reactRedux.connect(null, {
9088
9349
  withRef: true
9089
9350
  })(AudienceSelector);
9090
9351
 
9091
- 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); }; }
9352
+ 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); }; }
9092
9353
 
9093
- 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; } }
9354
+ 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; } }
9094
9355
 
9095
9356
  var TextFormatPopup = /*#__PURE__*/function (_Component) {
9096
9357
  _inherits__default['default'](TextFormatPopup, _Component);
9097
9358
 
9098
- var _super = _createSuper$3(TextFormatPopup);
9359
+ var _super = _createSuper$2(TextFormatPopup);
9099
9360
 
9100
9361
  function TextFormatPopup() {
9101
9362
  _classCallCheck__default['default'](this, TextFormatPopup);
@@ -9201,14 +9462,14 @@ var TextFormatPopup = /*#__PURE__*/function (_Component) {
9201
9462
  return TextFormatPopup;
9202
9463
  }(React.Component);
9203
9464
 
9204
- 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); }; }
9465
+ 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); }; }
9205
9466
 
9206
- 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; } }
9467
+ 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; } }
9207
9468
 
9208
9469
  var OptionsSection = /*#__PURE__*/function (_Component) {
9209
9470
  _inherits__default['default'](OptionsSection, _Component);
9210
9471
 
9211
- var _super = _createSuper$2(OptionsSection);
9472
+ var _super = _createSuper$1(OptionsSection);
9212
9473
 
9213
9474
  function OptionsSection() {
9214
9475
  _classCallCheck__default['default'](this, OptionsSection);
@@ -9286,267 +9547,6 @@ var OptionsSection = /*#__PURE__*/function (_Component) {
9286
9547
  return OptionsSection;
9287
9548
  }(React.Component);
9288
9549
 
9289
- 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; }
9290
-
9291
- 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; }
9292
-
9293
- 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); }; }
9294
-
9295
- 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; } }
9296
-
9297
- var DropdownInput = /*#__PURE__*/function (_Component) {
9298
- _inherits__default['default'](DropdownInput, _Component);
9299
-
9300
- var _super = _createSuper$1(DropdownInput);
9301
-
9302
- function DropdownInput(props) {
9303
- var _this;
9304
-
9305
- _classCallCheck__default['default'](this, DropdownInput);
9306
-
9307
- _this = _super.call(this, props);
9308
- _this.state = {
9309
- width: 0,
9310
- height: 0,
9311
- open: false
9312
- };
9313
- _this.setWrapperRef = _this.setWrapperRef.bind(_assertThisInitialized__default['default'](_this));
9314
- _this.handleClickOutside = _this.handleClickOutside.bind(_assertThisInitialized__default['default'](_this));
9315
- return _this;
9316
- }
9317
-
9318
- _createClass__default['default'](DropdownInput, [{
9319
- key: "componentDidMount",
9320
- value: function componentDidMount() {
9321
- document.addEventListener('mousedown', this.handleClickOutside);
9322
- }
9323
- }, {
9324
- key: "componentWillUnmount",
9325
- value: function componentWillUnmount() {
9326
- document.removeEventListener('mousedown', this.handleClickOutside);
9327
- }
9328
- }, {
9329
- key: "setWrapperRef",
9330
- value: function setWrapperRef(node) {
9331
- this.wrapperRef = node;
9332
- }
9333
- }, {
9334
- key: "handleClickOutside",
9335
- value: function handleClickOutside(event) {
9336
- if (this.wrapperRef && !this.wrapperRef.contains(event.target)) {
9337
- this.setState({
9338
- open: false
9339
- });
9340
- }
9341
- }
9342
- }, {
9343
- key: "getAutoComplete",
9344
- value: function getAutoComplete() {
9345
- if (!___default['default'].isUndefined(this.props.autoComplete)) {
9346
- return this.props.autoComplete ? 'on' : 'off';
9347
- }
9348
-
9349
- return 'off';
9350
- }
9351
- }, {
9352
- key: "getClassNames",
9353
- value: function getClassNames() {
9354
- var string = '';
9355
-
9356
- if (this.props.className) {
9357
- string += "".concat(this.props.className, " ");
9358
- }
9359
-
9360
- if (!___default['default'].isUndefined(this.props.disabled) && this.props.disabled) {
9361
- string = 'genericInput-disabled ';
9362
- }
9363
-
9364
- if (this.props.large) {
9365
- string += 'genericInput-large ';
9366
- }
9367
-
9368
- if (!___default['default'].isUndefined(this.props.showError) && this.props.showError()) {
9369
- return string + 'genericInput-error';
9370
- }
9371
-
9372
- if (!___default['default'].isUndefined(this.props.isValid) && this.props.isValid()) {
9373
- return string + 'genericInput-valid';
9374
- }
9375
-
9376
- return string;
9377
- }
9378
- }, {
9379
- key: "getLabelStyle",
9380
- value: function getLabelStyle() {
9381
- var style = {};
9382
-
9383
- if (___default['default'].isEmpty(this.props.value) && !this.props.alwaysShowLabel) {
9384
- style.opacity = 0;
9385
- }
9386
-
9387
- if (!___default['default'].isUndefined(this.props.ignoreValue) && this.props.value === this.props.ignoreValue && !this.props.alwaysShowLabel) {
9388
- style.opacity = 0;
9389
- } // if (this.props.isRequired) {
9390
- // style.marginLeft = 12;
9391
- // }
9392
-
9393
-
9394
- return style;
9395
- }
9396
- }, {
9397
- key: "renderError",
9398
- value: function renderError() {
9399
- if (!___default['default'].isUndefined(this.props.showError) && this.props.showError()) {
9400
- return /*#__PURE__*/React__default['default'].createElement("div", {
9401
- className: 'fieldLabel fieldLabel-warning'
9402
- }, this.props.errorMessage ? this.props.errorMessage : 'Required');
9403
- }
9404
-
9405
- return null;
9406
- }
9407
- }, {
9408
- key: "renderHelp",
9409
- value: function renderHelp() {
9410
- if (!___default['default'].isUndefined(this.props.help)) {
9411
- return /*#__PURE__*/React__default['default'].createElement("div", {
9412
- className: "genericInput-help"
9413
- }, this.props.help);
9414
- }
9415
-
9416
- return null;
9417
- }
9418
- }, {
9419
- key: "open",
9420
- value: function open() {
9421
- if (this.props.disabled) {
9422
- return;
9423
- }
9424
-
9425
- this.setState({
9426
- open: !this.state.open
9427
- });
9428
- }
9429
- }, {
9430
- key: "renderOption",
9431
- value: function renderOption() {
9432
- var _this2 = this;
9433
-
9434
- if (!this.state.open) {
9435
- return null;
9436
- }
9437
-
9438
- return /*#__PURE__*/React__default['default'].createElement("div", {
9439
- style: styles.dropdownItemsWrapper
9440
- }, ___default['default'].values(this.props.options).map(function (cat) {
9441
- return /*#__PURE__*/React__default['default'].createElement("div", {
9442
- key: cat.Key,
9443
- className: "subtleHover fontRegular fontSize-16 text-dark",
9444
- style: styles.dropDownOption,
9445
- onClick: function onClick() {
9446
- _this2.props.onSelect(cat.Key);
9447
- }
9448
- }, cat.Title);
9449
- }));
9450
- }
9451
- }, {
9452
- key: "getBottomBorder",
9453
- value: function getBottomBorder() {
9454
- if (!___default['default'].isUndefined(this.props.disabled) && this.props.disabled) {
9455
- return 'dropdownInput-bottomBorder--disabled';
9456
- }
9457
-
9458
- if (!___default['default'].isUndefined(this.props.showError) && this.props.showError()) {
9459
- return 'dropdownInput-bottomBorder--error';
9460
- }
9461
-
9462
- return '';
9463
- }
9464
- }, {
9465
- key: "renderInput",
9466
- value: function renderInput() {
9467
- return /*#__PURE__*/React__default['default'].createElement("div", {
9468
- style: styles.row
9469
- }, this.props.isRequired && /*#__PURE__*/React__default['default'].createElement("div", {
9470
- className: "inputRequired "
9471
- }), /*#__PURE__*/React__default['default'].createElement("div", {
9472
- onClick: this.open.bind(this),
9473
- className: "dropdownInput-bottomBorder ".concat(this.getBottomBorder(), " ").concat(!this.props.disabled ? 'pointer' : '')
9474
- }, /*#__PURE__*/React__default['default'].createElement("input", {
9475
- id: this.props.id,
9476
- placeholder: !___default['default'].isUndefined(this.props.placeholder) ? this.props.placeholder : this.props.label,
9477
- type: !___default['default'].isUndefined(this.props.type) ? this.props.type : 'text',
9478
- className: "genericInput ".concat(!this.props.disabled ? 'pointer' : ''),
9479
- value: this.props.value,
9480
- onChange: this.props.onChange,
9481
- onKeyPress: this.props.onEnter,
9482
- style: _objectSpread$1({}, this.props.inputStyle),
9483
- disabled: true,
9484
- autoComplete: "false"
9485
- }), /*#__PURE__*/React__default['default'].createElement("div", {
9486
- style: styles.chevronWrapper
9487
- }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
9488
- style: _objectSpread$1(_objectSpread$1({}, styles.chevron), {}, {
9489
- color: !___default['default'].isUndefined(this.props.disabled) && this.props.disabled ? 'transparent' : INACTIVE_TEXT
9490
- }),
9491
- name: this.state.open ? 'chevron-up' : 'chevron-down'
9492
- })), this.renderOption()));
9493
- }
9494
- }, {
9495
- key: "render",
9496
- value: function render() {
9497
- return /*#__PURE__*/React__default['default'].createElement("div", {
9498
- ref: this.setWrapperRef,
9499
- className: "dropdownInput ".concat(this.getClassNames()),
9500
- style: _objectSpread$1({
9501
- marginBottom: 16,
9502
- position: 'relative'
9503
- }, this.props.style)
9504
- }, /*#__PURE__*/React__default['default'].createElement("div", {
9505
- style: _objectSpread$1(_objectSpread$1({}, styles.row), {}, {
9506
- marginBottom: 0,
9507
- justifyContent: 'space-between'
9508
- })
9509
- }, !___default['default'].isUndefined(this.props.label) && /*#__PURE__*/React__default['default'].createElement("div", {
9510
- className: "fieldLabel",
9511
- style: this.getLabelStyle()
9512
- }, this.props.label), this.renderError()), this.renderInput(), this.renderHelp());
9513
- }
9514
- }]);
9515
-
9516
- return DropdownInput;
9517
- }(React.Component);
9518
-
9519
- var styles = {
9520
- row: {
9521
- display: 'flex',
9522
- flexDirection: 'row',
9523
- alignItems: 'center'
9524
- },
9525
- chevronWrapper: {
9526
- display: 'flex',
9527
- flexDirection: 'column',
9528
- justifyContent: 'center'
9529
- },
9530
- chevron: {
9531
- fontSize: 12,
9532
- paddingBottom: 4
9533
- },
9534
- dropdownItemsWrapper: {
9535
- backgroundColor: '#fff',
9536
- position: 'absolute',
9537
- width: '100%',
9538
- top: 35,
9539
- boxShadow: '2px 2px 10px rgba(106, 163, 216, 0.7)',
9540
- zIndex: 90,
9541
- borderRadius: 4,
9542
- paddingTop: 4,
9543
- paddingBottom: 4
9544
- },
9545
- dropDownOption: {
9546
- padding: '4px 16px'
9547
- }
9548
- };
9549
-
9550
9550
  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; }
9551
9551
 
9552
9552
  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; }