aha-components 1.7.11 → 1.7.12

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.
@@ -1,4 +1,11 @@
1
1
  import React from 'react';
2
+ interface LinkifyOptions {
3
+ validate?: (url: string) => boolean;
4
+ className?: string;
5
+ needProtocol?: boolean;
6
+ needHost?: boolean;
7
+ allowedTlds?: string[];
8
+ }
2
9
  export interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
3
10
  /** 是否禁用 */
4
11
  disabled?: boolean;
@@ -33,6 +40,11 @@ export interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTex
33
40
  onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
34
41
  /** 失焦回调 */
35
42
  onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
43
+ /** 是否启用实时链接识别 */
44
+ linkify?: boolean;
45
+ /** 链接识别配置 */
46
+ linkifyOptions?: LinkifyOptions;
36
47
  }
48
+ export declare const websiteValidator: (url: string, needProtocol?: boolean, needHost?: boolean, allowedTlds?: string[]) => boolean;
37
49
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
38
50
  export default Textarea;
package/dist/index.d.ts CHANGED
@@ -410,6 +410,13 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
410
410
  }
411
411
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
412
412
 
413
+ interface LinkifyOptions {
414
+ validate?: (url: string) => boolean;
415
+ className?: string;
416
+ needProtocol?: boolean;
417
+ needHost?: boolean;
418
+ allowedTlds?: string[];
419
+ }
413
420
  interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
414
421
  /** 是否禁用 */
415
422
  disabled?: boolean;
@@ -444,6 +451,10 @@ interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaEl
444
451
  onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
445
452
  /** 失焦回调 */
446
453
  onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
454
+ /** 是否启用实时链接识别 */
455
+ linkify?: boolean;
456
+ /** 链接识别配置 */
457
+ linkifyOptions?: LinkifyOptions;
447
458
  }
448
459
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
449
460