@vnejs/plugins.view.coralina.settings.defaults 0.1.5 → 0.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/view/index.jsx +4 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.view.coralina.settings.defaults",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
package/view/index.jsx CHANGED
@@ -4,22 +4,20 @@ import { createRoot } from "react-dom/client";
4
4
  import { Flex, Text, Screen, Settings, PositionBox } from "@vnejs/uis.react";
5
5
 
6
6
  const SettingsDefaults = ({ store, onMount, ...props } = {}) => {
7
- const [{ isShow = false, locs = {}, tab = {}, bgSrc = "" }, setState] = useState({});
7
+ const [{ isShow = false, isForce = false, locs = {}, tab = {}, bgSrc = "" }, setState] = useState({});
8
8
 
9
9
  useEffect(() => store.subscribe(setState), []);
10
10
  useEffect(() => void onMount(), []);
11
11
 
12
- console.log(11111, props);
13
-
14
12
  const mapFields = useCallback(
15
- ({ locKey = "", type = "", settingKey = "", options = [], titleToggledLocKey = "", titleUntoggledLocKey = "", valueMap = "", ...props2 } = {}) => {
13
+ ({ locKey = "", type = "", settingKey = "", options = [], titleToggledLocKey = "", titleUntoggledLocKey = "", valueMap = "", ...other } = {}) => {
16
14
  const onChange = (value) => props.emit(props.EVENTS.SETTINGS.SET, { name: settingKey, value });
17
15
 
18
16
  const titles = { title: locs[locKey], titleToggled: locs[titleToggledLocKey], titleUntoggled: locs[titleUntoggledLocKey] };
19
17
 
20
18
  const valueMapReal = valueMap ? props.PARAMS.SETTINGS_VIEW.VALUE_MAPS[valueMap] : null;
21
19
 
22
- return { ...titles, value: props.shared.settings[settingKey], type, onChange, props: props2, options, valueMap: valueMapReal };
20
+ return { ...titles, value: props.shared.settings[settingKey], type, onChange, props: other, options, valueMap: valueMapReal };
23
21
  },
24
22
  [locs],
25
23
  );
@@ -29,7 +27,7 @@ const SettingsDefaults = ({ store, onMount, ...props } = {}) => {
29
27
 
30
28
  const propsByView = props.PARAMS.SETTINGS_DEFAULTS_VIEW.VIEW_PROPS;
31
29
 
32
- const propsScreen = useMemo(() => ({ ...propsByView.screen, isShow, bgSrc }), [isShow, bgSrc]);
30
+ const propsScreen = useMemo(() => ({ ...propsByView.screen, isShow, isForce, bgSrc }), [isShow, isForce, bgSrc]);
33
31
  const propsTitle = useMemo(() => ({ ...propsByView.title, text: locs[tab.titleLocKey] }), [locs, tab]);
34
32
  const propsSettings = useMemo(() => ({ ...propsByView.settings, settings, selectedIndex: 0, selectedIndexInner: 0 }), [settings]);
35
33
  const propsAccept = useMemo(() => ({ ...propsByView.accept, text: locs[tab.acceptLocKey], onClick: onAccept }), [locs, tab]);