@uzum-tech/ui 1.13.2 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1848 -1664
- package/dist/index.prod.js +3 -3
- package/es/_mixins/use-css-vars-class.js +5 -3
- package/es/_mixins/use-rtl.js +5 -2
- package/es/_mixins/use-style.js +4 -2
- package/es/_mixins/use-theme.js +4 -2
- package/es/auto-complete/src/AutoComplete.d.ts +70 -0
- package/es/auto-complete/styles/light.d.ts +7 -0
- package/es/chat/src/Chat.d.ts +70 -0
- package/es/chat/src/ChatListItems.d.ts +77 -0
- package/es/chat/src/ChatMessages.d.ts +77 -0
- package/es/chat/src/ChatParts/MainArea.js +47 -54
- package/es/chat/src/ChatParts/Sidebar.d.ts +7 -0
- package/es/chat/src/styles/index.cssr.js +12 -7
- package/es/chat/styles/dark.d.ts +7 -0
- package/es/chat/styles/light.d.ts +7 -0
- package/es/color-picker/src/ColorInputUnit.d.ts +7 -0
- package/es/color-picker/src/ColorPicker.d.ts +63 -0
- package/es/color-picker/styles/light.d.ts +7 -0
- package/es/config-provider/src/ConfigProvider.d.ts +3 -0
- package/es/config-provider/src/ConfigProvider.js +4 -1
- package/es/config-provider/src/internal-interface.d.ts +1 -0
- package/es/data-table/src/DataTable.d.ts +58 -0
- package/es/data-table/src/DataTable.js +71 -4
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +14 -0
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +14 -0
- package/es/data-table/src/TableParts/Body.d.ts +14 -0
- package/es/data-table/src/TableParts/Body.js +6 -2
- package/es/data-table/src/TableParts/Header.d.ts +14 -0
- package/es/data-table/src/TableParts/Header.js +17 -5
- package/es/data-table/src/interface.d.ts +34 -0
- package/es/data-table/src/interface.js +1 -1
- package/es/data-table/src/use-resizable.d.ts +1 -0
- package/es/data-table/src/use-resizable.js +2 -1
- package/es/data-table/src/use-sorter.d.ts +1 -0
- package/es/data-table/src/use-sorter.js +2 -1
- package/es/data-table/src/use-table-data.d.ts +3 -2
- package/es/data-table/src/use-table-data.js +5 -1
- package/es/data-table/src/use-table-storage.d.ts +4 -0
- package/es/data-table/src/use-table-storage.js +43 -0
- package/es/data-table/src/utils.js +39 -5
- package/es/data-table/styles/light.d.ts +7 -0
- package/es/date-picker/src/DatePicker.d.ts +147 -0
- package/es/date-picker/src/panel/date.d.ts +21 -0
- package/es/date-picker/src/panel/daterange.d.ts +21 -0
- package/es/date-picker/src/panel/datetime.d.ts +21 -0
- package/es/date-picker/src/panel/datetimerange.d.ts +21 -0
- package/es/date-picker/src/panel/panelMonth.d.ts +42 -0
- package/es/date-picker/src/panel/panelMonthContent.d.ts +21 -0
- package/es/date-picker/src/panel/panelYear.d.ts +42 -0
- package/es/date-picker/src/panel/panelYearContent.d.ts +21 -0
- package/es/date-picker/src/panel/use-calendar.d.ts +21 -0
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +21 -0
- package/es/date-picker/src/panel/use-panel-common.d.ts +21 -0
- package/es/date-picker/styles/light.d.ts +14 -0
- package/es/date-picker-v2/src/DatePickerV2.d.ts +70 -0
- package/es/date-picker-v2/styles/dark.d.ts +7 -0
- package/es/date-picker-v2/styles/light.d.ts +7 -0
- package/es/dynamic-input/src/DynamicInput.d.ts +70 -0
- package/es/dynamic-input/src/InputPreset.d.ts +7 -0
- package/es/dynamic-input/src/PairPreset.d.ts +7 -0
- package/es/dynamic-input/styles/light.d.ts +7 -0
- package/es/dynamic-tags/src/DynamicTags.d.ts +70 -0
- package/es/dynamic-tags/styles/light.d.ts +7 -0
- package/es/input/src/Input.d.ts +77 -0
- package/es/input/src/Input.js +9 -1
- package/es/input/src/InputGroupLabel.d.ts +63 -0
- package/es/input/src/styles/input.cssr.js +1 -1
- package/es/input/styles/light.d.ts +7 -0
- package/es/input/styles/light.js +11 -1
- package/es/input-number/src/InputNumber.d.ts +70 -0
- package/es/input-number/styles/light.d.ts +7 -0
- package/es/input-otp/src/InputOtp.d.ts +70 -0
- package/es/input-otp/styles/light.d.ts +7 -0
- package/es/legacy-transfer/src/Transfer.d.ts +70 -0
- package/es/legacy-transfer/src/TransferFilter.d.ts +7 -0
- package/es/legacy-transfer/src/TransferList.d.ts +7 -0
- package/es/legacy-transfer/src/TransferListItem.d.ts +7 -0
- package/es/legacy-transfer/styles/light.d.ts +7 -0
- package/es/locales/date/enUS.js +1 -1
- package/es/mention/src/Mention.d.ts +70 -0
- package/es/mention/styles/light.d.ts +7 -0
- package/es/pagination/src/Pagination.d.ts +70 -0
- package/es/pagination/styles/light.d.ts +7 -0
- package/es/time-picker/src/Panel.d.ts +7 -0
- package/es/time-picker/src/TimePicker.d.ts +70 -0
- package/es/time-picker/styles/light.d.ts +7 -0
- package/es/transfer/src/Transfer.d.ts +70 -0
- package/es/transfer/src/TransferFilter.d.ts +7 -0
- package/es/transfer/src/TransferList.d.ts +7 -0
- package/es/transfer/src/TransferListItem.d.ts +7 -0
- package/es/transfer/styles/light.d.ts +7 -0
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_mixins/use-css-vars-class.js +5 -3
- package/lib/_mixins/use-rtl.js +4 -1
- package/lib/_mixins/use-style.js +4 -2
- package/lib/_mixins/use-theme.js +4 -2
- package/lib/auto-complete/src/AutoComplete.d.ts +70 -0
- package/lib/auto-complete/styles/light.d.ts +7 -0
- package/lib/chat/src/Chat.d.ts +70 -0
- package/lib/chat/src/ChatListItems.d.ts +77 -0
- package/lib/chat/src/ChatMessages.d.ts +77 -0
- package/lib/chat/src/ChatParts/MainArea.js +47 -54
- package/lib/chat/src/ChatParts/Sidebar.d.ts +7 -0
- package/lib/chat/src/styles/index.cssr.js +12 -7
- package/lib/chat/styles/dark.d.ts +7 -0
- package/lib/chat/styles/light.d.ts +7 -0
- package/lib/color-picker/src/ColorInputUnit.d.ts +7 -0
- package/lib/color-picker/src/ColorPicker.d.ts +63 -0
- package/lib/color-picker/styles/light.d.ts +7 -0
- package/lib/config-provider/src/ConfigProvider.d.ts +3 -0
- package/lib/config-provider/src/ConfigProvider.js +4 -1
- package/lib/config-provider/src/internal-interface.d.ts +1 -0
- package/lib/data-table/src/DataTable.d.ts +58 -0
- package/lib/data-table/src/DataTable.js +70 -3
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +14 -0
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +14 -0
- package/lib/data-table/src/TableParts/Body.d.ts +14 -0
- package/lib/data-table/src/TableParts/Body.js +6 -2
- package/lib/data-table/src/TableParts/Header.d.ts +14 -0
- package/lib/data-table/src/TableParts/Header.js +16 -4
- package/lib/data-table/src/interface.d.ts +34 -0
- package/lib/data-table/src/interface.js +1 -1
- package/lib/data-table/src/use-resizable.d.ts +1 -0
- package/lib/data-table/src/use-resizable.js +2 -1
- package/lib/data-table/src/use-sorter.d.ts +1 -0
- package/lib/data-table/src/use-sorter.js +2 -1
- package/lib/data-table/src/use-table-data.d.ts +3 -2
- package/lib/data-table/src/use-table-data.js +5 -1
- package/lib/data-table/src/use-table-storage.d.ts +4 -0
- package/lib/data-table/src/use-table-storage.js +48 -0
- package/lib/data-table/src/utils.js +39 -5
- package/lib/data-table/styles/light.d.ts +7 -0
- package/lib/date-picker/src/DatePicker.d.ts +147 -0
- package/lib/date-picker/src/panel/date.d.ts +21 -0
- package/lib/date-picker/src/panel/daterange.d.ts +21 -0
- package/lib/date-picker/src/panel/datetime.d.ts +21 -0
- package/lib/date-picker/src/panel/datetimerange.d.ts +21 -0
- package/lib/date-picker/src/panel/panelMonth.d.ts +42 -0
- package/lib/date-picker/src/panel/panelMonthContent.d.ts +21 -0
- package/lib/date-picker/src/panel/panelYear.d.ts +42 -0
- package/lib/date-picker/src/panel/panelYearContent.d.ts +21 -0
- package/lib/date-picker/src/panel/use-calendar.d.ts +21 -0
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +21 -0
- package/lib/date-picker/src/panel/use-panel-common.d.ts +21 -0
- package/lib/date-picker/styles/light.d.ts +14 -0
- package/lib/date-picker-v2/src/DatePickerV2.d.ts +70 -0
- package/lib/date-picker-v2/styles/dark.d.ts +7 -0
- package/lib/date-picker-v2/styles/light.d.ts +7 -0
- package/lib/dynamic-input/src/DynamicInput.d.ts +70 -0
- package/lib/dynamic-input/src/InputPreset.d.ts +7 -0
- package/lib/dynamic-input/src/PairPreset.d.ts +7 -0
- package/lib/dynamic-input/styles/light.d.ts +7 -0
- package/lib/dynamic-tags/src/DynamicTags.d.ts +70 -0
- package/lib/dynamic-tags/styles/light.d.ts +7 -0
- package/lib/input/src/Input.d.ts +77 -0
- package/lib/input/src/Input.js +9 -1
- package/lib/input/src/InputGroupLabel.d.ts +63 -0
- package/lib/input/src/styles/input.cssr.js +1 -1
- package/lib/input/styles/light.d.ts +7 -0
- package/lib/input/styles/light.js +11 -1
- package/lib/input-number/src/InputNumber.d.ts +70 -0
- package/lib/input-number/styles/light.d.ts +7 -0
- package/lib/input-otp/src/InputOtp.d.ts +70 -0
- package/lib/input-otp/styles/light.d.ts +7 -0
- package/lib/legacy-transfer/src/Transfer.d.ts +70 -0
- package/lib/legacy-transfer/src/TransferFilter.d.ts +7 -0
- package/lib/legacy-transfer/src/TransferList.d.ts +7 -0
- package/lib/legacy-transfer/src/TransferListItem.d.ts +7 -0
- package/lib/legacy-transfer/styles/light.d.ts +7 -0
- package/lib/locales/date/enUS.js +2 -2
- package/lib/mention/src/Mention.d.ts +70 -0
- package/lib/mention/styles/light.d.ts +7 -0
- package/lib/pagination/src/Pagination.d.ts +70 -0
- package/lib/pagination/styles/light.d.ts +7 -0
- package/lib/time-picker/src/Panel.d.ts +7 -0
- package/lib/time-picker/src/TimePicker.d.ts +70 -0
- package/lib/time-picker/styles/light.d.ts +7 -0
- package/lib/transfer/src/Transfer.d.ts +70 -0
- package/lib/transfer/src/TransferFilter.d.ts +7 -0
- package/lib/transfer/src/TransferList.d.ts +7 -0
- package/lib/transfer/src/TransferListItem.d.ts +7 -0
- package/lib/transfer/styles/light.d.ts +7 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/web-types.json +18 -1
|
@@ -702,6 +702,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
702
702
|
borderFocus: string;
|
|
703
703
|
boxShadowFocus: string;
|
|
704
704
|
loadingColor: string;
|
|
705
|
+
loadingColorSuccess: string;
|
|
706
|
+
borderSuccess: string;
|
|
707
|
+
borderHoverSuccess: string;
|
|
708
|
+
colorFocusSuccess: string;
|
|
709
|
+
borderFocusSuccess: string;
|
|
710
|
+
boxShadowFocusSuccess: string;
|
|
711
|
+
caretColorSuccess: string;
|
|
705
712
|
loadingColorWarning: string;
|
|
706
713
|
borderWarning: string;
|
|
707
714
|
borderHoverWarning: string;
|
|
@@ -1211,6 +1218,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1211
1218
|
borderFocus: string;
|
|
1212
1219
|
boxShadowFocus: string;
|
|
1213
1220
|
loadingColor: string;
|
|
1221
|
+
loadingColorSuccess: string;
|
|
1222
|
+
borderSuccess: string;
|
|
1223
|
+
borderHoverSuccess: string;
|
|
1224
|
+
colorFocusSuccess: string;
|
|
1225
|
+
borderFocusSuccess: string;
|
|
1226
|
+
boxShadowFocusSuccess: string;
|
|
1227
|
+
caretColorSuccess: string;
|
|
1214
1228
|
loadingColorWarning: string;
|
|
1215
1229
|
borderWarning: string;
|
|
1216
1230
|
borderHoverWarning: string;
|
|
@@ -727,6 +727,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
727
727
|
borderFocus: string;
|
|
728
728
|
boxShadowFocus: string;
|
|
729
729
|
loadingColor: string;
|
|
730
|
+
loadingColorSuccess: string;
|
|
731
|
+
borderSuccess: string;
|
|
732
|
+
borderHoverSuccess: string;
|
|
733
|
+
colorFocusSuccess: string;
|
|
734
|
+
borderFocusSuccess: string;
|
|
735
|
+
boxShadowFocusSuccess: string;
|
|
736
|
+
caretColorSuccess: string;
|
|
730
737
|
loadingColorWarning: string;
|
|
731
738
|
borderWarning: string;
|
|
732
739
|
borderHoverWarning: string;
|
|
@@ -1236,6 +1243,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1236
1243
|
borderFocus: string;
|
|
1237
1244
|
boxShadowFocus: string;
|
|
1238
1245
|
loadingColor: string;
|
|
1246
|
+
loadingColorSuccess: string;
|
|
1247
|
+
borderSuccess: string;
|
|
1248
|
+
borderHoverSuccess: string;
|
|
1249
|
+
colorFocusSuccess: string;
|
|
1250
|
+
borderFocusSuccess: string;
|
|
1251
|
+
boxShadowFocusSuccess: string;
|
|
1252
|
+
caretColorSuccess: string;
|
|
1239
1253
|
loadingColorWarning: string;
|
|
1240
1254
|
borderWarning: string;
|
|
1241
1255
|
borderHoverWarning: string;
|
|
@@ -728,6 +728,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
728
728
|
borderFocus: string;
|
|
729
729
|
boxShadowFocus: string;
|
|
730
730
|
loadingColor: string;
|
|
731
|
+
loadingColorSuccess: string;
|
|
732
|
+
borderSuccess: string;
|
|
733
|
+
borderHoverSuccess: string;
|
|
734
|
+
colorFocusSuccess: string;
|
|
735
|
+
borderFocusSuccess: string;
|
|
736
|
+
boxShadowFocusSuccess: string;
|
|
737
|
+
caretColorSuccess: string;
|
|
731
738
|
loadingColorWarning: string;
|
|
732
739
|
borderWarning: string;
|
|
733
740
|
borderHoverWarning: string;
|
|
@@ -1237,6 +1244,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1237
1244
|
borderFocus: string;
|
|
1238
1245
|
boxShadowFocus: string;
|
|
1239
1246
|
loadingColor: string;
|
|
1247
|
+
loadingColorSuccess: string;
|
|
1248
|
+
borderSuccess: string;
|
|
1249
|
+
borderHoverSuccess: string;
|
|
1250
|
+
colorFocusSuccess: string;
|
|
1251
|
+
borderFocusSuccess: string;
|
|
1252
|
+
boxShadowFocusSuccess: string;
|
|
1253
|
+
caretColorSuccess: string;
|
|
1240
1254
|
loadingColorWarning: string;
|
|
1241
1255
|
borderWarning: string;
|
|
1242
1256
|
borderHoverWarning: string;
|
|
@@ -15,6 +15,7 @@ import { pxfy, repeat } from 'seemly';
|
|
|
15
15
|
import { VirtualList, VResizeObserver } from 'vueuc';
|
|
16
16
|
import { useMemo } from 'vooks';
|
|
17
17
|
import { cssrAnchorMetaName } from '../../../_mixins/common';
|
|
18
|
+
import { configProviderInjectionKey } from '../../../config-provider/src/context';
|
|
18
19
|
import { c } from '../../../_utils/cssr';
|
|
19
20
|
import { UScrollbar } from '../../../_internal';
|
|
20
21
|
import { formatLength, resolveSlot, warn } from '../../../_utils';
|
|
@@ -97,6 +98,7 @@ export default defineComponent({
|
|
|
97
98
|
const { slots: dataTableSlots, bodyWidthRef, mergedExpandedRowKeysRef, mergedClsPrefixRef, mergedThemeRef, scrollXRef, colsRef, paginatedDataRef, rawPaginatedDataRef, fixedColumnLeftMapRef, fixedColumnRightMapRef, mergedCurrentPageRef, rowClassNameRef, leftActiveFixedColKeyRef, leftActiveFixedChildrenColKeysRef, rightActiveFixedColKeyRef, rightActiveFixedChildrenColKeysRef, renderExpandRef, hoverKeyRef, summaryRef, mergedSortStateRef, virtualScrollRef, componentId, mergedTableLayoutRef, childTriggerColIndexRef, indentRef, rowPropsRef, maxHeightRef, stripedRef, loadingRef, loadingSkeletonRef, onLoadRef, loadingKeySetRef, expandableRef, stickyExpandedRowsRef, renderExpandIconRef, summaryPlacementRef, treeMateRef, scrollbarPropsRef, setHeaderScrollLeft, doUpdateExpandedRowKeys, handleTableBodyScroll, doCheck, doUncheck, renderCell, defaultEmptyValueRef, emptyPropsRef
|
|
98
99
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
99
100
|
} = inject(dataTableInjectionKey);
|
|
101
|
+
const UConfigProvider = inject(configProviderInjectionKey, null);
|
|
100
102
|
const scrollbarInstRef = ref(null);
|
|
101
103
|
const virtualListRef = ref(null);
|
|
102
104
|
const emptyElRef = ref(null);
|
|
@@ -291,13 +293,15 @@ export default defineComponent({
|
|
|
291
293
|
id: `u-${componentId}`,
|
|
292
294
|
force: true,
|
|
293
295
|
props: cProps,
|
|
294
|
-
anchorMetaName: cssrAnchorMetaName
|
|
296
|
+
anchorMetaName: cssrAnchorMetaName,
|
|
297
|
+
parent: UConfigProvider === null || UConfigProvider === void 0 ? void 0 : UConfigProvider.styleMountTarget
|
|
295
298
|
});
|
|
296
299
|
fixedStyleMounted = true;
|
|
297
300
|
});
|
|
298
301
|
onUnmounted(() => {
|
|
299
302
|
style.unmount({
|
|
300
|
-
id: `u-${componentId}
|
|
303
|
+
id: `u-${componentId}`,
|
|
304
|
+
parent: UConfigProvider === null || UConfigProvider === void 0 ? void 0 : UConfigProvider.styleMountTarget
|
|
301
305
|
});
|
|
302
306
|
});
|
|
303
307
|
return Object.assign({ bodyWidth: bodyWidthRef, summaryPlacement: summaryPlacementRef, dataTableSlots,
|
|
@@ -715,6 +715,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
715
715
|
borderFocus: string;
|
|
716
716
|
boxShadowFocus: string;
|
|
717
717
|
loadingColor: string;
|
|
718
|
+
loadingColorSuccess: string;
|
|
719
|
+
borderSuccess: string;
|
|
720
|
+
borderHoverSuccess: string;
|
|
721
|
+
colorFocusSuccess: string;
|
|
722
|
+
borderFocusSuccess: string;
|
|
723
|
+
boxShadowFocusSuccess: string;
|
|
724
|
+
caretColorSuccess: string;
|
|
718
725
|
loadingColorWarning: string;
|
|
719
726
|
borderWarning: string;
|
|
720
727
|
borderHoverWarning: string;
|
|
@@ -1224,6 +1231,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1224
1231
|
borderFocus: string;
|
|
1225
1232
|
boxShadowFocus: string;
|
|
1226
1233
|
loadingColor: string;
|
|
1234
|
+
loadingColorSuccess: string;
|
|
1235
|
+
borderSuccess: string;
|
|
1236
|
+
borderHoverSuccess: string;
|
|
1237
|
+
colorFocusSuccess: string;
|
|
1238
|
+
borderFocusSuccess: string;
|
|
1239
|
+
boxShadowFocusSuccess: string;
|
|
1240
|
+
caretColorSuccess: string;
|
|
1227
1241
|
loadingColorWarning: string;
|
|
1228
1242
|
borderWarning: string;
|
|
1229
1243
|
borderHoverWarning: string;
|
|
@@ -6,7 +6,7 @@ import { UEllipsis } from '../../../ellipsis';
|
|
|
6
6
|
import SortButton from '../HeaderButton/SortButton';
|
|
7
7
|
import FilterButton from '../HeaderButton/FilterButton';
|
|
8
8
|
import ResizeButton from '../HeaderButton/ResizeButton';
|
|
9
|
-
import { isColumnSortable, isColumnFilterable, createNextSorter, getColKey, isColumnSorting, isColumnResizable, clampValueFollowCSSRules } from '../utils';
|
|
9
|
+
import { isColumnSortable, isColumnFilterable, createNextSorter, getColKey, getNumberColWidth, isColumnSorting, isColumnResizable, clampValueFollowCSSRules } from '../utils';
|
|
10
10
|
import { dataTableInjectionKey } from '../interface';
|
|
11
11
|
import SelectionMenu from './SelectionMenu';
|
|
12
12
|
function renderTitle(column) {
|
|
@@ -23,7 +23,7 @@ export default defineComponent({
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
setup() {
|
|
26
|
-
const { mergedClsPrefixRef, scrollXRef, fixedColumnLeftMapRef, fixedColumnRightMapRef, mergedCurrentPageRef, allRowsCheckedRef, someRowsCheckedRef, rowsRef, colsRef, mergedThemeRef, checkOptionsRef, mergedSortStateRef, componentId, mergedTableLayoutRef, headerCheckboxDisabledRef, sizeRef, onUnstableColumnResize, doUpdateResizableWidth, handleTableHeaderScroll, deriveNextSorter, doUncheckAll, doCheckAll
|
|
26
|
+
const { mergedClsPrefixRef, scrollXRef, fixedColumnLeftMapRef, fixedColumnRightMapRef, mergedCurrentPageRef, allRowsCheckedRef, someRowsCheckedRef, rowsRef, colsRef, mergedThemeRef, checkOptionsRef, mergedSortStateRef, componentId, mergedTableLayoutRef, headerCheckboxDisabledRef, sizeRef, onUnstableColumnResize, getResizableWidth, doUpdateResizableWidth, handleTableHeaderScroll, deriveNextSorter, doUncheckAll, doCheckAll
|
|
27
27
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
28
28
|
} = inject(dataTableInjectionKey);
|
|
29
29
|
const cellElsRef = ref({});
|
|
@@ -51,13 +51,25 @@ export default defineComponent({
|
|
|
51
51
|
deriveNextSorter(nextSorter);
|
|
52
52
|
}
|
|
53
53
|
const resizeStartWidthMap = new Map();
|
|
54
|
+
function getColumnStartWidth(column) {
|
|
55
|
+
const actual = getCellActualWidth(column.key);
|
|
56
|
+
if (actual !== undefined && actual > 0)
|
|
57
|
+
return actual;
|
|
58
|
+
const resized = getResizableWidth(column.key);
|
|
59
|
+
if (resized !== undefined && resized > 0)
|
|
60
|
+
return resized;
|
|
61
|
+
return getNumberColWidth(column);
|
|
62
|
+
}
|
|
54
63
|
function handleColumnResizeStart(column) {
|
|
55
|
-
resizeStartWidthMap.set(column.key,
|
|
64
|
+
resizeStartWidthMap.set(column.key, getColumnStartWidth(column));
|
|
56
65
|
}
|
|
57
66
|
function handleColumnResize(column, displacementX) {
|
|
58
|
-
|
|
67
|
+
let startWidth = resizeStartWidthMap.get(column.key);
|
|
59
68
|
if (startWidth === undefined) {
|
|
60
|
-
|
|
69
|
+
startWidth = getColumnStartWidth(column);
|
|
70
|
+
if (startWidth === undefined)
|
|
71
|
+
return;
|
|
72
|
+
resizeStartWidthMap.set(column.key, startWidth);
|
|
61
73
|
}
|
|
62
74
|
const widthAfterResize = startWidth + displacementX;
|
|
63
75
|
const limitWidth = clampValueFollowCSSRules(widthAfterResize, column.minWidth, column.maxWidth);
|
|
@@ -96,6 +96,7 @@ export declare const dataTableProps: {
|
|
|
96
96
|
readonly default: "current";
|
|
97
97
|
};
|
|
98
98
|
readonly scrollbarProps: PropType<ScrollbarProps>;
|
|
99
|
+
readonly localStorageKey: StringConstructor;
|
|
99
100
|
readonly renderCell: PropType<(value: any, rowData: object, column: TableBaseColumn) => VNodeChild>;
|
|
100
101
|
readonly defaultEmptyValue: PropType<string | (() => VNodeChild) | undefined>;
|
|
101
102
|
readonly renderExpandIcon: PropType<RenderExpandIcon>;
|
|
@@ -812,6 +813,13 @@ export declare const dataTableProps: {
|
|
|
812
813
|
borderFocus: string;
|
|
813
814
|
boxShadowFocus: string;
|
|
814
815
|
loadingColor: string;
|
|
816
|
+
loadingColorSuccess: string;
|
|
817
|
+
borderSuccess: string;
|
|
818
|
+
borderHoverSuccess: string;
|
|
819
|
+
colorFocusSuccess: string;
|
|
820
|
+
borderFocusSuccess: string;
|
|
821
|
+
boxShadowFocusSuccess: string;
|
|
822
|
+
caretColorSuccess: string;
|
|
815
823
|
loadingColorWarning: string;
|
|
816
824
|
borderWarning: string;
|
|
817
825
|
borderHoverWarning: string;
|
|
@@ -1760,6 +1768,13 @@ export declare const dataTableProps: {
|
|
|
1760
1768
|
borderFocus: string;
|
|
1761
1769
|
boxShadowFocus: string;
|
|
1762
1770
|
loadingColor: string;
|
|
1771
|
+
loadingColorSuccess: string;
|
|
1772
|
+
borderSuccess: string;
|
|
1773
|
+
borderHoverSuccess: string;
|
|
1774
|
+
colorFocusSuccess: string;
|
|
1775
|
+
borderFocusSuccess: string;
|
|
1776
|
+
boxShadowFocusSuccess: string;
|
|
1777
|
+
caretColorSuccess: string;
|
|
1763
1778
|
loadingColorWarning: string;
|
|
1764
1779
|
borderWarning: string;
|
|
1765
1780
|
borderHoverWarning: string;
|
|
@@ -2708,6 +2723,13 @@ export declare const dataTableProps: {
|
|
|
2708
2723
|
borderFocus: string;
|
|
2709
2724
|
boxShadowFocus: string;
|
|
2710
2725
|
loadingColor: string;
|
|
2726
|
+
loadingColorSuccess: string;
|
|
2727
|
+
borderSuccess: string;
|
|
2728
|
+
borderHoverSuccess: string;
|
|
2729
|
+
colorFocusSuccess: string;
|
|
2730
|
+
borderFocusSuccess: string;
|
|
2731
|
+
boxShadowFocusSuccess: string;
|
|
2732
|
+
caretColorSuccess: string;
|
|
2711
2733
|
loadingColorWarning: string;
|
|
2712
2734
|
borderWarning: string;
|
|
2713
2735
|
borderHoverWarning: string;
|
|
@@ -3185,6 +3207,18 @@ export interface MainTableInjection {
|
|
|
3185
3207
|
leftActiveFixedColKey: ColumnKey | null;
|
|
3186
3208
|
rightActiveFixedColKey: ColumnKey | null;
|
|
3187
3209
|
}
|
|
3210
|
+
export interface DataTableStorageState {
|
|
3211
|
+
columnWidths?: Record<string, number>;
|
|
3212
|
+
page?: number;
|
|
3213
|
+
pageSize?: number;
|
|
3214
|
+
filters?: FilterState;
|
|
3215
|
+
sortState?: Array<{
|
|
3216
|
+
columnKey: ColumnKey;
|
|
3217
|
+
order: SortState['order'];
|
|
3218
|
+
}>;
|
|
3219
|
+
checkedRowKeys?: RowKey[];
|
|
3220
|
+
expandedRowKeys?: RowKey[];
|
|
3221
|
+
}
|
|
3188
3222
|
export type RenderFilter = (props: {
|
|
3189
3223
|
active: boolean;
|
|
3190
3224
|
show: boolean;
|
|
@@ -50,7 +50,7 @@ export const dataTableProps = Object.assign(Object.assign({}, useTheme.props), {
|
|
|
50
50
|
}, paginationBehaviorOnFilter: {
|
|
51
51
|
type: String,
|
|
52
52
|
default: 'current'
|
|
53
|
-
}, scrollbarProps: Object, renderCell: Function, defaultEmptyValue: [String, Function], renderExpandIcon: Function, spinProps: { type: Object, default: {} }, emptyProps: Object, onLoad: Function, 'onUpdate:page': [Function, Array], onUpdatePage: [Function, Array], 'onUpdate:pageSize': [Function, Array], onUpdatePageSize: [Function, Array], 'onUpdate:sorter': [Function, Array], onUpdateSorter: [Function, Array], 'onUpdate:filters': [Function, Array], onUpdateFilters: [Function, Array], 'onUpdate:checkedRowKeys': [Function, Array], onUpdateCheckedRowKeys: [Function, Array], 'onUpdate:expandedRowKeys': [Function, Array], onUpdateExpandedRowKeys: [Function, Array], onScroll: Function,
|
|
53
|
+
}, scrollbarProps: Object, localStorageKey: String, renderCell: Function, defaultEmptyValue: [String, Function], renderExpandIcon: Function, spinProps: { type: Object, default: {} }, emptyProps: Object, onLoad: Function, 'onUpdate:page': [Function, Array], onUpdatePage: [Function, Array], 'onUpdate:pageSize': [Function, Array], onUpdatePageSize: [Function, Array], 'onUpdate:sorter': [Function, Array], onUpdateSorter: [Function, Array], 'onUpdate:filters': [Function, Array], onUpdateFilters: [Function, Array], 'onUpdate:checkedRowKeys': [Function, Array], onUpdateCheckedRowKeys: [Function, Array], 'onUpdate:expandedRowKeys': [Function, Array], onUpdateExpandedRowKeys: [Function, Array], onScroll: Function,
|
|
54
54
|
// deprecated
|
|
55
55
|
onPageChange: [Function, Array], onPageSizeChange: [Function, Array], onSorterChange: [Function, Array], onFiltersChange: [Function, Array], onCheckedRowKeysChange: [Function, Array] });
|
|
56
56
|
export const dataTableInjectionKey = createInjectionKey('u-data-table');
|
|
@@ -3,4 +3,5 @@ export declare function useResizable(): {
|
|
|
3
3
|
getResizableWidth: (key: ColumnKey) => number | undefined;
|
|
4
4
|
doUpdateResizableWidth: (column: TableColumn, width: number) => void;
|
|
5
5
|
clearResizableWidth: () => void;
|
|
6
|
+
resizableWidthsRef: import("vue").Ref<Record<ColumnKey, number>>;
|
|
6
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComputedRef } from 'vue';
|
|
2
2
|
import type { PaginationProps } from '../../pagination/src/Pagination';
|
|
3
|
-
import type { ColumnKey, FilterState, TableBaseColumn, TableSelectionColumn, InternalRowData, TmNode, TableExpandColumn, RowKey, DataTableSetupProps } from './interface';
|
|
3
|
+
import type { ColumnKey, FilterState, SortState, TableBaseColumn, TableSelectionColumn, InternalRowData, TmNode, TableExpandColumn, RowKey, DataTableSetupProps } from './interface';
|
|
4
4
|
export declare function useTableData(props: DataTableSetupProps, { dataRelatedColsRef }: {
|
|
5
5
|
dataRelatedColsRef: ComputedRef<Array<TableSelectionColumn | TableBaseColumn | TableExpandColumn>>;
|
|
6
6
|
}): {
|
|
@@ -22,10 +22,11 @@ export declare function useTableData(props: DataTableSetupProps, { dataRelatedCo
|
|
|
22
22
|
selectionColumnRef: ComputedRef<TableSelectionColumn | null>;
|
|
23
23
|
childTriggerColIndexRef: ComputedRef<number>;
|
|
24
24
|
doUpdateFilters: (filters: FilterState, sourceColumn: TableBaseColumn) => void;
|
|
25
|
-
deriveNextSorter: (sortState:
|
|
25
|
+
deriveNextSorter: (sortState: SortState | null) => void;
|
|
26
26
|
doUpdatePageSize: (pageSize: number) => void;
|
|
27
27
|
doUpdatePage: (page: number) => void;
|
|
28
28
|
onUnstableColumnResize: (resizedWidth: number, limitedWidth: number, column: TableBaseColumn, getColumnWidth: (key: ColumnKey) => number | undefined) => void;
|
|
29
|
+
restoreSortState: (sortState: SortState | SortState[] | null) => void;
|
|
29
30
|
filter: (filters: FilterState | null) => void;
|
|
30
31
|
filters: (filters: FilterState | null) => void;
|
|
31
32
|
clearFilter: () => void;
|
|
@@ -128,7 +128,7 @@ export function useTableData(props, { dataRelatedColsRef }) {
|
|
|
128
128
|
})
|
|
129
129
|
: [];
|
|
130
130
|
});
|
|
131
|
-
const { sortedDataRef, deriveNextSorter, mergedSortStateRef, sort, clearSorter } = useSorter(props, {
|
|
131
|
+
const { sortedDataRef, deriveNextSorter, mergedSortStateRef, sort, clearSorter, doUpdateSorter } = useSorter(props, {
|
|
132
132
|
dataRelatedColsRef,
|
|
133
133
|
filteredDataRef
|
|
134
134
|
});
|
|
@@ -299,6 +299,9 @@ export function useTableData(props, { dataRelatedColsRef }) {
|
|
|
299
299
|
warn('data-table', '`filters` is not an object');
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
+
function restoreSortState(sortState) {
|
|
303
|
+
doUpdateSorter(sortState);
|
|
304
|
+
}
|
|
302
305
|
return {
|
|
303
306
|
treeMateRef,
|
|
304
307
|
mergedCurrentPageRef: boundedMergedCurrentPageRef,
|
|
@@ -315,6 +318,7 @@ export function useTableData(props, { dataRelatedColsRef }) {
|
|
|
315
318
|
doUpdatePageSize,
|
|
316
319
|
doUpdatePage,
|
|
317
320
|
onUnstableColumnResize,
|
|
321
|
+
restoreSortState,
|
|
318
322
|
// exported methods
|
|
319
323
|
filter,
|
|
320
324
|
filters,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DataTableStorageState, SortState, TableBaseColumn, TableExpandColumn, TableSelectionColumn } from './interface';
|
|
2
|
+
export declare function loadTableState(localStorageKey: string): DataTableStorageState | null;
|
|
3
|
+
export declare function saveTableState(localStorageKey: string, state: DataTableStorageState): void;
|
|
4
|
+
export declare function restoreSortStateFromStored(stored: DataTableStorageState['sortState'], dataRelatedCols: Array<TableSelectionColumn | TableBaseColumn | TableExpandColumn>): SortState[] | null;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const STORAGE_KEY_PREFIX = 'u-data-table:';
|
|
2
|
+
function getStorageKey(key) {
|
|
3
|
+
return `${STORAGE_KEY_PREFIX}${key}`;
|
|
4
|
+
}
|
|
5
|
+
export function loadTableState(localStorageKey) {
|
|
6
|
+
try {
|
|
7
|
+
const raw = localStorage.getItem(getStorageKey(localStorageKey));
|
|
8
|
+
if (!raw)
|
|
9
|
+
return null;
|
|
10
|
+
return JSON.parse(raw);
|
|
11
|
+
}
|
|
12
|
+
catch (_a) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function saveTableState(localStorageKey, state) {
|
|
17
|
+
try {
|
|
18
|
+
localStorage.setItem(getStorageKey(localStorageKey), JSON.stringify(state));
|
|
19
|
+
}
|
|
20
|
+
catch (_a) {
|
|
21
|
+
console.warn(`Could not set localStorage value for ${localStorageKey}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function restoreSortStateFromStored(stored, dataRelatedCols) {
|
|
25
|
+
if (!(stored === null || stored === void 0 ? void 0 : stored.length))
|
|
26
|
+
return null;
|
|
27
|
+
const result = [];
|
|
28
|
+
for (const item of stored) {
|
|
29
|
+
const column = dataRelatedCols.find((col) => col.type !== 'selection' &&
|
|
30
|
+
col.type !== 'expand' &&
|
|
31
|
+
'key' in col &&
|
|
32
|
+
col.key === item.columnKey &&
|
|
33
|
+
col.sorter !== undefined);
|
|
34
|
+
if (column === null || column === void 0 ? void 0 : column.sorter) {
|
|
35
|
+
result.push({
|
|
36
|
+
columnKey: item.columnKey,
|
|
37
|
+
order: item.order,
|
|
38
|
+
sorter: column.sorter
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return result.length ? result : null;
|
|
43
|
+
}
|
|
@@ -79,15 +79,49 @@ export function clampValueFollowCSSRules(value, min, max) {
|
|
|
79
79
|
return value;
|
|
80
80
|
}
|
|
81
81
|
export function createCustomWidthStyle(column, resizedWidth) {
|
|
82
|
+
var _a;
|
|
82
83
|
if (resizedWidth !== undefined) {
|
|
84
|
+
const numWidth = depx(resizedWidth);
|
|
85
|
+
const minMaxColumn = column && 'minWidth' in column && 'maxWidth' in column
|
|
86
|
+
? column
|
|
87
|
+
: null;
|
|
88
|
+
const clampedNum = minMaxColumn
|
|
89
|
+
? clampValueFollowCSSRules(numWidth, minMaxColumn.minWidth, minMaxColumn.maxWidth)
|
|
90
|
+
: numWidth;
|
|
91
|
+
const clamped = formatLength(clampedNum);
|
|
83
92
|
return {
|
|
84
|
-
width:
|
|
85
|
-
minWidth:
|
|
86
|
-
maxWidth:
|
|
93
|
+
width: clamped,
|
|
94
|
+
minWidth: clamped,
|
|
95
|
+
maxWidth: clamped
|
|
87
96
|
};
|
|
88
97
|
}
|
|
89
|
-
const
|
|
90
|
-
const
|
|
98
|
+
const explicitNum = (_a = getNumberColWidth(column)) !== null && _a !== void 0 ? _a : undefined;
|
|
99
|
+
const minWidth = column && 'minWidth' in column
|
|
100
|
+
? column.minWidth
|
|
101
|
+
: undefined;
|
|
102
|
+
const maxWidth = column && 'maxWidth' in column
|
|
103
|
+
? column.maxWidth
|
|
104
|
+
: undefined;
|
|
105
|
+
let widthNum = explicitNum;
|
|
106
|
+
if (widthNum === undefined &&
|
|
107
|
+
(minWidth !== undefined || maxWidth !== undefined)) {
|
|
108
|
+
widthNum = clampValueFollowCSSRules(maxWidth !== undefined
|
|
109
|
+
? typeof maxWidth === 'number'
|
|
110
|
+
? maxWidth
|
|
111
|
+
: parseFloat(maxWidth)
|
|
112
|
+
: minWidth !== undefined
|
|
113
|
+
? typeof minWidth === 'number'
|
|
114
|
+
? minWidth
|
|
115
|
+
: parseFloat(minWidth)
|
|
116
|
+
: 0, minWidth, maxWidth);
|
|
117
|
+
}
|
|
118
|
+
else if (widthNum !== undefined &&
|
|
119
|
+
(minWidth !== undefined || maxWidth !== undefined)) {
|
|
120
|
+
widthNum = clampValueFollowCSSRules(widthNum, minWidth, maxWidth);
|
|
121
|
+
}
|
|
122
|
+
const width = widthNum !== undefined
|
|
123
|
+
? formatLength(widthNum)
|
|
124
|
+
: getStringColWidth(column);
|
|
91
125
|
return {
|
|
92
126
|
width,
|
|
93
127
|
minWidth: formatLength(minWidth) || width,
|
|
@@ -749,6 +749,13 @@ declare const dataTableLight: import("../../_mixins").Theme<"DataTable", {
|
|
|
749
749
|
borderFocus: string;
|
|
750
750
|
boxShadowFocus: string;
|
|
751
751
|
loadingColor: string;
|
|
752
|
+
loadingColorSuccess: string;
|
|
753
|
+
borderSuccess: string;
|
|
754
|
+
borderHoverSuccess: string;
|
|
755
|
+
colorFocusSuccess: string;
|
|
756
|
+
borderFocusSuccess: string;
|
|
757
|
+
boxShadowFocusSuccess: string;
|
|
758
|
+
caretColorSuccess: string;
|
|
752
759
|
loadingColorWarning: string;
|
|
753
760
|
borderWarning: string;
|
|
754
761
|
borderHoverWarning: string;
|