@ws-ui/shared 1.11.12-rc13 → 1.11.12-rc14

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.
Files changed (35) hide show
  1. package/dist/components/Checkbox/index.d.ts +1 -0
  2. package/dist/components/FloatingTooltip/index.d.ts +11 -0
  3. package/dist/components/Grid.d.ts +26 -0
  4. package/dist/components/Image.d.ts +5 -0
  5. package/dist/components/InvalidJsonError.d.ts +1 -0
  6. package/dist/components/Panel.d.ts +3 -2
  7. package/dist/components/index.d.ts +2 -0
  8. package/dist/declarations/datasources/interfaces/catalog.d.ts +114 -114
  9. package/dist/declarations/webform/webform.d.ts +2 -0
  10. package/dist/hooks/index.d.ts +6 -0
  11. package/dist/hooks/use-boolean.d.ts +5 -0
  12. package/dist/hooks/use-callback-ref.d.ts +1 -0
  13. package/dist/hooks/use-controllable-state.d.ts +7 -0
  14. package/dist/hooks/use-form-control-props.d.ts +15 -0
  15. package/dist/hooks/use-safe-layout-effect.d.ts +2 -0
  16. package/dist/hooks/use-update-effect.d.ts +2 -0
  17. package/dist/index.cjs.js +84 -85
  18. package/dist/index.cjs.js.map +1 -1
  19. package/dist/index.es.js +10716 -9659
  20. package/dist/index.es.js.map +1 -1
  21. package/dist/providers/index.d.ts +1 -0
  22. package/dist/providers/toast-provider.d.ts +18 -0
  23. package/dist/shared.css +1 -1
  24. package/dist/types/adapter.d.ts +12 -0
  25. package/dist/types/explorer.d.ts +5 -0
  26. package/dist/types/index.d.ts +1 -0
  27. package/dist/types/shared.d.ts +2 -0
  28. package/dist/types/webform-editor.d.ts +75 -0
  29. package/dist/types/welcome-tour.d.ts +3 -0
  30. package/dist/utils/chakra-utils.d.ts +21 -0
  31. package/dist/utils/common.d.ts +1 -0
  32. package/dist/utils/explorer.d.ts +4 -1
  33. package/dist/utils/index.d.ts +2 -0
  34. package/dist/utils/webform-editor.d.ts +91 -0
  35. package/package.json +3 -3
@@ -11,5 +11,6 @@ export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement
11
11
  isInvalid?: boolean;
12
12
  icon?: ReactElement<BaseCheckboxIconProps>;
13
13
  label?: ReactNode;
14
+ indeterminate?: boolean;
14
15
  }
