@hi-ui/table 4.0.0-beta.7 → 4.0.0
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/README.md +48 -45
- package/lib/cjs/BaseTable.js +29 -25
- package/lib/cjs/Table.js +44 -27
- package/lib/cjs/TableAdvancedFilter.js +38 -24
- package/lib/cjs/TableBody.js +12 -13
- package/lib/cjs/TableCell.js +10 -11
- package/lib/cjs/TableColumnMenu.js +27 -23
- package/lib/cjs/TableEmbedRow.js +4 -5
- package/lib/cjs/TableHeader.js +21 -13
- package/lib/cjs/TableRow.js +18 -18
- package/lib/cjs/TableSettingMenu.js +34 -42
- package/lib/cjs/context.js +1 -2
- package/lib/cjs/hooks/use-async-switch.js +5 -6
- package/lib/cjs/hooks/use-check.js +39 -17
- package/lib/cjs/hooks/use-col-hidden.js +1 -2
- package/lib/cjs/hooks/use-col-sorter.js +43 -18
- package/lib/cjs/hooks/use-col-width.js +7 -8
- package/lib/cjs/hooks/use-colgroup.js +10 -5
- package/lib/cjs/hooks/use-drag.js +8 -9
- package/lib/cjs/hooks/use-embed-expand.js +4 -5
- package/lib/cjs/hooks/use-expand.js +2 -5
- package/lib/cjs/hooks/use-pagination.js +4 -5
- package/lib/cjs/hooks/use-queue.js +1 -2
- package/lib/cjs/icons/index.js +5 -6
- package/lib/cjs/index.js +1 -2
- package/lib/cjs/styles/index.scss.js +3 -4
- package/lib/cjs/use-table.js +38 -29
- package/lib/cjs/utils/index.js +10 -8
- package/lib/esm/BaseTable.js +11 -7
- package/lib/esm/Table.js +36 -19
- package/lib/esm/TableAdvancedFilter.js +28 -14
- package/lib/esm/TableBody.js +1 -2
- package/lib/esm/TableCell.js +2 -3
- package/lib/esm/TableColumnMenu.js +12 -8
- package/lib/esm/TableEmbedRow.js +1 -2
- package/lib/esm/TableHeader.js +11 -4
- package/lib/esm/TableRow.js +8 -8
- package/lib/esm/TableSettingMenu.js +17 -25
- package/lib/esm/context.js +1 -2
- package/lib/esm/hooks/use-async-switch.js +1 -2
- package/lib/esm/hooks/use-check.js +36 -14
- package/lib/esm/hooks/use-col-hidden.js +1 -2
- package/lib/esm/hooks/use-col-sorter.js +42 -19
- package/lib/esm/hooks/use-col-width.js +1 -2
- package/lib/esm/hooks/use-colgroup.js +7 -2
- package/lib/esm/hooks/use-drag.js +7 -8
- package/lib/esm/hooks/use-embed-expand.js +1 -2
- package/lib/esm/hooks/use-expand.js +2 -5
- package/lib/esm/hooks/use-pagination.js +1 -2
- package/lib/esm/hooks/use-queue.js +1 -2
- package/lib/esm/icons/index.js +1 -2
- package/lib/esm/index.js +1 -2
- package/lib/esm/styles/index.scss.js +4 -6
- package/lib/esm/use-table.js +31 -22
- package/lib/esm/utils/index.js +10 -8
- package/lib/types/BaseTable.d.ts +12 -4
- package/lib/types/Table.d.ts +9 -5
- package/lib/types/TableAdvancedFilter.d.ts +4 -2
- package/lib/types/TableColumnMenu.d.ts +2 -0
- package/lib/types/context.d.ts +9 -7
- package/lib/types/hooks/use-col-sorter.d.ts +6 -7
- package/lib/types/hooks/use-drag.d.ts +2 -1
- package/lib/types/types.d.ts +108 -24
- package/lib/types/use-table.d.ts +20 -5
- package/lib/types/utils/index.d.ts +1 -1
- package/package.json +36 -31
- package/lib/cjs/BaseTable.js.map +0 -1
- package/lib/cjs/Table.js.map +0 -1
- package/lib/cjs/TableAdvancedFilter.js.map +0 -1
- package/lib/cjs/TableBody.js.map +0 -1
- package/lib/cjs/TableCell.js.map +0 -1
- package/lib/cjs/TableColumnMenu.js.map +0 -1
- package/lib/cjs/TableEmbedRow.js.map +0 -1
- package/lib/cjs/TableHeader.js.map +0 -1
- package/lib/cjs/TableRow.js.map +0 -1
- package/lib/cjs/TableSettingMenu.js.map +0 -1
- package/lib/cjs/context.js.map +0 -1
- package/lib/cjs/hooks/use-async-switch.js.map +0 -1
- package/lib/cjs/hooks/use-check.js.map +0 -1
- package/lib/cjs/hooks/use-col-hidden.js.map +0 -1
- package/lib/cjs/hooks/use-col-sorter.js.map +0 -1
- package/lib/cjs/hooks/use-col-width.js.map +0 -1
- package/lib/cjs/hooks/use-colgroup.js.map +0 -1
- package/lib/cjs/hooks/use-drag-sorter/lib/esm/index.js +0 -287
- package/lib/cjs/hooks/use-drag-sorter/lib/esm/index.js.map +0 -1
- package/lib/cjs/hooks/use-drag.js.map +0 -1
- package/lib/cjs/hooks/use-embed-expand.js.map +0 -1
- package/lib/cjs/hooks/use-expand.js.map +0 -1
- package/lib/cjs/hooks/use-pagination.js.map +0 -1
- package/lib/cjs/hooks/use-queue.js.map +0 -1
- package/lib/cjs/icons/index.js.map +0 -1
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/styles/index.scss.js.map +0 -1
- package/lib/cjs/use-table.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/_virtual/_cloneBuffer.js_commonjs-module.js +0 -29
- package/lib/cjs/utils/func-utils/lib/esm/_virtual/_cloneBuffer.js_commonjs-module.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/_virtual/_commonjsHelpers.js +0 -27
- package/lib/cjs/utils/func-utils/lib/esm/_virtual/_commonjsHelpers.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/_virtual/_nodeUtil.js_commonjs-module.js +0 -29
- package/lib/cjs/utils/func-utils/lib/esm/_virtual/_nodeUtil.js_commonjs-module.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/_virtual/isBuffer.js_commonjs-module.js +0 -29
- package/lib/cjs/utils/func-utils/lib/esm/_virtual/isBuffer.js_commonjs-module.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/index.js +0 -62
- package/lib/cjs/utils/func-utils/lib/esm/index.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_DataView.js +0 -37
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_DataView.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_Map.js +0 -37
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_Map.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_Promise.js +0 -37
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_Promise.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_Set.js +0 -37
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_Set.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_Symbol.js +0 -34
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_Symbol.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_WeakMap.js +0 -37
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_WeakMap.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_baseGetTag.js +0 -60
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_baseGetTag.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_baseIsArguments.js +0 -49
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_baseIsArguments.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_baseIsNative.js +0 -80
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_baseIsNative.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_cloneBuffer.js +0 -63
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_cloneBuffer.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_coreJsData.js +0 -34
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_coreJsData.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_defineProperty.js +0 -33
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_defineProperty.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_freeGlobal.js +0 -36
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_freeGlobal.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_getNative.js +0 -48
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_getNative.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_getRawTag.js +0 -77
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_getRawTag.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_getTag.js +0 -96
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_getTag.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_getValue.js +0 -40
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_getValue.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_isMasked.js +0 -50
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_isMasked.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_nativeCreate.js +0 -28
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_nativeCreate.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_nodeUtil.js +0 -58
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_nodeUtil.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_objectToString.js +0 -49
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_objectToString.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_root.js +0 -39
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_root.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_toSource.js +0 -55
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/_toSource.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/isArguments.js +0 -61
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/isArguments.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/isBuffer.js +0 -67
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/isBuffer.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/isFunction.js +0 -69
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/isFunction.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/isObject.js +0 -72
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/isObject.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/isObjectLike.js +0 -69
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/isObjectLike.js.map +0 -1
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/stubFalse.js +0 -45
- package/lib/cjs/utils/func-utils/lib/esm/node_modules/lodash/stubFalse.js.map +0 -1
- package/lib/cjs/utils/index.js.map +0 -1
- package/lib/esm/BaseTable.js.map +0 -1
- package/lib/esm/Table.js.map +0 -1
- package/lib/esm/TableAdvancedFilter.js.map +0 -1
- package/lib/esm/TableBody.js.map +0 -1
- package/lib/esm/TableCell.js.map +0 -1
- package/lib/esm/TableColumnMenu.js.map +0 -1
- package/lib/esm/TableEmbedRow.js.map +0 -1
- package/lib/esm/TableHeader.js.map +0 -1
- package/lib/esm/TableRow.js.map +0 -1
- package/lib/esm/TableSettingMenu.js.map +0 -1
- package/lib/esm/context.js.map +0 -1
- package/lib/esm/hooks/use-async-switch.js.map +0 -1
- package/lib/esm/hooks/use-check.js.map +0 -1
- package/lib/esm/hooks/use-col-hidden.js.map +0 -1
- package/lib/esm/hooks/use-col-sorter.js.map +0 -1
- package/lib/esm/hooks/use-col-width.js.map +0 -1
- package/lib/esm/hooks/use-colgroup.js.map +0 -1
- package/lib/esm/hooks/use-drag-sorter/lib/esm/index.js +0 -264
- package/lib/esm/hooks/use-drag-sorter/lib/esm/index.js.map +0 -1
- package/lib/esm/hooks/use-drag.js.map +0 -1
- package/lib/esm/hooks/use-embed-expand.js.map +0 -1
- package/lib/esm/hooks/use-expand.js.map +0 -1
- package/lib/esm/hooks/use-pagination.js.map +0 -1
- package/lib/esm/hooks/use-queue.js.map +0 -1
- package/lib/esm/icons/index.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/styles/index.scss.js.map +0 -1
- package/lib/esm/use-table.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/_virtual/_cloneBuffer.js_commonjs-module.js +0 -24
- package/lib/esm/utils/func-utils/lib/esm/_virtual/_cloneBuffer.js_commonjs-module.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/_virtual/_commonjsHelpers.js +0 -22
- package/lib/esm/utils/func-utils/lib/esm/_virtual/_commonjsHelpers.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/_virtual/_nodeUtil.js_commonjs-module.js +0 -24
- package/lib/esm/utils/func-utils/lib/esm/_virtual/_nodeUtil.js_commonjs-module.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/_virtual/isBuffer.js_commonjs-module.js +0 -24
- package/lib/esm/utils/func-utils/lib/esm/_virtual/isBuffer.js_commonjs-module.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/index.js +0 -45
- package/lib/esm/utils/func-utils/lib/esm/index.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_DataView.js +0 -29
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_DataView.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_Map.js +0 -29
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_Map.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_Promise.js +0 -29
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_Promise.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_Set.js +0 -29
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_Set.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_Symbol.js +0 -27
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_Symbol.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_WeakMap.js +0 -29
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_WeakMap.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_baseGetTag.js +0 -51
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_baseGetTag.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_baseIsArguments.js +0 -41
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_baseIsArguments.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_baseIsNative.js +0 -70
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_baseIsNative.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_cloneBuffer.js +0 -59
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_cloneBuffer.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_coreJsData.js +0 -27
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_coreJsData.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_defineProperty.js +0 -30
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_defineProperty.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_freeGlobal.js +0 -17
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_freeGlobal.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_getNative.js +0 -40
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_getNative.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_getRawTag.js +0 -70
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_getRawTag.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_getTag.js +0 -87
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_getTag.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_getValue.js +0 -35
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_getValue.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_isMasked.js +0 -43
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_isMasked.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_nativeCreate.js +0 -25
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_nativeCreate.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_nodeUtil.js +0 -54
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_nodeUtil.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_objectToString.js +0 -44
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_objectToString.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_root.js +0 -21
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_root.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_toSource.js +0 -50
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/_toSource.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/isArguments.js +0 -57
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/isArguments.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/isBuffer.js +0 -62
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/isBuffer.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/isFunction.js +0 -61
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/isFunction.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/isObject.js +0 -55
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/isObject.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/isObjectLike.js +0 -52
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/isObjectLike.js.map +0 -1
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/stubFalse.js +0 -40
- package/lib/esm/utils/func-utils/lib/esm/node_modules/lodash/stubFalse.js.map +0 -1
- package/lib/esm/utils/index.js.map +0 -1
package/lib/esm/context.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -22,4 +22,3 @@ var useTableContext = function useTableContext() {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export { TableProvider, useTableContext };
|
|
25
|
-
//# sourceMappingURL=context.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -121,4 +121,3 @@ var useAsyncSwitch = function useAsyncSwitch(setCascaderData, onExpand, onLoadCh
|
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
export { useAsyncSwitch };
|
|
124
|
-
//# sourceMappingURL=use-async-switch.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -41,15 +41,22 @@ var useTableCheck = function useTableCheck(_ref) {
|
|
|
41
41
|
return [false, false];
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var idsCanBeChecked = flattedData.filter(function (item) {
|
|
45
45
|
return !checkRowIsDisabledCheckbox(item.raw);
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
}).map(function (item) {
|
|
47
|
+
return item.id;
|
|
48
|
+
}); // TODO: 数组项完全匹配工具函数
|
|
49
|
+
// TODO: 数组项完全匹配工具函数
|
|
50
|
+
|
|
51
|
+
var _checkedAll = idsCanBeChecked.every(function (id) {
|
|
52
|
+
return isCheckedRowKey(id);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
var _semiChecked = _checkedAll ? false : checkedRowKeys.length > 0 && idsCanBeChecked.some(function (id) {
|
|
56
|
+
return isCheckedRowKey(id);
|
|
50
57
|
});
|
|
51
58
|
|
|
52
|
-
return [_checkedAll,
|
|
59
|
+
return [_checkedAll, _semiChecked];
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
return [false, false];
|
|
@@ -58,18 +65,34 @@ var useTableCheck = function useTableCheck(_ref) {
|
|
|
58
65
|
semiChecked = _React$useMemo[1];
|
|
59
66
|
|
|
60
67
|
var tryCheckAllRow = React.useCallback(function () {
|
|
61
|
-
if (checkedAll) {
|
|
62
|
-
trySetCheckedRowKeys([], [], false);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
68
|
var targetItems = flattedData.filter(function (item) {
|
|
67
69
|
return !checkRowIsDisabledCheckbox(item.raw);
|
|
68
70
|
});
|
|
69
71
|
var checkedRowKeys = targetItems.map(function (item) {
|
|
70
72
|
return item.id;
|
|
71
73
|
});
|
|
72
|
-
|
|
74
|
+
var targetRowItems = targetItems.map(function (item) {
|
|
75
|
+
return item.raw;
|
|
76
|
+
});
|
|
77
|
+
var checkedRowKeysSet = new Set(checkedRowKeys);
|
|
78
|
+
|
|
79
|
+
if (checkedAll) {
|
|
80
|
+
// 移除当前页所有行 ids
|
|
81
|
+
trySetCheckedRowKeys(function (prev) {
|
|
82
|
+
return prev.filter(function (id) {
|
|
83
|
+
return !checkedRowKeysSet.has(id);
|
|
84
|
+
});
|
|
85
|
+
}, targetRowItems, false);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
trySetCheckedRowKeys( // 添加当前页所有行 ids
|
|
90
|
+
function (prev) {
|
|
91
|
+
prev.forEach(function (id) {
|
|
92
|
+
return checkedRowKeysSet.add(id);
|
|
93
|
+
});
|
|
94
|
+
return Array.from(checkedRowKeysSet);
|
|
95
|
+
}, targetRowItems, true);
|
|
73
96
|
}, [trySetCheckedRowKeys, flattedData, checkRowIsDisabledCheckbox, checkedAll]);
|
|
74
97
|
return {
|
|
75
98
|
tryCheckAllRow: tryCheckAllRow,
|
|
@@ -84,4 +107,3 @@ var useTableCheck = function useTableCheck(_ref) {
|
|
|
84
107
|
};
|
|
85
108
|
|
|
86
109
|
export { useTableCheck };
|
|
87
|
-
//# sourceMappingURL=use-check.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -64,4 +64,3 @@ var useColHidden = function useColHidden(_ref) {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
export { useColHidden };
|
|
67
|
-
//# sourceMappingURL=use-col-hidden.js.map
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { useMemo, useEffect, useState } from 'react';
|
|
11
11
|
import { useUpdateEffect } from '@hi-ui/use-update-effect';
|
|
12
|
+
import { useUncontrolledState } from '@hi-ui/use-uncontrolled-state';
|
|
13
|
+
import { useLatestRef } from '@hi-ui/use-latest';
|
|
12
14
|
import { parseLocalArray } from '../utils/index.js';
|
|
13
15
|
var DEFAULT_COLUMNS = [];
|
|
14
16
|
/**
|
|
@@ -18,38 +20,59 @@ var DEFAULT_COLUMNS = [];
|
|
|
18
20
|
var useColSorter = function useColSorter(_ref) {
|
|
19
21
|
var uniqueId = _ref.uniqueId,
|
|
20
22
|
_ref$columns = _ref.columns,
|
|
21
|
-
columns = _ref$columns === void 0 ? DEFAULT_COLUMNS : _ref$columns
|
|
23
|
+
columns = _ref$columns === void 0 ? DEFAULT_COLUMNS : _ref$columns,
|
|
24
|
+
sortedColKeysProp = _ref.sortedColKeys,
|
|
25
|
+
onSortedColKeysChange = _ref.onSortedColKeysChange;
|
|
22
26
|
var cacheKey = uniqueId ? uniqueId + "_sortCols" : '';
|
|
23
27
|
|
|
24
|
-
var
|
|
28
|
+
var _useUncontrolledState = useUncontrolledState(function () {
|
|
25
29
|
return parseLocalArray({
|
|
26
30
|
key: cacheKey,
|
|
27
|
-
defaultValue: columns
|
|
31
|
+
defaultValue: columns.map(function (column) {
|
|
32
|
+
return column.dataKey;
|
|
33
|
+
})
|
|
28
34
|
});
|
|
29
|
-
}),
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
}, sortedColKeysProp, onSortedColKeysChange),
|
|
36
|
+
sortedColKeys = _useUncontrolledState[0],
|
|
37
|
+
setSortColKeys = _useUncontrolledState[1];
|
|
32
38
|
|
|
39
|
+
useUpdateEffect(function () {
|
|
40
|
+
// 当column发生改变的时候,同步 setting 的 sortedCols 设置
|
|
41
|
+
setSortColKeys(columns.map(function (column) {
|
|
42
|
+
return column.dataKey;
|
|
43
|
+
}));
|
|
44
|
+
}, [columns]);
|
|
45
|
+
var columnsLatestRef = useLatestRef(columns);
|
|
46
|
+
var sortedCols = useMemo(function () {
|
|
47
|
+
var columnsMap = columnsLatestRef.current.reduce(function (prev, cur) {
|
|
48
|
+
prev[cur.dataKey] = cur;
|
|
49
|
+
return prev;
|
|
50
|
+
}, {});
|
|
51
|
+
return sortedColKeys.map(function (colKey) {
|
|
52
|
+
return columnsMap[colKey];
|
|
53
|
+
}).filter(Boolean);
|
|
54
|
+
}, [sortedColKeys, columnsLatestRef]);
|
|
33
55
|
useEffect(function () {
|
|
34
56
|
if (!cacheKey) return;
|
|
35
|
-
window.localStorage.setItem(cacheKey, JSON.stringify(
|
|
36
|
-
}, [cacheKey,
|
|
57
|
+
window.localStorage.setItem(cacheKey, JSON.stringify(sortedColKeys));
|
|
58
|
+
}, [cacheKey, sortedColKeys]); // 用于维护列操作时排序临时状态((未确认保存时))
|
|
37
59
|
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
setCacheSortedCols =
|
|
60
|
+
var _useState = useState(sortedCols),
|
|
61
|
+
_cacheSortedCols = _useState[0],
|
|
62
|
+
setCacheSortedCols = _useState[1]; // 保证排序的 column,是有效的可展示的列
|
|
41
63
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
64
|
+
|
|
65
|
+
var cacheSortedCols = useMemo(function () {
|
|
66
|
+
return _cacheSortedCols.filter(function (col) {
|
|
67
|
+
return col && typeof col.dataKey === 'string' && col.dataKey !== '';
|
|
68
|
+
});
|
|
69
|
+
}, [_cacheSortedCols]);
|
|
46
70
|
return {
|
|
47
71
|
sortedCols: sortedCols,
|
|
48
|
-
|
|
72
|
+
setSortColKeys: setSortColKeys,
|
|
49
73
|
cacheSortedCols: cacheSortedCols,
|
|
50
74
|
setCacheSortedCols: setCacheSortedCols
|
|
51
75
|
};
|
|
52
76
|
};
|
|
53
77
|
|
|
54
78
|
export { useColSorter };
|
|
55
|
-
//# sourceMappingURL=use-col-sorter.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -117,4 +117,3 @@ var useColWidth = function useColWidth(_ref) {
|
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
export { useColWidth };
|
|
120
|
-
//# sourceMappingURL=use-col-width.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -36,6 +36,12 @@ var useColumns = function useColumns(_ref) {
|
|
|
36
36
|
align: (_a = raw.align) !== null && _a !== void 0 ? _a : 'left',
|
|
37
37
|
render: raw.render
|
|
38
38
|
});
|
|
39
|
+
}); // 记录下标位置,方便冻结列操作计算时快速获取更新
|
|
40
|
+
// 记录下标位置,方便冻结列操作计算时快速获取更新
|
|
41
|
+
|
|
42
|
+
flattedColumns.forEach(function (column, index) {
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
column.index = index;
|
|
39
45
|
});
|
|
40
46
|
return [flattedColumns, maxDepth];
|
|
41
47
|
}, [columns]),
|
|
@@ -90,4 +96,3 @@ var useColumns = function useColumns(_ref) {
|
|
|
90
96
|
};
|
|
91
97
|
|
|
92
98
|
export { useColumns };
|
|
93
|
-
//# sourceMappingURL=use-colgroup.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -17,20 +17,20 @@ var useTableDrag = function useTableDrag(_ref) {
|
|
|
17
17
|
setCacheData = _ref.setCacheData,
|
|
18
18
|
draggable = _ref.draggable,
|
|
19
19
|
onDropEnd = _ref.onDropEnd,
|
|
20
|
-
onDropProp = _ref.onDrop
|
|
20
|
+
onDropProp = _ref.onDrop,
|
|
21
|
+
fieldKey = _ref.fieldKey;
|
|
21
22
|
var dragRowRef = React.useRef(null);
|
|
22
23
|
var onDropEndLatest = useLatestCallback(onDropEnd);
|
|
23
24
|
var onDrop = useCallback(function (evt, sourceId, targetId, dragDirection) {
|
|
24
|
-
// console.log(sourceId, targetId, dragDirection)
|
|
25
25
|
if (!draggable) return;
|
|
26
26
|
if (targetId === sourceId) return; // TODO: 根据 id 查询数据原始数据或者直接使用引用值,两者选择,避免bug
|
|
27
27
|
// const { rowData, dropRowData, level } = dragRowRef.current
|
|
28
28
|
|
|
29
29
|
var sourceNode = findNodeById(cacheData, sourceId, {
|
|
30
|
-
idFieldName:
|
|
30
|
+
idFieldName: fieldKey
|
|
31
31
|
});
|
|
32
32
|
var targetNode = findNodeById(cacheData, targetId, {
|
|
33
|
-
idFieldName:
|
|
33
|
+
idFieldName: fieldKey
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
if (!sourceNode || !targetNode) {
|
|
@@ -40,10 +40,10 @@ var useTableDrag = function useTableDrag(_ref) {
|
|
|
40
40
|
|
|
41
41
|
var nextTreeData = cloneTree(cacheData);
|
|
42
42
|
deleteNodeById(nextTreeData, sourceId, {
|
|
43
|
-
idFieldName:
|
|
43
|
+
idFieldName: fieldKey
|
|
44
44
|
});
|
|
45
45
|
insertNodeById(nextTreeData, targetId, sourceNode, dragDirection === 'top' ? 0 : 1, {
|
|
46
|
-
idFieldName:
|
|
46
|
+
idFieldName: fieldKey
|
|
47
47
|
});
|
|
48
48
|
var resultMaybePromise = isFunction(onDropProp) ? // TODO: 支持 tree 拖拽层级,第四个参数
|
|
49
49
|
onDropProp(evt, {
|
|
@@ -88,4 +88,3 @@ var useTableDrag = function useTableDrag(_ref) {
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
export { useTableDrag };
|
|
91
|
-
//# sourceMappingURL=use-drag.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -157,4 +157,3 @@ var useEmbedExpand = function useEmbedExpand(_ref) {
|
|
|
157
157
|
};
|
|
158
158
|
|
|
159
159
|
export { useEmbedExpand };
|
|
160
|
-
//# sourceMappingURL=use-embed-expand.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -77,7 +77,6 @@ var useExpand = function useExpand(flattedData, defaultExpandedIds, expandedIdsP
|
|
|
77
77
|
trySetTransitionData(flattedData, expandedIds);
|
|
78
78
|
}, [flattedData, trySetTransitionData, expandedIds]);
|
|
79
79
|
var onNodeToggleStart = useCallback(function (expandedNode, shouldExpanded) {
|
|
80
|
-
console.error('onNodeToggleStart---------------', expandedNode, shouldExpanded);
|
|
81
80
|
if (isExpandingRef.current) return;
|
|
82
81
|
var expanded = expandedIdsRef.current.indexOf(expandedNode.id) !== -1;
|
|
83
82
|
|
|
@@ -125,8 +124,7 @@ var useExpand = function useExpand(flattedData, defaultExpandedIds, expandedIdsP
|
|
|
125
124
|
}
|
|
126
125
|
|
|
127
126
|
tryToggleExpandedIds(Array.from(expandedNodeIdSet), expandedNode, shouldExpanded);
|
|
128
|
-
}, [tryToggleExpandedIds, flattedData, trySetTransitionData, dequeue, expandedIdsRef, transitionDataRef]);
|
|
129
|
-
|
|
127
|
+
}, [tryToggleExpandedIds, flattedData, trySetTransitionData, dequeue, expandedIdsRef, transitionDataRef]);
|
|
130
128
|
var onNodeToggleStartLatest = useLatestCallback(onNodeToggleStart);
|
|
131
129
|
var onNodeExpand = useCallback(function (expandedNode, shouldExpanded) {
|
|
132
130
|
enqueue([expandedNode, shouldExpanded]);
|
|
@@ -169,4 +167,3 @@ function flattenTreeDataWithExpand(flattedTreeData, expandedIds) {
|
|
|
169
167
|
}
|
|
170
168
|
|
|
171
169
|
export { useExpand, useExpandProps };
|
|
172
|
-
//# sourceMappingURL=use-expand.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -43,4 +43,3 @@ var useTablePagination = function useTablePagination(_ref) {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
export { useTablePagination };
|
|
46
|
-
//# sourceMappingURL=use-pagination.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -46,4 +46,3 @@ var useQueue = function useQueue(initialValue) {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export { useQueue };
|
|
49
|
-
//# sourceMappingURL=use-queue.js.map
|
package/lib/esm/icons/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -30,4 +30,3 @@ var defaultLeafIcon = /*#__PURE__*/React.createElement("span", {
|
|
|
30
30
|
});
|
|
31
31
|
var defaultLoadingIcon = /*#__PURE__*/React.createElement(Spinner, null);
|
|
32
32
|
export { defaultCollapseIcon, defaultExpandIcon, defaultLeafIcon, defaultLoadingIcon };
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
10
|
import './styles/index.scss.js';
|
|
11
11
|
export { SELECTION_DATA_KEY, Table, Table as default } from './Table.js';
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
var css_248z = "@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n.hi-v4-table {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n font-size: 14px;\n position: relative; }\n.hi-v4-table table {\n width: 100%;\n text-align: left;\n background-color: #fff;\n background-color: var(--hi-v4-color-static-white, #fff);\n border-radius: 2px 2px 0 0;\n border-spacing: 0;\n border-collapse: separate;\n display: table;\n table-layout: fixed;\n overflow: auto; }\n.hi-v4-table__wrapper {\n position: relative;\n z-index: 0; }\n.hi-v4-table__switcher.hi-v4-icon-button {\n color: #929aa6;\n color: var(--hi-v4-color-gray-500, #929aa6); }\n.hi-v4-table__switcher--expanded.hi-v4-icon-button {\n color: #4a9eff;\n color: var(--hi-v4-color-brandblue-400, #4a9eff); }\n.hi-v4-table--size-md table tbody > tr > td {\n padding: 14px;\n padding: var(--hi-v4-spacing-7, 14px); }\n.hi-v4-table--size-md table thead > tr > th {\n padding: 14px;\n padding: var(--hi-v4-spacing-7, 14px); }\n.hi-v4-table--size-sm table tbody > tr > td {\n padding: 10px;\n padding: var(--hi-v4-spacing-5, 10px); }\n.hi-v4-table--size-sm table thead > tr > th {\n padding: 10px;\n padding: var(--hi-v4-spacing-5, 10px); }\n.hi-v4-table--size-lg table tbody > tr > td {\n padding: 18px;\n padding: var(--hi-v4-spacing-9, 18px); }\n.hi-v4-table--size-lg table thead > tr > th {\n padding: 18px;\n padding: var(--hi-v4-spacing-9, 18px); }\n.hi-v4-table--bordered table thead > tr > th {\n border-right: 1px solid #ebedf0;\n border-right: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }\n.hi-v4-table--bordered table td {\n border-right: 1px solid #ebedf0;\n border-right: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }\n.hi-v4-table--bordered .hi-v4-table-header {\n border-top: 1px solid #ebedf0;\n border-top: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);\n border-left: 1px solid #ebedf0;\n border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }\n.hi-v4-table--bordered .hi-v4-table-body {\n border-left: 1px solid #ebedf0;\n border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }\n.hi-v4-table--striped .hi-v4-table-row:not(:hover):nth-child(2n) .hi-v4-table-cell {\n background-color: #f5f7fa;\n background-color: var(--hi-v4-color-gray-50, #f5f7fa); }\n.hi-v4-table--sticky {\n position: sticky;\n top: 0; }\n.hi-v4-table-header {\n position: relative;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden; }\n.hi-v4-table-header__resizable {\n position: relative;\n background-clip: padding-box; }\n.hi-v4-table-header__resizable-handle {\n position: absolute;\n width: 2px;\n height: 100%;\n bottom: 0;\n right: 0;\n cursor: col-resize;\n z-index: 1; }\n.hi-v4-table-header__resizable-handle:hover {\n background-color: #237ffa;\n background-color: var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-table-header__col--hovered-highlight {\n background-color: #f2f4f7;\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-table-row:hover .hi-v4-table-cell {\n background-color: #e2f3fe;\n background-color: var(--hi-v4-color-brandblue-50, #e2f3fe); }\n.hi-v4-table-row--hovered {\n background: #f0f5fe; }\n.hi-v4-table-row--expanded {\n background: #fbfbfb; }\n.hi-v4-table-row--expanded > td {\n color: #1f2937;\n color: var(--hi-v4-color-gray-800, #1f2937); }\n.hi-v4-table-row--error > td {\n color: #ff5959;\n color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-table-row--highlight > td {\n background-color: #e2f3fe;\n background-color: var(--hi-v4-color-brandblue-50, #e2f3fe); }\n.hi-v4-table-row--dragging {\n background-color: #e2f3fe;\n background-color: var(--hi-v4-color-brandblue-50, #e2f3fe); }\n.hi-v4-table-row--drag-top td {\n border-top: 2px dashed #237ffa;\n border-top: 2px dashed var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-table-row--drag-bottom td {\n border-bottom: 2px dashed #237ffa;\n border-bottom: 2px dashed var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-table-row--avg .hi-v4-table-cell, .hi-v4-table-row--total .hi-v4-table-cell {\n background-color: #f5f7fa;\n background-color: var(--hi-v4-color-gray-50, #f5f7fa); }\n.hi-v4-table-row--avg:hover .hi-v4-table-cell, .hi-v4-table-row--total:hover .hi-v4-table-cell {\n background-color: #f5f7fa;\n background-color: var(--hi-v4-color-gray-50, #f5f7fa); }\n.hi-v4-table-header .hi-v4-table-header-col, .hi-v4-table-header .hi-v4-table-col {\n background-color: #f5f7fa;\n background-color: var(--hi-v4-color-gray-50, #f5f7fa); }\n.hi-v4-table-body .hi-v4-table-header-col[data-hover-highlight], .hi-v4-table-body .hi-v4-table-col[data-hover-highlight] {\n background-color: #e2f3fe;\n background-color: var(--hi-v4-color-brandblue-50, #e2f3fe); }\n.hi-v4-table-header .hi-v4-table-header-col[data-hover-highlight], .hi-v4-table-header .hi-v4-table-col[data-hover-highlight] {\n background-color: #f2f4f7;\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-table-header-cell {\n color: #1f2733;\n color: var(--hi-v4-color-gray-700, #1f2733);\n font-size: 0.875rem;\n font-size: var(--hi-v4-text-size-normal, 0.875rem);\n font-weight: 500;\n font-weight: var(--hi-v4-text-weight-medium, 500);\n line-height: 1.25rem;\n line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);\n padding: 14px 16px;\n padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-8, 16px);\n border-bottom: 1px solid #f0f0f0; }\n.hi-v4-table-header-cell.hi-v4-table__embed-col, .hi-v4-table-header-cell.hi-v4-table__selection-col {\n padding: 14px 10px;\n padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-5, 10px); }\n.hi-v4-table-cell {\n word-break: break-word;\n border-bottom: 1px solid #f0f0f0;\n font-size: 0.875rem;\n font-size: var(--hi-v4-text-size-normal, 0.875rem);\n font-weight: 400;\n font-weight: var(--hi-v4-text-weight-normal, 400);\n color: #1f2733;\n color: var(--hi-v4-color-gray-700, #1f2733);\n line-height: 1.25rem;\n line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);\n padding: 14px 16px;\n padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-8, 16px); }\n.hi-v4-table-cell[data-sticky] {\n background-color: #fff;\n background-color: var(--hi-v4-color-static-white, #fff); }\n.hi-v4-table-cell__col--highlight {\n background-color: #e2f3fe;\n background-color: var(--hi-v4-color-brandblue-50, #e2f3fe); }\n.hi-v4-table-cell__col--hovered-highlight {\n background-color: #e2f3fe;\n background-color: var(--hi-v4-color-brandblue-50, #e2f3fe); }\n.hi-v4-table-cell__indent {\n display: inline-block;\n width: 14px;\n height: 100%;\n margin-right: 2px;\n margin-right: var(--hi-v4-spacing-1, 2px); }\n.hi-v4-table-cell__switcher.hi-v4-icon-button {\n margin-right: 2px;\n margin-right: var(--hi-v4-spacing-1, 2px);\n color: #929aa6;\n color: var(--hi-v4-color-gray-500, #929aa6); }\n.hi-v4-table-cell.hi-v4-table__embed-col, .hi-v4-table-cell.hi-v4-table__selection-col {\n padding: 14px 10px;\n padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-5, 10px); }\n.hi-v4-table-th__col--highlight {\n background-color: #f2f4f7;\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\nth[data-sticky] {\n background-color: #f5f7fa;\n background-color: var(--hi-v4-color-gray-50, #f5f7fa);\n z-index: calc(1 + 1);\n z-index: calc(var(--hi-v4-zindex-absolute, 1) + 1); }\n.hi-v4-table-freeze-shadow {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 20;\n pointer-events: none;\n overflow: hidden;\n height: 100%;\n width: 200px; }\n.hi-v4-table-freeze-shadow--left {\n margin-right: 10px;\n left: 0;\n -webkit-box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.15);\n box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.15); }\n.hi-v4-table-freeze-shadow--right {\n margin-left: 10px;\n right: 0;\n -webkit-box-shadow: -6px 0 6px -4px rgba(0, 0, 0, 0.15);\n box-shadow: -6px 0 6px -4px rgba(0, 0, 0, 0.15); }\n.hi-v4-table-header-filter-dropdown__trigger.hi-v4-icon-button {\n margin-left: 4px; }\n.hi-v4-table-header-filter-dropdown__content {\n width: 124px;\n padding: 12px 8px;\n padding: var(--hi-v4-spacing-6, 12px) var(--hi-v4-spacing-4, 8px);\n font-weight: 400;\n font-weight: var(--hi-v4-text-weight-normal, 400); }\n.hi-v4-table-header-filter-dropdown__item {\n margin-top: 8px;\n margin-top: var(--hi-v4-spacing-4, 8px);\n padding: 6px 8px;\n padding: var(--hi-v4-spacing-3, 6px) var(--hi-v4-spacing-4, 8px);\n border-radius: 4px;\n border-radius: var(--hi-v4-border-radius-normal, 4px);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n cursor: pointer; }\n.hi-v4-table-header-filter-dropdown__item:first-child {\n margin-top: 0; }\n.hi-v4-table-header-filter-dropdown__item:hover {\n background-color: #f5f7fa;\n background-color: var(--hi-v4-color-gray-50, #f5f7fa); }\n.hi-v4-table-header-filter-dropdown__item--active {\n background-color: #e2f3fe;\n background-color: var(--hi-v4-color-brandblue-50, #e2f3fe); }\n.hi-v4-table-header-filter-dropdown__item--active:hover {\n background-color: #e2f3fe;\n background-color: var(--hi-v4-color-brandblue-50, #e2f3fe); }\n.hi-v4-table-header-filter-sorter {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n height: 20px;\n margin-top: 2px;\n margin-left: 6px; }\n.hi-v4-table-header-filter-sorter__icon {\n display: inline-block;\n height: 8px;\n cursor: pointer;\n overflow: hidden;\n font-weight: 400;\n font-weight: var(--hi-v4-text-weight-normal, 400);\n color: #929aa6;\n color: var(--hi-v4-color-gray-500, #929aa6); }\n.hi-v4-table-header-filter-sorter__icon svg {\n position: relative;\n top: -5px; }\n.hi-v4-table-header-filter-sorter__icon--active {\n color: #237ffa;\n color: var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-table-header-filter-custom__trigger {\n margin-left: 6px;\n color: #929aa6;\n color: var(--hi-v4-color-gray-500, #929aa6);\n cursor: pointer; }\n.hi-v4-table-header-filter-custom__content {\n padding: 12px 8px; }\n.hi-v4-table-embed-row {\n position: relative;\n z-index: 0; }\n.hi-v4-table-embed-row > td {\n background-color: #ebedf0;\n background-color: var(--hi-v4-color-gray-200, #ebedf0);\n padding: 20px;\n padding: var(--hi-v4-spacing-10, 20px); }\n.hi-v4-table-setting {\n position: absolute;\n height: 100%;\n z-index: 11;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n right: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n border-left: 1px solid #e0e1e2;\n border-bottom: 1px solid #e0e1e2;\n border-top: none;\n color: #999;\n cursor: pointer;\n font-size: 14px;\n width: 16px;\n background: #fbfbfb; }\n.hi-v4-table-setting__btn-group {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end; }\n.hi-v4-table-setting-item {\n position: relative;\n padding-top: 2px;\n padding-top: var(--hi-v4-spacing-1, 2px);\n padding-bottom: 2px;\n padding-bottom: var(--hi-v4-spacing-1, 2px);\n -webkit-box-sizing: border-box;\n box-sizing: border-box; }\n.hi-v4-table-setting-item__wrap {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n padding: 6px 8px;\n padding: var(--hi-v4-spacing-3, 6px) var(--hi-v4-spacing-4, 8px);\n line-height: 1.25rem;\n line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);\n border-radius: 4px;\n border-radius: var(--hi-v4-border-radius-normal, 4px); }\n.hi-v4-table-setting-item__wrap:hover {\n background-color: #e2f3fe;\n background-color: var(--hi-v4-color-brandblue-50, #e2f3fe); }\n.hi-v4-table-setting-item--dragging .hi-v4-table-setting-item__wrap {\n opacity: 0.6; }\n.hi-v4-table-setting-item::before {\n position: absolute;\n left: 0;\n z-index: 9999;\n display: none;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n width: 8px;\n height: 8px;\n content: '';\n background-color: #fff;\n background-color: var(--hi-v4-color-static-white, #fff);\n border: 1px solid #237ffa;\n border: 1px solid var(--hi-v4-color-brandblue-500, #237ffa);\n border-radius: 100%; }\n.hi-v4-table-setting-item::after {\n position: absolute;\n content: '';\n z-index: 9998;\n display: block;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n border-bottom-width: 0;\n border-bottom-style: solid;\n border-bottom-color: #237ffa;\n border-bottom-color: var(--hi-v4-color-brandblue-500, #237ffa);\n left: 0;\n width: 100%; }\n.hi-v4-table-setting-item::before, .hi-v4-table-setting-item::after {\n margin-left: -10px;\n margin-right: -10px; }\n.hi-v4-table-setting-item--direction-before::before {\n display: block;\n top: -0.5px;\n -webkit-transform: translateY(-4px);\n transform: translateY(-4px); }\n.hi-v4-table-setting-item--direction-before::after {\n top: -0.5px;\n border-bottom-width: 1px; }\n.hi-v4-table-setting-item--direction-after::before {\n display: block;\n bottom: 0.5px;\n -webkit-transform: translateY(4px);\n transform: translateY(4px); }\n.hi-v4-table-setting-item--direction-after::after {\n bottom: 0.5px;\n border-bottom-width: 1px; }\n.hi-v4-table-pagination {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n grid-row-gap: 8px;\n row-gap: 8px;\n padding: 12px 0;\n padding: var(--hi-v4-spacing-6, 12px) 0;\n background-color: #fff;\n background-color: var(--hi-v4-color-static-white, #fff); }\n.hi-v4-table-pagination--placement-left {\n -webkit-box-pack: start;\n -ms-flex-pack: start;\n justify-content: flex-start; }\n.hi-v4-table-pagination--placement-right {\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end; }\n.hi-v4-table-pagination--placement-middle {\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center; }\n.hi-v4-table-empty-content td {\n text-align: center;\n padding: 24px 0;\n padding: var(--hi-v4-spacing-12, 24px) 0; }\n";
|
|
11
|
-
|
|
12
|
-
var __styleInject__ = require('style-inject/dist/style-inject.es.js')["default"];
|
|
10
|
+
import __styleInject__ from 'inject-head-style';
|
|
11
|
+
var css_248z = ".hi-v4-table {-webkit-box-sizing: border-box;box-sizing: border-box;font-size: 14px;position: relative; }.hi-v4-table table {width: 100%;text-align: left;background-color: var(--hi-v4-color-static-white, #fff);border-radius: 2px 2px 0 0;border-spacing: 0;border-collapse: separate;display: table;table-layout: fixed; }.hi-v4-table__wrapper {position: relative;z-index: 0; }.hi-v4-table__switcher.hi-v4-icon-button {color: var(--hi-v4-color-gray-500, #929aa6); }.hi-v4-table__switcher--expanded.hi-v4-icon-button {color: var(--hi-v4-color-primary-400, var(--hi-v4-color-brandblue-400, #4a9eff)); }.hi-v4-table--size-md table tbody > tr > td {padding: var(--hi-v4-spacing-7, 14px); }.hi-v4-table--size-md table thead > tr > th {padding: var(--hi-v4-spacing-7, 14px); }.hi-v4-table--size-sm table tbody > tr > td {padding: var(--hi-v4-spacing-5, 10px); }.hi-v4-table--size-sm table thead > tr > th {padding: var(--hi-v4-spacing-5, 10px); }.hi-v4-table--size-lg table tbody > tr > td {padding: var(--hi-v4-spacing-9, 18px); }.hi-v4-table--size-lg table thead > tr > th {padding: var(--hi-v4-spacing-9, 18px); }.hi-v4-table--bordered table thead > tr > th {border-right: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }.hi-v4-table--bordered table td {border-right: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }.hi-v4-table--bordered .hi-v4-table-header {border-top: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }.hi-v4-table--bordered .hi-v4-table-body {border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }.hi-v4-table--sticky {position: -webkit-sticky;position: sticky;top: 0; }.hi-v4-table-header {position: relative;-webkit-box-sizing: border-box;box-sizing: border-box;overflow: hidden; }.hi-v4-table-header__resizable {position: relative;background-clip: padding-box; }.hi-v4-table-header__resizable-handle {position: absolute;width: 2px;height: 100%;bottom: 0;right: 0;cursor: col-resize;z-index: 1; }.hi-v4-table-header__resizable-handle:hover {background-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-table-header-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-header-cell.hi-v4-table-header-cell__col--highlight, .hi-v4-table-header-cell.hi-v4-table-header-cell__col--hovered-highlight, .hi-v4-table-header-cell.hi-v4-table-header-cell__col--active {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-table-header-cell.hi-v4-table-header-cell__col--highlight[data-sticky], .hi-v4-table-header-cell.hi-v4-table-header-cell__col--hovered-highlight[data-sticky], .hi-v4-table-header-cell.hi-v4-table-header-cell__col--active[data-sticky] {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-table-row--hover:hover > .hi-v4-table-cell {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-row--striped > .hi-v4-table-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-row--expanded > .hi-v4-table-cell {color: var(--hi-v4-color-gray-800, #1f2937); }.hi-v4-table-row--error > .hi-v4-table-cell {color: var(--hi-v4-color-danger-500, var(--hi-v4-color-red-500, #ff5959)); }.hi-v4-table-row--highlight > .hi-v4-table-cell {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-row--dragging > .hi-v4-table-cell {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-row--drag-top > .hi-v4-table-cell {border-top: 2px dashed var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-table-row--drag-bottom > .hi-v4-table-cell {border-bottom: 2px dashed var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-table-row--avg > .hi-v4-table-cell, .hi-v4-table-row--total > .hi-v4-table-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-row--avg:hover > .hi-v4-table-cell, .hi-v4-table-row--total:hover > .hi-v4-table-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-header .hi-v4-table-header-col, .hi-v4-table-header .hi-v4-table-col {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-body .hi-v4-table-header-col[data-hover-highlight], .hi-v4-table-body .hi-v4-table-col[data-hover-highlight] {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-header .hi-v4-table-header-col[data-hover-highlight], .hi-v4-table-header .hi-v4-table-col[data-hover-highlight] {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-table-body {position: relative;overflow: auto; }.hi-v4-table-header-cell {color: var(--hi-v4-color-gray-700, #1f2733);font-size: var(--hi-v4-text-size-md, 0.875rem);font-weight: var(--hi-v4-text-weight-medium, 500);line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-8, 16px);border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8); }.hi-v4-table-header-cell.hi-v4-table__embed-col, .hi-v4-table-header-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-5, 10px); }.hi-v4-table-cell {word-break: break-word;border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8);font-size: var(--hi-v4-text-size-md, 0.875rem);font-weight: var(--hi-v4-text-weight-normal, 400);color: var(--hi-v4-color-gray-700, #1f2733);line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-8, 16px);background-color: var(--hi-v4-color-static-white, #fff); }.hi-v4-table-cell__indent {display: inline-block;width: 14px;height: 100%;margin-right: var(--hi-v4-spacing-1, 2px); }.hi-v4-table-cell__switcher.hi-v4-icon-button {margin-right: var(--hi-v4-spacing-1, 2px);color: var(--hi-v4-color-gray-500, #929aa6); }.hi-v4-table-cell.hi-v4-table__embed-col, .hi-v4-table-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-5, 10px); }.hi-v4-table-cell.hi-v4-table-cell__col--highlight {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-cell.hi-v4-table-cell__col--hovered-highlight {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-freeze-shadow {position: absolute;top: 0;bottom: 0;z-index: 20;pointer-events: none;overflow: hidden;height: 100%;width: 200px; }.hi-v4-table-freeze-shadow--left {margin-right: 10px;left: 0;-webkit-box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.15);box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.15); }.hi-v4-table-freeze-shadow--right {margin-left: 10px;right: 0;-webkit-box-shadow: -6px 0 6px -4px rgba(0, 0, 0, 0.15);box-shadow: -6px 0 6px -4px rgba(0, 0, 0, 0.15); }.hi-v4-table-header-filter-dropdown__trigger.hi-v4-icon-button {margin-left: 4px; }.hi-v4-table-header-filter-dropdown__content {width: 124px;padding: var(--hi-v4-spacing-6, 12px) var(--hi-v4-spacing-4, 8px);font-weight: var(--hi-v4-text-weight-normal, 400); }.hi-v4-table-header-filter-dropdown__item {margin-top: var(--hi-v4-spacing-4, 8px);padding: var(--hi-v4-spacing-3, 6px) var(--hi-v4-spacing-4, 8px);border-radius: var(--hi-v4-border-radius-md, 4px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;-webkit-box-align: center;-ms-flex-align: center;align-items: center;cursor: pointer;color: var(--hi-v4-color-gray-700, #1f2733);font-size: var(--hi-v4-text-size-md, 0.875rem); }.hi-v4-table-header-filter-dropdown__item:first-child {margin-top: 0; }.hi-v4-table-header-filter-dropdown__item:hover {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-header-filter-dropdown__item--active {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-header-filter-dropdown__item--active:hover {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-header-filter-sorter {display: -webkit-inline-box;display: -ms-inline-flexbox;display: inline-flex;-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;height: 20px;margin-top: 2px;margin-left: 6px; }.hi-v4-table-header-filter-sorter__icon {display: inline-block;height: 8px;cursor: pointer;overflow: hidden;font-weight: var(--hi-v4-text-weight-normal, 400);color: var(--hi-v4-color-gray-500, #929aa6); }.hi-v4-table-header-filter-sorter__icon svg {position: relative;top: -5px; }.hi-v4-table-header-filter-sorter__icon--active {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-table-header-filter-custom__trigger {margin-left: 6px;color: var(--hi-v4-color-gray-500, #929aa6);cursor: pointer; }.hi-v4-table-header-filter-custom__content {padding: 12px 8px; }.hi-v4-table-embed-row {position: relative;z-index: 0; }.hi-v4-table-embed-row > td {background-color: var(--hi-v4-color-gray-200, #ebedf0);padding: var(--hi-v4-spacing-10, 20px); }.hi-v4-table-setting {position: absolute;height: 100%;z-index: 11;-webkit-box-sizing: border-box;box-sizing: border-box;right: 0;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8);border-bottom: none;border-top: none;color: var(--hi-v4-color-gray-500, #929aa6);cursor: pointer;font-size: var(--hi-v4-text-size-sm, 0.75rem);width: 18px;background: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-setting__btn-group {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: end;-ms-flex-pack: end;justify-content: flex-end; }.hi-v4-table-setting-item {position: relative;padding-top: var(--hi-v4-spacing-1, 2px);padding-bottom: var(--hi-v4-spacing-1, 2px);-webkit-box-sizing: border-box;box-sizing: border-box; }.hi-v4-table-setting-item__wrap {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;cursor: move;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-orient: horizontal;-webkit-box-direction: normal;-ms-flex-direction: row;flex-direction: row;padding: var(--hi-v4-spacing-3, 6px) var(--hi-v4-spacing-4, 8px);line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);border-radius: var(--hi-v4-border-radius-md, 4px); }.hi-v4-table-setting-item__wrap:hover {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-setting-item--dragging .hi-v4-table-setting-item__wrap {opacity: 0.6; }.hi-v4-table-setting-item::before {position: absolute;left: 0;z-index: 9999;display: none;-webkit-box-sizing: border-box;box-sizing: border-box;width: 8px;height: 8px;content: '';background-color: var(--hi-v4-color-static-white, #fff);border: 1px solid var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));border-radius: 100%; }.hi-v4-table-setting-item::after {position: absolute;content: '';z-index: 9998;display: block;-webkit-box-sizing: border-box;box-sizing: border-box;border-bottom-width: 0;border-bottom-style: solid;border-bottom-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));left: 0;width: 100%; }.hi-v4-table-setting-item::before, .hi-v4-table-setting-item::after {margin-left: -10px;margin-right: -10px; }.hi-v4-table-setting-item--direction-before::before {display: block;top: -0.5px;-webkit-transform: translateY(-4px);transform: translateY(-4px); }.hi-v4-table-setting-item--direction-before::after {top: -0.5px;border-bottom-width: 1px; }.hi-v4-table-setting-item--direction-after::before {display: block;bottom: 0.5px;-webkit-transform: translateY(4px);transform: translateY(4px); }.hi-v4-table-setting-item--direction-after::after {bottom: 0.5px;border-bottom-width: 1px; }.hi-v4-table-pagination {display: -webkit-box;display: -ms-flexbox;display: flex;-ms-flex-wrap: wrap;flex-wrap: wrap;row-gap: 8px;padding: var(--hi-v4-spacing-6, 12px) 0;background-color: var(--hi-v4-color-static-white, #fff); }.hi-v4-table-pagination--placement-left {-webkit-box-pack: start;-ms-flex-pack: start;justify-content: flex-start; }.hi-v4-table-pagination--placement-right {-webkit-box-pack: end;-ms-flex-pack: end;justify-content: flex-end; }.hi-v4-table-pagination--placement-middle {-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center; }.hi-v4-table-empty-content td {text-align: center;padding: var(--hi-v4-spacing-12, 24px) 0; }.hi-v4-table--bordered .hi-v4-table-empty-content td {border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8); }";
|
|
13
12
|
|
|
14
13
|
__styleInject__(css_248z);
|
|
15
14
|
|
|
16
|
-
export default
|
|
17
|
-
//# sourceMappingURL=index.scss.js.map
|
|
15
|
+
export { css_248z as default };
|
package/lib/esm/use-table.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/table
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -51,6 +51,8 @@ var useTable = function useTable(_a) {
|
|
|
51
51
|
showColHighlight = _a$showColHighlight === void 0 ? false : _a$showColHighlight,
|
|
52
52
|
_a$showRowHighlight = _a.showRowHighlight,
|
|
53
53
|
showRowHighlight = _a$showRowHighlight === void 0 ? true : _a$showRowHighlight,
|
|
54
|
+
_a$highlightRowOnDoub = _a.highlightRowOnDoubleClick,
|
|
55
|
+
highlightRowOnDoubleClick = _a$highlightRowOnDoub === void 0 ? true : _a$highlightRowOnDoub,
|
|
54
56
|
_a$defaultExpandedRow = _a.defaultExpandedRowKeys,
|
|
55
57
|
defaultExpandedRowKeys = _a$defaultExpandedRow === void 0 ? DEFAULT_EXPAND_ROW_KEYS : _a$defaultExpandedRow,
|
|
56
58
|
expandRowKeysProp = _a.expandedRowKeys,
|
|
@@ -71,7 +73,7 @@ var useTable = function useTable(_a) {
|
|
|
71
73
|
cellRender = _a.cellRender,
|
|
72
74
|
_a$fieldKey = _a.fieldKey,
|
|
73
75
|
fieldKey = _a$fieldKey === void 0 ? 'key' : _a$fieldKey,
|
|
74
|
-
rootProps = __rest(_a, ["data", "columns", "defaultFixedToColumn", "fixedToColumn", "onFixedToColumn", "scrollWidth", "resizable", "errorRowKeys", "highlightedColKeys", "highlightedRowKeys", "showColHighlight", "showRowHighlight", "defaultExpandedRowKeys", "expandedRowKeys", "onExpand", "defaultExpandAll", "onLoadChildren", "maxHeight", "sticky", "stickyTop", "draggable", "onDragStart", "onDrop", "onDropEnd", "showColMenu", "rowSelection", "cellRender", "fieldKey"]);
|
|
76
|
+
rootProps = __rest(_a, ["data", "columns", "defaultFixedToColumn", "fixedToColumn", "onFixedToColumn", "scrollWidth", "resizable", "errorRowKeys", "highlightedColKeys", "highlightedRowKeys", "showColHighlight", "showRowHighlight", "highlightRowOnDoubleClick", "defaultExpandedRowKeys", "expandedRowKeys", "onExpand", "defaultExpandAll", "onLoadChildren", "maxHeight", "sticky", "stickyTop", "draggable", "onDragStart", "onDrop", "onDropEnd", "showColMenu", "rowSelection", "cellRender", "fieldKey"]);
|
|
75
77
|
/**
|
|
76
78
|
* 获取 key 字段值
|
|
77
79
|
*/
|
|
@@ -120,7 +122,8 @@ var useTable = function useTable(_a) {
|
|
|
120
122
|
draggable: draggable,
|
|
121
123
|
flattedData: flattedData,
|
|
122
124
|
onDropEnd: onDropEnd,
|
|
123
|
-
onDrop: onDropProp
|
|
125
|
+
onDrop: onDropProp,
|
|
126
|
+
fieldKey: fieldKey
|
|
124
127
|
}),
|
|
125
128
|
onDrop = _useTableDrag.onDrop,
|
|
126
129
|
dragRowRef = _useTableDrag.dragRowRef; // ************************ colgroup ************************ //
|
|
@@ -160,10 +163,9 @@ var useTable = function useTable(_a) {
|
|
|
160
163
|
setHoveredColKey = _useState[1];
|
|
161
164
|
|
|
162
165
|
var _useSelect = useSelect({
|
|
163
|
-
disabled: !
|
|
166
|
+
disabled: !showColHighlight,
|
|
164
167
|
selectedId: hoveredColKey,
|
|
165
|
-
onSelect: setHoveredColKey
|
|
166
|
-
idFieldName: 'dataKey'
|
|
168
|
+
onSelect: setHoveredColKey
|
|
167
169
|
}),
|
|
168
170
|
onHoveredColChange = _useSelect[0],
|
|
169
171
|
isHoveredHighlightCol = _useSelect[1]; // ************************ 列宽 resizable ************************ //
|
|
@@ -249,9 +251,9 @@ var useTable = function useTable(_a) {
|
|
|
249
251
|
return index <= leftFrozenColIndex && item.depth === 0;
|
|
250
252
|
});
|
|
251
253
|
leftColumns.forEach(function (currentItem, index) {
|
|
252
|
-
var item = parseFixedColumns(currentItem, index, leftColumns, 'leftStickyWidth');
|
|
254
|
+
var item = parseFixedColumns(currentItem, index, nextColumns, leftColumns, 'leftStickyWidth');
|
|
253
255
|
leftColumns[index] = item;
|
|
254
|
-
nextColumns[index] = item;
|
|
256
|
+
nextColumns[item.index] = item;
|
|
255
257
|
});
|
|
256
258
|
} // @TODO: resizable 和 列冻结宽兼容,统一宽度设置来源
|
|
257
259
|
// const leftFixedColumnsWidth = colWidths.reduce(
|
|
@@ -295,9 +297,9 @@ var useTable = function useTable(_a) {
|
|
|
295
297
|
return index > rightFrozenColIndex && item.depth === 0;
|
|
296
298
|
})).reverse();
|
|
297
299
|
rightColumns.forEach(function (currentItem, index) {
|
|
298
|
-
var
|
|
299
|
-
|
|
300
|
-
|
|
300
|
+
var item = parseFixedColumns(currentItem, index, nextColumns, rightColumns, 'rightStickyWidth');
|
|
301
|
+
rightColumns[index] = item;
|
|
302
|
+
nextColumns[item.index] = item;
|
|
301
303
|
});
|
|
302
304
|
}
|
|
303
305
|
|
|
@@ -399,9 +401,9 @@ var useTable = function useTable(_a) {
|
|
|
399
401
|
trySetHighlightedRowKeys = _useUncontrolledState3[1];
|
|
400
402
|
|
|
401
403
|
var _useCheck2 = useCheck({
|
|
404
|
+
disabled: !highlightRowOnDoubleClick,
|
|
402
405
|
checkedIds: highlightedRowKeys,
|
|
403
|
-
onCheck: trySetHighlightedRowKeys
|
|
404
|
-
idFieldName: 'key'
|
|
406
|
+
onCheck: trySetHighlightedRowKeys
|
|
405
407
|
}),
|
|
406
408
|
onHighlightedRowChange = _useCheck2[0],
|
|
407
409
|
isHighlightedRow = _useCheck2[1];
|
|
@@ -430,14 +432,20 @@ var useTable = function useTable(_a) {
|
|
|
430
432
|
leftStickyWidth = column.leftStickyWidth,
|
|
431
433
|
align = column.align;
|
|
432
434
|
var sticky = canScroll && (typeof rightStickyWidth !== 'undefined' || typeof leftStickyWidth !== 'undefined');
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
textAlign: align,
|
|
437
|
-
right: rightStickyWidth + 'px',
|
|
438
|
-
left: leftStickyWidth + 'px' // backgroundColor: '#fff',
|
|
435
|
+
var style = {
|
|
436
|
+
textAlign: align
|
|
437
|
+
};
|
|
439
438
|
|
|
440
|
-
|
|
439
|
+
if (sticky) {
|
|
440
|
+
style.position = 'sticky';
|
|
441
|
+
style.right = rightStickyWidth + 'px';
|
|
442
|
+
style.left = leftStickyWidth + 'px'; // the value is same with v3
|
|
443
|
+
|
|
444
|
+
style.zIndex = 5;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
return {
|
|
448
|
+
style: style,
|
|
441
449
|
'data-sticky': setAttrStatus(sticky)
|
|
442
450
|
};
|
|
443
451
|
});
|
|
@@ -447,7 +455,7 @@ var useTable = function useTable(_a) {
|
|
|
447
455
|
top: sticky ? stickyTop : undefined,
|
|
448
456
|
boxShadow: maxHeight ? '0px 2px 6px 0px rgba(0,0,0,0.12)' : undefined,
|
|
449
457
|
overflow: 'hidden',
|
|
450
|
-
zIndex: 10
|
|
458
|
+
zIndex: sticky ? 10 : undefined
|
|
451
459
|
};
|
|
452
460
|
return {
|
|
453
461
|
style: style,
|
|
@@ -533,6 +541,8 @@ var useTable = function useTable(_a) {
|
|
|
533
541
|
isHighlightedRow: isHighlightedRow,
|
|
534
542
|
highlightedRowKeys: highlightedRowKeys,
|
|
535
543
|
trySetHighlightedRowKeys: trySetHighlightedRowKeys,
|
|
544
|
+
// 行 hover
|
|
545
|
+
showRowHighlight: showRowHighlight,
|
|
536
546
|
// 列高亮
|
|
537
547
|
onHighlightedColChange: onHighlightedColChange,
|
|
538
548
|
isHighlightedCol: isHighlightedCol,
|
|
@@ -564,4 +574,3 @@ var useTable = function useTable(_a) {
|
|
|
564
574
|
};
|
|
565
575
|
|
|
566
576
|
export { useTable };
|
|
567
|
-
//# sourceMappingURL=use-table.js.map
|