wenay-react2 1.0.7 → 1.0.9

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.
@@ -1,9 +1,18 @@
1
1
  import "../style/menuRight.css";
2
2
  import "../style/style.css";
3
- export * from "./src/components";
3
+ export * from "./updateBy";
4
4
  export * from "./src/hooks";
5
5
  export * from "./src/styles";
6
+ export * from "./src/components/Dnd";
6
7
  export * from "./src/utils";
8
+ export * from "./src/components/Buttons";
9
+ export * from "./src/components/MyResizeObserver";
10
+ export * from "./src/components/Other";
11
+ export * from "./src/components/Parameters";
12
+ export * from "./src/components/ParametersEngine";
13
+ export * from "./src/components/Input";
14
+ export * from "./src/components/Modal";
15
+ export * from "./src/components/Menu";
7
16
  export * from "./src/menu/menu";
8
17
  export * from "./src/menu/menuMouse";
9
18
  export * from "./src/menu/menuR";
@@ -13,5 +22,4 @@ export * from "./src/logs/miniLogs";
13
22
  export * from "./src/myChart/1/myChart";
14
23
  export * from "./src/myChart/1/myChartTest";
15
24
  export * from "./src/myChart/chartEngine/chartEngineReact";
16
- export * from "./updateBy";
17
25
  export declare function test(): number;
package/lib/common/api.js CHANGED
@@ -1,23 +1,42 @@
1
1
  // ... existing code ...
2
2
  import "../style/menuRight.css";
3
3
  import "../style/style.css";
4
- // Папки с index.ts
5
- export * from "./src/components";
4
+ // 1. БАЗОВЫЙ СЛОЙ - никаких зависимостей внутри проекта
5
+ export * from "./updateBy";
6
+ // 2. ХУКИ - зависят только от updateBy
6
7
  export * from "./src/hooks";
8
+ // 3. СТИЛИ - независимые
7
9
  export * from "./src/styles";
10
+ // 4. DND компоненты - зависят от updateBy
11
+ export * from "./src/components/Dnd";
12
+ // 5. UTILS - теперь зависят от Dnd (mapMemory импортирует ExRNDMap3, mapResiReact)
8
13
  export * from "./src/utils";
9
- // Папки без index.ts, экспортируем каждый файл отдельно
14
+ // 6. БАЗОВЫЕ КОМПОНЕНТЫ - зависят от hooks
15
+ export * from "./src/components/Buttons";
16
+ export * from "./src/components/MyResizeObserver";
17
+ export * from "./src/components/Other";
18
+ // 7. Parameters - зависит от utils
19
+ export * from "./src/components/Parameters";
20
+ // 8. ParametersEngine - зависит от Parameters и utils
21
+ export * from "./src/components/ParametersEngine";
22
+ // 9. Input - зависит от hooks и Dnd
23
+ export * from "./src/components/Input";
24
+ // 10. Modal - зависит от Input и updateBy
25
+ export * from "./src/components/Modal";
26
+ // 11. Menu - зависит от hooks, Dnd и Modal
27
+ export * from "./src/components/Menu";
28
+ // 12. МЕНЮ - зависят от компонентов
10
29
  export * from "./src/menu/menu";
11
30
  export * from "./src/menu/menuMouse";
12
31
  export * from "./src/menu/menuR";
32
+ // 13. ЛОГИ - зависят от utils/mapMemory, menu и components/ParametersEngine
13
33
  export * from "./src/logs/logs";
14
34
  export * from "./src/logs/logs3";
15
35
  export * from "./src/logs/miniLogs";
36
+ // 14. ГРАФИКИ - самый высокий уровень
16
37
  export * from "./src/myChart/1/myChart";
17
38
  export * from "./src/myChart/1/myChartTest";
18
39
  export * from "./src/myChart/chartEngine/chartEngineReact";
19
- // Файлы в корне src/common
20
- export * from "./updateBy";
21
40
  export function test() {
22
41
  return 5;
23
42
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Button } from "../../hooks";
2
+ import { Button } from "../../hooks/useOutside";
3
3
  export function MiniButton({ name, arr, get, onClick, style }) {
4
4
  const data = get();
5
5
  const a = Object.values(data);
@@ -1,4 +1,4 @@
1
1
  export * from './DraggableOutlineDiv';
2
2
  export * from './RNDFunc';
3
- export * from './RNDFunc3';
4
3
  export * from './Resizable';
4
+ export * from './RNDFunc3';
@@ -1,4 +1,4 @@
1
1
  export * from './DraggableOutlineDiv';
2
2
  export * from './RNDFunc';
3
- export * from './RNDFunc3';
4
3
  export * from './Resizable';
4
+ export * from './RNDFunc3';
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef } from "react";
3
- import { DivOutsideClick } from "../hooks";
4
- import { DivRnd3 } from "./Dnd";
3
+ import { DivOutsideClick } from "../hooks/useOutside";
4
+ import { DivRnd3 } from "./Dnd/RNDFunc3";
5
5
  // Unified modal wrapper component
