tenjin-ui-kit 0.2.195 → 0.2.197

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.
@@ -56,18 +56,12 @@ var FileUploader = function FileUploader(props) {
56
56
  if (selectedFile) {
57
57
  var _selectedFile$name, _selectedFile$name$sp, _selectedFile$name$sp2;
58
58
  var excludedExtensions = [".zip", ".exe", ".batch", ".webm", ".mp4", ".mp3", ".bat", ".js", ".vbs", ".html", ".scr", ".cmd", ".rar", ".svg", ".lnk"];
59
- var includedExtensions = [".xlsx", ".xls", ".csv", ".png", ".jpg", ".txt", ".pdf", ".doc", ".docx", ".ppt", ".yml", ".yaml", ".jpeg"];
60
59
  var fileExtension = selectedFile === null || selectedFile === void 0 ? void 0 : (_selectedFile$name = selectedFile.name) === null || _selectedFile$name === void 0 ? void 0 : (_selectedFile$name$sp = _selectedFile$name.split(".")) === null || _selectedFile$name$sp === void 0 ? void 0 : (_selectedFile$name$sp2 = _selectedFile$name$sp.pop()) === null || _selectedFile$name$sp2 === void 0 ? void 0 : _selectedFile$name$sp2.toLowerCase();
61
60
  if (excludedExtensions.some(function (ext) {
62
61
  return selectedFile.name.endsWith(ext);
63
62
  })) {
64
63
  alert("Selected file type .".concat(fileExtension, " is not allowed."));
65
64
  e.target.value = null;
66
- } else if (!includedExtensions.some(function (ext) {
67
- return selectedFile.name.endsWith(ext);
68
- })) {
69
- alert("Selected file type .".concat(fileExtension, " is not supported."));
70
- e.target.value = null;
71
65
  } else {
72
66
  e.target.files[0] && setSelectedFile(e.target.files);
73
67
  }
@@ -81,18 +75,12 @@ var FileUploader = function FileUploader(props) {
81
75
  if (droppedFiles.length > 0) {
82
76
  var _droppedFiles$, _droppedFiles$$name, _droppedFiles$$name$s, _droppedFiles$$name$s2;
83
77
  var excludedExtensions = [".zip", ".exe", ".batch", ".webm", ".mp4", ".mp3", ".bat", ".js", ".vbs", ".html", ".scr", ".cmd", ".rar", ".svg", ".lnk"];
84
- var includedExtensions = [".xlsx", ".xls", ".csv", ".png", ".jpg", ".txt", ".pdf", ".doc", ".docx", ".ppt", ".yml", ".yaml", ".jpeg"];
85
78
  var fileExtension = (_droppedFiles$ = droppedFiles[0]) === null || _droppedFiles$ === void 0 ? void 0 : (_droppedFiles$$name = _droppedFiles$.name) === null || _droppedFiles$$name === void 0 ? void 0 : (_droppedFiles$$name$s = _droppedFiles$$name.split(".")) === null || _droppedFiles$$name$s === void 0 ? void 0 : (_droppedFiles$$name$s2 = _droppedFiles$$name$s.pop()) === null || _droppedFiles$$name$s2 === void 0 ? void 0 : _droppedFiles$$name$s2.toLowerCase();
86
79
  if (excludedExtensions !== null && excludedExtensions !== void 0 && excludedExtensions.some(function (ext) {
87
80
  var _droppedFiles$2, _droppedFiles$2$name;
88
81
  return (_droppedFiles$2 = droppedFiles[0]) === null || _droppedFiles$2 === void 0 ? void 0 : (_droppedFiles$2$name = _droppedFiles$2.name) === null || _droppedFiles$2$name === void 0 ? void 0 : _droppedFiles$2$name.endsWith(ext);
89
82
  })) {
90
83
  alert("Selected file type .".concat(fileExtension, " is not allowed."));
91
- } else if (!includedExtensions.some(function (ext) {
92
- var _droppedFiles$3, _droppedFiles$3$name;
93
- return (_droppedFiles$3 = droppedFiles[0]) === null || _droppedFiles$3 === void 0 ? void 0 : (_droppedFiles$3$name = _droppedFiles$3.name) === null || _droppedFiles$3$name === void 0 ? void 0 : _droppedFiles$3$name.endsWith(ext);
94
- })) {
95
- alert("Selected file type .".concat(fileExtension, " is not supported."));
96
84
  } else {
97
85
  setSelectedFile(droppedFiles);
98
86
  }
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
  var _reactSelect = _interopRequireWildcard(require("react-select"));
11
11
  var _material = require("@mui/material");
12
+ var _KeyboardArrowDown = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowDown"));
12
13
  var _style = require("./style");
13
14
  var _excluded = ["getStyles", "Icon", "isDisabled", "isFocused", "isSelected", "children", "innerProps", "isCheckBox"],
14
15
  _excluded2 = ["options", "value", "label", "defaultValue", "isMulti", "isDisabled", "placeholder", "className", "isRequired", "simulateNativeSelect", "onChange", "theme", "error", "helperText", "isBlueTheme", "isLoading", "isCheckBox"];
@@ -30,7 +31,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
30
31
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
31
32
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
32
33
  var DropdownIndicator = function DropdownIndicator(props) {
33
- return /*#__PURE__*/_react.default.createElement(_reactSelect.components.DropdownIndicator, props, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Icon"));
34
+ return /*#__PURE__*/_react.default.createElement(_reactSelect.components.DropdownIndicator, props, /*#__PURE__*/_react.default.createElement(_KeyboardArrowDown.default, null));
34
35
  };
35
36
  var InputOption = function InputOption(_ref) {
36
37
  var getStyles = _ref.getStyles,
@@ -75,19 +75,20 @@ var SimpleSelect = function SimpleSelect(_ref) {
75
75
  return false;
76
76
  };
77
77
  var displayedOptions = (0, _react.useMemo)(function () {
78
- var filteredOptions = options.filter(function (option) {
79
- return containsText(option.label, searchText);
78
+ var filteredOptions = options === null || options === void 0 ? void 0 : options.filter(function (option) {
79
+ return containsText(option === null || option === void 0 ? void 0 : option.label, searchText);
80
80
  });
81
81
  if (isSearch) {
82
- setNoDataAvailable(filteredOptions.length === 0);
82
+ setNoDataAvailable((filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.length) === 0);
83
83
  }
84
- var sortedOptions = filteredOptions.sort(function (a, b) {
85
- return a.label.localeCompare(b.label);
84
+ var sortedOptions = filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.sort(function (a, b) {
85
+ var _a$label;
86
+ return a === null || a === void 0 ? void 0 : (_a$label = a.label) === null || _a$label === void 0 ? void 0 : _a$label.localeCompare(b.label);
86
87
  });
87
88
  return sortedOptions.map(function (option) {
88
89
  return {
89
- label: option.label,
90
- value: option.value
90
+ label: option === null || option === void 0 ? void 0 : option.label,
91
+ value: option === null || option === void 0 ? void 0 : option.value
91
92
  };
92
93
  });
93
94
  }, [options, searchText, isSearch]);
@@ -9,6 +9,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _text = _interopRequireDefault(require("../text"));
10
10
  var _material = require("@mui/material");
11
11
  var _reactBeautifulDnd = require("react-beautiful-dnd");
12
+ var _KeyboardArrowUp = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowUp"));
13
+ var _KeyboardArrowDown = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowDown"));
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -29,9 +31,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
29
31
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
30
32
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
31
33
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
32
- // import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
33
- // import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
34
-
35
34
  var Table = function Table(_ref) {
36
35
  var rows = _ref.rows,
37
36
  columns = _ref.columns,
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
+ var _KeyboardArrowDown = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowDown"));
8
9
  var _material = require("@mui/material");
9
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
11
  var _react = _interopRequireWildcard(require("react"));
@@ -61,9 +62,8 @@ var ValuePicker = function ValuePicker(_ref) {
61
62
  };
62
63
  var atleastOneItemSelected = selectedValues && selectedValues.length > 0;
63
64
  var theme = (0, _material.useTheme)();
64
- return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_button.default
65
- // endIcon={<KeyboardArrowDownIcon />}
66
- , {
65
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_button.default, {
66
+ endIcon: /*#__PURE__*/_react.default.createElement(_KeyboardArrowDown.default, null),
67
67
  variant: buttonVariant,
68
68
  onClick: handleMenuOpen,
69
69
  color: menuExpanded || atleastOneItemSelected ? "primary" : buttonVariant === "text" ? 'primary' : "info"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tenjin-ui-kit",
3
- "version": "0.2.195",
3
+ "version": "0.2.197",
4
4
  "repository": {
5
5
  "url": "https://gitlab.com/yethi/react/tenjin-ui-kit.git"
6
6
  },