one-design-next 0.0.33 → 0.0.35
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/input-otp/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var _excluded = ["className", "style", "length", "size", "disabled", "autoFocus"
|
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
-
import {
|
|
5
|
+
import { OTPField } from '@base-ui/react/otp-field';
|
|
6
6
|
import React, { useEffect, useImperativeHandle, useRef } from 'react';
|
|
7
7
|
import "./style";
|
|
8
8
|
var InputOtp = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
@@ -20,6 +20,7 @@ export interface TreeSelectProps extends Omit<RcTreeSelectProps, 'treeData'> {
|
|
|
20
20
|
showInnerSearch?: boolean;
|
|
21
21
|
light?: boolean;
|
|
22
22
|
popupRender?: (menu: React.ReactElement) => React.ReactElement;
|
|
23
|
+
checkStrictly?: boolean;
|
|
23
24
|
}
|
|
24
25
|
declare const TreeSelect: React.FC<TreeSelectProps>;
|
|
25
26
|
export default TreeSelect;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var _excluded = ["mode", "suffixIcon", "visible", "onVisibleChange", "treeCheckable", "className", "showInnerSearch", "light", "popupRender", "searchValue", "onSearch"];
|
|
1
|
+
var _excluded = ["mode", "suffixIcon", "visible", "onVisibleChange", "treeCheckable", "className", "showInnerSearch", "light", "popupRender", "searchValue", "onSearch", "checkStrictly", "value", "defaultValue", "onChange"];
|
|
3
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -14,13 +13,31 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
14
13
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
14
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
15
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
17
17
|
import clsx from 'clsx';
|
|
18
18
|
import RcTreeSelect from 'rc-tree-select';
|
|
19
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
19
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
20
20
|
import Icon from "../icon";
|
|
21
21
|
import "../select/style";
|
|
22
22
|
import useIcons from "../select/useIcons";
|
|
23
23
|
import "./style";
|
|
24
|
+
function toLabelInValue(val) {
|
|
25
|
+
if (val === undefined || val === null) return undefined;
|
|
26
|
+
var arr = Array.isArray(val) ? val : [val];
|
|
27
|
+
return arr.map(function (v) {
|
|
28
|
+
return _typeof(v) === 'object' && v !== null && 'value' in v ? v : {
|
|
29
|
+
value: v,
|
|
30
|
+
label: v
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function toSimpleValues(val) {
|
|
35
|
+
if (val === undefined || val === null) return [];
|
|
36
|
+
var arr = Array.isArray(val) ? val : [val];
|
|
37
|
+
return arr.map(function (v) {
|
|
38
|
+
return v.value;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
24
41
|
var TreeSelect = function TreeSelect(_ref) {
|
|
25
42
|
var mode = _ref.mode,
|
|
26
43
|
_ref$suffixIcon = _ref.suffixIcon,
|
|
@@ -39,8 +56,31 @@ var TreeSelect = function TreeSelect(_ref) {
|
|
|
39
56
|
popupRender = _ref.popupRender,
|
|
40
57
|
searchValueProp = _ref.searchValue,
|
|
41
58
|
onSearch = _ref.onSearch,
|
|
59
|
+
_ref$checkStrictly = _ref.checkStrictly,
|
|
60
|
+
checkStrictly = _ref$checkStrictly === void 0 ? false : _ref$checkStrictly,
|
|
61
|
+
valueProp = _ref.value,
|
|
62
|
+
defaultValueProp = _ref.defaultValue,
|
|
63
|
+
onChangeProp = _ref.onChange,
|
|
42
64
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
65
|
var isMultiple = mode === 'multiple';
|
|
66
|
+
var rcValue = useMemo(function () {
|
|
67
|
+
return checkStrictly ? toLabelInValue(valueProp) : valueProp;
|
|
68
|
+
}, [checkStrictly, valueProp]);
|
|
69
|
+
var rcDefaultValue = useMemo(function () {
|
|
70
|
+
return checkStrictly ? toLabelInValue(defaultValueProp) : defaultValueProp;
|
|
71
|
+
}, [checkStrictly, defaultValueProp]);
|
|
72
|
+
var rcOnChange = useCallback(function () {
|
|
73
|
+
if (!onChangeProp) return;
|
|
74
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
75
|
+
args[_key] = arguments[_key];
|
|
76
|
+
}
|
|
77
|
+
if (checkStrictly) {
|
|
78
|
+
var simpleValues = toSimpleValues(args[0]);
|
|
79
|
+
onChangeProp(simpleValues, args[1], args[2]);
|
|
80
|
+
} else {
|
|
81
|
+
onChangeProp.apply(void 0, args);
|
|
82
|
+
}
|
|
83
|
+
}, [checkStrictly, onChangeProp]);
|
|
44
84
|
var _useIcons = useIcons(_objectSpread(_objectSpread({}, rest), {}, {
|
|
45
85
|
multiple: isMultiple,
|
|
46
86
|
hasFeedback: false,
|
|
@@ -102,7 +142,8 @@ var TreeSelect = function TreeSelect(_ref) {
|
|
|
102
142
|
treeCheckable: isMultiple ? treeCheckable ? /*#__PURE__*/React.createElement("span", {
|
|
103
143
|
className: "odn-select-tree-checkbox-inner"
|
|
104
144
|
}) : treeCheckable : false,
|
|
105
|
-
|
|
145
|
+
treeCheckStrictly: checkStrictly,
|
|
146
|
+
showCheckedStrategy: checkStrictly ? 'SHOW_ALL' : 'SHOW_PARENT',
|
|
106
147
|
searchValue: searchValue,
|
|
107
148
|
dropdownRender: function dropdownRender(menu) {
|
|
108
149
|
var searchNode = showInnerSearch ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -133,7 +174,10 @@ var TreeSelect = function TreeSelect(_ref) {
|
|
|
133
174
|
var content = /*#__PURE__*/React.createElement(React.Fragment, null, searchNode, menu);
|
|
134
175
|
return popupRender ? popupRender(content) : content;
|
|
135
176
|
},
|
|
136
|
-
notFoundContent: "\u65E0\u5339\u914D\u7ED3\u679C"
|
|
177
|
+
notFoundContent: "\u65E0\u5339\u914D\u7ED3\u679C",
|
|
178
|
+
value: rcValue,
|
|
179
|
+
defaultValue: rcDefaultValue,
|
|
180
|
+
onChange: rcOnChange
|
|
137
181
|
}, rest));
|
|
138
182
|
};
|
|
139
183
|
TreeSelect.displayName = 'TreeSelect';
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "one-design-next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"description": "One Design Next from TAD@tencent.com",
|
|
5
|
-
"packageManager": "pnpm@
|
|
5
|
+
"packageManager": "pnpm@11.8.0",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"type": "module",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@fontsource/jetbrains-mono": "^5.2.8",
|
|
89
89
|
"@fontsource/noto-sans-sc": "^5.2.9",
|
|
90
90
|
"@tailwindcss/postcss": "^4",
|
|
91
|
-
"@tailwindcss/vite": "^4.3.
|
|
91
|
+
"@tailwindcss/vite": "^4.3.1",
|
|
92
92
|
"@testing-library/dom": "^10.4.1",
|
|
93
93
|
"@testing-library/jest-dom": "^6.9.1",
|
|
94
94
|
"@testing-library/react": "^16.3.2",
|
|
@@ -97,24 +97,26 @@
|
|
|
97
97
|
"@types/d3": "^7.4.3",
|
|
98
98
|
"@types/d3-cloud": "^1.2.9",
|
|
99
99
|
"@types/fs-extra": "^11.0.4",
|
|
100
|
+
"@types/node": "^20.5.1",
|
|
100
101
|
"@types/pngjs": "^6.0.5",
|
|
101
102
|
"@types/react": "^18.0.0",
|
|
102
103
|
"@types/react-dom": "^18.0.0",
|
|
103
104
|
"@umijs/lint": "latest",
|
|
104
105
|
"@umijs/plugins": "latest",
|
|
105
|
-
"@vitejs/plugin-react": "^
|
|
106
|
-
"@vitest/browser": "^
|
|
107
|
-
"@vitest/
|
|
108
|
-
"@
|
|
106
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
107
|
+
"@vitest/browser": "^4.1.9",
|
|
108
|
+
"@vitest/browser-playwright": "4.1.9",
|
|
109
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
110
|
+
"@xyflow/react": "^12.11.0",
|
|
109
111
|
"copy-to-clipboard": "latest",
|
|
110
112
|
"d3": "^7.9.0",
|
|
111
113
|
"d3-cloud": "^1.2.9",
|
|
112
114
|
"dumi": "latest",
|
|
113
|
-
"echarts": "^6.
|
|
115
|
+
"echarts": "^6.1.0",
|
|
114
116
|
"echarts-for-react": "^3.0.6",
|
|
115
117
|
"eslint": "^9.32.0",
|
|
116
118
|
"father": "^4.1.0",
|
|
117
|
-
"fs-extra": "^11.3.
|
|
119
|
+
"fs-extra": "^11.3.5",
|
|
118
120
|
"github-slugger": "^2.0.0",
|
|
119
121
|
"glob": "latest",
|
|
120
122
|
"husky": "^8.0.1",
|
|
@@ -122,11 +124,11 @@
|
|
|
122
124
|
"lucide-react": "latest",
|
|
123
125
|
"p5i": "^0.6.0",
|
|
124
126
|
"pixelmatch": "^7.2.0",
|
|
125
|
-
"playwright": "^1.
|
|
127
|
+
"playwright": "^1.61.0",
|
|
126
128
|
"pngjs": "^7.0.0",
|
|
127
|
-
"prettier": "^3.
|
|
129
|
+
"prettier": "^3.8.4",
|
|
128
130
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
129
|
-
"prettier-plugin-packagejson": "^
|
|
131
|
+
"prettier-plugin-packagejson": "^3.0.2",
|
|
130
132
|
"prism-react-renderer": "^2.4.1",
|
|
131
133
|
"react": "^18.0.0",
|
|
132
134
|
"react-d3-cloud": "^1.0.6",
|
|
@@ -139,20 +141,21 @@
|
|
|
139
141
|
"tailwind-merge": "^3.6.0",
|
|
140
142
|
"tailwindcss": "^4",
|
|
141
143
|
"tweakpane": "latest",
|
|
142
|
-
"typescript": "^
|
|
143
|
-
"
|
|
144
|
+
"typescript": "^6.0.3",
|
|
145
|
+
"vite": "^8.0.16",
|
|
146
|
+
"vitest": "^4.1.9"
|
|
144
147
|
},
|
|
145
148
|
"dependencies": {
|
|
146
|
-
"@base-ui/react": "^1.
|
|
149
|
+
"@base-ui/react": "^1.6.0",
|
|
147
150
|
"@daypicker/react": "^10.0.1",
|
|
148
151
|
"@floating-ui/react": "^0.27.19",
|
|
149
152
|
"@number-flow/react": "^0.6.0",
|
|
150
153
|
"@paper-design/shaders-react": "^0.0.76",
|
|
151
|
-
"@radix-ui/react-slot": "^1.
|
|
154
|
+
"@radix-ui/react-slot": "^1.3.0",
|
|
152
155
|
"clsx": "^2.1.1",
|
|
153
156
|
"echarts-for-react": "^3.0.6",
|
|
154
157
|
"ldrs": "^1.1.9",
|
|
155
|
-
"motion": "^12.
|
|
158
|
+
"motion": "^12.40.0",
|
|
156
159
|
"rc-cascader": "^3.34.0",
|
|
157
160
|
"rc-select": "^14.16.8",
|
|
158
161
|
"rc-slider": "^11.1.9",
|