6
6
  function ModalWrapper({ outClick, children, zIndex, size = { height: 150, width: 300 }, keyForSave, position }) {
7
7
  const defaultPosition = position ?? { y: -(size.height / 2), x: -(size.width / 2) };
@@ -10,7 +10,7 @@ function ModalWrapper({ outClick, children, zIndex, size = { height: 150, width:
10
10
  export function InputPage({ callback, name = "", txt = "" }) {
11
11
  const txtName = useRef(txt);
12
12
  return _jsxs("div", { className: "maxSize", style: { padding: 20, }, children: [_jsx("label", { children: name }), _jsx("input", { type: "text", style: { width: "100%" }, defaultValue: txtName.current, onChange: (e) => {
13
- txtName.current = e.target.value; //?? txt
13
+ txtName.current = e.target.value;
14
14
  } }), _jsx("div", { style: { marginTop: 20 }, className: "msTradeAlt msTradeActive", onClick: () => { callback(txtName.current); }, children: "send" })] });
15
15
  }
16
16
  export function InputPageModal({ callback, name, outClick, keyForSave = "InputPage2", txt }) {
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { sleepAsync } from 'wenay-common2';
4
- import { GetModalFuncJSX } from "../Modal";
5
- import { DivOutsideClick, useDraggable } from "../../hooks";
6
- import { DraggableOutlineDiv } from "../Dnd";
4
+ import { useDraggable } from "../../hooks/useDraggable";
5
+ import { DivOutsideClick } from "../../hooks/useOutside";
6
+ import { DraggableOutlineDiv } from "../Dnd/DraggableOutlineDiv";
7
+ import { GetModalFuncJSX } from "../Modal/Modal";
7
8
  export function DropdownMenu({ elements, style, position: initialPosition = 'right', position2: initialPos2 = 'top' }) {
8
9
  const [isOpen, setIsOpen] = useState(false);
9
10
  const [isFixed, setIsFixed] = useState(false);
@@ -1,2 +1,2 @@
1
- export * from './RightMenu';
2
1
  export * from './StickerMenu';
2
+ export * from './RightMenu';
@@ -1,2 +1,2 @@
1
- export * from './RightMenu';
2
1
  export * from './StickerMenu';
2
+ export * from './RightMenu';
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useRef, useState } from "react";
3
3
  import { colorGenerator2, sleepAsync } from "wenay-common2";
4
- import { Drag22 } from "../Dnd";
5
4
  import { renderBy, updateBy } from "../../../updateBy";
6
5
  import { GetModalJSX } from "./Modal";
6
+ import { Drag22 } from "../Dnd/RNDFunc3";
7
7
  function useViewport() {
8
8
  const [width, setWidth] = useState(window.innerWidth);
9
9
  useEffect(() => {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx_1 } from "react/jsx-runtime";
2
- import { InputPageModal } from "../Input";
3
2
  import { renderBy, updateBy } from "../../../updateBy";
3
+ import { InputPageModal } from "../Input";
4
4
  export function inputModal({ setModalJSX, func, name, txt }) {
5
5
  setModalJSX(_jsx_1(InputPageModal, { callback: txt => {
6
6
  func(txt);
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { createContext, useContext, useState } from 'react';
3
3
  import { createPortal } from 'react-dom';
4
- import { DivOutsideClick } from "../../hooks";
4
+ import { DivOutsideClick } from "../../hooks/useOutside";
5
5
  // Контекст хранит только функцию setModal
6
6
  const ModalContext = createContext(() => { });
7
7
  export const ModalProvider = ({ children }) => {
@@ -1,3 +1,3 @@
1
1
  export * from './Modal';
2
- export * from './LeftModal';
3
2
  export * from './ModalContextProvider';
3
+ export * from './LeftModal';
@@ -1,3 +1,3 @@
1
1
  export * from './Modal';
2
- export * from './LeftModal';
3
2
  export * from './ModalContextProvider';
3
+ export * from './LeftModal';
@@ -27,12 +27,12 @@ function DivHover({ children, className, style }) {
27
27
  }
28
28
  function CheckBox(set, val, style) {
29
29
  return _jsx("input", { type: "checkbox", style: { marginTop: "auto", marginBottom: "auto", ...style }, checked: val, onChange: (a) => {
30
- set(a.currentTarget.checked);
30
+ set(a.target.checked);
31
31
  } });
32
32
  }
33
33
  function InputString(set, val, style) {
34
34
  return _jsx("input", { type: "text", style: { marginTop: "auto", marginBottom: "auto", ...style }, value: val, onChange: (e) => {
35
- set(e.currentTarget.value);
35
+ set(e.target.value);
36
36
  } });
37
37
  }
38
38
  function InputTime(set, value, range) {
@@ -82,8 +82,6 @@ function InputTime(set, value, range) {
82
82
  }, onMouseLeave: () => {
83
83
  _ref?.blur();
84
84
  } }) }), _jsx("input", { required: true, className: "toNumberInput inputCan", type: "number", style: { width: 18, marginLeft: -13, marginRight: 0 }, min: toNum(min), max: toNum(max), step: step, value: toNum(value), onInput: (e) => {
85
- //console.log("value:",toNum(value),"->",e.currentTarget.value);
86
- //<input type="number" value={this.vvv ?? 99} onInput={(e)=>{console.log(this.vvv= e.currentTarget.value); this.Refresh(); }}/>
87
85
  const target = e.currentTarget;
88
86
  setVal(Number(target.value));
89
87
  },
@@ -126,9 +124,10 @@ function InputNumber(set, value, range) {
126
124
  _inputNumStrMap.delete(range);
127
125
  let _ref;
128
126
  return _jsxs(_Fragment, { children: [_jsx("input", { type: "range", min: range.defaultMin ?? range.min, max: range.defaultMax ?? range.max, step: range.defaultStep ?? range.step, value: String(value), onInput: (e) => {
129
- set(Number(e.currentTarget.value));
127
+ const current = e.currentTarget;
128
+ set(Number(current.value));
130
129
  if (_ref)
131
- _ref.step = e.currentTarget.step;
130
+ _ref.step = current.step;
132
131
  }, ref: (ref) => {
133
132
  if (ref) {
134
133
  setResizeableElement(ref);
@@ -4,8 +4,8 @@ import { useCallback, useEffect, useRef } from "react";
4
4
  import { copyToClipboard, Params, timeLocalToStr_hhmmss } from "wenay-common2";
5
5
  import { renderBy, updateBy } from "../../updateBy";
6
6
  import { mouseMenuApi } from "../menu/menuMouse";
7
- import { staticGetAdd } from "../utils";
8
- import { ParametersReact } from "../components";
7
+ import { staticGetAdd } from "../utils/mapMemory";
8
+ import { ParametersReact } from "../components/ParametersEngine";
9
9
  const cashLogs = new Map();
10
10
  const datumConst = {
11
11
  map: cashLogs,
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useEffect, useRef } from "react";
3
3
  import { MenuBase } from "./menu";
4
- import { DivOutsideClick } from "../hooks";
4
+ import { DivOutsideClick } from "../hooks/useOutside";
5
5
  // Функция-обёртка для создания компонента MenuR и управления глобальной переменной `bb`
6
6
  export function GetMenuR() {
7
7
  let bb = false; // Глобальная переменная, предотвращающая множественное открытие меню (флаг активности)
@@ -1,4 +1,11 @@
1
- export declare function SetAutoStepForElement(element: HTMLInputElement, params?: {
1
+ interface IStepInputElement extends HTMLElement {
2
+ value: string;
3
+ step: string;
4
+ min: string;
5
+ max: string;
6
+ }
7
+ export declare function SetAutoStepForElement(element: IStepInputElement, params?: {
2
8
  minStep?: number | undefined;
3
9
  maxStep?: number;
4
10
  }): void;
11
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { deepClone } from "wenay-common2";
2
- import { ExRNDMap3, mapResiReact } from "../components";
2
+ import { ExRNDMap3 } from "../components/Dnd/RNDFunc3";
3
+ import { mapResiReact } from "../components/Dnd/Resizable";
3
4
  const staticProps = new Map();
4
5
  export function staticSet(key, data) {
5
6
  if (!staticProps.has(key))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wenay-react2",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Common react",
5
5
  "strict": true,
6
6
  "main": "dist/index.js",
@@ -22,8 +22,8 @@
22
22
  "re-resizable": "^6.11.2",
23
23
  "react": "^19.2.0",
24
24
  "react-dom": "^19.2.0",
25
- "react-rnd": "^10.5.2",
26
- "wenay-common2": "^1.0.17"
25
+ "react-rnd": "^10.5.3",
26
+ "wenay-common2": "^1.0.28"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "^19.2.0",
@@ -1,9 +0,0 @@
1
- export * from './Buttons';
2
- export * from './Dnd';
3
- export * from './Menu';
4
- export * from './Modal';
5
- export * from './Input';
6
- export * from './Parameters';
7
- export * from './ParametersEngine';
8
- export * from './MyResizeObserver';
9
- export * from './Other';
@@ -1,9 +0,0 @@
1
- export * from './Buttons';
2
- export * from './Dnd';
3
- export * from './Menu';
4
- export * from './Modal';
5
- export * from './Input';
6
- export * from './Parameters';
7
- export * from './ParametersEngine';
8
- export * from './MyResizeObserver';
9
- export * from './Other';