synos-helena 21.11.1-beta.0 → 21.12.0-beta.0

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/lib/index.d.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  // ../antd/lib/card
7
7
  // ../react
8
8
  // ../antd/lib/checkbox
9
+ // ../react-syntax-highlighter
9
10
  // ../antd/lib/collapse
10
11
  // util/constants
11
12
  // HLInput
@@ -23,6 +24,7 @@
23
24
  // HLModulesMenu
24
25
  // HLNotification
25
26
  // HLUserBox
27
+ // ../react-markdown/lib/react-markdown
26
28
  // ../react-router-dom
27
29
  // ../antd/lib/page-header
28
30
  // HLContext
@@ -39,8 +41,10 @@ import { Card } from 'antd';
39
41
  import { CardTabListType } from 'antd/lib/card';
40
42
  import { CSSProperties } from 'react';
41
43
  import { CheckboxChangeEvent } from 'antd/lib/checkbox';
44
+ import { SyntaxHighlighterProps } from 'react-syntax-highlighter';
42
45
  import { CollapseProps } from 'antd/lib/collapse';
43
46
  import { CollapsePanelProps } from 'antd/lib/collapse';
47
+ import React from 'react';
44
48
  import { DATE_TIME, DATE } from 'src/util/constants';
45
49
  import { HLInputPropTypes } from 'src/HLInput';
46
50
  import { SizeType } from 'antd/lib/config-provider/SizeContext';
@@ -52,7 +56,7 @@ import { DescriptionsProps } from 'antd/lib/descriptions';
52
56
  import { DividerProps } from 'antd/lib/divider';
53
57
  import { DrawerProps } from 'antd/lib/drawer';
54
58
  import { DropDownProps } from 'antd/lib/dropdown';
55
- import { TableProps } from "antd";
59
+ import { TableProps } from 'antd';
56
60
  import { Form } from 'antd';
57
61
  import { ReactNode } from 'react';
58
62
  import { HLHeaderButtonPropTypes } from 'src/HLHeaderButton';
@@ -62,6 +66,7 @@ import { HLModulesMenuPropTypes } from 'src/HLModulesMenu';
62
66
  import { HLNotificationPropTypes } from 'src/HLNotification';
63
67
  import { HLUserBoxPropTypes } from 'src/HLUserBox';
64
68
  import { Input } from 'antd';
69
+ import { ReactMarkdownOptions } from 'react-markdown/lib/react-markdown';
65
70
  import { Link } from 'react-router-dom';
66
71
  import { BreadcrumbProps } from 'antd';
67
72
  import { PageHeaderProps } from 'antd/lib/page-header';
@@ -78,11 +83,27 @@ export type HLAlertPropTypes = AlertProps;
78
83
 
79
84
  export const HLAlert: React.FC<HLAlertPropTypes>;
80
85
 
86
+ export type HLArticleSection = {
87
+ key: string;
88
+ title: string;
89
+ content: ReactNode;
90
+ subsections?: HLArticleSection[];
91
+ };
92
+
93
+ export type HLArticlePropTypes = {
94
+ href: string;
95
+ title?: string;
96
+ sections: HLArticleSection[];
97
+ };
98
+
99
+ export const HLArticle: React.FC<HLArticlePropTypes>;
100
+
81
101
 
82
102
  export type HLButtonPropTypes = ButtonProps & {
83
103
  premium?: boolean;
84
104
  tooltip?: string;
85
105
  borderless?: boolean;
106
+ 'data-cy'?: string;
86
107
  };
87
108
 
88
109
  export const HLButton: React.FC<HLButtonPropTypes>;
