builder-settings-types 0.0.462 → 0.0.464
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/base/additional-settings/additonalSettings.d.ts +42 -0
- package/dist/base/additional-settings/repeatingSetting.d.ts +61 -0
- package/dist/base/drawable.d.ts +11 -0
- package/dist/base/pendingSettingsGroup.d.ts +0 -2
- package/dist/base/settings-group/settingsGroup.d.ts +30 -3
- package/dist/base/settings.d.ts +20 -2
- package/dist/builder-settings-types.cjs.js +218 -201
- package/dist/builder-settings-types.es.js +11727 -10618
- package/dist/components/actions/action.d.ts +8 -0
- package/dist/components/actions/actionFactory.d.ts +6 -0
- package/dist/components/actions/actionWrapper.d.ts +6 -0
- package/dist/components/actions/actionsCollection.d.ts +25 -0
- package/dist/components/button/button.d.ts +13 -0
- package/dist/components/draggable/draggable.d.ts +20 -0
- package/dist/components/popup/popup.d.ts +51 -0
- package/dist/components/select/select.d.ts +50 -0
- package/dist/groups/borderSettingsSet.d.ts +2 -0
- package/dist/groups/effectSettingsSet.d.ts +31 -0
- package/dist/groups/shadowSettingsSet.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/settings/axis-settings/axisSettings.d.ts +5 -16
- package/dist/settings/color-settings/colorSettings.d.ts +25 -1
- package/dist/settings/gradient-settings/GradientSetting.d.ts +0 -1
- package/dist/settings/gradient-settings/components/GlobalColorsDisplay.d.ts +23 -0
- package/dist/settings/gradient-settings/utils/types.d.ts +3 -0
- package/dist/settings/multi-settings/multiSettings.d.ts +8 -14
- package/dist/settings/number-settings/numberSettings.d.ts +1 -0
- package/dist/settings/select-api/select-api.d.ts +3 -0
- package/dist/settings/select-settings/selectSettings.d.ts +3 -23
- package/dist/types/index.d.ts +2 -11
- package/dist/utils/calculatePopupPosition.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SettingsMap } from '../../types';
|
|
2
|
+
import { IDrawable } from '../drawable';
|
|
3
|
+
export type AdditionalSettingsProps<TSettings extends SettingsMap> = {
|
|
4
|
+
title: string;
|
|
5
|
+
settings: TSettings;
|
|
6
|
+
};
|
|
7
|
+
export declare class AdditionalSettings<TSettings extends SettingsMap> implements IDrawable {
|
|
8
|
+
title: string;
|
|
9
|
+
private settings;
|
|
10
|
+
private selectedKeys;
|
|
11
|
+
private repeatingInstances;
|
|
12
|
+
private rootElement;
|
|
13
|
+
private contentElement;
|
|
14
|
+
private addButton;
|
|
15
|
+
private selector;
|
|
16
|
+
constructor(additionalSettingsProps: AdditionalSettingsProps<TSettings>);
|
|
17
|
+
draw(): HTMLElement;
|
|
18
|
+
getSettings(): TSettings;
|
|
19
|
+
getSelectedKeys(): (keyof TSettings)[];
|
|
20
|
+
setSelectedKeys(keys: (keyof TSettings)[]): void;
|
|
21
|
+
removeSettingKey(key: keyof TSettings): void;
|
|
22
|
+
addSettingKey(key: keyof TSettings): void;
|
|
23
|
+
/**
|
|
24
|
+
* Restore visible repeating instances for a key from serialized values.
|
|
25
|
+
* Clears existing instances for that key and re-creates from the array.
|
|
26
|
+
*/
|
|
27
|
+
restoreRepeatingInstances(key: keyof TSettings, values: unknown[]): void;
|
|
28
|
+
private createHeader;
|
|
29
|
+
private createContentContainer;
|
|
30
|
+
private getRemainingKeys;
|
|
31
|
+
private selectSetting;
|
|
32
|
+
private addRepeatingInstance;
|
|
33
|
+
private removeRepeatingInstance;
|
|
34
|
+
private renderRepeatingInstance;
|
|
35
|
+
private clearRegularElements;
|
|
36
|
+
private removeSetting;
|
|
37
|
+
private renderSelectedSetting;
|
|
38
|
+
private getSettingTitle;
|
|
39
|
+
private attachAddButtonClickHandler;
|
|
40
|
+
private updateAddButtonState;
|
|
41
|
+
private updateSelectorOptions;
|
|
42
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type RepeatingSettingProps<T extends object> = {
|
|
2
|
+
title: string;
|
|
3
|
+
factory: () => T;
|
|
4
|
+
max?: number;
|
|
5
|
+
};
|
|
6
|
+
/** Sentinel wrapper written into getInstanceValues() for hidden instances. */
|
|
7
|
+
export type RepeatingHiddenSentinel = {
|
|
8
|
+
__hidden: true;
|
|
9
|
+
value: unknown;
|
|
10
|
+
};
|
|
11
|
+
export declare function isRepeatingHiddenSentinel(v: unknown): v is RepeatingHiddenSentinel;
|
|
12
|
+
export declare class RepeatingSetting<T extends object> {
|
|
13
|
+
readonly isRepeating: true;
|
|
14
|
+
readonly isAdditional: true;
|
|
15
|
+
title: string;
|
|
16
|
+
readonly factory: () => T;
|
|
17
|
+
readonly max: number;
|
|
18
|
+
private instances;
|
|
19
|
+
private onChangeCb?;
|
|
20
|
+
private restoreCallback?;
|
|
21
|
+
constructor(props: RepeatingSettingProps<T>);
|
|
22
|
+
canAddMore(): boolean;
|
|
23
|
+
createInstance(hidden?: boolean): {
|
|
24
|
+
id: string;
|
|
25
|
+
instance: T;
|
|
26
|
+
};
|
|
27
|
+
removeInstance(id: string): void;
|
|
28
|
+
/** Returns all instances (visible and hidden) in insertion order. */
|
|
29
|
+
getInstances(): {
|
|
30
|
+
id: string;
|
|
31
|
+
instance: T;
|
|
32
|
+
}[];
|
|
33
|
+
clearInstances(): void;
|
|
34
|
+
setInstanceHidden(id: string, hidden: boolean): void;
|
|
35
|
+
getInstanceHidden(id: string): boolean;
|
|
36
|
+
private extractInstanceValue;
|
|
37
|
+
private extractInstanceValueForJson;
|
|
38
|
+
/**
|
|
39
|
+
* Returns ALL instances in order, preserving hidden state.
|
|
40
|
+
* Hidden instances are wrapped: { __hidden: true, value: <instanceValue> }.
|
|
41
|
+
* This lets restoreFromValues reconstruct exact order + hidden state.
|
|
42
|
+
*/
|
|
43
|
+
getInstanceValues(): unknown[];
|
|
44
|
+
/**
|
|
45
|
+
* Returns values for ALL instances.
|
|
46
|
+
* Hidden instances are wrapped: { __hidden: true, value: <instanceValue> }.
|
|
47
|
+
* This lets restoreFromValues reconstruct exact order + hidden state.
|
|
48
|
+
*/
|
|
49
|
+
getInstanceValuesForJson(): unknown[];
|
|
50
|
+
setOnChange(cb: () => void): void;
|
|
51
|
+
setRestoreCallback(cb: (values: unknown[]) => void): void;
|
|
52
|
+
setValue(newValues: unknown[]): void;
|
|
53
|
+
notifyChange(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Clears all instances and restores from values.
|
|
56
|
+
* Handles both plain values (visible) and sentinel-wrapped values (hidden),
|
|
57
|
+
* preserving the original order.
|
|
58
|
+
*/
|
|
59
|
+
restoreFromValues(values: unknown[]): void;
|
|
60
|
+
}
|
|
61
|
+
export declare function isRepeatingSetting(value: unknown): value is RepeatingSetting<object>;
|
package/dist/base/drawable.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
export interface IDrawable {
|
|
2
2
|
draw(): HTMLElement;
|
|
3
|
+
drawWithActions?(): HTMLElement;
|
|
3
4
|
}
|
|
4
5
|
export interface IChangable<T> {
|
|
5
6
|
setOnChange(onChange: (value: T) => void): void;
|
|
6
7
|
}
|
|
8
|
+
export interface IActionable {
|
|
9
|
+
setIsHidden(hidden: boolean): void;
|
|
10
|
+
setIncludeInTree(include: boolean): void;
|
|
11
|
+
getIsHidden(): boolean;
|
|
12
|
+
getIncludeInTree(): boolean;
|
|
13
|
+
resetActionStates(options?: {
|
|
14
|
+
includeInTree?: boolean;
|
|
15
|
+
hide?: boolean;
|
|
16
|
+
}): void;
|
|
17
|
+
}
|
|
@@ -6,9 +6,7 @@ export interface PendingSettingsGroupProps<TSettings extends SettingsMap> extend
|
|
|
6
6
|
}
|
|
7
7
|
export declare class PendingSettingsGroup<TSettings extends SettingsMap> extends SettingGroup<TSettings> implements IDrawable, IChangable<ExtractSettingValues<TSettings>> {
|
|
8
8
|
isRootNode: boolean;
|
|
9
|
-
isInitialized: boolean;
|
|
10
9
|
pendingSettingValuesByKey: Record<string, ExtractSettingValues<TSettings>[keyof TSettings]>;
|
|
11
|
-
static readonly IGNORE_KEYS: string[];
|
|
12
10
|
static readonly DEFAULT_KEYS: string[];
|
|
13
11
|
constructor(groupProps: PendingSettingsGroupProps<TSettings>);
|
|
14
12
|
setValue(newValue: ExtractSettingValues<TSettings>): void;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { IChangable, IDrawable } from '../drawable';
|
|
1
|
+
import { IActionable, IChangable, IDrawable } from '../drawable';
|
|
2
2
|
import { SettingsMap, SettingChild, SettingsProps, ExtractSettingValues, ExtractSettingValuesOptional, SettingChangeCallback, SettingBlurCallback, SerializedSettingValues, MobileSettingValues, SettingIteratorCallback } from '../../types/index';
|
|
3
3
|
import { ParsedRule } from '../../services/ExcelRulesService';
|
|
4
|
+
import { AdditionalSettings } from '../additional-settings/additonalSettings';
|
|
5
|
+
import { Action, ActionType } from '../../components/actions/action';
|
|
6
|
+
import { SettingGroupAction } from '../../components/actions/actionsCollection';
|
|
4
7
|
export type ExcelImportConfig = {
|
|
5
8
|
enabled: boolean;
|
|
6
9
|
languages?: string[];
|
|
@@ -24,6 +27,7 @@ export type SettingGroupProps<TSettings extends SettingsMap> = {
|
|
|
24
27
|
id?: string;
|
|
25
28
|
title?: string;
|
|
26
29
|
settings: TSettings;
|
|
30
|
+
additionalSettingsTitle?: string;
|
|
27
31
|
collapsed?: boolean;
|
|
28
32
|
main?: boolean;
|
|
29
33
|
custom?: boolean;
|
|
@@ -34,22 +38,25 @@ export type SettingGroupProps<TSettings extends SettingsMap> = {
|
|
|
34
38
|
hide?: boolean;
|
|
35
39
|
setActiveOnSettingSelection?: boolean;
|
|
36
40
|
disabled?: boolean;
|
|
41
|
+
actions?: SettingGroupAction[];
|
|
42
|
+
isAdditional?: boolean;
|
|
37
43
|
};
|
|
38
44
|
export declare function iterateSettings<TSettings extends SettingsMap>(settings: TSettings, callback: SettingIteratorCallback<TSettings>): void;
|
|
39
45
|
export type SettingGroupWithSettings<TSettings extends SettingsMap> = SettingGroup<TSettings> & TSettings;
|
|
40
46
|
export type TabSettingsGroupGenericType = Record<string, SettingGroup<SettingsMap>>;
|
|
41
|
-
export declare class SettingGroup<TSettings extends SettingsMap> implements IDrawable, IChangable<ExtractSettingValues<TSettings
|
|
47
|
+
export declare class SettingGroup<TSettings extends SettingsMap> implements IDrawable, IChangable<ExtractSettingValues<TSettings>>, IActionable {
|
|
42
48
|
title: string;
|
|
43
49
|
settings: TSettings;
|
|
50
|
+
additionalSettings?: AdditionalSettings<TSettings>;
|
|
44
51
|
id: string;
|
|
45
52
|
onChange?: SettingChangeCallback<ExtractSettingValues<TSettings>> | undefined;
|
|
46
53
|
onBlur?: SettingBlurCallback;
|
|
54
|
+
isAdditional: boolean;
|
|
47
55
|
private isCollapsed;
|
|
48
56
|
private isMain;
|
|
49
57
|
private includeGetJson;
|
|
50
58
|
private elementRef;
|
|
51
59
|
private static hiddenElements;
|
|
52
|
-
private isHidden;
|
|
53
60
|
private custom;
|
|
54
61
|
initialValues: ExtractSettingValues<TSettings>;
|
|
55
62
|
private changeTimeout;
|
|
@@ -66,6 +73,7 @@ export declare class SettingGroup<TSettings extends SettingsMap> implements IDra
|
|
|
66
73
|
private dataProps?;
|
|
67
74
|
private dataPropsPath;
|
|
68
75
|
private hide;
|
|
76
|
+
private hideAsSetting;
|
|
69
77
|
private isValueInProcessing;
|
|
70
78
|
protected suppressOnChange: boolean;
|
|
71
79
|
protected isRootNode: boolean;
|
|
@@ -76,12 +84,20 @@ export declare class SettingGroup<TSettings extends SettingsMap> implements IDra
|
|
|
76
84
|
detectChange?: () => void;
|
|
77
85
|
private disabled?;
|
|
78
86
|
private groupContainer?;
|
|
87
|
+
actionsByType: Map<ActionType, Action>;
|
|
88
|
+
private includeInTree;
|
|
89
|
+
private excludeFromUI;
|
|
90
|
+
private additionalSettingsMap;
|
|
91
|
+
private static EXTRA_SETTINGS_KEYS;
|
|
79
92
|
constructor(groupProps: SettingGroupProps<TSettings>);
|
|
93
|
+
private buildAdditionalSettingsMap;
|
|
94
|
+
private isAdditionalKey;
|
|
80
95
|
private propagateNestingLevel;
|
|
81
96
|
consumeSkipHistoryNextChange(): boolean;
|
|
82
97
|
getNestingLevel(): number;
|
|
83
98
|
setNestingLevel(level: number): void;
|
|
84
99
|
setTitle(title: string): void;
|
|
100
|
+
setActions(actions: Action[]): void;
|
|
85
101
|
getDataPropsPath(): string;
|
|
86
102
|
setDataPropsPath(path: string): void;
|
|
87
103
|
private propagateDataPropsPath;
|
|
@@ -100,6 +116,7 @@ export declare class SettingGroup<TSettings extends SettingsMap> implements IDra
|
|
|
100
116
|
getMobileValues<K extends keyof TSettings>(childKey: K): unknown;
|
|
101
117
|
setOnChange(onChange: SettingChangeCallback<ExtractSettingValues<TSettings>>): SettingGroup<TSettings>;
|
|
102
118
|
cleanup(): void;
|
|
119
|
+
private setExtraSettingValue;
|
|
103
120
|
setValue(values: ExtractSettingValuesOptional<TSettings>): void;
|
|
104
121
|
private wireChild;
|
|
105
122
|
addSetting<T extends SettingsProps>(key: string, setting: SettingChild<T>): void;
|
|
@@ -124,8 +141,18 @@ export declare class SettingGroup<TSettings extends SettingsMap> implements IDra
|
|
|
124
141
|
draw(): HTMLElement;
|
|
125
142
|
collapse(): void;
|
|
126
143
|
expand(): void;
|
|
144
|
+
getIncludeInTree(): boolean;
|
|
145
|
+
getIsHidden(): boolean;
|
|
127
146
|
getJson(): string;
|
|
128
147
|
setJson(jsonString: string): void;
|
|
148
|
+
setIsCollapsed(collapsed: boolean): void;
|
|
149
|
+
setIncludeInTree(include: boolean): void;
|
|
150
|
+
setIsHidden(hidden: boolean): void;
|
|
151
|
+
resetActionStates({ includeInTree, hide, collapsed }?: {
|
|
152
|
+
includeInTree?: boolean;
|
|
153
|
+
hide?: boolean;
|
|
154
|
+
collapsed?: boolean;
|
|
155
|
+
}): void;
|
|
129
156
|
}
|
|
130
157
|
export declare class RootSettingGroup<TSettings extends SettingsMap> extends SettingGroup<TSettings> implements IDrawable, IChangable<ExtractSettingValues<TSettings>> {
|
|
131
158
|
constructor(groupProps: SettingGroupProps<TSettings>);
|
package/dist/base/settings.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { IChangable, IDrawable } from './drawable';
|
|
1
|
+
import { IActionable, IChangable, IDrawable } from './drawable';
|
|
2
|
+
import { Action } from '../components/actions/action';
|
|
3
|
+
import { SettingAction } from '../components/actions/actionsCollection';
|
|
2
4
|
export interface SettingProps<T> {
|
|
3
5
|
default?: T;
|
|
4
6
|
title?: string;
|
|
@@ -10,6 +12,8 @@ export interface SettingProps<T> {
|
|
|
10
12
|
detectChangeButOneThatReallyWorks?: (value: T | undefined) => void;
|
|
11
13
|
includeGetJson?: boolean;
|
|
12
14
|
description?: string;
|
|
15
|
+
actions?: SettingAction[];
|
|
16
|
+
isAdditional?: boolean;
|
|
13
17
|
}
|
|
14
18
|
export type Primitive = string | number | boolean | symbol | bigint | null | undefined;
|
|
15
19
|
export type InputTypes = 'number' | 'text' | 'select' | 'color' | 'date' | 'button';
|
|
@@ -29,7 +33,7 @@ export type FontItem = {
|
|
|
29
33
|
fontName: string;
|
|
30
34
|
fontUrl: string;
|
|
31
35
|
};
|
|
32
|
-
export declare abstract class Setting<T, P extends SettingProps<T>> implements IDrawable, IChangable<T
|
|
36
|
+
export declare abstract class Setting<T, P extends SettingProps<T>> implements IDrawable, IChangable<T>, IActionable {
|
|
33
37
|
protected props: P;
|
|
34
38
|
static DefaultUploadUrl: string;
|
|
35
39
|
static DefaultLanguage: string;
|
|
@@ -55,15 +59,29 @@ export declare abstract class Setting<T, P extends SettingProps<T>> implements I
|
|
|
55
59
|
title: string | undefined;
|
|
56
60
|
desktop: T | undefined;
|
|
57
61
|
includeGetJson: boolean;
|
|
62
|
+
isAdditional: boolean;
|
|
58
63
|
private dataPropsPath;
|
|
64
|
+
private actionsByType;
|
|
65
|
+
private hide;
|
|
66
|
+
private includeInTree;
|
|
59
67
|
abstract inputType: T extends Primitive ? InputTypes : Record<keyof T, InputTypes>;
|
|
60
68
|
onChange: ((value: T) => void) | undefined;
|
|
61
69
|
onBlur: ((value: T) => void) | undefined;
|
|
62
70
|
constructor(props?: P);
|
|
71
|
+
setActions(actions: Action[]): void;
|
|
72
|
+
drawWithActions(): HTMLElement;
|
|
63
73
|
setOnChange(onChange: (value: T) => void): Setting<T, P>;
|
|
64
74
|
setOnBlur(onBlur: (value: T) => void): Setting<T, P>;
|
|
65
75
|
setDataPropsPath(path: string): void;
|
|
76
|
+
setIsHidden(hidden: boolean): void;
|
|
77
|
+
setIncludeInTree(include: boolean): void;
|
|
78
|
+
resetActionStates({ includeInTree, hide }?: {
|
|
79
|
+
includeInTree?: boolean;
|
|
80
|
+
hide?: boolean;
|
|
81
|
+
}): void;
|
|
66
82
|
getDataPropsPath(): string;
|
|
83
|
+
getIsHidden(): boolean;
|
|
84
|
+
getIncludeInTree(): boolean;
|
|
67
85
|
/**
|
|
68
86
|
* Set the component path for this setting (used for hierarchical identification)
|
|
69
87
|
* Override in subclasses that need this functionality
|