react-vant-nova 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.
Files changed (41) hide show
  1. package/README.md +2 -2
  2. package/bundle/index.css +149 -0
  3. package/bundle/index.min.css +1 -1
  4. package/bundle/react-vant-nova.es.js +949 -728
  5. package/bundle/react-vant-nova.js +868 -646
  6. package/bundle/react-vant-nova.min.js +2 -2
  7. package/es/empty/Network.d.ts +1 -0
  8. package/es/index.d.ts +1 -0
  9. package/es/index.js +2 -1
  10. package/es/radio/Radio.d.ts +1 -0
  11. package/es/radio/RadioGroup.d.ts +1 -0
  12. package/es/treeSelect/PropsType.d.ts +85 -0
  13. package/es/treeSelect/PropsType.js +1 -0
  14. package/es/treeSelect/TreeSelect.d.ts +4 -0
  15. package/es/treeSelect/TreeSelect.js +259 -0
  16. package/es/treeSelect/index.d.ts +5 -0
  17. package/es/treeSelect/index.js +4 -0
  18. package/es/treeSelect/style/index.css +149 -0
  19. package/es/treeSelect/style/var.css +0 -0
  20. package/es/utils/dom/render.js +12 -30
  21. package/es/utils/dom/render1.d.ts +9 -0
  22. package/es/utils/dom/render1.js +85 -0
  23. package/lib/empty/Network.d.ts +1 -0
  24. package/lib/index.css +149 -0
  25. package/lib/index.d.ts +1 -0
  26. package/lib/index.js +12 -0
  27. package/lib/index.min.css +1 -1
  28. package/lib/radio/Radio.d.ts +1 -0
  29. package/lib/radio/RadioGroup.d.ts +1 -0
  30. package/lib/treeSelect/PropsType.d.ts +85 -0
  31. package/lib/treeSelect/PropsType.js +6 -0
  32. package/lib/treeSelect/TreeSelect.d.ts +4 -0
  33. package/lib/treeSelect/TreeSelect.js +291 -0
  34. package/lib/treeSelect/index.d.ts +5 -0
  35. package/lib/treeSelect/index.js +16 -0
  36. package/lib/treeSelect/style/index.css +149 -0
  37. package/lib/treeSelect/style/var.css +0 -0
  38. package/lib/utils/dom/render.js +20 -32
  39. package/lib/utils/dom/render1.d.ts +9 -0
  40. package/lib/utils/dom/render1.js +106 -0
  41. package/package.json +1 -1
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.render = render;
7
+ exports.unmount = unmount;
8
+ function _tslib() {
9
+ const data = require("tslib");
10
+ _tslib = function () {
11
+ return data;
12
+ };
13
+ return data;
14
+ }
15
+ function ReactDOM() {
16
+ const data = _interopRequireWildcard(require("react-dom"));
17
+ ReactDOM = function () {
18
+ return data;
19
+ };
20
+ return data;
21
+ }
22
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
23
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
24
+ // Let compiler not to search module usage
25
+ const fullClone = Object.assign({}, ReactDOM());
26
+ const {
27
+ unmountComponentAtNode
28
+ } = fullClone;
29
+ let createRoot;
30
+ // 确保在React 18+版本中获取createRoot
31
+ if (fullClone.createRoot) {
32
+ createRoot = fullClone.createRoot;
33
+ } else {
34
+ // 如果createRoot不可用,尝试从react-dom/client导入
35
+ try {
36
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
37
+ createRoot = require('react-dom/client').createRoot;
38
+ } catch (e) {
39
+ // 保留原有行为以兼容旧版本
40
+ }
41
+ }
42
+ function toggleWarning(skip) {
43
+ const {
44
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
45
+ } = fullClone;
46
+ if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === 'object') {
47
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
48
+ }
49
+ }
50
+ const MARK = '__react_vant_root__';
51
+ /************* ✨ Windsurf Command ⭐ *************/
52
+ /**
53
+ * 使用ReactDOM.render的替代方案,仅用于旧版本React
54
+ * 如果ReactDOM.render不可用,将降级使用createRoot(如果可用)
55
+ /******* 57770e2e-0e81-41a7-aee6-9175a4a59062 *******/
56
+ function legacyRender(node, container) {
57
+ // 使用ReactDOM.render的替代方案,仅用于旧版本React
58
+ // @ts-ignore
59
+ if (fullClone.render) {
60
+ // @ts-ignore
61
+ fullClone.render(node, container);
62
+ } else {
63
+ // 如果ReactDOM.render不可用,降级使用createRoot(如果可用)
64
+ //@ts-ignore
65
+ if (createRoot) {
66
+ concurrentRender(node, container);
67
+ }
68
+ }
69
+ }
70
+ function concurrentRender(node, container) {
71
+ toggleWarning(true);
72
+ const root = container[MARK] || createRoot(container);
73
+ toggleWarning(false);
74
+ // @ts-ignore
75
+ root.render(node);
76
+ container[MARK] = root;
77
+ }
78
+ function render(node, container) {
79
+ //@ts-ignore
80
+ if (createRoot) {
81
+ concurrentRender(node, container);
82
+ return;
83
+ }
84
+ legacyRender(node, container);
85
+ }
86
+ // ========================== Unmount =========================
87
+ function legacyUnmount(container) {
88
+ return unmountComponentAtNode(container);
89
+ }
90
+ function concurrentUnmount(container) {
91
+ return (0, _tslib().__awaiter)(this, void 0, void 0, function* () {
92
+ // Delay to unmount to avoid React 18 sync warning
93
+ return Promise.resolve().then(() => {
94
+ var _a;
95
+ (_a = container[MARK]) === null || _a === void 0 ? void 0 : _a.unmount();
96
+ delete container[MARK];
97
+ });
98
+ });
99
+ }
100
+ function unmount(container) {
101
+ //@ts-ignore
102
+ if (createRoot) {
103
+ return concurrentUnmount(container);
104
+ }
105
+ return legacyUnmount(container);
106
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-vant-nova",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "React Mobile UI Components based on Vant UI (兼容 React 19+,新增轻量 Table 组件)",
5
5
  "keywords": [
6
6
  "ui",