@rainbow-oh/yee-c 0.8.18 → 0.8.20
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/cjs/Anchor/anchor.js +4 -1
- package/dist/cjs/Checkbox/checkbox-group.js +1 -1
- package/dist/cjs/Checkbox/checkbox.js +2 -1
- package/dist/cjs/Checkbox/style/index.less +3 -0
- package/dist/cjs/Form/Group.js +1 -3
- package/dist/cjs/Form/style/index.less +2 -0
- package/dist/cjs/Form/utils/validate.d.ts +1 -0
- package/dist/cjs/Form/utils/validate.js +3 -2
- package/dist/cjs/Progress/circle.js +46 -35
- package/dist/cjs/Progress/line.js +20 -11
- package/dist/cjs/Search/demo/basic.js +38 -3
- package/dist/cjs/Search/interface.d.ts +2 -2
- package/dist/cjs/Search/search.js +52 -32
- package/dist/cjs/Search/style/index.less +20 -3
- package/dist/cjs/Table/style/index.less +4 -2
- package/dist/cjs/Table/tbody/cell.js +2 -2
- package/dist/cjs/Transfer/interface.d.ts +0 -1
- package/dist/cjs/Transfer/style/index.less +4 -0
- package/dist/cjs/Transfer/transfer-list.js +1 -0
- package/dist/cjs/message/use-message.js +1 -3
- package/dist/cjs/notice/notice.js +1 -1
- package/dist/cjs/style/themes.css +1 -1
- package/dist/cjs/style/variables.css +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Checkbox/checkbox-group.js +1 -1
- package/dist/esm/Checkbox/checkbox.js +2 -1
- package/dist/esm/Checkbox/style/index.less +3 -0
- package/dist/esm/Form/Group.js +2 -2
- package/dist/esm/Form/style/index.less +2 -0
- package/dist/esm/Form/utils/validate.d.ts +1 -0
- package/dist/esm/Form/utils/validate.js +2 -2
- package/dist/esm/Search/demo/basic.js +61 -7
- package/dist/esm/Search/interface.d.ts +2 -2
- package/dist/esm/Search/search.js +22 -15
- package/dist/esm/Search/style/index.less +20 -3
- package/dist/esm/Table/style/index.less +4 -2
- package/dist/esm/Table/tbody/cell.js +2 -2
- package/dist/esm/Transfer/interface.d.ts +0 -1
- package/dist/esm/Transfer/style/index.less +4 -0
- package/dist/esm/Transfer/transfer-list.js +1 -0
- package/dist/esm/notice/notice.js +1 -1
- package/dist/esm/style/themes.css +1 -1
- package/dist/esm/style/variables.css +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/yee-c.min.css +1 -1
- package/dist/umd/yee-c.min.js +1 -1
- package/package.json +1 -1
- package/src/Anchor/anchor.tsx +9 -5
- package/src/Checkbox/checkbox-group.tsx +1 -1
- package/src/Checkbox/checkbox.tsx +1 -0
- package/src/Checkbox/style/index.less +3 -0
- package/src/Form/Group.tsx +2 -4
- package/src/Form/style/index.less +2 -0
- package/src/Form/utils/validate.ts +7 -2
- package/src/Progress/circle.tsx +5 -1
- package/src/Progress/line.tsx +5 -1
- package/src/Progress/progress.tsx +5 -1
- package/src/Search/demo/basic.tsx +43 -7
- package/src/Search/index.en-US.md +1 -1
- package/src/Search/index.zh-CN.md +1 -1
- package/src/Search/interface.ts +2 -2
- package/src/Search/search.tsx +40 -23
- package/src/Search/style/index.less +20 -3
- package/src/Spin/indicator.tsx +1 -1
- package/src/Table/style/index.less +4 -2
- package/src/Table/tbody/cell.tsx +2 -2
- package/src/Transfer/interface.ts +0 -1
- package/src/Transfer/style/index.less +4 -0
- package/src/Transfer/transfer-list.tsx +1 -0
- package/src/Tree/interface.ts +6 -1
- package/src/Tree/tree-node.tsx +7 -6
- package/src/Tree/utils/tree-tools.ts +4 -1
- package/src/Trigger/interface.ts +2 -1
- package/src/message/demo/base.tsx +1 -1
- package/src/message/interface.ts +1 -5
- package/src/message/message.test.tsx +15 -5
- package/src/message/message.tsx +10 -4
- package/src/message/use-message.tsx +2 -8
- package/src/message/wrapper.tsx +1 -2
- package/src/notice/interface.ts +1 -5
- package/src/notice/notice.test.tsx +14 -6
- package/src/notice/notice.tsx +12 -6
- package/src/notice/wrapper.tsx +1 -2
- package/src/version.ts +1 -1
- package/dist/cjs/Search/style/index.d.ts +0 -1
- package/dist/cjs/Search/style/index.js +0 -2
- package/dist/esm/Search/style/index.d.ts +0 -1
- package/dist/esm/Search/style/index.js +0 -1
- package/src/Search/style/index.ts +0 -1
|
@@ -88,12 +88,14 @@
|
|
|
88
88
|
--yee-input-border-color: var(--yee-error-color);
|
|
89
89
|
--yee-input-hover-border-color: var(--yee-error-color-hover);
|
|
90
90
|
--yee-input-focus-bs-color: var(--yee-error-color-border);
|
|
91
|
+
--yee-checkbox-border-color: var(--yee-error-color);
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
&&-warning {
|
|
94
95
|
--yee-input-border-color: var(--yee-warning-color);
|
|
95
96
|
--yee-input-hover-border-color: var(--yee-warning-color-hover);
|
|
96
97
|
--yee-input-focus-bs-color: var(--yee-warning-color-border);
|
|
98
|
+
--yee-checkbox-border-color: var(--yee-warning-color);
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
}
|
|
@@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
-
function isEmpty(
|
|
6
|
-
return
|
|
5
|
+
export function isEmpty(value) {
|
|
6
|
+
return value === undefined || value === null || value === '' || Array.isArray(value) && value.length === 0;
|
|
7
7
|
}
|
|
8
8
|
function verifyRuleOfMin(min, value) {
|
|
9
9
|
if (isEmpty(value)) return true;
|
|
@@ -1,15 +1,69 @@
|
|
|
1
|
-
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useMemo, useState } from 'react';
|
|
2
8
|
import Search from "../index";
|
|
9
|
+
var people = [{
|
|
10
|
+
key: 'ada',
|
|
11
|
+
value: 'ada',
|
|
12
|
+
label: 'Ada Lovelace'
|
|
13
|
+
}, {
|
|
14
|
+
key: 'grace',
|
|
15
|
+
value: 'grace',
|
|
16
|
+
label: 'Grace Hopper'
|
|
17
|
+
}, {
|
|
18
|
+
key: 'alan',
|
|
19
|
+
value: 'alan',
|
|
20
|
+
label: 'Alan Turing'
|
|
21
|
+
}, {
|
|
22
|
+
key: 'margaret',
|
|
23
|
+
value: 'margaret',
|
|
24
|
+
label: 'Margaret Hamilton'
|
|
25
|
+
}];
|
|
3
26
|
export default (function () {
|
|
4
|
-
var
|
|
5
|
-
|
|
27
|
+
var _useState = useState(''),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
keyword = _useState2[0],
|
|
30
|
+
setKeyword = _useState2[1];
|
|
31
|
+
var _useState3 = useState(null),
|
|
32
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
33
|
+
selected = _useState4[0],
|
|
34
|
+
setSelected = _useState4[1];
|
|
35
|
+
var results = useMemo(function () {
|
|
36
|
+
var normalizedKeyword = keyword.trim().toLowerCase();
|
|
37
|
+
var matched = people.filter(function (person) {
|
|
38
|
+
return String(person.label).toLowerCase().includes(normalizedKeyword);
|
|
39
|
+
});
|
|
40
|
+
return matched.length > 0 ? matched : [{
|
|
41
|
+
key: 'empty',
|
|
42
|
+
value: 'empty',
|
|
43
|
+
label: 'No results found',
|
|
44
|
+
disabled: true
|
|
45
|
+
}];
|
|
46
|
+
}, [keyword]);
|
|
47
|
+
var handleSelect = function handleSelect(option) {
|
|
48
|
+
setSelected(option);
|
|
49
|
+
if (option) {
|
|
50
|
+
setKeyword(String(option.label));
|
|
51
|
+
}
|
|
6
52
|
};
|
|
7
53
|
return /*#__PURE__*/React.createElement("div", {
|
|
8
54
|
style: {
|
|
9
|
-
width:
|
|
55
|
+
width: 320
|
|
10
56
|
}
|
|
11
57
|
}, /*#__PURE__*/React.createElement(Search, {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
58
|
+
allowClear: true,
|
|
59
|
+
value: keyword,
|
|
60
|
+
options: results,
|
|
61
|
+
placeholder: "Search people",
|
|
62
|
+
onSearch: setKeyword,
|
|
63
|
+
onChange: handleSelect
|
|
64
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
style: {
|
|
66
|
+
marginTop: 12
|
|
67
|
+
}
|
|
68
|
+
}, "Selected: ", selected ? String(selected.label) : 'None'));
|
|
15
69
|
});
|
|
@@ -50,7 +50,7 @@ export interface SearchProps extends Omit<React.InputHTMLAttributes<HTMLInputEle
|
|
|
50
50
|
/**
|
|
51
51
|
* @description Suffix content
|
|
52
52
|
*/
|
|
53
|
-
suffix?: React.ReactNode;
|
|
53
|
+
suffix?: React.ReactNode | false;
|
|
54
54
|
/**
|
|
55
55
|
* @description Whether disabled
|
|
56
56
|
* @default false
|
|
@@ -74,7 +74,7 @@ export interface SearchProps extends Omit<React.InputHTMLAttributes<HTMLInputEle
|
|
|
74
74
|
* @description trigger search event
|
|
75
75
|
* @default 'typing'
|
|
76
76
|
*/
|
|
77
|
-
searchOnAction?: 'typing' | 'enter';
|
|
77
|
+
searchOnAction?: 'typing' | 'enter' | 'button';
|
|
78
78
|
/**
|
|
79
79
|
* @description suggest data
|
|
80
80
|
*/
|
|
@@ -13,7 +13,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
15
|
import clsx from 'clsx';
|
|
16
|
-
import { X } from 'lucide-react';
|
|
16
|
+
import { Search as SearchIcon, X } from 'lucide-react';
|
|
17
17
|
import React, { startTransition, useContext, useEffect, useId, useRef, useState } from 'react';
|
|
18
18
|
import { GlobalContext } from "../Config-Provider";
|
|
19
19
|
import useMergedState from "../hooks/useMergedState";
|
|
@@ -92,20 +92,12 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
|
|
|
92
92
|
(_popupRef$current = popupRef.current) === null || _popupRef$current === void 0 || _popupRef$current.focus();
|
|
93
93
|
} else {}
|
|
94
94
|
}, [open]);
|
|
95
|
-
var handleSearch = function handleSearch(e) {
|
|
96
|
-
if (disabled) return;
|
|
97
|
-
onSearch === null || onSearch === void 0 || onSearch(searchValue);
|
|
98
|
-
if ((e === null || e === void 0 ? void 0 : e.type) === 'click') {
|
|
99
|
-
var _blur, _ref;
|
|
100
|
-
(_blur = (_ref = e.target).blur) === null || _blur === void 0 || _blur.call(_ref);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
95
|
var handleChange = function handleChange(e) {
|
|
104
96
|
var newValue = e.target.value;
|
|
105
97
|
setSearchValue(newValue);
|
|
106
98
|
startTransition(function () {
|
|
107
99
|
if (searchOnAction === 'typing') {
|
|
108
|
-
|
|
100
|
+
onSearch === null || onSearch === void 0 || onSearch(newValue);
|
|
109
101
|
}
|
|
110
102
|
});
|
|
111
103
|
};
|
|
@@ -115,10 +107,24 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
|
|
|
115
107
|
onChange === null || onChange === void 0 || onChange(null);
|
|
116
108
|
onSearch === null || onSearch === void 0 || onSearch('');
|
|
117
109
|
};
|
|
110
|
+
var handleSearchClick = function handleSearchClick(e) {
|
|
111
|
+
e.stopPropagation();
|
|
112
|
+
if (searchOnAction === 'button') {
|
|
113
|
+
onSearch === null || onSearch === void 0 || onSearch(searchValue);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
var renderSearchIcon = function renderSearchIcon() {
|
|
117
|
+
if (suffix === false) return null;
|
|
118
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
119
|
+
className: "".concat(prefixCls, "-search-icon"),
|
|
120
|
+
onClick: handleSearchClick
|
|
121
|
+
}, suffix || /*#__PURE__*/React.createElement(SearchIcon, {
|
|
122
|
+
size: 14
|
|
123
|
+
}));
|
|
124
|
+
};
|
|
118
125
|
var renderSuffix = function renderSuffix() {
|
|
119
|
-
var
|
|
120
|
-
var
|
|
121
|
-
var showSuffix = suffix || showClearIcon;
|
|
126
|
+
var showClearIcon = allowClear && !disabled && !rest.readOnly;
|
|
127
|
+
var showSuffix = suffix !== false || suffix !== null || showClearIcon;
|
|
122
128
|
if (!showSuffix) {
|
|
123
129
|
return null;
|
|
124
130
|
}
|
|
@@ -141,7 +147,7 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
|
|
|
141
147
|
}, /*#__PURE__*/React.createElement(X, {
|
|
142
148
|
size: 14,
|
|
143
149
|
"aria-hidden": "true"
|
|
144
|
-
})),
|
|
150
|
+
})), renderSearchIcon());
|
|
145
151
|
};
|
|
146
152
|
var renderPrefix = function renderPrefix() {
|
|
147
153
|
if (!prefix) return null;
|
|
@@ -154,7 +160,7 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
|
|
|
154
160
|
return clsx("".concat(prefixCls, "-input"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-input-small"), size === 'small'), "".concat(prefixCls, "-input-large"), size === 'large'), "".concat(prefixCls, "-input-disabled"), disabled), classNames === null || classNames === void 0 ? void 0 : classNames.input);
|
|
155
161
|
};
|
|
156
162
|
var getRootClassName = function getRootClassName() {
|
|
157
|
-
return clsx(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-borderless"), !bordered), "".concat(prefixCls, "-small"), size === 'small'), "".concat(prefixCls, "-large"), size === 'large'), className);
|
|
163
|
+
return clsx(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-with-clear"), allowClear && searchValue), "".concat(prefixCls, "-borderless"), !bordered), "".concat(prefixCls, "-small"), size === 'small'), "".concat(prefixCls, "-large"), size === 'large'), className);
|
|
158
164
|
};
|
|
159
165
|
var hasPopup = Array.isArray(options) || Array.isArray(suggestions);
|
|
160
166
|
var popup = /*#__PURE__*/React.createElement("div", {
|
|
@@ -176,6 +182,7 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
|
|
|
176
182
|
return /*#__PURE__*/React.createElement(Trigger, {
|
|
177
183
|
popup: popup,
|
|
178
184
|
open: open,
|
|
185
|
+
stretch: "width",
|
|
179
186
|
onOpenChange: setOpen
|
|
180
187
|
}, /*#__PURE__*/React.createElement("div", {
|
|
181
188
|
className: getRootClassName(),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @import '../../style/index.less';
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@cls: ~'yee-search';
|
|
4
4
|
|
|
5
|
-
.@{
|
|
5
|
+
.@{cls} {
|
|
6
6
|
position: relative;
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
align-items: center;
|
|
@@ -69,9 +69,10 @@
|
|
|
69
69
|
border: none;
|
|
70
70
|
outline: none;
|
|
71
71
|
transition: all 0.2s;
|
|
72
|
+
line-height: var(--yee-input-line-height);
|
|
72
73
|
|
|
73
74
|
&::placeholder {
|
|
74
|
-
color: var(--yee-
|
|
75
|
+
color: var(--yee-placeholder-color);
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
&-disabled {
|
|
@@ -99,7 +100,17 @@
|
|
|
99
100
|
color: var(--yee-input-fix-icon-color);
|
|
100
101
|
}
|
|
101
102
|
|
|
103
|
+
&-search-icon {
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
}
|
|
106
|
+
|
|
102
107
|
&-clear-icon {
|
|
108
|
+
display: inline-flex;
|
|
109
|
+
padding: var(--yee-input-clear-padding);
|
|
110
|
+
color: var(--yee-input-clear-color);
|
|
111
|
+
background-color: var(--yee-input-clear-bg-color);
|
|
112
|
+
border-radius: 50%;
|
|
113
|
+
visibility: hidden;
|
|
103
114
|
cursor: pointer;
|
|
104
115
|
transition: color 0.2s;
|
|
105
116
|
|
|
@@ -108,6 +119,12 @@
|
|
|
108
119
|
}
|
|
109
120
|
}
|
|
110
121
|
|
|
122
|
+
&&-with-clear:not(.@{cls}-disabled):hover {
|
|
123
|
+
.@{cls}-clear-icon {
|
|
124
|
+
visibility: visible;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
111
128
|
&-button {
|
|
112
129
|
display: flex;
|
|
113
130
|
align-items: center;
|
|
@@ -97,7 +97,8 @@
|
|
|
97
97
|
width: 15px;
|
|
98
98
|
right: -15px;
|
|
99
99
|
top: 0;
|
|
100
|
-
box-shadow: inset 4px 0 8px -4px
|
|
100
|
+
box-shadow: inset 4px 0 8px -4px
|
|
101
|
+
var(--yee-table-fixed-left-after-bs-color);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
|
|
@@ -111,7 +112,8 @@
|
|
|
111
112
|
width: 15px;
|
|
112
113
|
left: -15px;
|
|
113
114
|
top: 0;
|
|
114
|
-
box-shadow: inset -4px 0 8px -4px
|
|
115
|
+
box-shadow: inset -4px 0 8px -4px
|
|
116
|
+
var(--yee-table-fixed-right-after-bs-color);
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
119
|
}
|
|
@@ -43,7 +43,7 @@ var TableCell = function TableCell(props) {
|
|
|
43
43
|
var getTdProps = function getTdProps() {
|
|
44
44
|
var title = render ? undefined : record[dataIndex || ''];
|
|
45
45
|
var cls = clsx("".concat(prefixCls, "-cell"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-cell-fixed-").concat(fixed), fixed), "".concat(prefixCls, "-cell-fixed-").concat(fixed, "-first"), isFixedRightFirst), "".concat(prefixCls, "-cell-fixed-").concat(fixed, "-last"), isFixedLeftLast), className);
|
|
46
|
-
var
|
|
46
|
+
var _style = _objectSpread(_objectSpread({}, style), {}, {
|
|
47
47
|
width: width,
|
|
48
48
|
maxWidth: width,
|
|
49
49
|
textAlign: align
|
|
@@ -51,7 +51,7 @@ var TableCell = function TableCell(props) {
|
|
|
51
51
|
var _title = typeof title === 'string' ? title : undefined;
|
|
52
52
|
return _objectSpread(_objectSpread({}, cellProperty), {}, {
|
|
53
53
|
className: cls,
|
|
54
|
-
style:
|
|
54
|
+
style: _style,
|
|
55
55
|
title: _title
|
|
56
56
|
});
|
|
57
57
|
};
|
|
@@ -115,7 +115,6 @@ export interface TransferListProps {
|
|
|
115
115
|
total?: number;
|
|
116
116
|
};
|
|
117
117
|
draggable?: boolean;
|
|
118
|
-
targetMinCountLimit?: number;
|
|
119
118
|
onDrop?: (dropObj: Record<string, any>, dataSource: DataSource[]) => void;
|
|
120
119
|
onDelete?: (key: string | number) => void;
|
|
121
120
|
onItemSelect: (keys: Array<string | number>) => void;
|
|
@@ -66,6 +66,10 @@
|
|
|
66
66
|
line-height: var(--yee-transfer-list-item-height, 32px);
|
|
67
67
|
padding: var(--yee-transfer-list-item-padding, 0 11px);
|
|
68
68
|
|
|
69
|
+
&-checkbox {
|
|
70
|
+
width: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
69
73
|
&:hover:not(.yee-one-way):not(.disabled) {
|
|
70
74
|
color: var(--yee-transfer-list-content-item-hover-color);
|
|
71
75
|
background-color: var(--yee-transfer-list-content-item-hover-bg-color);
|
|
@@ -192,6 +192,7 @@ var TransferList = function TransferList(props) {
|
|
|
192
192
|
className: "".concat(prefixCls, "-list-item"),
|
|
193
193
|
key: option.value || index
|
|
194
194
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
195
|
+
className: "".concat(prefixCls, "-list-item-checkbox"),
|
|
195
196
|
value: option.value,
|
|
196
197
|
disabled: option.disabled || disabled,
|
|
197
198
|
checked: checkedKeys.includes(option.value),
|
|
@@ -9,9 +9,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import { CircleAlert, CircleCheck, CircleX, Info, X } from 'lucide-react';
|
|
11
11
|
import React from 'react';
|
|
12
|
+
import Button from "../Button";
|
|
12
13
|
import Progress from "../Progress";
|
|
13
14
|
import useCountdown from "../hooks/useCountdown";
|
|
14
|
-
import Button from "../Button";
|
|
15
15
|
var icons = {
|
|
16
16
|
info: /*#__PURE__*/React.createElement(Info, {
|
|
17
17
|
size: 22,
|
package/dist/esm/version.d.ts
CHANGED
package/dist/esm/version.js
CHANGED