15
16
  export declare function Checkbox({ isChecked: controlledIsChecked, isIndeterminate, isInvalid, icon, label, className, style, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { PropsWithChildren } from 'react';
2
+ type TooltipProps = {
3
+ message?: string | JSX.Element;
4
+ delayDuration?: number;
5
+ open?: boolean;
6
+ side?: 'top' | 'bottom' | 'left' | 'right';
7
+ sideOffset?: number;
8
+ alignOffset?: number;
9
+ };
10
+ export declare function FloatingTooltip(props: PropsWithChildren<TooltipProps>): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,26 @@
1
+ import { CSSProperties, HTMLAttributes } from 'react';
2
+ type GridValue = number | string | undefined;
3
+ export interface GridProps extends HTMLAttributes<HTMLDivElement> {
4
+ rowGap?: GridValue;
5
+ columnGap?: GridValue;
6
+ templateColumns?: string;
7
+ templateRows?: string;
8
+ height?: GridValue;
9
+ width?: GridValue;
10
+ }
11
+ export declare function Grid({ rowGap, columnGap, templateColumns, templateRows, height, width, style, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
12
+ export interface GridItemProps extends HTMLAttributes<HTMLDivElement> {
13
+ colStart?: number;
14
+ colSpan?: number;
15
+ rowStart?: number;
16
+ rowSpan?: number;
17
+ sx?: CSSProperties;
18
+ }
19
+ export declare function GridItem({ colStart, colSpan, rowStart, rowSpan, sx, style, ...props }: GridItemProps): import("react/jsx-runtime").JSX.Element;
20
+ export interface SimpleGridProps extends HTMLAttributes<HTMLDivElement> {
21
+ columns?: number;
22
+ spacingX?: GridValue;
23
+ spacingY?: GridValue;
24
+ }
25
+ export declare function SimpleGrid({ columns, spacingX, spacingY, style, ...props }: SimpleGridProps): import("react/jsx-runtime").JSX.Element;
26
+ export {};
@@ -0,0 +1,5 @@
1
+ import { ImgHTMLAttributes, ReactNode } from 'react';
2
+ export interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'children'> {
3
+ fallback?: ReactNode;
4
+ }
5
+ export declare const Image: import('react').ForwardRefExoticComponent<ImageProps & import('react').RefAttributes<HTMLImageElement>>;
@@ -5,5 +5,6 @@ export interface IInvalidJsonErrorProps {
5
5
  onClose?: () => void;
6
6
  onOpenInTextEditor?: () => void;
7
7
  onReset?: () => void;
8
+ resetButtonLabel?: string;
8
9
  }
9
10
  export declare const InvalidJsonError: FC<IInvalidJsonErrorProps>;
@@ -1,6 +1,7 @@
1
1
  import { FC, PropsWithChildren, ReactNode } from 'react';
2
- export declare const PANEL_INITIAL_HEIGHT = 30;
3
- export declare const PANEL_EXPANDED_HEIGHT = 500;
2
+ export declare const PANEL_COLLAPSED_HEIGHT = 30;
3
+ export declare const PANEL_INITIAL_OPEN_RATIO = 0.3;
4
+ export declare const PANEL_MAX_RATIO = 0.6;
4
5
  export interface ICommonPanelProps {
5
6
  headerRightSide?: ReactNode;
6
7
  }
@@ -15,3 +15,5 @@ export * from './ToolbarIcon';
15
15
  export * from './SearchInput';
16
16
  export * from './Panel';
17
17
  export * from './InvalidJsonError';
18
+ export * from './Grid';
19
+ export * from './Image';
@@ -1,114 +1,114 @@
1
- declare namespace catalog {
2
- enum EAttributeKind {
3
- STORAGE = 'storage',
4
- RELATEDENTITY = 'relatedEntity',
5
- RELATEDENTITIES = 'relatedEntities',
6
- CALCULATED = 'calculated',
7
- COMPOSITION = 'composition',
8
- ALIAS = 'alias',
9
- }
10
- type AttributeType =
11
- | 'bool'
12
- | 'word'
13
- | 'blob'
14
- | 'string'
15
- | 'text'
16
- | 'uuid'
17
- | 'short'
18
- | 'long'
19
- | 'number'
20
- | 'byte'
21
- | 'long64'
22
- | 'duration'
23
- | 'object'
24
- | 'date'
25
- | 'image';
26
- type Scope = 'public' | 'publicOnServer';
27
- type ApplyTo = 'dataClass' | 'entity' | 'entityCollection' | 'dataStore';
28
- type AttributeKind =
29
- | 'storage'
30
- | 'alias'
31
- | 'calculated'
32
- | 'relatedEntity'
33
- | 'relatedEntities';
34
-
35
- type IDataClassProperties = Partial<{
36
- panelColor: string;
37
- position: {
38
- x: number;
39
- y: number;
40
- };
41
- }>;
42
- type IAttributeProperties = Partial<{}>;
43
- interface IModelProperties
44
- extends Partial<{
45
- version: string;
46
- backgroundColor: string;
47
- backgroundImage: string;
48
- backgroundVariant: 'dotted' | 'grid' | 'none';
49
- viewport?: { zoom: number; x: number; y: number };
50
- }> {}
51
- interface IMethod {
52
- name: string;
53
- applyTo: ApplyTo;
54
- scope: Scope;
55
- from: 'remoteServer';
56
- allowedOnHTTPGET: boolean;
57
- startingLine: number;
58
- paramsText: string;
59
- filePath: string;
60
- userDefined: boolean;
61
- endingLine: number;
62
- exposed: boolean;
63
- }
64
- type IDataClass = {
65
- name: string;
66
- className: string;
67
- collectionName: string;
68
- scope: DataclassScope;
69
- attributes: IAttribute[];
70
- uuid?: string;
71
- virtual?: boolean;
72
- } & Partial<{
73
- defaultTopSize: number;
74
- leave_tag_on_delete: boolean;
75
- prevent_journaling: boolean;
76
- comment: string;
77
- extraProperties: IDataClassProperties;
78
- }>;
79
- type IEvent = {
80
- kind: string;
81
- from: string;
82
- userDefined: boolean;
83
- };
84
- export type AttributeIndexKind = 'btree' | 'cluster' | 'auto' | 'none';
85
- type IAttribute = {
86
- name: string;
87
- type: string;
88
- kind: AttributeKind;
89
- scope: Scope;
90
- uuid?: string;
91
- } & Partial<{
92
- indexKind?: AttributeIndexKind | null;
93
- invalidAlias: boolean;
94
- autogenerate: boolean;
95
- unique: boolean;
96
- primKey: boolean;
97
- exposed: boolean;
98
- behavior: string;
99
- autosequence: boolean;
100
- indexed: boolean;
101
- reversePath: boolean;
102
- keywordIndexed: boolean;
103
- not_null: boolean; // TODO: to be renamed to mandatory
104
- minValue: number;
105
- maxValue: number;
106
- simpleDate: boolean;
107
- defaultValue: any;
108
- events: any[];
109
- path: string;
110
- extraProperties: IAttributeProperties;
111
- styled_text: boolean;
112
- comment: string;
113
- }>;
114
- }
1
+ declare namespace catalog {
2
+ enum EAttributeKind {
3
+ STORAGE = 'storage',
4
+ RELATEDENTITY = 'relatedEntity',
5
+ RELATEDENTITIES = 'relatedEntities',
6
+ CALCULATED = 'calculated',
7
+ COMPOSITION = 'composition',
8
+ ALIAS = 'alias',
9
+ }
10
+ type AttributeType =
11
+ | 'bool'
12
+ | 'word'
13
+ | 'time'
14
+ | 'blob'
15
+ | 'string'
16
+ | 'text'
17
+ | 'uuid'
18
+ | 'short'
19
+ | 'long'
20
+ | 'number'
21
+ | 'byte'
22
+ | 'long64'
23
+ | 'duration'
24
+ | 'object'
25
+ | 'date'
26
+ | 'image';
27
+ type Scope = 'public' | 'publicOnServer';
28
+ type ApplyTo = 'dataClass' | 'entity' | 'entityCollection' | 'dataStore';
29
+ type AttributeKind =
30
+ | 'storage'
31
+ | 'alias'
32
+ | 'calculated'
33
+ | 'relatedEntity'
34
+ | 'relatedEntities';
35
+
36
+ type IDataClassProperties = Partial<{
37
+ panelColor: string;
38
+ position: {
39
+ x: number;
40
+ y: number;
41
+ };
42
+ }>;
43
+ type IAttributeProperties = Partial<{}>;
44
+ interface IModelProperties extends Partial<{
45
+ version: string;
46
+ backgroundColor: string;
47
+ backgroundImage: string;
48
+ backgroundVariant: 'dotted' | 'grid' | 'none';
49
+ viewport?: { zoom: number; x: number; y: number };
50
+ }> {}
51
+ interface IMethod {
52
+ name: string;
53
+ applyTo: ApplyTo;
54
+ scope: Scope;
55
+ from: 'remoteServer';
56
+ allowedOnHTTPGET: boolean;
57
+ startingLine: number;
58
+ paramsText: string;
59
+ filePath: string;
60
+ userDefined: boolean;
61
+ endingLine: number;
62
+ exposed: boolean;
63
+ }
64
+ type IDataClass = {
65
+ name: string;
66
+ className: string;
67
+ collectionName: string;
68
+ scope: DataclassScope;
69
+ attributes: IAttribute[];
70
+ uuid?: string;
71
+ virtual?: boolean;
72
+ } & Partial<{
73
+ defaultTopSize: number;
74
+ leave_tag_on_delete: boolean;
75
+ prevent_journaling: boolean;
76
+ comment: string;
77
+ extraProperties: IDataClassProperties;
78
+ }>;
79
+ type IEvent = {
80
+ kind: string;
81
+ from: string;
82
+ userDefined: boolean;
83
+ };
84
+ export type AttributeIndexKind = 'btree' | 'cluster' | 'auto' | 'none';
85
+ type IAttribute = {
86
+ name: string;
87
+ type: string;
88
+ kind: AttributeKind;
89
+ scope: Scope;
90
+ uuid?: string;
91
+ } & Partial<{
92
+ indexKind?: AttributeIndexKind | null;
93
+ invalidAlias: boolean;
94
+ autogenerate: boolean;
95
+ unique: boolean;
96
+ primKey: boolean;
97
+ exposed: boolean;
98
+ behavior: string;
99
+ autosequence: boolean;
100
+ indexed: boolean;
101
+ reversePath: boolean;
102
+ keywordIndexed: boolean;
103
+ not_null: boolean; // TODO: to be renamed to mandatory
104
+ minValue: number;
105
+ maxValue: number;
106
+ simpleDate: boolean;
107
+ defaultValue: any;
108
+ events: any[];
109
+ path: string;
110
+ extraProperties: IAttributeProperties;
111
+ styled_text: boolean;
112
+ comment: string;
113
+ }>;
114
+ }
@@ -170,6 +170,8 @@ declare namespace webforms {
170
170
  [event: string]: string[];
171
171
  };
172
172
  minutes?: number;
173
+ delayType?: 'debounce' | 'throttle';
174
+ delayTime?: number;
173
175
  };
174
176
 
175
177
  interface BaseEvent {
@@ -11,3 +11,9 @@ export * from './useDoubleClick';
11
11
  export * from './use-enhanced-state/useEnhancedState';
12
12
  export * from './use-ds-renderer';
13
13
  export * from './use-ds-change-renderer';
14
+ export * from './use-boolean';
15
+ export * from './use-callback-ref';
16
+ export * from './use-controllable-state';
17
+ export * from './use-safe-layout-effect';
18
+ export * from './use-update-effect';
19
+ export * from './use-form-control-props';
@@ -0,0 +1,5 @@
1
+ export declare function useBoolean(defaultValue?: boolean): readonly [boolean, {
2
+ on: () => void;
3
+ off: () => void;
4
+ toggle: () => void;
5
+ }];
@@ -0,0 +1 @@
1
+ export declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T;
@@ -0,0 +1,7 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ export declare function useControllableProp<T>(prop: T | undefined, state: T): readonly [boolean, T];
3
+ export declare function useControllableState<T>({ value, defaultValue, onChange, }: {
4
+ value?: T;
5
+ defaultValue: T;
6
+ onChange?: (value: T) => void;
7
+ }): readonly [T, Dispatch<SetStateAction<T>>];
@@ -0,0 +1,15 @@
1
+ type FormControlLikeProps = {
2
+ disabled?: boolean;
3
+ isDisabled?: boolean;
4
+ readOnly?: boolean;
5
+ isReadOnly?: boolean;
6
+ required?: boolean;
7
+ isRequired?: boolean;
8
+ isInvalid?: boolean;
9
+ };
10
+ export declare function useFormControlProps<T extends FormControlLikeProps>(props: T): T & {
11
+ isDisabled: boolean | undefined;
12
+ isReadOnly: boolean | undefined;
13
+ isRequired: boolean | undefined;
14
+ };
15
+ export {};
@@ -0,0 +1,2 @@
1
+ import { useEffect } from 'react';
2
+ export declare const useSafeLayoutEffect: typeof useEffect;
@@ -0,0 +1,2 @@
1
+ import { DependencyList, EffectCallback } from 'react';
2
+ export declare function useUpdateEffect(effect: EffectCallback, deps: DependencyList): void;