@vnejs/plugins.views.settings 0.2.6 → 0.2.7
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/modules/fields.controller.arrows.d.ts +2 -2
- package/dist/modules/fields.controller.d.ts +5 -3
- package/dist/modules/fields.view.d.ts +1 -1
- package/dist/types.d.ts +14 -1
- package/dist/utils/settings.d.ts +1 -20
- package/dist/view/SettingsExampleText.d.ts +1 -1
- package/dist/view/SettingsTabContent.d.ts +1 -1
- package/dist/view/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/modules/fields.controller.arrows.ts +1 -1
- package/src/modules/fields.controller.ts +3 -1
- package/src/modules/fields.view.ts +1 -2
- package/src/types.ts +16 -1
- package/src/utils/settings.ts +1 -22
- package/src/view/SettingsExampleText.tsx +1 -2
- package/src/view/SettingsTabContent.tsx +3 -3
- package/src/view/index.tsx +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SettingsField } from "@vnejs/contracts.views.settings";
|
|
2
2
|
import { ModuleControllerArrowsVertical } from "@vnejs/module.controller.arrows.vertical";
|
|
3
3
|
import type { SettingsViewPluginConstants, SettingsViewPluginEvents, SettingsViewPluginParams, SettingsViewPluginSettings } from "../types.js";
|
|
4
|
-
import type { SettingsViewTabPayload } from "
|
|
4
|
+
import type { SettingsViewTabPayload } from "@vnejs/contracts.views.settings";
|
|
5
5
|
export declare class SettingsFieldsControllerArrows extends ModuleControllerArrowsVertical<SettingsViewPluginEvents, SettingsViewPluginConstants, SettingsViewPluginSettings, SettingsViewPluginParams> {
|
|
6
6
|
name: string;
|
|
7
7
|
EVENT_SHOW: "vne:settings_view:show";
|
|
@@ -11,7 +11,7 @@ export declare class SettingsFieldsControllerArrows extends ModuleControllerArro
|
|
|
11
11
|
CONTROLS_ZINDEX: number;
|
|
12
12
|
fields: SettingsField[];
|
|
13
13
|
subscribe: () => void;
|
|
14
|
-
onShow: (payload?: SettingsViewTabPayload) => Promise<
|
|
14
|
+
onShow: (payload?: SettingsViewTabPayload) => Promise<import("@vnejs/shared").EmitResults<"vne:controls:push">> | undefined;
|
|
15
15
|
onTabSet: (payload?: SettingsViewTabPayload) => void;
|
|
16
16
|
getMaxCurrentItem: () => number;
|
|
17
17
|
syncFields: (payload?: SettingsViewTabPayload) => void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ModuleController } from "@vnejs/module.components";
|
|
2
2
|
import type { SettingsField } from "@vnejs/contracts.views.settings";
|
|
3
3
|
import type { SettingsViewPluginConstants, SettingsViewPluginEvents, SettingsViewPluginParams, SettingsViewPluginSettings } from "../types.js";
|
|
4
|
-
import type { SettingsViewPluginState
|
|
4
|
+
import type { SettingsViewPluginState } from "../types.js";
|
|
5
|
+
import type { SettingsViewTabContent } from "../utils/settings.js";
|
|
6
|
+
import type { SettingsViewTabPayload } from "@vnejs/contracts.views.settings";
|
|
5
7
|
export declare class SettingsFieldsController extends ModuleController<SettingsViewPluginEvents, SettingsViewPluginConstants, SettingsViewPluginSettings, SettingsViewPluginParams, SettingsViewPluginState> {
|
|
6
8
|
name: string;
|
|
7
9
|
EVENT_UPDATE_VIEW: "vne:settings_view:update";
|
|
@@ -26,7 +28,7 @@ export declare class SettingsFieldsController extends ModuleController<SettingsV
|
|
|
26
28
|
currentItemInner: number;
|
|
27
29
|
};
|
|
28
30
|
onShowFields: (payload?: SettingsViewTabPayload) => Promise<void>;
|
|
29
|
-
onTabSet: (payload?: SettingsViewTabPayload) => Promise<void |
|
|
31
|
+
onTabSet: (payload?: SettingsViewTabPayload) => Promise<void | import("@vnejs/shared").EmitResults<string>>;
|
|
30
32
|
onStateUpdate: (payload?: Partial<SettingsViewPluginState>) => void;
|
|
31
33
|
getFocusedField: () => SettingsField | undefined;
|
|
32
34
|
innerIndexOfField: (field?: SettingsField) => number;
|
|
@@ -38,5 +40,5 @@ export declare class SettingsFieldsController extends ModuleController<SettingsV
|
|
|
38
40
|
subscribe: () => void;
|
|
39
41
|
beforeShow: (payload?: SettingsViewTabPayload) => Promise<void>;
|
|
40
42
|
afterHide: () => void;
|
|
41
|
-
onSettingChange: () => false | Promise<
|
|
43
|
+
onSettingChange: () => false | Promise<import("@vnejs/shared").EmitResults<string>> | undefined;
|
|
42
44
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleView } from "@vnejs/module.components";
|
|
2
2
|
import type { SettingsViewPluginConstants, SettingsViewPluginEvents, SettingsViewPluginParams, SettingsViewPluginSettings } from "../types.js";
|
|
3
|
-
import type { SettingsViewPluginState } from "../
|
|
3
|
+
import type { SettingsViewPluginState } from "../types.js";
|
|
4
4
|
export declare class SettingsFieldsView extends ModuleView<SettingsViewPluginEvents, SettingsViewPluginConstants, SettingsViewPluginSettings, SettingsViewPluginParams, SettingsViewPluginState> {
|
|
5
5
|
name: string;
|
|
6
6
|
EVENT_UPDATE_VIEW: "vne:settings_view:update";
|
package/dist/types.d.ts
CHANGED
|
@@ -3,8 +3,21 @@ import type { Constants as ControlsConstants, PluginName as ControlsPluginName }
|
|
|
3
3
|
import type { PluginName as SettingsPluginName, SubscribeEvents as SettingsSubscribeEvents } from "@vnejs/contracts.core.settings";
|
|
4
4
|
import type { SettingsKeys as TextsizeSettingsKeys, PluginName as TextsizePluginName } from "@vnejs/contracts.settings.textsize";
|
|
5
5
|
import type { Params as TextSmoothParams, PluginName as TextSmoothPluginName, SettingsKeys as TextSmoothSettingsKeys } from "@vnejs/contracts.text.smooth";
|
|
6
|
-
import type { Constants, Params, PluginName, SubscribeEvents } from "@vnejs/contracts.views.settings";
|
|
6
|
+
import type { Constants, Params, PluginName, SettingsField, SettingsTab, SubscribeEvents } from "@vnejs/contracts.views.settings";
|
|
7
|
+
import type { SettingsViewTabContent } from "./utils/settings.js";
|
|
7
8
|
export type SettingsViewPluginEvents = ModuleComponentsEvents & Record<PluginName, SubscribeEvents> & Record<SettingsPluginName, SettingsSubscribeEvents>;
|
|
8
9
|
export type SettingsViewPluginConstants = ModuleComponentsConstants & Record<ControlsPluginName, ControlsConstants> & Record<PluginName, Constants>;
|
|
9
10
|
export type SettingsViewPluginSettings = ModuleComponentsSettings & Record<TextSmoothPluginName, TextSmoothSettingsKeys> & Record<TextsizePluginName, TextsizeSettingsKeys>;
|
|
10
11
|
export type SettingsViewPluginParams = ModuleComponentsParams & Record<PluginName, Params> & Record<TextSmoothPluginName, TextSmoothParams>;
|
|
12
|
+
export type SettingsViewPluginState = {
|
|
13
|
+
isShow: boolean;
|
|
14
|
+
isForce: boolean;
|
|
15
|
+
tab?: SettingsTab;
|
|
16
|
+
tabKey?: string;
|
|
17
|
+
tabsContent?: Record<string, SettingsViewTabContent>;
|
|
18
|
+
fields?: SettingsField[];
|
|
19
|
+
locs?: Record<string, string>;
|
|
20
|
+
showTextExample?: boolean;
|
|
21
|
+
currentArrowVerticalItem?: number | null;
|
|
22
|
+
currentItemInner?: number | null;
|
|
23
|
+
};
|
package/dist/utils/settings.d.ts
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
import type { SettingsField
|
|
1
|
+
import type { SettingsField } from "@vnejs/contracts.views.settings";
|
|
2
2
|
export type SettingsViewTabContent = {
|
|
3
3
|
fields?: SettingsField[];
|
|
4
4
|
showTextExample?: boolean;
|
|
5
5
|
locs?: Record<string, string>;
|
|
6
6
|
};
|
|
7
|
-
export type SettingsViewPluginState = {
|
|
8
|
-
isShow: boolean;
|
|
9
|
-
isForce: boolean;
|
|
10
|
-
tab?: SettingsTab;
|
|
11
|
-
tabKey?: string;
|
|
12
|
-
tabsContent?: Record<string, SettingsViewTabContent>;
|
|
13
|
-
fields?: SettingsField[];
|
|
14
|
-
locs?: Record<string, string>;
|
|
15
|
-
showTextExample?: boolean;
|
|
16
|
-
currentArrowVerticalItem?: number | null;
|
|
17
|
-
currentItemInner?: number | null;
|
|
18
|
-
};
|
|
19
|
-
export type SettingsViewTabPayload = {
|
|
20
|
-
tab?: SettingsTab;
|
|
21
|
-
tabs?: Record<string, SettingsTab>;
|
|
22
|
-
tabKey?: string;
|
|
23
|
-
locs?: Record<string, string>;
|
|
24
|
-
isForce?: boolean;
|
|
25
|
-
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactComponentProps } from "@vnejs/uis.react";
|
|
2
2
|
import type { SettingsViewPluginConstants, SettingsViewPluginEvents, SettingsViewPluginParams, SettingsViewPluginSettings } from "../types.js";
|
|
3
|
-
import type { SettingsViewPluginState } from "../
|
|
3
|
+
import type { SettingsViewPluginState } from "../types.js";
|
|
4
4
|
type SettingsExampleTextProps = ReactComponentProps<SettingsViewPluginEvents, SettingsViewPluginConstants, SettingsViewPluginSettings, SettingsViewPluginParams, SettingsViewPluginState> & {
|
|
5
5
|
isShow?: boolean;
|
|
6
6
|
locs?: Record<string, string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SettingsField } from "@vnejs/contracts.views.settings";
|
|
2
2
|
import type { ReactComponentProps } from "@vnejs/uis.react";
|
|
3
3
|
import type { SettingsViewPluginConstants, SettingsViewPluginEvents, SettingsViewPluginParams, SettingsViewPluginSettings } from "../types.js";
|
|
4
|
-
import type { SettingsViewPluginState } from "../
|
|
4
|
+
import type { SettingsViewPluginState } from "../types.js";
|
|
5
5
|
type SettingsTabContentProps = ReactComponentProps<SettingsViewPluginEvents, SettingsViewPluginConstants, SettingsViewPluginSettings, SettingsViewPluginParams, SettingsViewPluginState> & {
|
|
6
6
|
isShow?: boolean;
|
|
7
7
|
isForce?: boolean;
|
package/dist/view/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import type { SettingsField } from "@vnejs/contracts.views.settings";
|
|
|
3
3
|
import { ModuleControllerArrowsVertical } from "@vnejs/module.controller.arrows.vertical";
|
|
4
4
|
|
|
5
5
|
import type { SettingsViewPluginConstants, SettingsViewPluginEvents, SettingsViewPluginParams, SettingsViewPluginSettings } from "../types.js";
|
|
6
|
-
import type { SettingsViewTabPayload } from "
|
|
6
|
+
import type { SettingsViewTabPayload } from "@vnejs/contracts.views.settings";
|
|
7
7
|
|
|
8
8
|
export class SettingsFieldsControllerArrows extends ModuleControllerArrowsVertical<
|
|
9
9
|
SettingsViewPluginEvents,
|
|
@@ -2,7 +2,9 @@ import { ModuleController } from "@vnejs/module.components";
|
|
|
2
2
|
import type { SettingsField } from "@vnejs/contracts.views.settings";
|
|
3
3
|
|
|
4
4
|
import type { SettingsViewPluginConstants, SettingsViewPluginEvents, SettingsViewPluginParams, SettingsViewPluginSettings } from "../types.js";
|
|
5
|
-
import type { SettingsViewPluginState
|
|
5
|
+
import type { SettingsViewPluginState } from "../types.js";
|
|
6
|
+
import type { SettingsViewTabContent } from "../utils/settings.js";
|
|
7
|
+
import type { SettingsViewTabPayload } from "@vnejs/contracts.views.settings";
|
|
6
8
|
|
|
7
9
|
export class SettingsFieldsController extends ModuleController<
|
|
8
10
|
SettingsViewPluginEvents,
|
|
@@ -2,8 +2,7 @@ import { ModuleView } from "@vnejs/module.components";
|
|
|
2
2
|
|
|
3
3
|
import { render } from "../view/index.js";
|
|
4
4
|
import type { SettingsViewPluginConstants, SettingsViewPluginEvents, SettingsViewPluginParams, SettingsViewPluginSettings } from "../types.js";
|
|
5
|
-
import type { SettingsViewPluginState } from "../
|
|
6
|
-
|
|
5
|
+
import type { SettingsViewPluginState } from "../types.js";
|
|
7
6
|
export class SettingsFieldsView extends ModuleView<
|
|
8
7
|
SettingsViewPluginEvents,
|
|
9
8
|
SettingsViewPluginConstants,
|
package/src/types.ts
CHANGED
|
@@ -3,7 +3,9 @@ import type { Constants as ControlsConstants, PluginName as ControlsPluginName }
|
|
|
3
3
|
import type { PluginName as SettingsPluginName, SubscribeEvents as SettingsSubscribeEvents } from "@vnejs/contracts.core.settings";
|
|
4
4
|
import type { SettingsKeys as TextsizeSettingsKeys, PluginName as TextsizePluginName } from "@vnejs/contracts.settings.textsize";
|
|
5
5
|
import type { Params as TextSmoothParams, PluginName as TextSmoothPluginName, SettingsKeys as TextSmoothSettingsKeys } from "@vnejs/contracts.text.smooth";
|
|
6
|
-
import type { Constants, Params, PluginName, SubscribeEvents } from "@vnejs/contracts.views.settings";
|
|
6
|
+
import type { Constants, Params, PluginName, SettingsField, SettingsTab, SubscribeEvents } from "@vnejs/contracts.views.settings";
|
|
7
|
+
|
|
8
|
+
import type { SettingsViewTabContent } from "./utils/settings.js";
|
|
7
9
|
|
|
8
10
|
export type SettingsViewPluginEvents = ModuleComponentsEvents & Record<PluginName, SubscribeEvents> & Record<SettingsPluginName, SettingsSubscribeEvents>;
|
|
9
11
|
|
|
@@ -14,3 +16,16 @@ export type SettingsViewPluginSettings = ModuleComponentsSettings &
|
|
|
14
16
|
Record<TextsizePluginName, TextsizeSettingsKeys>;
|
|
15
17
|
|
|
16
18
|
export type SettingsViewPluginParams = ModuleComponentsParams & Record<PluginName, Params> & Record<TextSmoothPluginName, TextSmoothParams>;
|
|
19
|
+
|
|
20
|
+
export type SettingsViewPluginState = {
|
|
21
|
+
isShow: boolean;
|
|
22
|
+
isForce: boolean;
|
|
23
|
+
tab?: SettingsTab;
|
|
24
|
+
tabKey?: string;
|
|
25
|
+
tabsContent?: Record<string, SettingsViewTabContent>;
|
|
26
|
+
fields?: SettingsField[];
|
|
27
|
+
locs?: Record<string, string>;
|
|
28
|
+
showTextExample?: boolean;
|
|
29
|
+
currentArrowVerticalItem?: number | null;
|
|
30
|
+
currentItemInner?: number | null;
|
|
31
|
+
};
|
package/src/utils/settings.ts
CHANGED
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
import type { SettingsField
|
|
1
|
+
import type { SettingsField } from "@vnejs/contracts.views.settings";
|
|
2
2
|
|
|
3
3
|
export type SettingsViewTabContent = {
|
|
4
4
|
fields?: SettingsField[];
|
|
5
5
|
showTextExample?: boolean;
|
|
6
6
|
locs?: Record<string, string>;
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
export type SettingsViewPluginState = {
|
|
10
|
-
isShow: boolean;
|
|
11
|
-
isForce: boolean;
|
|
12
|
-
tab?: SettingsTab;
|
|
13
|
-
tabKey?: string;
|
|
14
|
-
tabsContent?: Record<string, SettingsViewTabContent>;
|
|
15
|
-
fields?: SettingsField[];
|
|
16
|
-
locs?: Record<string, string>;
|
|
17
|
-
showTextExample?: boolean;
|
|
18
|
-
currentArrowVerticalItem?: number | null;
|
|
19
|
-
currentItemInner?: number | null;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type SettingsViewTabPayload = {
|
|
23
|
-
tab?: SettingsTab;
|
|
24
|
-
tabs?: Record<string, SettingsTab>;
|
|
25
|
-
tabKey?: string;
|
|
26
|
-
locs?: Record<string, string>;
|
|
27
|
-
isForce?: boolean;
|
|
28
|
-
};
|
|
@@ -3,8 +3,7 @@ import type { ReactComponentProps } from "@vnejs/uis.react";
|
|
|
3
3
|
import { SmoothText, useEffect, useMemo, useState } from "@vnejs/uis.react";
|
|
4
4
|
|
|
5
5
|
import type { SettingsViewPluginConstants, SettingsViewPluginEvents, SettingsViewPluginParams, SettingsViewPluginSettings } from "../types.js";
|
|
6
|
-
import type { SettingsViewPluginState } from "../
|
|
7
|
-
|
|
6
|
+
import type { SettingsViewPluginState } from "../types.js";
|
|
8
7
|
type SettingsExampleTextProps = ReactComponentProps<
|
|
9
8
|
SettingsViewPluginEvents,
|
|
10
9
|
SettingsViewPluginConstants,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { SettingsField } from "@vnejs/contracts.views.settings";
|
|
1
|
+
import type { SettingsActionContext, SettingsField } from "@vnejs/contracts.views.settings";
|
|
2
2
|
import type { ReactComponentProps } from "@vnejs/uis.react";
|
|
3
3
|
import { Flex, PositionBox, Settings, useCallback } from "@vnejs/uis.react";
|
|
4
4
|
|
|
5
5
|
import type { SettingsViewPluginConstants, SettingsViewPluginEvents, SettingsViewPluginParams, SettingsViewPluginSettings } from "../types.js";
|
|
6
|
-
import type { SettingsViewPluginState } from "../
|
|
6
|
+
import type { SettingsViewPluginState } from "../types.js";
|
|
7
7
|
import { SettingsExampleText } from "./SettingsExampleText.js";
|
|
8
8
|
|
|
9
9
|
type SettingsTabContentProps = ReactComponentProps<
|
|
@@ -67,7 +67,7 @@ export const SettingsTabContent = ({
|
|
|
67
67
|
|
|
68
68
|
if (option.action) {
|
|
69
69
|
delete result.action;
|
|
70
|
-
result.onClick = () => PARAMS.SETTINGS_VIEW.ACTIONS[option.action!]({ emit, emitOne: emit, emitReal: emit }, locs);
|
|
70
|
+
result.onClick = () => PARAMS.SETTINGS_VIEW.ACTIONS[option.action!]({ emit, emitOne: emit, emitReal: emit } as SettingsActionContext, locs);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
return result;
|
package/src/view/index.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import type { ReactComponentProps } from "@vnejs/uis.react";
|
|
|
3
3
|
import { View, createRenderFunc, useIsForceHook, useMemo, useStoreState } from "@vnejs/uis.react";
|
|
4
4
|
|
|
5
5
|
import type { SettingsViewPluginConstants, SettingsViewPluginEvents, SettingsViewPluginParams, SettingsViewPluginSettings } from "../types.js";
|
|
6
|
-
import type { SettingsViewPluginState } from "../
|
|
6
|
+
import type { SettingsViewPluginState } from "../types.js";
|
|
7
7
|
import { SettingsTabContent } from "./SettingsTabContent.js";
|
|
8
8
|
|
|
9
9
|
type SettingsComponentProps = ReactComponentProps<
|