@sheinx/hooks 3.6.0-beta.9 → 3.6.1-beta.1
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-pagination-list/index.d.ts.map +1 -1
- package/cjs/common/use-pagination-list/index.js +6 -1
- package/cjs/common/use-position-style/index.d.ts.map +1 -1
- package/cjs/common/use-position-style/index.js +7 -3
- package/cjs/components/use-check/use-check.d.ts +1 -1
- package/cjs/components/use-check/use-check.d.ts.map +1 -1
- package/cjs/components/use-check/use-check.js +10 -3
- package/cjs/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-datepicker-format.js +4 -0
- package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts +1 -1
- package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
- package/cjs/components/use-form/Provider.d.ts +1 -2
- package/cjs/components/use-form/Provider.d.ts.map +1 -1
- 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 +2 -3
- package/cjs/components/use-form/use-form.d.ts +1 -2
- package/cjs/components/use-form/use-form.d.ts.map +1 -1
- package/cjs/components/use-form/use-form.js +20 -11
- package/cjs/components/use-form/use-form.type.d.ts +5 -3
- package/cjs/components/use-form/use-form.type.d.ts.map +1 -1
- package/cjs/components/use-input/use-input-format.d.ts +1 -1
- package/cjs/components/use-input/use-input-number.d.ts +1 -1
- package/cjs/components/use-input/use-input-number.d.ts.map +1 -1
- package/cjs/components/use-input/use-input-number.js +1 -0
- package/cjs/components/use-popup/use-popup.d.ts.map +1 -1
- package/cjs/components/use-popup/use-popup.js +5 -0
- package/cjs/components/use-table/index.d.ts +2 -1
- package/cjs/components/use-table/index.d.ts.map +1 -1
- package/cjs/components/use-table/index.js +7 -0
- package/cjs/components/use-table/use-table-filter.d.ts +19 -0
- package/cjs/components/use-table/use-table-filter.d.ts.map +1 -0
- package/cjs/components/use-table/use-table-filter.js +96 -0
- package/cjs/components/use-table/use-table.type.d.ts +93 -0
- package/cjs/components/use-table/use-table.type.d.ts.map +1 -1
- package/cjs/components/use-tabs/context.d.ts +1 -1
- package/cjs/components/use-tabs/context.d.ts.map +1 -1
- package/cjs/components/use-tabs/use-tabs.d.ts +1 -1
- package/cjs/components/use-tree/use-tree.d.ts.map +1 -1
- package/cjs/components/use-tree/use-tree.js +58 -13
- package/cjs/components/use-tree/use-tree.type.d.ts +4 -0
- package/cjs/components/use-tree/use-tree.type.d.ts.map +1 -1
- package/cjs/components/use-treeselect/use-tiled.d.ts +1 -1
- package/cjs/utils/dom/element.d.ts +1 -1
- package/cjs/utils/dom/element.d.ts.map +1 -1
- package/cjs/utils/dom/element.js +5 -3
- package/cjs/utils/lazyload.d.ts.map +1 -1
- package/cjs/utils/lazyload.js +2 -2
- package/esm/common/use-pagination-list/index.d.ts.map +1 -1
- package/esm/common/use-pagination-list/index.js +6 -1
- package/esm/common/use-position-style/index.d.ts.map +1 -1
- package/esm/common/use-position-style/index.js +7 -3
- package/esm/components/use-check/use-check.d.ts +1 -1
- package/esm/components/use-check/use-check.d.ts.map +1 -1
- package/esm/components/use-check/use-check.js +10 -3
- package/esm/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-datepicker-format.js +4 -0
- package/esm/components/use-datepicker/use-datepicker-format.type.d.ts +1 -1
- package/esm/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
- package/esm/components/use-form/Provider.d.ts +1 -2
- package/esm/components/use-form/Provider.d.ts.map +1 -1
- 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 +2 -3
- package/esm/components/use-form/use-form.d.ts +1 -2
- package/esm/components/use-form/use-form.d.ts.map +1 -1
- package/esm/components/use-form/use-form.js +20 -11
- package/esm/components/use-form/use-form.type.d.ts +5 -3
- package/esm/components/use-form/use-form.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input-format.d.ts +1 -1
- package/esm/components/use-input/use-input-number.d.ts +1 -1
- package/esm/components/use-input/use-input-number.d.ts.map +1 -1
- package/esm/components/use-input/use-input-number.js +1 -0
- package/esm/components/use-popup/use-popup.d.ts.map +1 -1
- package/esm/components/use-popup/use-popup.js +5 -0
- package/esm/components/use-table/index.d.ts +2 -1
- package/esm/components/use-table/index.d.ts.map +1 -1
- package/esm/components/use-table/index.js +1 -0
- package/esm/components/use-table/use-table-filter.d.ts +19 -0
- package/esm/components/use-table/use-table-filter.d.ts.map +1 -0
- package/esm/components/use-table/use-table-filter.js +89 -0
- package/esm/components/use-table/use-table.type.d.ts +93 -0
- package/esm/components/use-table/use-table.type.d.ts.map +1 -1
- package/esm/components/use-tabs/context.d.ts +1 -1
- package/esm/components/use-tabs/context.d.ts.map +1 -1
- package/esm/components/use-tabs/use-tabs.d.ts +1 -1
- package/esm/components/use-tree/use-tree.d.ts.map +1 -1
- package/esm/components/use-tree/use-tree.js +58 -13
- package/esm/components/use-tree/use-tree.type.d.ts +4 -0
- package/esm/components/use-tree/use-tree.type.d.ts.map +1 -1
- package/esm/components/use-treeselect/use-tiled.d.ts +1 -1
- package/esm/utils/dom/element.d.ts +1 -1
- package/esm/utils/dom/element.d.ts.map +1 -1
- package/esm/utils/dom/element.js +4 -2
- package/esm/utils/lazyload.d.ts.map +1 -1
- package/esm/utils/lazyload.js +3 -3
- package/package.json +1 -1
@@ -139,6 +139,93 @@ export interface TableColumnSorter {
|
|
139
139
|
export interface ColumnRenderFunc<DataItem> {
|
140
140
|
(data: DataItem, index: number, checkInstance?: React.ReactComponentElement<any>): React.ReactNode | (() => React.ReactNode);
|
141
141
|
}
|
142
|
+
export interface TableColumnFilterBase<DataItem> {
|
143
|
+
/**
|
144
|
+
* @cn 筛选模式: search 搜索模式, select 选择模式
|
145
|
+
* @en Filter mode: search search mode, select select mode
|
146
|
+
*/
|
147
|
+
mode: 'search' | 'select';
|
148
|
+
/**
|
149
|
+
* @cn 筛选数据的函数
|
150
|
+
* @en Filter data function
|
151
|
+
* @param value 筛选值
|
152
|
+
* @param row 行数据
|
153
|
+
* @returns 是否通过筛选
|
154
|
+
*/
|
155
|
+
onFilter: (value: any, row: DataItem) => boolean;
|
156
|
+
/**
|
157
|
+
* @cn 自定义的筛选项图标
|
158
|
+
* @en Custom filter icon
|
159
|
+
*/
|
160
|
+
icon?: React.ReactNode;
|
161
|
+
}
|
162
|
+
export type TableFilterData = {
|
163
|
+
label: string;
|
164
|
+
value: any;
|
165
|
+
icon?: React.ReactNode;
|
166
|
+
[key: string]: any;
|
167
|
+
children?: TableFilterData[];
|
168
|
+
};
|
169
|
+
export interface SelectModeColumnFilter<DataItem> extends TableColumnFilterBase<DataItem> {
|
170
|
+
/**
|
171
|
+
* @cn 筛选模式为 select 时
|
172
|
+
* @en Filter mode is select
|
173
|
+
*/
|
174
|
+
mode: 'select';
|
175
|
+
/**
|
176
|
+
* 必填的 `config` 字段
|
177
|
+
*/
|
178
|
+
config: {
|
179
|
+
/**
|
180
|
+
* @cn 筛选项数据
|
181
|
+
* @en Filter item data
|
182
|
+
*/
|
183
|
+
data: Array<TableFilterData>;
|
184
|
+
/**
|
185
|
+
* @cn 自定义渲染筛选项
|
186
|
+
* @en Custom rendering filter options
|
187
|
+
* @default (data) => data.label
|
188
|
+
*/
|
189
|
+
renderItem?: ((item: TableFilterData) => React.ReactNode) | ObjectKey<TableFilterData>;
|
190
|
+
/**
|
191
|
+
* @cn 是否多选
|
192
|
+
* @en Whether to multiple select
|
193
|
+
*/
|
194
|
+
multiple?: boolean;
|
195
|
+
/**
|
196
|
+
* @cn 是否开启顶部的搜索框
|
197
|
+
* @en Whether to open the top search box
|
198
|
+
*/
|
199
|
+
search?: boolean;
|
200
|
+
/**
|
201
|
+
* @cn 是否高亮命中的关键词,仅当 search 为 true 时有效
|
202
|
+
* @en Whether to highlight the hit keywords
|
203
|
+
*/
|
204
|
+
highlight?: boolean;
|
205
|
+
};
|
206
|
+
/**
|
207
|
+
* @cn 筛选数据的函数
|
208
|
+
* @en Filter data function
|
209
|
+
* @param value 筛选值,单选时为单个值,多选时为数组
|
210
|
+
* @param row 行数据
|
211
|
+
* @returns 是否通过筛选
|
212
|
+
*/
|
213
|
+
onFilter: (value: any, row: DataItem) => boolean;
|
214
|
+
}
|
215
|
+
export interface SearchModeColumnFilter<DataItem> extends TableColumnFilterBase<DataItem> {
|
216
|
+
/**
|
217
|
+
* 筛选模式为 search 时
|
218
|
+
*/
|
219
|
+
mode: 'search';
|
220
|
+
/**
|
221
|
+
* 此时不允许传 `config`
|
222
|
+
*/
|
223
|
+
config?: never;
|
224
|
+
}
|
225
|
+
/**
|
226
|
+
* 最终的联合类型
|
227
|
+
*/
|
228
|
+
export type TableColumnFilter<DataItem> = SelectModeColumnFilter<DataItem> | SearchModeColumnFilter<DataItem>;
|
142
229
|
/**
|
143
230
|
* @title TableColumn
|
144
231
|
*/
|
@@ -227,6 +314,12 @@ export interface TableColumnItem<DataItem> {
|
|
227
314
|
* @version 3.5.0
|
228
315
|
*/
|
229
316
|
sortDirections?: ('asc' | 'desc')[];
|
317
|
+
/**
|
318
|
+
* @cn 列的筛选配置
|
319
|
+
* @en Column filter configuration
|
320
|
+
* @version 3.6.0
|
321
|
+
*/
|
322
|
+
filter?: TableColumnFilter<DataItem>;
|
230
323
|
/**
|
231
324
|
* @en The content of the header
|
232
325
|
* @cn 表头显示内容
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-table.type.d.ts","sourceRoot":"","sources":["use-table.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG,QA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sContextProps } from './context.type';
|
3
3
|
export declare const TabsContext: React.Context<TabsContextProps<any>>;
|
4
|
-
export declare const Provider: <TabData>(props: TabsProviderProps<TabData>) => JSX.Element;
|
4
|
+
export declare const Provider: <TabData>(props: TabsProviderProps<TabData>) => import("react/jsx-runtime").JSX.Element;
|
5
5
|
export declare const useTabsContext: <TabData>() => TabsContextProps<TabData>;
|
6
6
|
//# sourceMappingURL=context.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAErE,eAAO,MAAM,WAAW,sCAA8E,CAAC;AAEvG,eAAO,MAAM,QAAQ,
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAErE,eAAO,MAAM,WAAW,sCAA8E,CAAC;AAEvG,eAAO,MAAM,QAAQ,yFAGpB,CAAC;AAEF,eAAO,MAAM,cAAc,0CAA8E,CAAC"}
|
@@ -5,7 +5,7 @@ declare const useTabs: <TabData = any>(props: BaseTabsProps) => {
|
|
5
5
|
onChange: (key: string | number) => void;
|
6
6
|
tabs: TabData[];
|
7
7
|
setTabs: import("react").Dispatch<import("react").SetStateAction<TabData[]>>;
|
8
|
-
Provider: <TabData_1>(props: import("./context.type").TabsProviderProps<TabData_1>) => JSX.Element;
|
8
|
+
Provider: <TabData_1>(props: import("./context.type").TabsProviderProps<TabData_1>) => import("react/jsx-runtime").JSX.Element;
|
9
9
|
};
|
10
10
|
export default useTabs;
|
11
11
|
//# sourceMappingURL=use-tabs.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["use-tree.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAKb,SAAS,EAGV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["use-tree.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAKb,SAAS,EAGV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiBjD,eAAO,MAAM,IAAI;IACf;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEJ,CAAC;AAEF,QAAA,MAAM,OAAO;;;;;CAurBZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
@@ -33,7 +33,6 @@ function toArray(value) {
|
|
33
33
|
if (!Array.isArray(value)) return [value];
|
34
34
|
return value;
|
35
35
|
}
|
36
|
-
var global_tree_map = new Map();
|
37
36
|
var MODE = exports.MODE = {
|
38
37
|
/**
|
39
38
|
* 返回全选数据,包含父节点和子节点
|
@@ -318,6 +317,34 @@ var useTree = function useTree(props) {
|
|
318
317
|
}
|
319
318
|
return ids;
|
320
319
|
};
|
320
|
+
var initFlatData = function initFlatData(data, path) {
|
321
|
+
var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
322
|
+
var pid = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
323
|
+
var result = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
324
|
+
for (var i = 0; i < data.length; i++) {
|
325
|
+
var item = data[i];
|
326
|
+
var id = getKey(item, path[path.length - 1], i);
|
327
|
+
var node = {
|
328
|
+
id: id,
|
329
|
+
level: level,
|
330
|
+
data: item,
|
331
|
+
pid: pid
|
332
|
+
};
|
333
|
+
if (defaultExpandAll) {
|
334
|
+
result.push(node);
|
335
|
+
} else {
|
336
|
+
if (level === 1) {
|
337
|
+
result.push(node);
|
338
|
+
} else if (expanded && pid !== null && expanded.indexOf(pid) >= 0) {
|
339
|
+
result.push(node);
|
340
|
+
}
|
341
|
+
}
|
342
|
+
if (Array.isArray(item[childrenKey])) {
|
343
|
+
initFlatData(item[childrenKey], [].concat(_toConsumableArray(path), [id]), level + 1, id, result);
|
344
|
+
}
|
345
|
+
}
|
346
|
+
return result;
|
347
|
+
};
|
321
348
|
var initValue = function initValue(ids_outer, forceCheck) {
|
322
349
|
var ids = ids_outer;
|
323
350
|
if (!context.data || !context.value) {
|
@@ -408,15 +435,6 @@ var useTree = function useTree(props) {
|
|
408
435
|
return 2;
|
409
436
|
};
|
410
437
|
var setData = function setData(data) {
|
411
|
-
// if(data && global_tree_map.get(data)){
|
412
|
-
// context.cachedValue = global_tree_map.get(data)?.cachedValue || []
|
413
|
-
// context.pathMap = global_tree_map.get(data)?.pathMap || new Map()
|
414
|
-
// context.dataMap = global_tree_map.get(data)?.dataMap || new Map()
|
415
|
-
// context.valueMap = global_tree_map.get(data)?.valueMap || new Map()
|
416
|
-
// context.unmatchedValueMap = global_tree_map.get(data)?.unmatchedValueMap || new Map()
|
417
|
-
// return
|
418
|
-
// }
|
419
|
-
|
420
438
|
var prevValue = context.value || [];
|
421
439
|
context.cachedValue = [];
|
422
440
|
context.pathMap = new Map();
|
@@ -437,8 +455,6 @@ var useTree = function useTree(props) {
|
|
437
455
|
}
|
438
456
|
initValue();
|
439
457
|
setValue(prevValue);
|
440
|
-
|
441
|
-
// global_tree_map.set(data, context)
|
442
458
|
};
|
443
459
|
var set = function set(id, checked, direction) {
|
444
460
|
if (!isDisabled(id)) {
|
@@ -480,6 +496,28 @@ var useTree = function useTree(props) {
|
|
480
496
|
}
|
481
497
|
return current;
|
482
498
|
};
|
499
|
+
var updateInnerCheckStatus = function updateInnerCheckStatus() {
|
500
|
+
var _context$value;
|
501
|
+
if (mode !== MODE.MODE_0) return;
|
502
|
+
(_context$value = context.value) === null || _context$value === void 0 || _context$value.forEach(function (id) {
|
503
|
+
var _ref3 = context.pathMap.get(id),
|
504
|
+
children = _ref3.children;
|
505
|
+
if (children.length) {
|
506
|
+
var noCheckedChildren = children.filter(function (cid) {
|
507
|
+
var _context$value2;
|
508
|
+
return !((_context$value2 = context.value) !== null && _context$value2 !== void 0 && _context$value2.includes(cid));
|
509
|
+
});
|
510
|
+
if (noCheckedChildren.length > 0) {
|
511
|
+
setTimeout(function () {
|
512
|
+
setValueMap(id, 2);
|
513
|
+
noCheckedChildren.forEach(function (cid) {
|
514
|
+
setValueMap(cid, 0);
|
515
|
+
});
|
516
|
+
}, 0);
|
517
|
+
}
|
518
|
+
}
|
519
|
+
});
|
520
|
+
};
|
483
521
|
var appendChildrenExpanded = function appendChildrenExpanded(child, level, pid, insertData) {
|
484
522
|
if (!child) return;
|
485
523
|
child.forEach(function (item, i) {
|
@@ -565,7 +603,7 @@ var useTree = function useTree(props) {
|
|
565
603
|
expanded: true
|
566
604
|
}));
|
567
605
|
});
|
568
|
-
var _getExpandVirtualData = (0, _useTableTree.getExpandVirtualData)(context.data, expanded, getKey, childrenKey),
|
606
|
+
var _getExpandVirtualData = (0, _useTableTree.getExpandVirtualData)(props.tiledData || context.data, expanded, getKey, childrenKey),
|
569
607
|
treeDataInfo = _getExpandVirtualData.treeDataInfo;
|
570
608
|
if (!treeDataInfo) {
|
571
609
|
return;
|
@@ -590,11 +628,18 @@ var useTree = function useTree(props) {
|
|
590
628
|
if (props.datum) return;
|
591
629
|
if (!dataUpdate) return;
|
592
630
|
setData(data);
|
631
|
+
updateInnerCheckStatus();
|
593
632
|
}, [data]);
|
594
633
|
(0, _react.useEffect)(function () {
|
595
634
|
if (props.datum) return;
|
596
635
|
setValue(value);
|
597
636
|
}, [value]);
|
637
|
+
(0, _react.useEffect)(function () {
|
638
|
+
if (!virtual) return;
|
639
|
+
if (!props.tiledData) return;
|
640
|
+
var tiledFlatData = initFlatData(props.tiledData, [], 1);
|
641
|
+
setDataFlat(tiledFlatData);
|
642
|
+
}, [props.tiledData]);
|
598
643
|
(0, _react.useEffect)(function () {
|
599
644
|
setInited(true);
|
600
645
|
}, []);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-tree.type.d.ts","sourceRoot":"","sources":["use-tree.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEpF,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE1C,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE7C,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;AAEjE,MAAM,MAAM,YAAY,CAAC,QAAQ,IAAI;IACnC,EAAE,EAAE,YAAY,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,WAAW,CAAC,QAAQ;IACnC,OAAO,EAAE,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACzC,OAAO,EAAE,GAAG,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACrC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC,iBAAiB,EAAE,GAAG,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAClD,QAAQ,EAAE,GAAG,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAC/C,i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AY,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IACrF,UAAU,EAAE,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAC3D,YAAY,EAAE,CAAC,EAAE,EAAE,YAAY,KAAK,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC;IACpC,SAAS,EAAE,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACzC,OAAO,EAAE,GAAG,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACrC,QAAQ,EAAE,GAAG,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAC/C,iBAAiB,EAAE,GAAG,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;CACnD"}
|
@@ -7,7 +7,7 @@ declare const useTiled: <DataItem>(props: UseTiledProps<DataItem>) => {
|
|
7
7
|
} | {
|
8
8
|
data: any;
|
9
9
|
onFilter: (text: string, from?: string) => void;
|
10
|
-
expandIcons: ((item: DataItem) => string | number | boolean | import("react").
|
10
|
+
expandIcons: ((item: DataItem) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined)[];
|
11
11
|
};
|
12
12
|
export default useTiled;
|
13
13
|
//# sourceMappingURL=use-tiled.d.ts.map
|
@@ -13,7 +13,7 @@ export declare const addResizeObserver: (el: HTMLElement, handler: any, options?
|
|
13
13
|
}) => () => void;
|
14
14
|
export declare function getParent(el: HTMLElement | null | Element, target?: string | HTMLElement): Element | null;
|
15
15
|
export declare function getClosestScrollContainer(element: HTMLElement | null): HTMLElement | null;
|
16
|
-
export declare function
|
16
|
+
export declare function getClosestPositionedContainer(element: Element | HTMLElement | null, positions?: React.CSSProperties['position'][]): HTMLElement | null;
|
17
17
|
export declare function cssSupport(attr: keyof CSSStyleDeclaration, value: string): boolean;
|
18
18
|
export declare const parsePxToNumber: (str: string) => number;
|
19
19
|
export declare const getFieldId: (name?: string, formName?: string) => string | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["element.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,WAAW,UAAQ,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,KAAK,CAAC,SAAS,CASjB;AAGD,eAAO,MAAM,iBAAiB,OACxB,WAAW,WACN,GAAG;;;gBA4Cb,CAAC;AAEF,wBAAgB,SAAS,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,kBAmBxF;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI,CAmCzF;AAED,wBAAgB,
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["element.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,WAAW,UAAQ,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,KAAK,CAAC,SAAS,CASjB;AAGD,eAAO,MAAM,iBAAiB,OACxB,WAAW,WACN,GAAG;;;gBA4Cb,CAAC;AAEF,wBAAgB,SAAS,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,kBAmBxF;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI,CAmCzF;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,EACrC,SAAS,GAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,EAA0B,sBAuBrE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,mBAAmB,EAAE,KAAK,EAAE,MAAM,WAYxE;AAED,eAAO,MAAM,eAAe,QAAS,MAAM,WAAwC,CAAC;AAEpF,eAAO,MAAM,UAAU,UAAW,MAAM,aAAa,MAAM,uBAG1D,CAAC"}
|
package/cjs/utils/dom/element.js
CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.addResizeObserver = void 0;
|
7
7
|
exports.cssSupport = cssSupport;
|
8
|
-
exports.
|
8
|
+
exports.getClosestPositionedContainer = getClosestPositionedContainer;
|
9
9
|
exports.getClosestScrollContainer = getClosestScrollContainer;
|
10
10
|
exports.getFieldId = void 0;
|
11
11
|
exports.getParent = getParent;
|
@@ -158,13 +158,15 @@ function getClosestScrollContainer(element) {
|
|
158
158
|
// 如果没有找到可滚动的祖先,返回 body 或 documentElement
|
159
159
|
return document.scrollingElement || document.documentElement;
|
160
160
|
}
|
161
|
-
function
|
161
|
+
function getClosestPositionedContainer(element) {
|
162
|
+
var positions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['fixed', 'absolute'];
|
162
163
|
if (!element) {
|
163
164
|
return null;
|
164
165
|
}
|
165
166
|
var isFixable = function isFixable(el) {
|
166
167
|
var style = window.getComputedStyle(el);
|
167
|
-
|
168
|
+
var position = style.position;
|
169
|
+
return positions.includes(position);
|
168
170
|
};
|
169
171
|
|
170
172
|
// 遍历父元素
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lazyload.d.ts","sourceRoot":"","sources":["lazyload.ts"],"names":[],"mappings":"AAKA,KAAK,UAAU,GAAG;IAChB,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC,CAAC;AAsBF,wBAAgB,QAAQ,SAgBvB;AAWD,wBAAgB,WAAW,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,QAUvE;
|
1
|
+
{"version":3,"file":"lazyload.d.ts","sourceRoot":"","sources":["lazyload.ts"],"names":[],"mappings":"AAKA,KAAK,UAAU,GAAG;IAChB,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC,CAAC;AAsBF,wBAAgB,QAAQ,SAgBvB;AAWD,wBAAgB,WAAW,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,QAUvE;AA0BD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,UAAU,iBA4BvC"}
|
package/cjs/utils/lazyload.js
CHANGED
@@ -19,7 +19,6 @@ var getRect = function getRect(el) {
|
|
19
19
|
if (el) {
|
20
20
|
_utils.devUseWarning.error("the ".concat(el, " is not a element"));
|
21
21
|
}
|
22
|
-
;
|
23
22
|
return {
|
24
23
|
top: 0,
|
25
24
|
bottom: winHeight
|
@@ -75,13 +74,14 @@ function getObserver(obj, id) {
|
|
75
74
|
render = obj.render,
|
76
75
|
offscreen = obj.offscreen,
|
77
76
|
noRemove = obj.noRemove;
|
78
|
-
var fixedContainer = (0, _element.
|
77
|
+
var fixedContainer = (0, _element.getClosestPositionedContainer)(element, ['fixed', 'absolute']);
|
79
78
|
var observer = new IntersectionObserver(function (entries) {
|
80
79
|
entries.forEach(function (en) {
|
81
80
|
if (en.isIntersecting || en.intersectionRatio > 0) {
|
82
81
|
render();
|
83
82
|
if (!noRemove) removeStack(id);
|
84
83
|
} else {
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
85
85
|
offscreen && offscreen();
|
86
86
|
}
|
87
87
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpE,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,QAAA,MAAM,iBAAiB,UAAW,mBAAmB;;;;;;;;;;;;;wBAKP,MAAM,YAAY,MAAM;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpE,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,QAAA,MAAM,iBAAiB,UAAW,mBAAmB;;;;;;;;;;;;;wBAKP,MAAM,YAAY,MAAM;CA0CrE,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
@@ -33,8 +33,13 @@ var usePaginationList = function usePaginationList(props) {
|
|
33
33
|
var _props$total;
|
34
34
|
if (!shouldPage) return {};
|
35
35
|
var total = (_props$total = props.total) !== null && _props$total !== void 0 ? _props$total : Array.isArray(data) ? data.length : 0;
|
36
|
+
var finalCurrent = props.current || current;
|
37
|
+
var maxCurrent = Math.ceil(total / (props.pageSize || pageSize));
|
38
|
+
if (current > maxCurrent) {
|
39
|
+
finalCurrent = 1;
|
40
|
+
}
|
36
41
|
return {
|
37
|
-
current:
|
42
|
+
current: finalCurrent,
|
38
43
|
pageSize: props.pageSize || pageSize,
|
39
44
|
total: total,
|
40
45
|
disabled: !!props.loading,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AASnD,MAAM,MAAM,kBAAkB,GAC1B,aAAa,GACb,UAAU,GACV,cAAc,GACd,WAAW,GACX,MAAM,GACN,OAAO,CAAC;AACZ,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,cAAc,GACd,UAAU,GACV,WAAW,GACX,KAAK,GACL,QAAQ,CAAC;AAYb,KAAK,YAAY,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,OAAO,CAAC;A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AS,CAAC,WAAW,CAAC,CAAC;IAE1C,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAEzC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3C,YAAY,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3B;AAOD,eAAO,MAAM,gBAAgB,WAAY,mBAAmB;;;CAkT3D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
@@ -238,10 +238,12 @@ export var usePositionStyle = function usePositionStyle(config) {
|
|
238
238
|
}
|
239
239
|
if (_h === 'right') {
|
240
240
|
style.left = rect.right - containerRect.left + containerScroll.left + popupGap;
|
241
|
+
arrayStyle.left = '0px';
|
242
|
+
arrayStyle.right = 'auto';
|
241
243
|
} else {
|
242
|
-
style.
|
243
|
-
arrayStyle.right =
|
244
|
-
|
244
|
+
style.right = containerRect.right - rect.left;
|
245
|
+
arrayStyle.right = '0px';
|
246
|
+
arrayStyle.left = 'auto';
|
245
247
|
}
|
246
248
|
} else if (position === 'cover') {
|
247
249
|
style.top = rect.top - containerRect.top + containerScroll.top;
|
@@ -324,6 +326,8 @@ export var usePositionStyle = function usePositionStyle(config) {
|
|
324
326
|
// for animation
|
325
327
|
if (realPosition.indexOf('top') === 0) {
|
326
328
|
newStyle.transformOrigin = 'center bottom';
|
329
|
+
} else if (realPosition.indexOf('bottom') === 0) {
|
330
|
+
newStyle.transformOrigin = 'center top';
|
327
331
|
}
|
328
332
|
return {
|
329
333
|
newStyle: newStyle,
|
@@ -22,7 +22,7 @@ declare const useCheck: (props: BaseCheckProps) => {
|
|
22
22
|
ref: ((instance: HTMLInputElement | null) => void) | null;
|
23
23
|
disabled: boolean | undefined;
|
24
24
|
};
|
25
|
-
getRootProps: <TOther_2 extends ObjectType>(externalProps?: TOther_2) => TOther_2 & {
|
25
|
+
getRootProps: <TOther_2 extends ObjectType>(externalProps?: TOther_2) => Omit<TOther_2, "needStopPropagation"> & {
|
26
26
|
onClick: (event: React.MouseEvent) => void;
|
27
27
|
};
|
28
28
|
disabled: boolean | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-check.d.ts","sourceRoot":"","sources":["use-check.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"use-check.d.ts","sourceRoot":"","sources":["use-check.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,QAAA,MAAM,QAAQ,UAAW,cAAc;;;;;qBAuDpB,gBAAgB,CAAC,gBAAgB,CAAC;0BArBT,MAAM,WAAW,CAAC,gBAAgB,CAAC;;;;;;;;;;;yBAnBa,gBAAgB;;;;CAiE3G,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
@@ -17,6 +17,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
17
|
*/
|
18
18
|
import React from 'react';
|
19
19
|
import { extractEventHandlers } from "../../utils";
|
20
|
+
import { util } from "../..";
|
20
21
|
import useForkRef from "../../common/use-fork-ref";
|
21
22
|
var useCheck = function useCheck(props) {
|
22
23
|
var checked = props.checked,
|
@@ -37,9 +38,12 @@ var useCheck = function useCheck(props) {
|
|
37
38
|
};
|
38
39
|
var inputRef = React.useRef(null);
|
39
40
|
var handleInputRef = useForkRef(inputRef, inputRefPo);
|
40
|
-
var handleClick = function handleClick(otherHandlers) {
|
41
|
+
var handleClick = function handleClick(otherHandlers, needStopPropagation) {
|
41
42
|
return function (event) {
|
42
43
|
var _inputRef$current, _otherHandlers$onClic;
|
44
|
+
if (needStopPropagation) {
|
45
|
+
event.stopPropagation();
|
46
|
+
}
|
43
47
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.click();
|
44
48
|
otherHandlers === null || otherHandlers === void 0 || (_otherHandlers$onClic = otherHandlers.onClick) === null || _otherHandlers$onClic === void 0 || _otherHandlers$onClic.call(otherHandlers, event);
|
45
49
|
};
|
@@ -47,8 +51,10 @@ var useCheck = function useCheck(props) {
|
|
47
51
|
var getRootProps = function getRootProps() {
|
48
52
|
var externalProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
49
53
|
var externalEventHandlers = extractEventHandlers(externalProps);
|
50
|
-
return _objectSpread(_objectSpread({}, externalProps
|
51
|
-
|
54
|
+
return _objectSpread(_objectSpread({}, util.removeProps(externalProps, {
|
55
|
+
needStopPropagation: true
|
56
|
+
})), {}, {
|
57
|
+
onClick: handleClick(externalEventHandlers, externalProps.needStopPropagation)
|
52
58
|
});
|
53
59
|
//封装点击事件 点击触发input 的点击
|
54
60
|
// disabled 禁用后不可点击
|
@@ -77,6 +83,7 @@ var useCheck = function useCheck(props) {
|
|
77
83
|
disabled: disabled
|
78
84
|
}, checkProps), {}, {
|
79
85
|
onClick: function onClick(e) {
|
86
|
+
// TODO: 这个e.stopPropagation生效不了,外部的触发是通过inputRef.current?.click()方式的;没啥用的代码
|
80
87
|
e.stopPropagation();
|
81
88
|
_onClick === null || _onClick === void 0 || _onClick(e);
|
82
89
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;0BAuMe,gBAAgB;sCAiEJ,MAAM;iCA7BX,MAAM,SAAS,MAAM;yCAxLrD,OAAO,GAAG,KAAK,GAAG,SAAS,QAAQ,MAAM,UAAU,IAAI,KAAK,OAAO;uCAWvE,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,QAC3B,MAAM;kBACG,MAAM,SAAS;mBAAS,GAAG;;+BA4CrC,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS,gBAAgB,MAAM;;CAwN3E,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
@@ -204,6 +204,10 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
|
|
204
204
|
if (props.formatResult) {
|
205
205
|
if (typeof props.formatResult === 'string') {
|
206
206
|
return getFormatValueArr(dateArr, props.formatResult);
|
207
|
+
} else if (typeof props.formatResult === 'function') {
|
208
|
+
return dateArr.map(function (item) {
|
209
|
+
return props.formatResult(item);
|
210
|
+
});
|
207
211
|
} else {
|
208
212
|
return dateArr.map(function (item) {
|
209
213
|
if (!item) return '';
|
@@ -5,7 +5,7 @@ export type DatePickerModeType = 'year' | 'month' | 'quarter' | 'time' | 'day';
|
|
5
5
|
export interface UseDatePickerFormatProps<Value extends DatePickerValueType> {
|
6
6
|
type: 'date' | 'datetime' | 'month' | 'time' | 'week' | 'year' | 'quarter';
|
7
7
|
format: string | undefined;
|
8
|
-
formatResult
|
8
|
+
formatResult?: string | ((date?: Date) => string);
|
9
9
|
range: boolean | undefined | number;
|
10
10
|
value: Value | undefined;
|
11
11
|
onChange: ((value: Value extends any[] ? string[] : string, ...args: any) => void) | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-datepicker-format.type.d.ts","sourceRoot":"","sources":["use-datepicker-format.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9D,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,YAAY,EAAE,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAClG,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC;AAC/E,MAAM,WAAW,wBAAwB,CAAC,KAAK,SAAS,mBAAmB;IACzE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3E,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,
|
1
|
+
{"version":3,"file":"use-datepicker-format.type.d.ts","sourceRoot":"","sources":["use-datepicker-format.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9D,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,YAAY,EAAE,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,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EACnC,IAAI,EAAE,kBAAkB,KACrB,IAAI,CAAC,GACV,SAAS,CAAC;IACd,QAAQ,EACJ,OAAO,GACP,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,KAAK,OAAO,CAAC,GACvF,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,GAC1C,SAAS,CAAC;CACf"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { ProviderProps } from './use-form.type';
|
3
|
-
export declare const Provider: (props: ProviderProps) => JSX.Element;
|
2
|
+
export declare const Provider: (props: ProviderProps) => import("react/jsx-runtime").JSX.Element;
|
4
3
|
//# sourceMappingURL=Provider.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["Provider.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["Provider.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,UAAW,aAAa,4CAW5C,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AA0B/D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;
|
1
|
+
{"version":3,"file":"use-form-control.d.ts","sourceRoot":"","sources":["use-form-control.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AA0B/D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;;kBAiJpC,CAAC,YAAY,GAAG,EAAE;;;;;EAkDrD"}
|
@@ -88,7 +88,6 @@ export default function useFormControl(props) {
|
|
88
88
|
var formValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
89
89
|
var errors = arguments.length > 1 ? arguments[1] : undefined;
|
90
90
|
var severErrors = arguments.length > 2 ? arguments[2] : undefined;
|
91
|
-
var names = arguments.length > 3 ? arguments[3] : undefined;
|
92
91
|
if (!name) return;
|
93
92
|
if (isArray(name)) {
|
94
93
|
var _value = getValue(name, formValue);
|
@@ -100,7 +99,7 @@ export default function useFormControl(props) {
|
|
100
99
|
var dv = isArray(defaultValue) ? defaultValue : [];
|
101
100
|
var nextValue = [];
|
102
101
|
name.forEach(function (n, index) {
|
103
|
-
if (
|
102
|
+
if (_value[index] === undefined && dv[index] !== undefined) {
|
104
103
|
nextValue[index] = dv[index];
|
105
104
|
} else {
|
106
105
|
nextValue[index] = _value[index];
|
@@ -114,7 +113,7 @@ export default function useFormControl(props) {
|
|
114
113
|
setErrorState(_error2);
|
115
114
|
}
|
116
115
|
if (!shallowEqual(_value2, latestInfo.valueState)) {
|
117
|
-
if (
|
116
|
+
if (_value2 === undefined && defaultValue !== undefined) {
|
118
117
|
setValueState(defaultValue);
|
119
118
|
} else {
|
120
119
|
setValueState(_value2);
|
@@ -1,9 +1,8 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { ProviderProps, UseFormProps, UseFormSlotProps, ValidateFnConfig } from './use-form.type';
|
3
2
|
import { ObjectType } from '../../common/type';
|
4
3
|
declare const useForm: <T extends ObjectType>(props: UseFormProps<T>) => {
|
5
4
|
getFormProps: <TOther extends ObjectType = ObjectType>(externalProps?: TOther) => UseFormSlotProps<TOther>;
|
6
|
-
Provider: (props: ProviderProps) => JSX.Element;
|
5
|
+
Provider: (props: ProviderProps) => import("react/jsx-runtime").JSX.Element;
|
7
6
|
ProviderProps: {
|
8
7
|
formValue: import("./use-form.type").FormContextValueType;
|
9
8
|
formConfig: import("./use-form.type").FormCommonConfig;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-form.d.ts","sourceRoot":"","sources":["use-form.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"use-form.d.ts","sourceRoot":"","sources":["use-form.ts"],"names":[],"mappings":"AA+BA,OAAO,EAEL,aAAa,EACb,YAAY,EACZ,gBAAgB,EAGhB,gBAAgB,EAEjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI5D,QAAA,MAAM,OAAO;;;;;;;;;wBAyRC;gBAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;gBAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;aAAE;8BA9Jd,MAAM;oCAiOD,OAAO;;6BAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;oCAdrB,MAAM,EAAE;sCA5LxC,MAAM,GAAG,MAAM,EAAE,WAAU,gBAAgB;qCA8PvB,MAAM,WAAW,gBAAgB;gCA/CzB,MAAM,SAAS,MAAM,UAAU,KAAK;gCAKpC,MAAM,SAAS,MAAM;kCAnIpD,MAAM,0BAAyB,qBAAqB;;;;;;oBAqEjD;YAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE;0BA9Jd,MAAM;gCAiOD,OAAO;;yBAfb,MAAM,KAAK,KAAK,GAAG,SAAS;;gCAdrB,MAAM,EAAE;kCA5LxC,MAAM,GAAG,MAAM,EAAE,WAAU,gBAAgB;iCA8PvB,MAAM,WAAW,gBAAgB;4BA/CzB,MAAM,SAAS,MAAM,UAAU,KAAK;4BAKpC,MAAM,SAAS,MAAM;8BAnIpD,MAAM,0BAAyB,qBAAqB;;CAma9D,CAAC;AAEF,eAAe,OAAO,CAAC"}
|