@@ -126,6 +147,13 @@ export interface HLCheckboxPropTypes {
126
147
  export const HLCheckbox: React.FC<HLCheckboxPropTypes>;
127
148
 
128
149
 
150
+ export type HLCodePropTypes = SyntaxHighlighterProps & {
151
+ copyToClipboard?: boolean;
152
+ };
153
+
154
+ export const HLCode: React.FC<HLCodePropTypes>;
155
+
156
+
129
157
  export type HLCollapsePropTypes = CollapseProps;
130
158
 
131
159
  export const HLCollapse: React.FC<HLCollapsePropTypes> & { Panel: typeof Panel };
@@ -140,6 +168,7 @@ export interface HLCollapseInfoPanelPropTypes {
140
168
  object: any;
141
169
  title: string;
142
170
  columns?: number;
171
+ isOpen?: boolean;
143
172
  }
144
173
 
145
174
 
@@ -167,7 +196,7 @@ export interface HLContextPropTypes {
167
196
  serie?: Record<string, any>;
168
197
  series?: any[];
169
198
  format?: string;
170
- onApply?: Function;
199
+ onApply?: (estabelecimento: any, format: 'YYYY-MM-DDTHH:mm:ss' | 'YYYY-MM-DD' | null, serie: any) => any | undefined;
171
200
  periodo?: number;
172
201
  width?: any;
173
202
  useISOFormat: 'YYYY-MM-DDTHH:mm:ss' | 'YYYY-MM-DD';
@@ -191,15 +220,15 @@ export type DatePickerProps = {
191
220
  } & PickerProps<Dayjs | Moment>;
192
221
 
193
222
  export type HLDatePickerPropTypes = DatePickerProps & {
194
- disableDateAfterThan?: Object;
195
- disableDateBeforeThan?: Object;
223
+ disableDateAfterThan?: Record<string, unknown>;
224
+ disableDateBeforeThan?: Record<string, unknown>;
196
225
  disableDateRange?: any[];
197
226
  disabled?: boolean;
198
227
  form?: any;
199
228
  initialValue?: any;
200
229
  domainAttribute: string;
201
230
  label?: string;
202
- onChange?: Function;
231
+ onChange?: (date: moment, dateString: string) => void;
203
232
  placeholder?: string;
204
233
  rules?: any[];
205
234
  size?: SizeType;
@@ -223,7 +252,7 @@ export type HLMonthPickerProps = DatePickerProps & {
223
252
  domainAttribute: string;
224
253
  form?: Record<string, any>;
225
254
  label?: string;
226
- onChange?: Function;
255
+ onChange?: (value: Dayjs | moment.Moment | null, dateString: string) => void;
227
256
  rules?: any[];
228
257
  key?: any;
229
258
  format?: string;
@@ -241,7 +270,7 @@ export type HLRangePickerProps = RangeDatePickerProps & {
241
270
  domainAttribute: string;
242
271
  form?: any;
243
272
  label?: string;
244
- onChange?: Function;
273
+ onChange?: (value: Dayjs | moment.Moment | null, dateString: string) => void;
245
274
  rules?: any[];
246
275
  key?: any;
247
276
  format?: string;
@@ -276,13 +305,14 @@ export type HLDropdownPropTypes = DropDownProps & {
276
305
 
277
306
  export const HLDropdown: React.FC<HLDropdownPropTypes>;
278
307
 
308
+
279
309
  interface Menu {
280
310
  divider?: boolean;
281
311
  label?: string;
282
312
  link?: string;
283
313
  disabled?: boolean;
284
314
  query?: string;
285
- onClick?: Function;
315
+ onClick?: React.MouseEvent<HTMLElement>;
286
316
  }
287
317
  export interface HLDropdownButtonPropTypes {
288
318
  menus: Menu[];
@@ -297,7 +327,7 @@ export const HLDropdownButton: React.FC<HLDropdownButtonPropTypes>;
297
327
 
298
328
  export type HLEditTablePropTypes = TableProps & {
299
329
  handleSave: (row: any) => void;
300
- }
330
+ };
301
331
  export const HLEditTable: React.FC<HLEditTablePropTypes>;
302
332
 
303
333
  export interface Page500PropTypes {
@@ -330,13 +360,13 @@ export type HLFromToPanelTypes<P> = {
330
360
  };
331
361
  table?: {
332
362
  loading?: boolean;
333
- columns: object[];
334
- dataSource: object[];
335
- loadMore?: object;
363
+ columns: Record<string, unknown>;
364
+ dataSource: Record<string, unknown>[];
365
+ loadMore?: Record<string, unknown>;
336
366
  onSelect?: (selectedRows?: P | P[]) => void;
337
367
  };
338
368
  powerSearch?: {
339
- columns: object[];
369
+ columns: Record<string, unknown>;
340
370
  onSubmit: (params) => void;
341
371
  };
342
372
  custom?: {
@@ -350,7 +380,7 @@ export type HLFromToPanelTypes<P> = {
350
380
  export interface HLHeaderPropTypes {
351
381
  children: ReactNode;
352
382
  collapsed: boolean;
353
- collapsedClick: Function;
383
+ collapsedClick: () => unknown;
354
384
  headerSearch?: HLHeaderSearchPropTypes;
355
385
  moduleName: string;
356
386
  modulesMenu?: HLModulesMenuPropTypes;
@@ -372,7 +402,7 @@ export interface HLHeaderButtonPropTypes {
372
402
  export const HLHeaderButton: React.FC<HLHeaderButtonPropTypes>;
373
403
 
374
404
  export interface HLHeaderSearchPropTypes {
375
- onSubmit: Function;
405
+ onSubmit: (unknown) => unknown;
376
406
  }
377
407
 
378
408
  export const HLHeaderSearch: React.FC<HLHeaderSearchPropTypes>;
@@ -383,6 +413,7 @@ export interface HLInputPropTypes {
383
413
  label?: string;
384
414
  disabled?: boolean;
385
415
  domainAttribute: string;
416
+ 'data-cy'?: string;
386
417
  form?: Record<string, any>;
387
418
  initialValue?: string | number;
388
419
  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
@@ -392,8 +423,12 @@ export interface HLInputPropTypes {
392
423
  maxLength?: number;
393
424
  onPressEnter?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
394
425
  ref?: ((instance: Input | null) => void) | React.RefObject<Input> | null;
395
- onValueFromEvent?: Function;
426
+ onValueFromEvent?: (unknown) => unknown;
396
427
  style?: React.CSSProperties;
428
+ autoComplete?: string;
429
+ readOnly?: boolean;
430
+ onFocus?: (unknown) => unknown | undefined;
431
+ onBlur?: (unknown) => unknown | undefined;
397
432
  }
398
433
 
399
434
  interface HLInputChildren {
@@ -441,6 +476,11 @@ export interface HLMainPropTypes {
441
476
 
442
477
  export const HLMain: React.FC<HLMainPropTypes>;
443
478
 
479
+
480
+ export type HLMarkdownPropTypes = ReactMarkdownOptions;
481
+
482
+ export const HLMarkdown: React.FC<HLMarkdownPropTypes>;
483
+
444
484
  interface Module {
445
485
  title: string;
446
486
  description?: string;
@@ -455,33 +495,19 @@ export interface HLModulesMenuPropTypes {
455
495
  export const HLModulesMenu: React.FC<HLModulesMenuPropTypes>;
456
496
 
457
497
 
458
- interface DateObject {
459
- chronology: any;
460
- dayOfMonth: number;
461
- dayOfWeek: string;
462
- dayOfYear: number;
463
- hour: number;
464
- minute: number;
465
- month: string;
466
- monthValue: number;
467
- nano: number;
468
- second: number;
469
- year: number;
470
- }
471
-
472
498
  interface Notification {
473
499
  title: string;
474
500
  description: string;
475
501
  type: string;
476
- date: DateObject;
502
+ date: number;
477
503
  isVisualized: boolean;
478
504
  link?: string;
479
- onClick?: Function;
505
+ onClick?: React.MouseEvent<HTMLElement>;
480
506
  }
481
507
 
482
508
  export interface HLNotificationPropTypes {
483
509
  buttonLabel?: string;
484
- onClearNotification?: Function;
510
+ onClearNotification?: () => any;
485
511
  title?: string;
486
512
  placement?:
487
513
  | 'bottom'
@@ -498,7 +524,6 @@ export interface HLNotificationPropTypes {
498
524
  | 'rightBottom';
499
525
  Link?: Link;
500
526
  notifications?: Notification[];
501
- markAsReadCallback: (notification: Record<string, string>) => void;
502
527
  fetchNewNotifications: () => void;
503
528
  showFormat: string;
504
529
  refreshInterval: number;
@@ -507,33 +532,19 @@ export interface HLNotificationPropTypes {
507
532
  export const HLNotification: React.FC<HLNotificationPropTypes>;
508
533
 
509
534
 
510
- interface DateObject {
511
- chronology: any;
512
- dayOfMonth: number;
513
- dayOfWeek: string;
514
- dayOfYear: number;
515
- hour: number;
516
- minute: number;
517
- month: string;
518
- monthValue: number;
519
- nano: number;
520
- second: number;
521
- year: number;
522
- }
523
-
524
535
  interface Notification {
525
536
  title: string;
526
537
  description: string;
527
538
  type: string;
528
- date: DateObject;
539
+ date: number;
529
540
  isVisualized: boolean;
530
541
  link?: string;
531
- onClick?: Function;
542
+ onClick?: React.MouseEvent<HTMLElement>;
532
543
  }
533
544
 
534
545
  export interface NotificationListPropTypes {
535
546
  Link?: Link;
536
- onClickNotification: (notification: Record<string, string>) => void;
547
+ onClickNotification?: (unknown) => any;
537
548
  notifications?: Notification[];
538
549
  useDayjs?: boolean;
539
550
  }
@@ -544,7 +555,7 @@ export const NotificationList: React.FC<NotificationListPropTypes>;
544
555
  interface Context {
545
556
  label: string;
546
557
  value?: any;
547
- render?: Function;
558
+ render?: (unknown) => unknown;
548
559
  }
549
560
 
550
561
  interface ContextInfo {
@@ -630,11 +641,11 @@ export interface HLSideMenuPropTypes {
630
641
  collapsed: boolean;
631
642
  location: any;
632
643
  subMenus: any[];
633
- changeOpenKeys: Function;
634
- onOpenChange: Function;
635
- generateLink: Function;
636
- allowsAccessByUrl: Function;
637
- changeCollapsedState: Function;
644
+ changeOpenKeys: (unknown) => unknown;
645
+ onOpenChange: (unknown) => unknown;
646
+ generateLink: (unknown, unknown, unknown, unknown) => any;
647
+ allowsAccessByResourceId: (unknown) => unknown;
648
+ changeCollapsedState: (unknown) => unknown;
638
649
  openKeys: any[];
639
650
  baseboardLogoPath?: string;
640
651
  baseboardText?: string;
@@ -704,7 +715,7 @@ interface User {
704
715
  export interface HLUserBoxPropTypes {
705
716
  options?: any[];
706
717
  user?: User;
707
- logout?: Function;
718
+ logout?: (unknown) => unknown;
708
719
  tenant?: string;
709
720
  moduleInfo?: ModuleInfo;
710
721
  sysStatus?: any;
@@ -751,8 +762,10 @@ export {
751
762
  HLAdvancedPowerSelect,
752
763
  AdvancedPowerSelectStoreInterface,
753
764
  HLFromTo,
754
- HLMarkDown,
765
+ HLMarkdown,
755
766
  HLEditTable,
767
+ HLArticle,
768
+ HLCode,
756
769
  };
757
770
 
758
771
  declare module '*.module.css';
@@ -769,6 +782,7 @@ export interface HLInputPropTypes {
769
782
  label?: string;
770
783
  disabled?: boolean;
771
784
  domainAttribute: string;
785
+ 'data-cy'?: string;
772
786
  form?: Record<string, any>;
773
787
  initialValue?: string | number;
774
788
  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
@@ -778,8 +792,12 @@ export interface HLInputPropTypes {
778
792
  maxLength?: number;
779
793
  onPressEnter?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
780
794
  ref?: ((instance: Input | null) => void) | React.RefObject<Input> | null;
781
- onValueFromEvent?: Function;
795
+ onValueFromEvent?: (unknown) => unknown;
782
796
  style?: React.CSSProperties;
797
+ autoComplete?: string;
798
+ readOnly?: boolean;
799
+ onFocus?: (unknown) => unknown | undefined;
800
+ onBlur?: (unknown) => unknown | undefined;
783
801
  }
784
802
 
785
803
  interface HLInputChildren {