@hi-ui/table 4.10.0 → 4.12.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/CHANGELOG.md +16 -0
- package/lib/cjs/BaseTable.js +4 -2
- package/lib/cjs/Table.js +3 -2
- package/lib/cjs/TbodyContent.js +33 -2
- package/lib/cjs/hooks/use-col-width.js +24 -22
- package/lib/cjs/styles/index.scss.js +1 -1
- package/lib/cjs/use-table.js +11 -1
- package/lib/cjs/utils/index.js +11 -4
- package/lib/esm/BaseTable.js +4 -2
- package/lib/esm/Table.js +1 -1
- package/lib/esm/TbodyContent.js +36 -5
- package/lib/esm/hooks/use-col-width.js +22 -20
- package/lib/esm/styles/index.scss.js +1 -1
- package/lib/esm/use-table.js +11 -1
- package/lib/esm/utils/index.js +11 -4
- package/lib/types/BaseTable.d.ts +8 -1
- package/lib/types/context.d.ts +15 -7
- package/lib/types/types.d.ts +5 -1
- package/lib/types/utils/index.d.ts +4 -1
- package/package.json +2 -1
- package/lib/cjs/packages/ui/radio/lib/esm/Radio.js +0 -100
- package/lib/cjs/packages/ui/radio/lib/esm/RadioGroup.js +0 -104
- package/lib/cjs/packages/ui/radio/lib/esm/context.js +0 -37
- package/lib/cjs/packages/ui/radio/lib/esm/index.js +0 -33
- package/lib/cjs/packages/ui/radio/lib/esm/styles/index.scss.js +0 -35
- package/lib/cjs/packages/ui/radio/lib/esm/types.js +0 -34
- package/lib/cjs/packages/ui/radio/lib/esm/use-radio-group.js +0 -61
- package/lib/cjs/packages/ui/radio/lib/esm/use-radio.js +0 -88
- package/lib/esm/packages/ui/radio/lib/esm/Radio.js +0 -88
- package/lib/esm/packages/ui/radio/lib/esm/RadioGroup.js +0 -92
- package/lib/esm/packages/ui/radio/lib/esm/context.js +0 -31
- package/lib/esm/packages/ui/radio/lib/esm/index.js +0 -26
- package/lib/esm/packages/ui/radio/lib/esm/styles/index.scss.js +0 -23
- package/lib/esm/packages/ui/radio/lib/esm/types.js +0 -27
- package/lib/esm/packages/ui/radio/lib/esm/use-radio-group.js +0 -56
- package/lib/esm/packages/ui/radio/lib/esm/use-radio.js +0 -83
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
10
|
import __styleInject__ from '@hi-ui/style-inject';
|
|
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 .hi-v4-table-header-cell {padding: var(--hi-v4-spacing-7, 14px);}.hi-v4-table--size-md .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--size-md .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .hi-v4-table-cell {padding: var(--hi-v4-spacing-7, 14px);}.hi-v4-table--size-md .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .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--size-sm .hi-v4-table-header-cell {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-sm .hi-v4-table-header-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-sm .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .hi-v4-table-cell {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-sm .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .hi-v4-table-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-lg .hi-v4-table-header-cell {padding: var(--hi-v4-spacing-9, 18px);}.hi-v4-table--size-lg .hi-v4-table-header-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-9, 18px) var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-lg .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .hi-v4-table-cell {padding: var(--hi-v4-spacing-9, 18px);}.hi-v4-table--size-lg .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .hi-v4-table-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-9, 18px) var(--hi-v4-spacing-5, 10px);}.hi-v4-table--bordered > .hi-v4-table__wrapper {border: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table--bordered > .hi-v4-table__wrapper .hi-v4-table-header-cell, .hi-v4-table--bordered > .hi-v4-table__wrapper .hi-v4-table-cell {border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table--bordered > .hi-v4-table__wrapper .hi-v4-table-row:last-child .hi-v4-table-cell {border-bottom: none;}.hi-v4-table--bordered.hi-v4-table--bordered-left-none > .hi-v4-table__wrapper {border-left: none;}.hi-v4-table--bordered.hi-v4-table--virtual > .hi-v4-table__wrapper .hi-v4-table-row .hi-v4-table-cell {border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table--bordered.hi-v4-table--virtual > .hi-v4-table__wrapper .hi-v4-table-virtual-row:last-child .hi-v4-table-row .hi-v4-table-cell {border-bottom: none;}.hi-v4-table--sticky {position: sticky;top: 0;}.hi-v4-table--virtual {width: 100%;overflow: hidden;}.hi-v4-table--virtual .hi-v4-table-cell {-webkit-box-sizing: border-box;box-sizing: border-box;}.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:hover {background-color: var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table-header__resizable:hover .hi-v4-table-header__resizable-handle {border-left-color: var(--hi-v4-color-gray-200, #ebedf0);border-right-color: var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table-header__resizable-handle {-webkit-box-sizing: content-box;box-sizing: content-box;position: absolute;width: 2px;height: 100%;bottom: 0;right: 0;margin-right: -2px;border-left: 2px solid transparent;border-right: 2px solid transparent;cursor: col-resize;z-index: 1;}.hi-v4-table__selection-col > .hi-v4-table-header__resizable-handle {display: none;}.hi-v4-table-header__resizable-handle:hover {background-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));border-left-color: var(--hi-v4-color-gray-200, #ebedf0);border-right-color: var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table-header-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa);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-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-row--virtual {display: -webkit-box;display: -ms-flexbox;display: flex;}.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, .hi-v4-table-content {position: relative;overflow: auto;}.hi-v4-table-body--virtual-holder {overflow: hidden;}.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;vertical-align: middle;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);vertical-align: middle;}.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;vertical-align: middle;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-body-empty-content td {text-align: center;padding: var(--hi-v4-spacing-12, 24px) 0;}.hi-v4-table--bordered .hi-v4-table-body-empty-content td {border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8);}.hi-v4-setting-drawer .hi-v4-setting-footer {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v4-setting-drawer .hi-v4-setting-footer__extra {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-flex: 1;-ms-flex: 1 1;flex: 1 1;}.hi-v4-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-setting-item:not(.hi-v4-setting-item--drag-disabled) .hi-v4-setting-item__wrap {cursor: move;}.hi-v4-setting-item__wrap {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;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-setting-item__wrap:hover {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-setting-item--dragging .hi-v4-setting-item__wrap {opacity: 0.6;}.hi-v4-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-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-setting-item::before, .hi-v4-setting-item::after {margin-left: -10px;margin-right: -10px;}.hi-v4-setting-item--direction-before::before {display: block;top: -0.5px;-webkit-transform: translateY(-4px);transform: translateY(-4px);}.hi-v4-setting-item--direction-before::after {top: -0.5px;border-bottom-width: 1px;}.hi-v4-setting-item--direction-after::before {display: block;bottom: 0.5px;-webkit-transform: translateY(4px);transform: translateY(4px);}.hi-v4-setting-item--direction-after::after {bottom: 0.5px;border-bottom-width: 1px;}";
|
|
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 .hi-v4-table-header-cell {padding: var(--hi-v4-spacing-7, 14px);}.hi-v4-table--size-md .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--size-md .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .hi-v4-table-cell {padding: var(--hi-v4-spacing-7, 14px);}.hi-v4-table--size-md .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .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--size-sm .hi-v4-table-header-cell {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-sm .hi-v4-table-header-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-sm .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .hi-v4-table-cell {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-sm .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .hi-v4-table-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-lg .hi-v4-table-header-cell {padding: var(--hi-v4-spacing-9, 18px);}.hi-v4-table--size-lg .hi-v4-table-header-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-9, 18px) var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-lg .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .hi-v4-table-cell {padding: var(--hi-v4-spacing-9, 18px);}.hi-v4-table--size-lg .hi-v4-table-row:not(.hi-v4-table-body-empty-content) .hi-v4-table-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-9, 18px) var(--hi-v4-spacing-5, 10px);}.hi-v4-table--bordered > .hi-v4-table__wrapper {border: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table--bordered > .hi-v4-table__wrapper .hi-v4-table-header-cell, .hi-v4-table--bordered > .hi-v4-table__wrapper .hi-v4-table-cell {border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table--bordered > .hi-v4-table__wrapper .hi-v4-table-row:last-child .hi-v4-table-cell {border-bottom: none;}.hi-v4-table--bordered.hi-v4-table--bordered-left-none > .hi-v4-table__wrapper {border-left: none;}.hi-v4-table--bordered.hi-v4-table--virtual > .hi-v4-table__wrapper .hi-v4-table-row .hi-v4-table-cell {border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table--bordered.hi-v4-table--virtual > .hi-v4-table__wrapper .hi-v4-table-virtual-row:last-child .hi-v4-table-row .hi-v4-table-cell {border-bottom: none;}.hi-v4-table--sticky {position: sticky;top: 0;}.hi-v4-table--virtual {width: 100%;overflow: hidden;}.hi-v4-table--virtual .hi-v4-table-cell {-webkit-box-sizing: border-box;box-sizing: border-box;}.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:hover {background-color: var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table-header__resizable:hover .hi-v4-table-header__resizable-handle {border-left-color: var(--hi-v4-color-gray-200, #ebedf0);border-right-color: var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table-header__resizable-handle {-webkit-box-sizing: content-box;box-sizing: content-box;position: absolute;width: 2px;height: 100%;bottom: 0;right: 0;margin-right: -2px;border-left: 2px solid transparent;border-right: 2px solid transparent;cursor: col-resize;z-index: 1;}.hi-v4-table__selection-col > .hi-v4-table-header__resizable-handle {display: none;}.hi-v4-table-header__resizable-handle:hover {background-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));border-left-color: var(--hi-v4-color-gray-200, #ebedf0);border-right-color: var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table-header-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa);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-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--fixed-top, .hi-v4-table-row--fixed-bottom {position: sticky;z-index: 6;}.hi-v4-table-row--fixed-top {top: 0;}.hi-v4-table-row--fixed-bottom {bottom: 0;}.hi-v4-table-row--fixed-bottom .hi-v4-table-cell {border-top: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8);}.hi-v4-table-row:has(+ .hi-v4-table-row--fixed-bottom) .hi-v4-table-cell {border-bottom: none;}.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-row--virtual {display: -webkit-box;display: -ms-flexbox;display: flex;}.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, .hi-v4-table-content {position: relative;overflow: auto;}.hi-v4-table-body--virtual-holder {overflow: hidden;}.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;vertical-align: middle;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);vertical-align: middle;}.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;vertical-align: middle;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-body-empty-content td {text-align: center;padding: var(--hi-v4-spacing-12, 24px) 0;}.hi-v4-table--bordered .hi-v4-table-body-empty-content td {border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8);}.hi-v4-setting-drawer .hi-v4-setting-footer {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v4-setting-drawer .hi-v4-setting-footer__extra {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-flex: 1;-ms-flex: 1 1;flex: 1 1;}.hi-v4-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-setting-item:not(.hi-v4-setting-item--drag-disabled) .hi-v4-setting-item__wrap {cursor: move;}.hi-v4-setting-item__wrap {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;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-setting-item__wrap:hover {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-setting-item--dragging .hi-v4-setting-item__wrap {opacity: 0.6;}.hi-v4-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-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-setting-item::before, .hi-v4-setting-item::after {margin-left: -10px;margin-right: -10px;}.hi-v4-setting-item--direction-before::before {display: block;top: -0.5px;-webkit-transform: translateY(-4px);transform: translateY(-4px);}.hi-v4-setting-item--direction-before::after {top: -0.5px;border-bottom-width: 1px;}.hi-v4-setting-item--direction-after::before {display: block;bottom: 0.5px;-webkit-transform: translateY(4px);transform: translateY(4px);}.hi-v4-setting-item--direction-after::after {bottom: 0.5px;border-bottom-width: 1px;}";
|
|
12
12
|
__styleInject__(css_248z);
|
|
13
13
|
export { css_248z as default };
|
package/lib/esm/use-table.js
CHANGED
|
@@ -390,8 +390,18 @@ var useTable = function useTable(_a) {
|
|
|
390
390
|
right = _scrollBodyElementRef.right;
|
|
391
391
|
scrollRight = tableTefRight - right;
|
|
392
392
|
}
|
|
393
|
+
var _scrollLeft = scrollLeft;
|
|
394
|
+
if (bodyTableRef.current && scrollBodyElementRef.current) {
|
|
395
|
+
var _bodyTableRef$current2 = bodyTableRef.current.getBoundingClientRect(),
|
|
396
|
+
tableWidth = _bodyTableRef$current2.width;
|
|
397
|
+
var _scrollBodyElementRef2 = scrollBodyElementRef.current.getBoundingClientRect(),
|
|
398
|
+
scrollBodyWidth = _scrollBodyElementRef2.width;
|
|
399
|
+
if (scrollLeft + scrollBodyWidth > tableWidth) {
|
|
400
|
+
_scrollLeft = tableWidth - scrollBodyWidth;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
393
403
|
setScrollSize({
|
|
394
|
-
scrollLeft:
|
|
404
|
+
scrollLeft: _scrollLeft,
|
|
395
405
|
scrollRight: scrollRight
|
|
396
406
|
});
|
|
397
407
|
}, [rightFrozenColKeys, scrollSize]);
|
package/lib/esm/utils/index.js
CHANGED
|
@@ -61,22 +61,29 @@ var setColumnsDefaultWidth = function setColumnsDefaultWidth(columns, defaultWid
|
|
|
61
61
|
* 如果是多级表头,将会递归 children 得到叶子结点层每项的宽度
|
|
62
62
|
*/
|
|
63
63
|
var getGroupItemWidth = function getGroupItemWidth(columns) {
|
|
64
|
-
var
|
|
64
|
+
var colWidths = [];
|
|
65
|
+
var minColWidths = [];
|
|
65
66
|
var dig = function dig(column) {
|
|
66
67
|
column.forEach(function (_ref) {
|
|
67
68
|
var children = _ref.children,
|
|
68
|
-
width = _ref.width
|
|
69
|
+
width = _ref.width,
|
|
70
|
+
minWidth = _ref.minWidth;
|
|
69
71
|
if (Array.isArray(children)) {
|
|
70
72
|
dig(children);
|
|
71
73
|
return;
|
|
72
74
|
}
|
|
73
75
|
// 如果没有设置列宽度,css 宽度默认是 `auto`,这里对于非数字 width 均设置为 0
|
|
74
76
|
var colWidth = isNumeric(width) ? Number(width) : 0;
|
|
75
|
-
|
|
77
|
+
var minColWidth = isNumeric(minWidth) ? Number(minWidth) : colWidth || 60;
|
|
78
|
+
colWidths.push(colWidth < minColWidth ? minColWidth : colWidth);
|
|
79
|
+
minColWidths.push(minColWidth);
|
|
76
80
|
});
|
|
77
81
|
};
|
|
78
82
|
dig(columns);
|
|
79
|
-
return
|
|
83
|
+
return {
|
|
84
|
+
colWidths: colWidths,
|
|
85
|
+
minColWidths: minColWidths
|
|
86
|
+
};
|
|
80
87
|
};
|
|
81
88
|
var parseFixedColumns = function parseFixedColumns(item, index, columns, arr, key, parentStickyWidth) {
|
|
82
89
|
if (parentStickyWidth === void 0) {
|
package/lib/types/BaseTable.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HiBaseHTMLProps, HiBaseSizeEnum } from '@hi-ui/core';
|
|
3
|
-
import { TableExtra, TableColumnItem, TableOnRowReturn } from './types';
|
|
3
|
+
import { TableExtra, TableColumnItem, TableOnRowReturn, TableRowEventData } from './types';
|
|
4
4
|
import { UseTableProps } from './use-table';
|
|
5
5
|
import { UseEmbedExpandProps } from './hooks/use-embed-expand';
|
|
6
6
|
import { ResizeCallbackData } from 'react-resizable';
|
|
@@ -53,4 +53,11 @@ export interface BaseTableProps extends Omit<HiBaseHTMLProps<'div'>, 'onDrop' |
|
|
|
53
53
|
* resizable 模式下,列宽变化后触发的回调
|
|
54
54
|
*/
|
|
55
55
|
onResizeStop?: (evt: React.SyntheticEvent, size: ResizeCallbackData['size'], index: number, columnsWidth: number[]) => void;
|
|
56
|
+
/**
|
|
57
|
+
* 固定行,只有设置 maxHeight 时才生效
|
|
58
|
+
*/
|
|
59
|
+
fixedToRow?: {
|
|
60
|
+
top?: number | ((rowData: TableRowEventData, index: number) => boolean);
|
|
61
|
+
bottom?: number | ((rowData: TableRowEventData, index: number) => boolean);
|
|
62
|
+
};
|
|
56
63
|
}
|
package/lib/types/context.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SyntheticEvent } from 'react';
|
|
2
|
-
import { TableOnRowReturn } from './types';
|
|
2
|
+
import { TableOnRowReturn, TableRowEventData } from './types';
|
|
3
3
|
import { ResizeCallbackData } from 'react-resizable';
|
|
4
4
|
export declare const TableProvider: import("react").Provider<(Omit<{
|
|
5
5
|
getColgroupProps: (column: import("./types").FlattedTableColumnItemData, index: number) => {
|
|
@@ -32,10 +32,10 @@ export declare const TableProvider: import("react").Provider<(Omit<{
|
|
|
32
32
|
}) => void) | undefined;
|
|
33
33
|
onDrop: (evt: any, sourceId: any, targetId: any, dragDirection: any) => void;
|
|
34
34
|
groupedColumns: import("./types").FlattedTableColumnItemData[][];
|
|
35
|
-
onExpandTreeRowsChange: (expandedNode:
|
|
35
|
+
onExpandTreeRowsChange: (expandedNode: TableRowEventData, shouldExpanded: boolean) => void;
|
|
36
36
|
isExpandTreeRows: (id: import("react").ReactText) => boolean;
|
|
37
37
|
isLoadingTreeNodeId: (id: import("react").ReactText) => boolean;
|
|
38
|
-
onTreeNodeSwitch: (node:
|
|
38
|
+
onTreeNodeSwitch: (node: TableRowEventData, onlyExpand?: any) => Promise<void>;
|
|
39
39
|
resizable: boolean;
|
|
40
40
|
colWidths: number[];
|
|
41
41
|
onColumnResizable: (evt: any, { size }: any, index: number) => void;
|
|
@@ -43,7 +43,7 @@ export declare const TableProvider: import("react").Provider<(Omit<{
|
|
|
43
43
|
cellRender: ((text: any) => import("react").ReactNode) | undefined;
|
|
44
44
|
footerRender: ((...nodes: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[]) => import("react").ReactNode) | undefined;
|
|
45
45
|
showColMenu: boolean | undefined;
|
|
46
|
-
onLoadChildren: ((item:
|
|
46
|
+
onLoadChildren: ((item: TableRowEventData) => void | Promise<void | any[]>) | undefined;
|
|
47
47
|
setHeaderTableElement: import("react").Dispatch<import("react").SetStateAction<HTMLTableRowElement | null>>;
|
|
48
48
|
scrollbar: boolean | import("packages/ui/scrollbar/lib/types").ScrollbarProps | undefined;
|
|
49
49
|
rowClassName: ((record: Record<string, any>, index: number) => string) | undefined;
|
|
@@ -128,6 +128,10 @@ export declare const TableProvider: import("react").Provider<(Omit<{
|
|
|
128
128
|
} | undefined) => void) | undefined;
|
|
129
129
|
} | undefined;
|
|
130
130
|
onResizeStop?: ((evt: SyntheticEvent, size: ResizeCallbackData['size'], index: number, columnsWidth: number[]) => void) | undefined;
|
|
131
|
+
fixedToRow?: {
|
|
132
|
+
top?: number | ((rowData: TableRowEventData, index: number) => boolean) | undefined;
|
|
133
|
+
bottom?: number | ((rowData: TableRowEventData, index: number) => boolean) | undefined;
|
|
134
|
+
} | undefined;
|
|
131
135
|
}) | null>;
|
|
132
136
|
export declare const useTableContext: () => Omit<{
|
|
133
137
|
getColgroupProps: (column: import("./types").FlattedTableColumnItemData, index: number) => {
|
|
@@ -160,10 +164,10 @@ export declare const useTableContext: () => Omit<{
|
|
|
160
164
|
}) => void) | undefined;
|
|
161
165
|
onDrop: (evt: any, sourceId: any, targetId: any, dragDirection: any) => void;
|
|
162
166
|
groupedColumns: import("./types").FlattedTableColumnItemData[][];
|
|
163
|
-
onExpandTreeRowsChange: (expandedNode:
|
|
167
|
+
onExpandTreeRowsChange: (expandedNode: TableRowEventData, shouldExpanded: boolean) => void;
|
|
164
168
|
isExpandTreeRows: (id: import("react").ReactText) => boolean;
|
|
165
169
|
isLoadingTreeNodeId: (id: import("react").ReactText) => boolean;
|
|
166
|
-
onTreeNodeSwitch: (node:
|
|
170
|
+
onTreeNodeSwitch: (node: TableRowEventData, onlyExpand?: any) => Promise<void>;
|
|
167
171
|
resizable: boolean;
|
|
168
172
|
colWidths: number[];
|
|
169
173
|
onColumnResizable: (evt: any, { size }: any, index: number) => void;
|
|
@@ -171,7 +175,7 @@ export declare const useTableContext: () => Omit<{
|
|
|
171
175
|
cellRender: ((text: any) => import("react").ReactNode) | undefined;
|
|
172
176
|
footerRender: ((...nodes: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[]) => import("react").ReactNode) | undefined;
|
|
173
177
|
showColMenu: boolean | undefined;
|
|
174
|
-
onLoadChildren: ((item:
|
|
178
|
+
onLoadChildren: ((item: TableRowEventData) => void | Promise<void | any[]>) | undefined;
|
|
175
179
|
setHeaderTableElement: import("react").Dispatch<import("react").SetStateAction<HTMLTableRowElement | null>>;
|
|
176
180
|
scrollbar: boolean | import("packages/ui/scrollbar/lib/types").ScrollbarProps | undefined;
|
|
177
181
|
rowClassName: ((record: Record<string, any>, index: number) => string) | undefined;
|
|
@@ -256,4 +260,8 @@ export declare const useTableContext: () => Omit<{
|
|
|
256
260
|
} | undefined) => void) | undefined;
|
|
257
261
|
} | undefined;
|
|
258
262
|
onResizeStop?: ((evt: SyntheticEvent, size: ResizeCallbackData['size'], index: number, columnsWidth: number[]) => void) | undefined;
|
|
263
|
+
fixedToRow?: {
|
|
264
|
+
top?: number | ((rowData: TableRowEventData, index: number) => boolean) | undefined;
|
|
265
|
+
bottom?: number | ((rowData: TableRowEventData, index: number) => boolean) | undefined;
|
|
266
|
+
} | undefined;
|
|
259
267
|
};
|
package/lib/types/types.d.ts
CHANGED
|
@@ -95,7 +95,11 @@ export declare type TableColumnItem = {
|
|
|
95
95
|
*/
|
|
96
96
|
width?: number;
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* 该列最小宽度
|
|
99
|
+
*/
|
|
100
|
+
minWidth?: number;
|
|
101
|
+
/**
|
|
102
|
+
* 是否固定列宽,使用场景:设置 width 后,当所有列宽总和小于表格宽度时,多的宽度会分摊到每一列上,设置 fixed 后该列不会参与多余宽度分摊。
|
|
99
103
|
*/
|
|
100
104
|
fixed?: boolean;
|
|
101
105
|
/**
|
|
@@ -6,7 +6,10 @@ export declare const setColumnsDefaultWidth: (columns: any, defaultWidth: any) =
|
|
|
6
6
|
* 获取每个 Column 的真实列宽度(排除合并列头)
|
|
7
7
|
* 如果是多级表头,将会递归 children 得到叶子结点层每项的宽度
|
|
8
8
|
*/
|
|
9
|
-
export declare const getGroupItemWidth: (columns: TableColumnItem[]) =>
|
|
9
|
+
export declare const getGroupItemWidth: (columns: TableColumnItem[]) => {
|
|
10
|
+
colWidths: number[];
|
|
11
|
+
minColWidths: number[];
|
|
12
|
+
};
|
|
10
13
|
export declare const getMaskItemsWIdth: (columns: TableColumnItem[]) => number;
|
|
11
14
|
export declare const parseFixedColumns: (item: any, index: number, columns: any[], arr: any[], key: string, parentStickyWidth?: number) => any;
|
|
12
15
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hi-ui/table",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "HiUI <mi-hiui@xiaomi.com>",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"@hi-ui/object-utils": "^4.0.4",
|
|
59
59
|
"@hi-ui/pagination": "^4.2.0",
|
|
60
60
|
"@hi-ui/popper": "^4.1.5",
|
|
61
|
+
"@hi-ui/radio": "^4.1.4",
|
|
61
62
|
"@hi-ui/react-utils": "^4.0.4",
|
|
62
63
|
"@hi-ui/scrollbar": "^4.2.0",
|
|
63
64
|
"@hi-ui/select": "^4.6.0",
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/** @LICENSE
|
|
2
|
-
* @hi-ui/table
|
|
3
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
13
|
-
Object.defineProperty(exports, '__esModule', {
|
|
14
|
-
value: true
|
|
15
|
-
});
|
|
16
|
-
var tslib = require('tslib');
|
|
17
|
-
var React = require('react');
|
|
18
|
-
var classname = require('@hi-ui/classname');
|
|
19
|
-
var env = require('@hi-ui/env');
|
|
20
|
-
var useRadio = require('./use-radio.js');
|
|
21
|
-
var context = require('./context.js');
|
|
22
|
-
var typeAssertion = require('@hi-ui/type-assertion');
|
|
23
|
-
var funcUtils = require('@hi-ui/func-utils');
|
|
24
|
-
function _interopDefaultCompat(e) {
|
|
25
|
-
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
26
|
-
'default': e
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
30
|
-
|
|
31
|
-
/** @LICENSE
|
|
32
|
-
* @hi-ui/radio
|
|
33
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
34
|
-
*
|
|
35
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
36
|
-
*
|
|
37
|
-
* This source code is licensed under the MIT license found in the
|
|
38
|
-
* LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/
|
|
40
|
-
var RADIO_PREFIX = classname.getPrefixCls('radio');
|
|
41
|
-
/**
|
|
42
|
-
* 单选
|
|
43
|
-
*/
|
|
44
|
-
var Radio = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
45
|
-
var _a$prefixCls = _a.prefixCls,
|
|
46
|
-
prefixCls = _a$prefixCls === void 0 ? RADIO_PREFIX : _a$prefixCls,
|
|
47
|
-
_a$role = _a.role,
|
|
48
|
-
role = _a$role === void 0 ? 'radio' : _a$role,
|
|
49
|
-
className = _a.className,
|
|
50
|
-
children = _a.children,
|
|
51
|
-
rest = tslib.__rest(_a, ["prefixCls", "role", "className", "children"]);
|
|
52
|
-
var groupContext = context.useRadioGroupContext();
|
|
53
|
-
var _ref = groupContext || {},
|
|
54
|
-
disabledContext = _ref.disabled,
|
|
55
|
-
isCheckedContext = _ref.isChecked,
|
|
56
|
-
nameContext = _ref.name,
|
|
57
|
-
onChangeContext = _ref.onChange,
|
|
58
|
-
_ref$type = _ref.type,
|
|
59
|
-
type = _ref$type === void 0 ? 'default' : _ref$type;
|
|
60
|
-
var checkedProp = rest.checked,
|
|
61
|
-
valueProp = rest.value,
|
|
62
|
-
_rest$disabled = rest.disabled,
|
|
63
|
-
disabled = _rest$disabled === void 0 ? disabledContext : _rest$disabled,
|
|
64
|
-
_rest$name = rest.name,
|
|
65
|
-
name = _rest$name === void 0 ? nameContext : _rest$name,
|
|
66
|
-
onChangeProp = rest.onChange;
|
|
67
|
-
// Group's priority is higher than its own.
|
|
68
|
-
var checked = isCheckedContext && !typeAssertion.isNullish(valueProp) ? isCheckedContext(valueProp) : checkedProp;
|
|
69
|
-
var onChange = onChangeContext && !typeAssertion.isNullish(valueProp) ? funcUtils.callAllFuncs(function (evt) {
|
|
70
|
-
if (evt.target.checked) {
|
|
71
|
-
onChangeContext(valueProp);
|
|
72
|
-
}
|
|
73
|
-
}, onChangeProp) : onChangeProp;
|
|
74
|
-
var _useRadio = useRadio.useRadio(Object.assign(Object.assign({}, rest), {
|
|
75
|
-
disabled: disabled,
|
|
76
|
-
name: name,
|
|
77
|
-
checked: checked,
|
|
78
|
-
onChange: onChange
|
|
79
|
-
})),
|
|
80
|
-
rootProps = _useRadio.rootProps,
|
|
81
|
-
getInputProps = _useRadio.getInputProps;
|
|
82
|
-
var inputProps = getInputProps();
|
|
83
|
-
var cls = classname.cx(prefixCls, className, prefixCls + "--type-" + type);
|
|
84
|
-
return /*#__PURE__*/React__default["default"].createElement("label", Object.assign({
|
|
85
|
-
ref: ref,
|
|
86
|
-
role: role,
|
|
87
|
-
className: cls
|
|
88
|
-
}, rootProps), /*#__PURE__*/React__default["default"].createElement("input", Object.assign({}, inputProps, {
|
|
89
|
-
tabIndex: 0,
|
|
90
|
-
className: prefixCls + "__input"
|
|
91
|
-
})), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
92
|
-
className: prefixCls + "__controller"
|
|
93
|
-
}), children ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
94
|
-
className: prefixCls + "__label"
|
|
95
|
-
}, children) : null);
|
|
96
|
-
});
|
|
97
|
-
if (env.__DEV__) {
|
|
98
|
-
Radio.displayName = 'Radio';
|
|
99
|
-
}
|
|
100
|
-
exports.Radio = Radio;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/** @LICENSE
|
|
2
|
-
* @hi-ui/table
|
|
3
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
13
|
-
Object.defineProperty(exports, '__esModule', {
|
|
14
|
-
value: true
|
|
15
|
-
});
|
|
16
|
-
var tslib = require('tslib');
|
|
17
|
-
var React = require('react');
|
|
18
|
-
var classname = require('@hi-ui/classname');
|
|
19
|
-
var env = require('@hi-ui/env');
|
|
20
|
-
var useRadioGroup = require('./use-radio-group.js');
|
|
21
|
-
var context = require('./context.js');
|
|
22
|
-
var types = require('./types.js');
|
|
23
|
-
var typeAssertion = require('@hi-ui/type-assertion');
|
|
24
|
-
var Radio = require('./Radio.js');
|
|
25
|
-
function _interopDefaultCompat(e) {
|
|
26
|
-
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
27
|
-
'default': e
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
31
|
-
|
|
32
|
-
/** @LICENSE
|
|
33
|
-
* @hi-ui/radio
|
|
34
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
35
|
-
*
|
|
36
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
37
|
-
*
|
|
38
|
-
* This source code is licensed under the MIT license found in the
|
|
39
|
-
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/
|
|
41
|
-
var RADIO_GROUP_PREFIX = classname.getPrefixCls('radio-group');
|
|
42
|
-
/**
|
|
43
|
-
* 单选组合器
|
|
44
|
-
*/
|
|
45
|
-
var RadioGroup = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
46
|
-
var _a$prefixCls = _a.prefixCls,
|
|
47
|
-
prefixCls = _a$prefixCls === void 0 ? RADIO_GROUP_PREFIX : _a$prefixCls,
|
|
48
|
-
className = _a.className,
|
|
49
|
-
children = _a.children,
|
|
50
|
-
data = _a.data,
|
|
51
|
-
_a$type = _a.type,
|
|
52
|
-
type = _a$type === void 0 ? types.RadioGroupTypeEnum.DEFAULT : _a$type,
|
|
53
|
-
_a$placement = _a.placement,
|
|
54
|
-
placement = _a$placement === void 0 ? types.RadioGroupPlacementEnum.HORIZONTAL : _a$placement,
|
|
55
|
-
_a$autoWidth = _a.autoWidth,
|
|
56
|
-
autoWidth = _a$autoWidth === void 0 ? false : _a$autoWidth,
|
|
57
|
-
rest = tslib.__rest(_a, ["prefixCls", "className", "children", "data", "type", "placement", "autoWidth"]);
|
|
58
|
-
var _useRadioGroup = useRadioGroup.useRadioGroup(rest),
|
|
59
|
-
rootProps = _useRadioGroup.rootProps,
|
|
60
|
-
name = _useRadioGroup.name,
|
|
61
|
-
value = _useRadioGroup.value,
|
|
62
|
-
onChange = _useRadioGroup.onChange,
|
|
63
|
-
isChecked = _useRadioGroup.isChecked,
|
|
64
|
-
disabled = _useRadioGroup.disabled;
|
|
65
|
-
var providedValue = React.useMemo(function () {
|
|
66
|
-
return {
|
|
67
|
-
name: name,
|
|
68
|
-
onChange: onChange,
|
|
69
|
-
value: value,
|
|
70
|
-
isChecked: isChecked,
|
|
71
|
-
disabled: disabled,
|
|
72
|
-
type: type,
|
|
73
|
-
placement: placement
|
|
74
|
-
};
|
|
75
|
-
}, [name, onChange, value, isChecked, disabled, type, placement]);
|
|
76
|
-
var hasData = typeAssertion.isArrayNonEmpty(data);
|
|
77
|
-
// data 优先级大于内嵌式组合
|
|
78
|
-
if (hasData) {
|
|
79
|
-
children = data.map(function (_ref) {
|
|
80
|
-
var id = _ref.id,
|
|
81
|
-
disabled = _ref.disabled,
|
|
82
|
-
title = _ref.title;
|
|
83
|
-
return /*#__PURE__*/React__default["default"].createElement(Radio.Radio, {
|
|
84
|
-
key: id,
|
|
85
|
-
value: id,
|
|
86
|
-
name: name,
|
|
87
|
-
disabled: disabled,
|
|
88
|
-
checked: isChecked(id),
|
|
89
|
-
className: prefixCls + "__item"
|
|
90
|
-
}, title);
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
var cls = classname.cx(prefixCls, className, prefixCls + "--placement-" + placement, autoWidth && type === types.RadioGroupTypeEnum.BUTTON && prefixCls + "--auto-width", prefixCls + "--type-" + type, hasData && prefixCls + "--data-wrap");
|
|
94
|
-
return /*#__PURE__*/React__default["default"].createElement(context.RadioGroupProvider, {
|
|
95
|
-
value: providedValue
|
|
96
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
|
|
97
|
-
ref: ref,
|
|
98
|
-
className: cls
|
|
99
|
-
}, rootProps), children));
|
|
100
|
-
});
|
|
101
|
-
if (env.__DEV__) {
|
|
102
|
-
RadioGroup.displayName = 'RadioGroup';
|
|
103
|
-
}
|
|
104
|
-
exports.RadioGroup = RadioGroup;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/** @LICENSE
|
|
2
|
-
* @hi-ui/table
|
|
3
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, '__esModule', {
|
|
13
|
-
value: true
|
|
14
|
-
});
|
|
15
|
-
var React = require('react');
|
|
16
|
-
|
|
17
|
-
/** @LICENSE
|
|
18
|
-
* @hi-ui/radio
|
|
19
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/
|
|
26
|
-
var RadioGroupContext = /*#__PURE__*/React.createContext(null);
|
|
27
|
-
var RadioGroupProvider = RadioGroupContext.Provider;
|
|
28
|
-
var useRadioGroupContext = function useRadioGroupContext() {
|
|
29
|
-
var context = React.useContext(RadioGroupContext);
|
|
30
|
-
// 允许 Radio 单独存在,不做检查
|
|
31
|
-
// if (!context) {
|
|
32
|
-
// throw new Error('The RadioGroupContext context should using in Radio.')
|
|
33
|
-
// }
|
|
34
|
-
return context;
|
|
35
|
-
};
|
|
36
|
-
exports.RadioGroupProvider = RadioGroupProvider;
|
|
37
|
-
exports.useRadioGroupContext = useRadioGroupContext;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/** @LICENSE
|
|
2
|
-
* @hi-ui/table
|
|
3
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, '__esModule', {
|
|
13
|
-
value: true
|
|
14
|
-
});
|
|
15
|
-
require('./styles/index.scss.js');
|
|
16
|
-
var Radio$1 = require('./Radio.js');
|
|
17
|
-
var RadioGroup = require('./RadioGroup.js');
|
|
18
|
-
|
|
19
|
-
/** @LICENSE
|
|
20
|
-
* @hi-ui/radio
|
|
21
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
22
|
-
*
|
|
23
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the MIT license found in the
|
|
26
|
-
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/
|
|
28
|
-
var Radio = Object.assign(Radio$1.Radio, {
|
|
29
|
-
Group: RadioGroup.RadioGroup
|
|
30
|
-
});
|
|
31
|
-
exports.Radio = Radio$1.Radio;
|
|
32
|
-
exports.RadioGroup = RadioGroup.RadioGroup;
|
|
33
|
-
exports["default"] = Radio;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** @LICENSE
|
|
2
|
-
* @hi-ui/table
|
|
3
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
13
|
-
Object.defineProperty(exports, '__esModule', {
|
|
14
|
-
value: true
|
|
15
|
-
});
|
|
16
|
-
var __styleInject__ = require('@hi-ui/style-inject');
|
|
17
|
-
function _interopDefaultCompat(e) {
|
|
18
|
-
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
19
|
-
'default': e
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
var __styleInject____default = /*#__PURE__*/_interopDefaultCompat(__styleInject__);
|
|
23
|
-
|
|
24
|
-
/** @LICENSE
|
|
25
|
-
* @hi-ui/radio
|
|
26
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
27
|
-
*
|
|
28
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the MIT license found in the
|
|
31
|
-
* LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/
|
|
33
|
-
var css_248z = ".hi-v4-radio {overflow-wrap: break-word;font-size: var(--hi-v4-text-size-md, 0.875rem);line-height: var(--hi-v4-text-lineheight-md, 1.375rem);position: relative;-webkit-box-sizing: border-box;box-sizing: border-box;cursor: pointer;display: -webkit-inline-box;display: -ms-inline-flexbox;display: inline-flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;vertical-align: middle;}.hi-v4-radio--type-button {height: 32px;padding: 0 12px;color: var(--hi-v4-color-gray-600, #5f6a7a);background: var(--hi-v4-color-gray-100, #f2f4f7);cursor: pointer;-webkit-transition: all var(--hi-v4-motion-duration-normal, 200ms);transition: all var(--hi-v4-motion-duration-normal, 200ms);}.hi-v4-radio--type-button .hi-v4-radio__input {display: none;}.hi-v4-radio--type-button .hi-v4-radio__input:focus + .hi-v4-radio__label {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-button .hi-v4-radio__controller {display: none;}.hi-v4-radio--type-button:hover, .hi-v4-radio--type-button[data-checked] {background: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-button[data-disabled] {cursor: not-allowed;background: var(--hi-v4-color-gray-200, #ebedf0);color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-radio--type-button[data-checked].hi-v4-radio--type-button[data-disabled] {background: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));color: var(--hi-v4-color-primary-300, var(--hi-v4-color-brandblue-300, #70b8ff));}.hi-v4-radio--type-default .hi-v4-radio__input:focus + .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));-webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-primary-100, var(--hi-v4-color-brandblue-100, #bde2ff));box-shadow: 0 0 0 2px var(--hi-v4-color-primary-100, var(--hi-v4-color-brandblue-100, #bde2ff));}.hi-v4-radio--type-default .hi-v4-radio__controller {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;-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;position: relative;-webkit-box-sizing: border-box;box-sizing: border-box;width: 16px;height: 16px;border: 1px solid var(--hi-v4-color-gray-300, #dfe2e8);border-radius: var(--hi-v4-border-radius-full, 9999px);-webkit-transition: all var(--hi-v4-motion-duration-normal, 200ms);transition: all var(--hi-v4-motion-duration-normal, 200ms);-webkit-box-flex: 0;-ms-flex: none;flex: none;}.hi-v4-radio--type-default .hi-v4-radio__controller::after {position: absolute;top: 0;left: 0;-webkit-box-sizing: border-box;box-sizing: border-box;display: inline-block;width: 14px;height: 14px;content: \"\";background: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));border-radius: var(--hi-v4-border-radius-full, 9999px);opacity: 0;-webkit-transition: all var(--hi-v4-motion-duration-normal, 200ms);transition: all var(--hi-v4-motion-duration-normal, 200ms);-webkit-transform: scale(0);transform: scale(0);}.hi-v4-radio--type-default .hi-v4-radio__label {-webkit-box-sizing: border-box;box-sizing: border-box;-webkit-margin-start: var(--hi-v4-spacing-4, 8px);margin-inline-start: var(--hi-v4-spacing-4, 8px);color: var(--hi-v4-color-gray-700, #1f2733);}.hi-v4-radio--type-default:hover .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-default[data-checked] .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));background: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-default[data-checked] .hi-v4-radio__controller::after {opacity: 1;-webkit-transform: scale(0.3);transform: scale(0.3);background-color: var(--hi-v4-color-static-white, #fff);}.hi-v4-radio--type-default[data-checked].hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));background: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));opacity: 0.4;}.hi-v4-radio--type-default[data-checked].hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller::after {opacity: 1;-webkit-transform: scale(0.3);transform: scale(0.3);background-color: var(--hi-v4-color-static-white, #fff);}.hi-v4-radio--type-default[data-disabled] {cursor: not-allowed;}.hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller {border-color: var(--hi-v4-color-gray-300, #dfe2e8);background: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller::after {background: var(--hi-v4-color-gray-300, #dfe2e8);}.hi-v4-radio--type-default[data-disabled] .hi-v4-radio__label {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-radio-group {position: relative;}.hi-v4-radio-group--data-wrap {display: -webkit-inline-box;display: -ms-inline-flexbox;display: inline-flex;z-index: var(--hi-v4-zindex-normal, 0);}.hi-v4-radio-group--type-button {border-radius: var(--hi-v4-border-radius-md, 4px);overflow: hidden;}.hi-v4-radio-group--type-default.hi-v4-radio-group--data-wrap {gap: var(--hi-v4-spacing-8, 16px);}.hi-v4-radio-group--placement-horizontal.hi-v4-radio-group--data-wrap {-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v4-radio-group--placement-horizontal.hi-v4-radio-group--auto-width {display: -webkit-box;display: -ms-flexbox;display: flex;}.hi-v4-radio-group--placement-horizontal.hi-v4-radio-group--auto-width .hi-v4-radio--type-button {-webkit-box-flex: 1;-ms-flex: 1 1;flex: 1 1;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;}.hi-v4-radio-group--placement-horizontal .hi-v4-radio--type-button::after {content: \"\";background: var(--hi-v4-color-gray-300, #dfe2e8);width: 1px;left: 100%;top: 8px;bottom: 8px;position: absolute;z-index: var(--hi-v4-zindex-absolute, 1);}.hi-v4-radio-group--placement-vertical {-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;}.hi-v4-radio-group--placement-vertical .hi-v4-radio--type-button::after {content: \"\";background: var(--hi-v4-color-gray-300, #dfe2e8);height: 1px;left: 8px;right: 8px;top: 100%;position: absolute;z-index: var(--hi-v4-zindex-absolute, 1);}";
|
|
34
|
-
__styleInject____default["default"](css_248z);
|
|
35
|
-
exports["default"] = css_248z;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/** @LICENSE
|
|
2
|
-
* @hi-ui/table
|
|
3
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, '__esModule', {
|
|
13
|
-
value: true
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
/** @LICENSE
|
|
17
|
-
* @hi-ui/radio
|
|
18
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
|
-
var RadioGroupPlacementEnum = {
|
|
26
|
-
VERTICAL: 'vertical',
|
|
27
|
-
HORIZONTAL: 'horizontal'
|
|
28
|
-
};
|
|
29
|
-
var RadioGroupTypeEnum = {
|
|
30
|
-
DEFAULT: 'default',
|
|
31
|
-
BUTTON: 'button'
|
|
32
|
-
};
|
|
33
|
-
exports.RadioGroupPlacementEnum = RadioGroupPlacementEnum;
|
|
34
|
-
exports.RadioGroupTypeEnum = RadioGroupTypeEnum;
|