@xaypay/tui 0.0.112 → 0.0.113

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.
@@ -3,6 +3,8 @@ import React from 'react'
3
3
 
4
4
  import { SingleCheckbox } from './../singleCheckbox'
5
5
 
6
+ import { hasOwnerProperty } from './../../utils'
7
+
6
8
  import styles from './table.module.css'
7
9
 
8
10
  const TH = ({
@@ -17,6 +19,12 @@ const TH = ({
17
19
  handleHeaderItemClick,
18
20
  handleCheckArrowActionHeader,
19
21
  }) => {
22
+ const handleCheckArrowAction = (e, object, property) => {
23
+ if (hasOwnerProperty(object, property)) {
24
+ handleCheckArrowActionHeader(e, object)
25
+ }
26
+ }
27
+
20
28
  return (
21
29
  <th
22
30
  style={{
@@ -38,10 +46,10 @@ const TH = ({
38
46
  style={{
39
47
  display: 'flex',
40
48
  alignItems: 'flex-start',
41
- justifyContent: Object.prototype.hasOwnProperty.call(item, 'checkBox') ? 'space-between' : 'center',
49
+ justifyContent: hasOwnerProperty(item, 'checkBox') ? 'space-between' : 'center',
42
50
  }}
43
51
  >
44
- {item.hasOwnProperty('checkBox') ? (
52
+ {hasOwnerProperty(item, 'checkBox') ? (
45
53
  <SingleCheckbox
46
54
  data={item}
47
55
  float="left"
@@ -58,15 +66,11 @@ const TH = ({
58
66
  style={{
59
67
  margin: '0px',
60
68
  }}
61
- onClick={
62
- Object.prototype.hasOwnProperty.call(item, 'arrowComponent')
63
- ? (e) => handleCheckArrowActionHeader(e, item)
64
- : (_) => _
65
- }
69
+ onClick={(e) => handleCheckArrowAction(e, item, 'arrowComponent')}
66
70
  >
67
71
  {item.type === 'show'
68
72
  ? item.content
69
- : Object.prototype.hasOwnProperty.call(item, 'arrowComponent')
73
+ : hasOwnerProperty(item, 'arrowComponent')
70
74
  ? item.status === 'close'
71
75
  ? item.closeArrow
72
76
  : item.openArrow
@@ -70,16 +70,10 @@ export const Textarea = ({
70
70
  if (maxLength) {
71
71
  if (value.length > maxLength) {
72
72
  onChange(value.substr(0, maxLength))
73
- setError('Նիշերի քանակը գերազանցում է')
74
- } else {
75
- setError('')
76
73
  }
77
74
  } else {
78
75
  if (value.length > configStyles.TEXTAREA.maxLength) {
79
- setError('Նիշերի քանակը գերազանցում է')
80
76
  onChange(value.substr(0, configStyles.TEXTAREA.maxLength))
81
- } else {
82
- setError('')
83
77
  }
84
78
  }
85
79
  }
@@ -116,7 +116,7 @@ Typography.propTypes = {
116
116
  textDecoration: PropTypes.string,
117
117
  backgroundColor: PropTypes.string,
118
118
  variant: PropTypes.oneOf(Object.values(TypographyType)),
119
- size: PropTypes.oneOf([PropTypes.string, PropTypes.number]),
119
+ size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
120
120
  }
121
121
 
122
122
  Typography.defaultProps = {
@@ -23,3 +23,7 @@ export const compereConfigs = () => {
23
23
 
24
24
  return _.merge(packageConfig, projectConfig)
25
25
  }
26
+
27
+ export const hasOwnerProperty = (object, property) => {
28
+ return Object.prototype.hasOwnProperty.call(object, property)
29
+ }