@scbt-ecom/ui 0.125.0 → 0.127.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/dist/lib/exports/ui.js +1 -1
- package/dist/lib/exports/utils.js +1 -1
- package/dist/lib/shared/ui/confirmable/Confirmable.js +2 -0
- package/dist/lib/shared/ui/confirmable/Confirmable.js.map +1 -0
- package/dist/lib/shared/ui/confirmable/index.js +2 -0
- package/dist/lib/shared/ui/confirmable/index.js.map +1 -0
- package/dist/lib/shared/ui/index.js +1 -1
- package/dist/lib/shared/utils/index.js +1 -1
- package/dist/lib/shared/utils/variableHolder/index.js +2 -0
- package/dist/lib/shared/utils/variableHolder/index.js.map +1 -0
- package/dist/lib/shared/utils/variableHolder/variableContextHolder.js +2 -0
- package/dist/lib/shared/utils/variableHolder/variableContextHolder.js.map +1 -0
- package/dist/node_modules/prosemirror-view/dist/index.js +4 -4
- package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/types/lib/shared/ui/confirmable/Confirmable.d.ts +7 -0
- package/dist/types/lib/shared/ui/confirmable/index.d.ts +1 -0
- package/dist/types/lib/shared/ui/index.d.ts +1 -0
- package/dist/types/lib/shared/utils/index.d.ts +1 -0
- package/dist/types/lib/shared/utils/variableHolder/index.d.ts +1 -0
- package/dist/types/lib/shared/utils/variableHolder/variableContextHolder.d.ts +49 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PopoverProps } from '../popover';
|
|
2
|
+
export interface ConfirmableProps extends Omit<PopoverProps, 'triggerElement'> {
|
|
3
|
+
children: React.ReactElement;
|
|
4
|
+
approve?: React.ReactElement;
|
|
5
|
+
reject?: React.ReactElement;
|
|
6
|
+
}
|
|
7
|
+
export declare const Confirmable: ({ children, approve, reject, ...props }: ConfirmableProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Confirmable, type ConfirmableProps } from './Confirmable';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { VariableContextHolder, type VariableEntry, type IVariableContextHolder, type Variable } from './variableContextHolder';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface Variable<Key = string, Value = string> {
|
|
2
|
+
_id: string;
|
|
3
|
+
key: Key;
|
|
4
|
+
value: Value;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
export type VariableEntry<Key = string, Value = string> = [Key, Value];
|
|
10
|
+
export interface IVariableContextHolder<Key, Value> {
|
|
11
|
+
variables: Variable<Key, Value>[];
|
|
12
|
+
append: (variable: Variable<Key, Value>) => void;
|
|
13
|
+
remove: (key: Key) => void;
|
|
14
|
+
has: (key: Key) => boolean;
|
|
15
|
+
replace: (variables: Variable<Key, Value>[]) => void;
|
|
16
|
+
clear: () => void;
|
|
17
|
+
update: (id: string, variable: Variable<Key, Value>) => void;
|
|
18
|
+
entriesOf: (...keys: Key[]) => VariableEntry<Key, Value>[];
|
|
19
|
+
observe: (listener: (variables: Variable<Key, Value>[]) => void) => () => void;
|
|
20
|
+
get: (key: Key) => Variable<Key, Value> | undefined;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Класс для управления переменными
|
|
24
|
+
*/
|
|
25
|
+
export declare class VariableContextHolder<Key extends string = string, Value = string> implements IVariableContextHolder<Key, Value> {
|
|
26
|
+
private _store;
|
|
27
|
+
private _variables;
|
|
28
|
+
private _listeners;
|
|
29
|
+
private _nextListenerId;
|
|
30
|
+
private static _VARIABLE_REGEX;
|
|
31
|
+
private static _VARIABLE_PATTERN;
|
|
32
|
+
private static _instance;
|
|
33
|
+
private constructor();
|
|
34
|
+
static unwrap(variable: string): string;
|
|
35
|
+
static wrap(variable: string): string;
|
|
36
|
+
static match(pattern: string): string[] | null;
|
|
37
|
+
static getInstance(store: string): VariableContextHolder;
|
|
38
|
+
get variables(): Variable<Key, Value>[];
|
|
39
|
+
private collect;
|
|
40
|
+
get: (id: string) => Variable<Key, Value> | undefined;
|
|
41
|
+
append: (variable: Variable<Key, Value>) => void;
|
|
42
|
+
clear: () => void;
|
|
43
|
+
entriesOf: (...keys: Key[]) => VariableEntry<Key, Value>[];
|
|
44
|
+
remove: (key: Key) => void;
|
|
45
|
+
replace: (variables: Variable<Key, Value>[]) => Variable<Key, Value>[];
|
|
46
|
+
update: (id: string, variable: Variable<Key, Value>) => Variable<Key, Value>[];
|
|
47
|
+
observe: (listener: (variables: Variable<Key, Value>[]) => void) => (() => void);
|
|
48
|
+
has(key: Key): boolean;
|
|
49
|
+
}
|