Skip to content

Commit 072108c

Browse files
authored
chore(modifiers): set private and protected (#1018) (#1058)
1 parent 564c79b commit 072108c

File tree

53 files changed

+139
-138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+139
-138
lines changed

src/amount/amount.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export type AmountProps = {
8989
*/
9090
@performance(true)
9191
export class Amount extends React.Component<AmountProps> {
92-
cn = createCn('amount');
92+
protected cn = createCn('amount');
9393

9494
static defaultProps: Partial<AmountProps> = {
9595
size: 'm',

src/attach/attach.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export type AttachProps = {
180180
* Компонент прикрепления файлов.
181181
*/
182182
export class Attach extends React.PureComponent<AttachProps> {
183-
cn = createCn('attach');
183+
protected cn = createCn('attach');
184184

185185
static defaultProps: Partial<AttachProps> = {
186186
buttonContent: 'Выберите файл',
@@ -197,8 +197,8 @@ export class Attach extends React.PureComponent<AttachProps> {
197197
value: []
198198
};
199199

200+
// TODO [issues/1018] переписать тесты нужно, что бы private был
200201
input: HTMLInputElement;
201-
202202
root: HTMLSpanElement;
203203

204204
// eslint-disable-next-line camelcase

src/button/button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export type ButtonProps = {
180180
* Компонент кнопки (да, она нажимается!).
181181
*/
182182
export class Button extends React.PureComponent<ButtonProps> {
183-
cn = createCn('button');
183+
protected cn = createCn('button');
184184

185185
static defaultProps: Partial<ButtonProps> = {
186186
type: 'button',
@@ -195,7 +195,7 @@ export class Button extends React.PureComponent<ButtonProps> {
195195
pressed: false
196196
};
197197

198-
control: HTMLButtonElement | HTMLSpanElement;
198+
private control: HTMLButtonElement | HTMLSpanElement;
199199

200200
// eslint-disable-next-line camelcase
201201
UNSAFE_componentWillReceiveProps(nextProps) {

src/calendar-input/calendar-input.tsx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export type CalendarInputProps = {
222222
*/
223223
@performance(true)
224224
export class CalendarInput extends React.Component<CalendarInputProps> {
225-
cn = createCn('calendar-input');
225+
protected cn = createCn('calendar-input');
226226

227227
static defaultProps: Partial<CalendarInputProps> = {
228228
withIcon: true,
@@ -245,35 +245,27 @@ export class CalendarInput extends React.Component<CalendarInputProps> {
245245
)
246246
};
247247

248-
/**
249-
* @type {Number}
250-
*/
251-
timeoutId;
248+
private timeoutId;
252249

253-
/**
254-
* @type {Number}
255-
*/
256-
changeCloseTimeoutId;
250+
private changeCloseTimeoutId;
257251

258252
/**
259253
* @type {Calendar}
260254
*/
261-
calendar;
255+
private calendar;
262256

263257
/**
264258
* @type {Popup}
265259
*/
266-
calendarPopup;
260+
private calendarPopup;
267261

268262
/**
269263
* @type {Input}
270264
*/
265+
// TODO [issues/1018] переписать тесты нужно, что бы private был
271266
customCalendarTarget;
272267

273-
/**
274-
* @type {HTMLInputElement}
275-
*/
276-
nativeCalendarTarget;
268+
private nativeCalendarTarget;
277269

278270
componentDidMount() {
279271
if (this.calendarPopup) {

src/calendar/calendar.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ type CalendarState = {
171171
*/
172172
@performance(true)
173173
export class Calendar extends React.Component<CalendarProps, CalendarState> {
174-
cn = createCn('calendar');
174+
protected cn = createCn('calendar');
175175

176176
static defaultProps: Partial<CalendarProps> = {
177177
selectedFrom: null,
@@ -191,21 +191,21 @@ export class Calendar extends React.Component<CalendarProps, CalendarState> {
191191
month: startOfMonth(new Date())
192192
};
193193

194-
root: HTMLDivElement;
194+
private root: HTMLDivElement;
195195

196-
blurTimeoutId: number = null;
196+
private blurTimeoutId: number = null;
197197

198-
years = [];
198+
private years = [];
199199

200-
earlierLimit: Date;
200+
private earlierLimit: Date;
201201

202-
laterLimit: Date;
202+
private laterLimit: Date;
203203

204-
value: Date;
204+
private value: Date;
205205

206-
selectedTo: Date;
206+
private selectedTo: Date;
207207

208-
selectedFrom: Date;
208+
private selectedFrom: Date;
209209

210210
// eslint-disable-next-line camelcase
211211
UNSAFE_componentWillMount() {

src/card-input/card-input.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type CardInputProps = InputProps & {
1717
* Поле ввода номера карты с маской.
1818
*/
1919
export class CardInput extends React.PureComponent<CardInputProps> {
20-
cn = createCn('card-input');
20+
protected cn = createCn('card-input');
2121

2222
static defaultProps: Partial<CardInputProps> = {
2323
placeholder: '0000 0000 0000 0000 00'
@@ -26,6 +26,7 @@ export class CardInput extends React.PureComponent<CardInputProps> {
2626
/**
2727
* @type {Input}
2828
*/
29+
// TODO [issues/1018] переписать тесты нужно, что бы private был
2930
root;
3031

3132
render() {

src/checkbox-group/checkbox-group.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export type CheckBoxGroupProps = ({
9292
* Компонент группы чекбоксов.
9393
*/
9494
export class CheckBoxGroup extends React.PureComponent<CheckBoxGroupProps> {
95-
cn = createCn('checkbox-group');
95+
protected cn = createCn('checkbox-group');
9696

9797
static defaultProps: Partial<CheckBoxGroupProps> = {
9898
type: 'normal'
@@ -102,6 +102,7 @@ export class CheckBoxGroup extends React.PureComponent<CheckBoxGroupProps> {
102102
value: []
103103
};
104104

105+
// TODO [issues/1018] переписать тесты нужно, что бы private был
105106
checkboxes: any[];
106107

107108
render() {

src/checkbox/checkbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export type CheckboxProps = ({
126126
* Компонент чекбокса.
127127
*/
128128
export class CheckBox extends React.PureComponent<CheckboxProps> {
129-
cn = createCn('checkbox');
129+
protected cn = createCn('checkbox');
130130

131131
static defaultProps: Partial<CheckboxProps> = {
132132
type: 'normal',
@@ -139,7 +139,7 @@ export class CheckBox extends React.PureComponent<CheckboxProps> {
139139
checked: false
140140
};
141141

142-
root;
142+
private root;
143143

144144
render() {
145145
const checked = this.props.checked === undefined ? this.state.checked : this.props.checked;

src/collapse/collapse.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export type CollapseProps = {
6262
* Компонент «подката» позволяет спрятать кусок текста за ссылку «Еще...».
6363
*/
6464
export class Collapse extends React.PureComponent<CollapseProps> {
65-
cn = createCn('collapse');
65+
protected cn = createCn('collapse');
6666

6767
static defaultProps: Partial<CollapseProps> = {
6868
expandedLabel: 'Collapse',
@@ -73,6 +73,7 @@ export class Collapse extends React.PureComponent<CollapseProps> {
7373
isExpanded: false
7474
};
7575

76+
// TODO [issues/1018] переписать тесты нужно, что бы private был
7677
content;
7778
contentCase;
7879

src/dropdown/dropdown.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export type DropdownProps = {
119119
* Компонент «выпадашка»: ссылка или кнопка. По клику показывается Popup.
120120
*/
121121
export class Dropdown extends React.PureComponent<DropdownProps> {
122-
cn = createCn('dropdown');
122+
protected cn = createCn('dropdown');
123123

124124
static defaultProps: Partial<DropdownProps> = {
125125
switcherType: 'link',
@@ -137,8 +137,8 @@ export class Dropdown extends React.PureComponent<DropdownProps> {
137137
popupHovered: false
138138
};
139139

140-
popup;
141-
switcher;
140+
private popup;
141+
private switcher;
142142

143143
componentDidMount() {
144144
this.popup.setTarget(this.switcher.getNode());

0 commit comments

Comments
 (0)