@sheinx/hooks 3.7.0-beta.4 → 3.7.0-beta.40
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/cjs/common/use-component-memo/index.d.ts +2 -0
- package/cjs/common/use-component-memo/index.d.ts.map +1 -0
- package/cjs/common/use-component-memo/index.js +13 -0
- package/cjs/common/use-component-memo/use-memo.d.ts +2 -0
- package/cjs/common/use-component-memo/use-memo.d.ts.map +1 -0
- package/cjs/common/{use-memo → use-component-memo}/use-memo.js +2 -2
- package/cjs/common/use-filter/index.d.ts +1 -0
- package/cjs/common/use-filter/index.d.ts.map +1 -1
- package/cjs/common/use-filter/index.js +7 -0
- package/cjs/common/use-filter/use-filter-context.d.ts +7 -0
- package/cjs/common/use-filter/use-filter-context.d.ts.map +1 -0
- package/cjs/common/use-filter/use-filter-context.js +10 -0
- package/cjs/common/use-filter/use-filter.d.ts +1 -0
- package/cjs/common/use-filter/use-filter.d.ts.map +1 -1
- package/cjs/common/use-filter/use-filter.js +2 -0
- package/cjs/common/use-position-style/check-element-size.d.ts +10 -0
- package/cjs/common/use-position-style/check-element-size.d.ts.map +1 -0
- package/cjs/common/use-position-style/check-element-size.js +65 -0
- package/cjs/common/use-position-style/index.d.ts.map +1 -1
- package/cjs/common/use-position-style/index.js +5 -8
- package/cjs/components/use-datepicker/index.d.ts +1 -1
- package/cjs/components/use-datepicker/index.d.ts.map +1 -1
- package/cjs/components/use-datepicker/index.js +23 -2
- package/cjs/components/use-datepicker/use-datepicker-format.d.ts +17 -0
- package/cjs/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-datepicker-format.js +15 -3
- package/cjs/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
- package/cjs/components/use-form/use-form-control/use-form-control.js +15 -2
- package/cjs/components/use-form/use-form-control/use-form-control.type.d.ts +3 -0
- package/cjs/components/use-form/use-form-control/use-form-control.type.d.ts.map +1 -1
- package/cjs/components/use-form/use-form.d.ts +4 -4
- package/cjs/components/use-form/use-form.d.ts.map +1 -1
- package/cjs/components/use-form/use-form.js +54 -26
- package/cjs/components/use-form/use-form.type.d.ts +9 -0
- package/cjs/components/use-form/use-form.type.d.ts.map +1 -1
- package/cjs/components/use-image/use-image.d.ts +2 -0
- package/cjs/components/use-image/use-image.d.ts.map +1 -1
- package/cjs/components/use-image/use-image.js +40 -2
- package/cjs/components/use-popup/popup-context.d.ts +2 -0
- package/cjs/components/use-popup/popup-context.d.ts.map +1 -1
- package/cjs/components/use-popup/popup-context.js +2 -0
- package/cjs/components/use-popup/use-popup.d.ts +4 -0
- package/cjs/components/use-popup/use-popup.d.ts.map +1 -1
- package/cjs/components/use-popup/use-popup.js +33 -13
- package/cjs/components/use-table/index.d.ts +1 -1
- package/cjs/components/use-table/index.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-group.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-group.js +3 -1
- package/cjs/components/use-table/use-table-layout.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-layout.js +0 -1
- package/cjs/components/use-table/use-table-virtual.d.ts +1 -2
- package/cjs/components/use-table/use-table-virtual.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-virtual.js +14 -12
- package/cjs/components/use-table/use-table.type.d.ts +13 -15
- package/cjs/components/use-table/use-table.type.d.ts.map +1 -1
- package/cjs/components/use-tree/use-tree.d.ts.map +1 -1
- package/cjs/components/use-tree/use-tree.js +25 -7
- package/cjs/components/use-tree/use-tree.type.d.ts +1 -0
- package/cjs/components/use-tree/use-tree.type.d.ts.map +1 -1
- package/cjs/components/use-upload/use-upload.d.ts.map +1 -1
- package/cjs/components/use-upload/use-upload.js +54 -34
- package/cjs/components/use-upload/use-upload.type.d.ts +7 -0
- package/cjs/components/use-upload/use-upload.type.d.ts.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +4 -4
- package/cjs/utils/highlight.d.ts +7 -0
- package/cjs/utils/highlight.d.ts.map +1 -0
- package/cjs/utils/highlight.js +67 -0
- package/cjs/utils/index.d.ts +1 -0
- package/cjs/utils/index.d.ts.map +1 -1
- package/cjs/utils/index.js +12 -0
- package/cjs/utils/string.d.ts +1 -0
- package/cjs/utils/string.d.ts.map +1 -1
- package/cjs/utils/string.js +13 -0
- package/esm/common/use-component-memo/index.d.ts +2 -0
- package/esm/common/use-component-memo/index.d.ts.map +1 -0
- package/esm/common/use-component-memo/index.js +2 -0
- package/esm/common/use-component-memo/use-memo.d.ts +2 -0
- package/esm/common/use-component-memo/use-memo.d.ts.map +1 -0
- package/esm/common/{use-memo → use-component-memo}/use-memo.js +1 -1
- package/esm/common/use-filter/index.d.ts +1 -0
- package/esm/common/use-filter/index.d.ts.map +1 -1
- package/esm/common/use-filter/index.js +2 -1
- package/esm/common/use-filter/use-filter-context.d.ts +7 -0
- package/esm/common/use-filter/use-filter-context.d.ts.map +1 -0
- package/esm/common/use-filter/use-filter-context.js +3 -0
- package/esm/common/use-filter/use-filter.d.ts +1 -0
- package/esm/common/use-filter/use-filter.d.ts.map +1 -1
- package/esm/common/use-filter/use-filter.js +2 -0
- package/esm/common/use-position-style/check-element-size.d.ts +10 -0
- package/esm/common/use-position-style/check-element-size.d.ts.map +1 -0
- package/esm/common/use-position-style/check-element-size.js +59 -0
- package/esm/common/use-position-style/index.d.ts.map +1 -1
- package/esm/common/use-position-style/index.js +5 -8
- package/esm/components/use-datepicker/index.d.ts +1 -1
- package/esm/components/use-datepicker/index.d.ts.map +1 -1
- package/esm/components/use-datepicker/index.js +1 -1
- package/esm/components/use-datepicker/use-datepicker-format.d.ts +17 -0
- package/esm/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-datepicker-format.js +14 -2
- package/esm/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
- package/esm/components/use-form/use-form-control/use-form-control.js +15 -2
- package/esm/components/use-form/use-form-control/use-form-control.type.d.ts +3 -0
- package/esm/components/use-form/use-form-control/use-form-control.type.d.ts.map +1 -1
- package/esm/components/use-form/use-form.d.ts +4 -4
- package/esm/components/use-form/use-form.d.ts.map +1 -1
- package/esm/components/use-form/use-form.js +54 -26
- package/esm/components/use-form/use-form.type.d.ts +9 -0
- package/esm/components/use-form/use-form.type.d.ts.map +1 -1
- package/esm/components/use-image/use-image.d.ts +2 -0
- package/esm/components/use-image/use-image.d.ts.map +1 -1
- package/esm/components/use-image/use-image.js +40 -2
- package/esm/components/use-popup/popup-context.d.ts +2 -0
- package/esm/components/use-popup/popup-context.d.ts.map +1 -1
- package/esm/components/use-popup/popup-context.js +2 -0
- package/esm/components/use-popup/use-popup.d.ts +4 -0
- package/esm/components/use-popup/use-popup.d.ts.map +1 -1
- package/esm/components/use-popup/use-popup.js +34 -14
- package/esm/components/use-table/index.d.ts +1 -1
- package/esm/components/use-table/index.d.ts.map +1 -1
- package/esm/components/use-table/use-table-group.d.ts.map +1 -1
- package/esm/components/use-table/use-table-group.js +3 -1
- package/esm/components/use-table/use-table-layout.d.ts.map +1 -1
- package/esm/components/use-table/use-table-layout.js +0 -1
- package/esm/components/use-table/use-table-virtual.d.ts +1 -2
- package/esm/components/use-table/use-table-virtual.d.ts.map +1 -1
- package/esm/components/use-table/use-table-virtual.js +14 -12
- package/esm/components/use-table/use-table.type.d.ts +13 -15
- package/esm/components/use-table/use-table.type.d.ts.map +1 -1
- package/esm/components/use-tree/use-tree.d.ts.map +1 -1
- package/esm/components/use-tree/use-tree.js +26 -8
- package/esm/components/use-tree/use-tree.type.d.ts +1 -0
- package/esm/components/use-tree/use-tree.type.d.ts.map +1 -1
- package/esm/components/use-upload/use-upload.d.ts.map +1 -1
- package/esm/components/use-upload/use-upload.js +54 -34
- package/esm/components/use-upload/use-upload.type.d.ts +7 -0
- package/esm/components/use-upload/use-upload.type.d.ts.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/utils/highlight.d.ts +7 -0
- package/esm/utils/highlight.d.ts.map +1 -0
- package/esm/utils/highlight.js +59 -0
- package/esm/utils/index.d.ts +1 -0
- package/esm/utils/index.d.ts.map +1 -1
- package/esm/utils/index.js +1 -0
- package/esm/utils/string.d.ts +1 -0
- package/esm/utils/string.d.ts.map +1 -1
- package/esm/utils/string.js +12 -0
- package/package.json +1 -1
- package/cjs/common/use-memo/index.d.ts +0 -2
- package/cjs/common/use-memo/index.d.ts.map +0 -1
- package/cjs/common/use-memo/index.js +0 -20
- package/cjs/common/use-memo/use-memo.d.ts +0 -2
- package/cjs/common/use-memo/use-memo.d.ts.map +0 -1
- package/esm/common/use-memo/index.d.ts +0 -2
- package/esm/common/use-memo/index.d.ts.map +0 -1
- package/esm/common/use-memo/index.js +0 -2
- package/esm/common/use-memo/use-memo.d.ts +0 -2
- package/esm/common/use-memo/use-memo.d.ts.map +0 -1
@@ -58,11 +58,12 @@ var promised = function promised(action) {
|
|
58
58
|
resolve(true);
|
59
59
|
});
|
60
60
|
};
|
61
|
+
var defaultValue = [];
|
61
62
|
var useUpload = function useUpload(props) {
|
62
63
|
var _props$limit = props.limit,
|
63
64
|
limit = _props$limit === void 0 ? 100 : _props$limit,
|
64
65
|
_props$value = props.value,
|
65
|
-
value = _props$value === void 0 ?
|
66
|
+
value = _props$value === void 0 ? defaultValue : _props$value;
|
66
67
|
var accept = props.forceAccept || props.accept;
|
67
68
|
var forceAccept = !!props.forceAccept;
|
68
69
|
var _useState = useState({}),
|
@@ -182,21 +183,22 @@ var useUpload = function useUpload(props) {
|
|
182
183
|
responseType: props.responseType,
|
183
184
|
onStart: props.onStart,
|
184
185
|
onProgress: function onProgress(e, msg) {
|
185
|
-
|
186
|
+
var percent = typeof e.percent === 'number' ? e.percent : e.loaded / e.total * 100;
|
187
|
+
if (throttle && percent !== 100) return;
|
186
188
|
throttle = true;
|
187
189
|
setTimeout(function () {
|
188
190
|
throttle = false;
|
189
191
|
}, 16);
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
}
|
192
|
+
setFiles(function (files) {
|
193
|
+
return produce(files, function (draft) {
|
194
|
+
if (!draft[id]) return draft;
|
195
|
+
draft[id].process = percent;
|
196
|
+
if (msg) draft[id].message = msg;
|
197
|
+
if (typeof props.onProgress === 'function') {
|
198
|
+
props.onProgress(draft[id]);
|
199
|
+
}
|
200
|
+
});
|
201
|
+
});
|
200
202
|
},
|
201
203
|
onLoad: function onLoad(xhr) {
|
202
204
|
if (!/^2|1223/.test("".concat(xhr.status))) {
|
@@ -224,11 +226,17 @@ var useUpload = function useUpload(props) {
|
|
224
226
|
delete draft[id];
|
225
227
|
});
|
226
228
|
});
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
229
|
+
if (props.functionalOnChange) {
|
230
|
+
// 回调型 setState不会丢值
|
231
|
+
props.onChange(function (prev) {
|
232
|
+
return [].concat(_toConsumableArray(prev || []), [result]);
|
233
|
+
});
|
234
|
+
} else {
|
235
|
+
var latestValue = latestState.value;
|
236
|
+
var newValue = _toConsumableArray(latestValue);
|
237
|
+
newValue.push(result);
|
238
|
+
props.onChange(newValue);
|
239
|
+
}
|
232
240
|
}
|
233
241
|
},
|
234
242
|
onError: function onError(xhr) {
|
@@ -346,48 +354,60 @@ var useUpload = function useUpload(props) {
|
|
346
354
|
error = _context2.sent;
|
347
355
|
case 21:
|
348
356
|
if (!(error instanceof Error)) {
|
349
|
-
_context2.next =
|
357
|
+
_context2.next = 29;
|
350
358
|
break;
|
351
359
|
}
|
352
360
|
if (validatorHandle(error, blob)) {
|
353
|
-
_context2.next =
|
361
|
+
_context2.next = 25;
|
354
362
|
break;
|
355
363
|
}
|
356
|
-
|
357
|
-
|
364
|
+
setFiles(function (prev) {
|
365
|
+
return produce(prev, function (draft) {
|
366
|
+
delete draft[id];
|
367
|
+
});
|
368
|
+
});
|
358
369
|
return _context2.abrupt("return", 0);
|
359
|
-
case
|
370
|
+
case 25:
|
360
371
|
fileRecord.message = error.message;
|
361
372
|
fileRecord.status = 3;
|
362
|
-
setFiles(
|
373
|
+
setFiles(function (prev) {
|
374
|
+
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, id, fileRecord));
|
375
|
+
});
|
363
376
|
return _context2.abrupt("return", 0);
|
364
|
-
case
|
377
|
+
case 29:
|
365
378
|
if (!props.beforeUpload) {
|
366
|
-
_context2.next =
|
379
|
+
_context2.next = 36;
|
367
380
|
break;
|
368
381
|
}
|
369
382
|
beforeUploadResult = props.beforeUpload(blob); // @ts-ignoreq
|
370
383
|
if (!(beforeUploadResult && beforeUploadResult.then)) {
|
371
|
-
_context2.next =
|
384
|
+
_context2.next = 34;
|
372
385
|
break;
|
373
386
|
}
|
374
387
|
props.beforeUpload(blob).then(function (args) {
|
375
388
|
if (args.status !== 'error') {
|
376
389
|
newFiles[id].xhr = uploadFile(id, blob, fileRecord.src);
|
377
|
-
setFiles(
|
390
|
+
setFiles(function (prev) {
|
391
|
+
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, id, fileRecord));
|
392
|
+
});
|
378
393
|
}
|
379
394
|
}).catch(function () {
|
380
|
-
|
381
|
-
|
395
|
+
setFiles(function (prev) {
|
396
|
+
return produce(prev, function (draft) {
|
397
|
+
delete draft[id];
|
398
|
+
});
|
399
|
+
});
|
382
400
|
});
|
383
401
|
return _context2.abrupt("return", 0);
|
384
|
-
case
|
385
|
-
_context2.next =
|
402
|
+
case 34:
|
403
|
+
_context2.next = 38;
|
386
404
|
break;
|
387
|
-
case
|
405
|
+
case 36:
|
388
406
|
fileRecord.xhr = uploadFile(id, blob, fileRecord.src);
|
389
|
-
setFiles(
|
390
|
-
|
407
|
+
setFiles(function (prev) {
|
408
|
+
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, id, fileRecord));
|
409
|
+
});
|
410
|
+
case 38:
|
391
411
|
case "end":
|
392
412
|
return _context2.stop();
|
393
413
|
}
|
@@ -166,6 +166,13 @@ export interface UseUploadProps<ValueItem = any> {
|
|
166
166
|
forceAcceptErrorMsg: string;
|
167
167
|
invalidImage: string;
|
168
168
|
};
|
169
|
+
/**
|
170
|
+
* @cn 设置为true后,组件的onChange参数会返回函数,即回调函数方式的setState
|
171
|
+
* @en After setting to true, the onChange parameter of the component will return a function, that is, the setState of the callback function
|
172
|
+
* @default false
|
173
|
+
* @version 3.6.5
|
174
|
+
*/
|
175
|
+
functionalOnChange?: boolean;
|
169
176
|
}
|
170
177
|
export interface Validator {
|
171
178
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-upload.type.d.ts","sourceRoot":"","sources":["use-upload.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,0BAA0B,CAAC;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AACD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,cAAc,CAAC,SAAS,GAAG,GAAG;IAC7C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,S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K,IAAI,CAAC;IACjC;;;OAGG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,GAAG,CAAC;IACxD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,SAAS,KAAK,CAAC,GAAG,KAAK,CAAC;IAClF;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB"}
|
package/esm/index.d.ts
CHANGED
@@ -23,7 +23,7 @@ export * from './common/use-drag-mock';
|
|
23
23
|
export * from './common/use-pagination-list';
|
24
24
|
export * from './common/use-filter';
|
25
25
|
export * from './common/use-scrollbar-width';
|
26
|
-
export * from './common/use-memo';
|
26
|
+
export * from './common/use-component-memo';
|
27
27
|
export * from './components/use-input';
|
28
28
|
export * from './components/use-textarea';
|
29
29
|
export * from './components/use-form';
|
package/esm/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,UAAU,CAAC;AAEjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,IAAI,EAAE,CAAC;AAGhB,cAAc,eAAe,CAAC;AAE9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBA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AAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;;AAE1C,wBAAkB"}
|
package/esm/index.js
CHANGED
@@ -26,7 +26,7 @@ export * from "./common/use-drag-mock";
|
|
26
26
|
export * from "./common/use-pagination-list";
|
27
27
|
export * from "./common/use-filter";
|
28
28
|
export * from "./common/use-scrollbar-width";
|
29
|
-
export * from "./common/use-memo";
|
29
|
+
export * from "./common/use-component-memo";
|
30
30
|
|
31
31
|
//components
|
32
32
|
export * from "./components/use-input";
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["highlight.tsx"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,EAClC,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,MAAM,GACP,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,GAAG,CAAC,CA8BJ"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import React, { cloneElement } from 'react';
|
2
|
+
import { escapeRegExp } from "./string";
|
3
|
+
import { isArray } from "./is";
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
6
|
+
export function getHighlightText(_ref) {
|
7
|
+
var nodeList = _ref.nodeList,
|
8
|
+
searchWords = _ref.searchWords,
|
9
|
+
highlightClassName = _ref.highlightClassName,
|
10
|
+
enable = _ref.enable;
|
11
|
+
if (!enable || !searchWords) {
|
12
|
+
return nodeList;
|
13
|
+
}
|
14
|
+
var transformNode = function transformNode(node) {
|
15
|
+
var _node$props;
|
16
|
+
if (node && typeof ((_node$props = node.props) === null || _node$props === void 0 ? void 0 : _node$props.children) === 'string') {
|
17
|
+
return /*#__PURE__*/cloneElement(node, undefined, /*#__PURE__*/_jsx(HighlightText, {
|
18
|
+
textToHighlight: node.props.children,
|
19
|
+
searchWords: searchWords,
|
20
|
+
highlightClassName: highlightClassName
|
21
|
+
}));
|
22
|
+
}
|
23
|
+
if (node && typeof node === 'string') {
|
24
|
+
return /*#__PURE__*/_jsx(HighlightText, {
|
25
|
+
textToHighlight: node,
|
26
|
+
searchWords: searchWords,
|
27
|
+
highlightClassName: highlightClassName
|
28
|
+
});
|
29
|
+
}
|
30
|
+
return node;
|
31
|
+
};
|
32
|
+
return isArray(nodeList) ? nodeList.map(transformNode) : transformNode(nodeList);
|
33
|
+
}
|
34
|
+
function HighlightText(_ref2) {
|
35
|
+
var textToHighlight = _ref2.textToHighlight,
|
36
|
+
searchWords = _ref2.searchWords,
|
37
|
+
highlightClassName = _ref2.highlightClassName;
|
38
|
+
if (!searchWords) return /*#__PURE__*/_jsx(_Fragment, {
|
39
|
+
children: textToHighlight
|
40
|
+
});
|
41
|
+
if (searchWords.length > 500) {
|
42
|
+
searchWords = searchWords.slice(0, 500);
|
43
|
+
}
|
44
|
+
|
45
|
+
// 注意这里的括号,这里使用了带capture group功能的正则,来split字符串
|
46
|
+
// 从而在strArr中可以保留匹配文本
|
47
|
+
var re = new RegExp("(".concat(escapeRegExp(searchWords), ")"), 'i');
|
48
|
+
var strArr = textToHighlight.split(re);
|
49
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
50
|
+
children: strArr.map(function (item, index) {
|
51
|
+
return re.test(item) ? /*#__PURE__*/_jsx("span", {
|
52
|
+
className: highlightClassName,
|
53
|
+
children: item
|
54
|
+
}, index) : /*#__PURE__*/_jsx(React.Fragment, {
|
55
|
+
children: item
|
56
|
+
}, index);
|
57
|
+
})
|
58
|
+
});
|
59
|
+
}
|
package/esm/utils/index.d.ts
CHANGED
package/esm/utils/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC"}
|
package/esm/utils/index.js
CHANGED
package/esm/utils/string.d.ts
CHANGED
@@ -11,4 +11,5 @@ export declare function substitute<T extends ObjectType = ObjectType>(str: strin
|
|
11
11
|
* 输出 '//github.com/'
|
12
12
|
*/
|
13
13
|
export declare function removeProtocol(url: string): string;
|
14
|
+
export declare function escapeRegExp(str?: any): any;
|
14
15
|
//# sourceMappingURL=string.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EAC1D,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,EAClC,GAAG,EAAE,CAAC,UAoBP;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,UAQzC"}
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EAC1D,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,EAClC,GAAG,EAAE,CAAC,UAoBP;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,UAQzC;AASD,wBAAgB,YAAY,CAAC,GAAG,GAAE,GAAQ,OAKzC"}
|
package/esm/utils/string.js
CHANGED
@@ -37,4 +37,16 @@ export function removeProtocol(url) {
|
|
37
37
|
} catch (error) {
|
38
38
|
return url;
|
39
39
|
}
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Used to match `RegExp`
|
44
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
45
|
+
*/
|
46
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
47
|
+
reHasRegExpChar = RegExp(reRegExpChar.source);
|
48
|
+
export function escapeRegExp() {
|
49
|
+
var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
50
|
+
var string = typeof str === 'string' ? str : str.toString();
|
51
|
+
return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, '\\$&') : string;
|
40
52
|
}
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
"use client";
|
3
|
-
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
Object.defineProperty(exports, "default", {
|
8
|
-
enumerable: true,
|
9
|
-
get: function get() {
|
10
|
-
return _useMemo.default;
|
11
|
-
}
|
12
|
-
});
|
13
|
-
Object.defineProperty(exports, "useMemo", {
|
14
|
-
enumerable: true,
|
15
|
-
get: function get() {
|
16
|
-
return _useMemo.default;
|
17
|
-
}
|
18
|
-
});
|
19
|
-
var _useMemo = _interopRequireDefault(require("./use-memo"));
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"use-memo.d.ts","sourceRoot":"","sources":["use-memo.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,EAAE,EACtD,QAAQ,EAAE,MAAM,KAAK,EACrB,SAAS,EAAE,SAAS,EACpB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,KAAK,OAAO,qBAc7D"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"use-memo.d.ts","sourceRoot":"","sources":["use-memo.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,EAAE,EACtD,QAAQ,EAAE,MAAM,KAAK,EACrB,SAAS,EAAE,SAAS,EACpB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,KAAK,OAAO,qBAc7D"}
|