@uzum-tech/ui 1.9.1 → 1.10.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 +5316 -804
- package/dist/index.prod.js +12 -3
- package/es/_internal/scrollbar/src/Scrollbar.js +19 -38
- package/es/auto-complete/src/AutoComplete.d.ts +1 -1
- package/es/cascader/src/Cascader.d.ts +1 -1
- package/es/chat/src/ChatListItems.js +16 -1
- package/es/chat/src/ChatParts/MainArea.js +31 -21
- package/es/components.d.ts +2 -0
- package/es/components.js +2 -0
- package/es/config-provider/src/internal-interface.d.ts +4 -0
- package/es/crop/index.d.ts +3 -0
- package/es/crop/index.js +1 -0
- package/es/crop/src/Crop.d.ts +222 -0
- package/es/crop/src/Crop.js +157 -0
- package/es/crop/src/interface.d.ts +6 -0
- package/es/crop/src/interface.js +7 -0
- package/es/crop/src/styles/index.cssr.d.ts +2 -0
- package/es/crop/src/styles/index.cssr.js +333 -0
- package/es/crop/styles/_common.d.ts +4 -0
- package/es/crop/styles/_common.js +3 -0
- package/es/crop/styles/dark.d.ts +3 -0
- package/es/crop/styles/dark.js +9 -0
- package/es/crop/styles/index.d.ts +3 -0
- package/es/crop/styles/index.js +2 -0
- package/es/crop/styles/light.d.ts +14 -0
- package/es/crop/styles/light.js +14 -0
- package/es/date-picker/src/panel/panelMonth.d.ts +1 -1
- package/es/date-picker/src/panel/panelYear.d.ts +1 -1
- package/es/dynamic-tags/src/DynamicTags.d.ts +30 -0
- package/es/dynamic-tags/styles/light.d.ts +3 -0
- package/es/infinite-scroll/src/InfiniteScroll.d.ts +16 -0
- package/es/infinite-scroll/src/InfiniteScroll.js +45 -12
- package/es/input/src/Input.d.ts +1 -1
- package/es/input-number/src/InputNumber.d.ts +1 -1
- package/es/legacy-transfer/src/Transfer.d.ts +1 -1
- package/es/modal-fullscreen/index.d.ts +2 -0
- package/es/modal-fullscreen/index.js +1 -0
- package/es/modal-fullscreen/src/ModalFull.d.ts +953 -0
- package/es/modal-fullscreen/src/ModalFull.js +250 -0
- package/es/modal-fullscreen/src/interface.d.ts +0 -0
- package/es/modal-fullscreen/src/interface.js +1 -0
- package/es/modal-fullscreen/src/styles/index.cssr.d.ts +2 -0
- package/es/modal-fullscreen/src/styles/index.cssr.js +85 -0
- package/es/modal-fullscreen/styles/_common.d.ts +12 -0
- package/es/modal-fullscreen/styles/_common.js +11 -0
- package/es/modal-fullscreen/styles/dark.d.ts +3 -0
- package/es/modal-fullscreen/styles/dark.js +14 -0
- package/es/modal-fullscreen/styles/index.d.ts +3 -0
- package/es/modal-fullscreen/styles/index.js +2 -0
- package/es/modal-fullscreen/styles/light.d.ts +100 -0
- package/es/modal-fullscreen/styles/light.js +19 -0
- package/es/rate/src/Rate.d.ts +1 -1
- package/es/select/src/Select.d.ts +1 -1
- package/es/slider/src/Slider.d.ts +1 -1
- package/es/switch/src/Switch.d.ts +1 -1
- package/es/tag/index.d.ts +2 -0
- package/es/tag/index.js +1 -0
- package/es/tag/src/Tag.d.ts +40 -0
- package/es/tag/src/Tag.js +3 -0
- package/es/tag/src/TagGroup.d.ts +644 -0
- package/es/tag/src/TagGroup.js +109 -0
- package/es/tag/src/styles/index.cssr.d.ts +1 -0
- package/es/tag/src/styles/index.cssr.js +8 -1
- package/es/tag/styles/light.d.ts +3 -0
- package/es/tag/styles/light.js +5 -0
- package/es/themes/dark.js +5 -1
- package/es/themes/light.js +5 -1
- package/es/time-picker/src/TimePicker.d.ts +1 -1
- package/es/transfer/src/Transfer.d.ts +1 -1
- package/es/tree-select/src/TreeSelect.d.ts +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/es/virtual-list/index.d.ts +1 -1
- package/es/virtual-list/index.js +1 -1
- package/lib/_internal/scrollbar/src/Scrollbar.js +19 -38
- package/lib/auto-complete/src/AutoComplete.d.ts +1 -1
- package/lib/cascader/src/Cascader.d.ts +1 -1
- package/lib/chat/src/ChatListItems.js +16 -1
- package/lib/chat/src/ChatParts/MainArea.js +31 -21
- package/lib/components.d.ts +2 -0
- package/lib/components.js +2 -0
- package/lib/config-provider/src/internal-interface.d.ts +4 -0
- package/lib/crop/index.d.ts +3 -0
- package/lib/crop/index.js +9 -0
- package/lib/crop/src/Crop.d.ts +222 -0
- package/lib/crop/src/Crop.js +163 -0
- package/lib/crop/src/interface.d.ts +6 -0
- package/lib/crop/src/interface.js +10 -0
- package/lib/crop/src/styles/index.cssr.d.ts +2 -0
- package/lib/crop/src/styles/index.cssr.js +338 -0
- package/lib/crop/styles/_common.d.ts +4 -0
- package/lib/crop/styles/_common.js +5 -0
- package/lib/crop/styles/dark.d.ts +3 -0
- package/lib/crop/styles/dark.js +11 -0
- package/lib/crop/styles/index.d.ts +3 -0
- package/lib/crop/styles/index.js +10 -0
- package/lib/crop/styles/light.d.ts +14 -0
- package/lib/crop/styles/light.js +21 -0
- package/lib/date-picker/src/panel/panelMonth.d.ts +1 -1
- package/lib/date-picker/src/panel/panelYear.d.ts +1 -1
- package/lib/dynamic-tags/src/DynamicTags.d.ts +30 -0
- package/lib/dynamic-tags/styles/light.d.ts +3 -0
- package/lib/infinite-scroll/src/InfiniteScroll.d.ts +16 -0
- package/lib/infinite-scroll/src/InfiniteScroll.js +44 -11
- package/lib/input/src/Input.d.ts +1 -1
- package/lib/input-number/src/InputNumber.d.ts +1 -1
- package/lib/legacy-transfer/src/Transfer.d.ts +1 -1
- package/lib/modal-fullscreen/index.d.ts +2 -0
- package/lib/modal-fullscreen/index.js +9 -0
- package/lib/modal-fullscreen/src/ModalFull.d.ts +953 -0
- package/lib/modal-fullscreen/src/ModalFull.js +256 -0
- package/lib/modal-fullscreen/src/interface.d.ts +0 -0
- package/lib/modal-fullscreen/src/interface.js +1 -0
- package/lib/modal-fullscreen/src/styles/index.cssr.d.ts +2 -0
- package/lib/modal-fullscreen/src/styles/index.cssr.js +90 -0
- package/lib/modal-fullscreen/styles/_common.d.ts +12 -0
- package/lib/modal-fullscreen/styles/_common.js +13 -0
- package/lib/modal-fullscreen/styles/dark.d.ts +3 -0
- package/lib/modal-fullscreen/styles/dark.js +16 -0
- package/lib/modal-fullscreen/styles/index.d.ts +3 -0
- package/lib/modal-fullscreen/styles/index.js +10 -0
- package/lib/modal-fullscreen/styles/light.d.ts +100 -0
- package/lib/modal-fullscreen/styles/light.js +26 -0
- package/lib/rate/src/Rate.d.ts +1 -1
- package/lib/select/src/Select.d.ts +1 -1
- package/lib/slider/src/Slider.d.ts +1 -1
- package/lib/switch/src/Switch.d.ts +1 -1
- package/lib/tag/index.d.ts +2 -0
- package/lib/tag/index.js +3 -1
- package/lib/tag/src/Tag.d.ts +40 -0
- package/lib/tag/src/Tag.js +3 -0
- package/lib/tag/src/TagGroup.d.ts +644 -0
- package/lib/tag/src/TagGroup.js +112 -0
- package/lib/tag/src/styles/index.cssr.d.ts +1 -0
- package/lib/tag/src/styles/index.cssr.js +9 -1
- package/lib/tag/styles/light.d.ts +3 -0
- package/lib/tag/styles/light.js +5 -0
- package/lib/themes/dark.js +5 -1
- package/lib/themes/light.js +5 -1
- package/lib/time-picker/src/TimePicker.d.ts +1 -1
- package/lib/transfer/src/Transfer.d.ts +1 -1
- package/lib/tree-select/src/TreeSelect.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/virtual-list/index.d.ts +1 -1
- package/lib/virtual-list/index.js +2 -2
- package/package.json +7 -6
- package/volar.d.ts +4 -0
- package/web-types.json +387 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { h, defineComponent, computed, ref, toRef, cloneVNode } from 'vue';
|
|
2
|
+
import { useMergedState } from 'vooks';
|
|
3
|
+
import { useTheme, useConfig, useThemeClass, useRtl } from '../../_mixins';
|
|
4
|
+
import { getSlot, call, flatten, createKey, resolveSize } from '../../_utils';
|
|
5
|
+
import { tagGroupStyle } from './styles/index.cssr';
|
|
6
|
+
import { tagLight } from '../styles';
|
|
7
|
+
function mapSlot(defaultSlot, value, size, disabled, doUpdateValue) {
|
|
8
|
+
var _a;
|
|
9
|
+
const children = [];
|
|
10
|
+
for (let i = 0; i < defaultSlot.length; i++) {
|
|
11
|
+
const wrappedInstance = defaultSlot[i];
|
|
12
|
+
const name = (_a = wrappedInstance.type) === null || _a === void 0 ? void 0 : _a.name;
|
|
13
|
+
if (name !== 'Tag') {
|
|
14
|
+
children.push(wrappedInstance);
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const instanceProps = wrappedInstance.props;
|
|
18
|
+
const instanceValue = instanceProps === null || instanceProps === void 0 ? void 0 : instanceProps.value;
|
|
19
|
+
if (instanceValue !== undefined) {
|
|
20
|
+
const isChecked = value === instanceValue;
|
|
21
|
+
const mergedDisabled = disabled || (instanceProps === null || instanceProps === void 0 ? void 0 : instanceProps.disabled) !== undefined || false;
|
|
22
|
+
const mergedSize = (instanceProps === null || instanceProps === void 0 ? void 0 : instanceProps.size) || size;
|
|
23
|
+
children.push(cloneVNode(wrappedInstance, {
|
|
24
|
+
size: mergedSize,
|
|
25
|
+
disabled: mergedDisabled,
|
|
26
|
+
checkable: true,
|
|
27
|
+
checked: isChecked,
|
|
28
|
+
onUpdateChecked: () => {
|
|
29
|
+
doUpdateValue(instanceValue);
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
children.push(wrappedInstance);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return children;
|
|
38
|
+
}
|
|
39
|
+
export const tagGroupProps = Object.assign(Object.assign({}, useTheme.props), { value: {
|
|
40
|
+
type: [String, Number, Boolean],
|
|
41
|
+
default: undefined
|
|
42
|
+
}, defaultValue: {
|
|
43
|
+
type: [String, Number, Boolean],
|
|
44
|
+
default: null
|
|
45
|
+
}, size: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: 'medium'
|
|
48
|
+
}, gap: [String, Number], disabled: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: undefined
|
|
51
|
+
}, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array] });
|
|
52
|
+
export default defineComponent({
|
|
53
|
+
name: 'TagGroup',
|
|
54
|
+
props: tagGroupProps,
|
|
55
|
+
setup(props) {
|
|
56
|
+
const { mergedClsPrefixRef, inlineThemeDisabled, mergedRtlRef } = useConfig(props);
|
|
57
|
+
const themeRef = useTheme('Tag', '-tag-group', tagGroupStyle, tagLight, props, mergedClsPrefixRef);
|
|
58
|
+
const mergedSizeRef = computed(() => props.size);
|
|
59
|
+
const mergedDisabledRef = computed(() => { var _a; return (_a = props.disabled) !== null && _a !== void 0 ? _a : false; });
|
|
60
|
+
const uncontrolledValueRef = ref(props.defaultValue);
|
|
61
|
+
const controlledValueRef = toRef(props, 'value');
|
|
62
|
+
const mergedValueRef = useMergedState(controlledValueRef, uncontrolledValueRef);
|
|
63
|
+
function doUpdateValue(value) {
|
|
64
|
+
const { onUpdateValue, 'onUpdate:value': _onUpdateValue } = props;
|
|
65
|
+
if (onUpdateValue) {
|
|
66
|
+
call(onUpdateValue, value);
|
|
67
|
+
}
|
|
68
|
+
if (_onUpdateValue) {
|
|
69
|
+
call(_onUpdateValue, value);
|
|
70
|
+
}
|
|
71
|
+
uncontrolledValueRef.value = value;
|
|
72
|
+
}
|
|
73
|
+
const rtlEnabledRef = useRtl('Tag', mergedRtlRef, mergedClsPrefixRef);
|
|
74
|
+
const cssVarsRef = computed(() => {
|
|
75
|
+
const { gap } = props;
|
|
76
|
+
const { common: { cubicBezierEaseInOut }, self: { [createKey('gap', mergedSizeRef.value)]: themeGap } } = themeRef.value;
|
|
77
|
+
const mergedGap = resolveSize(gap, themeGap);
|
|
78
|
+
return {
|
|
79
|
+
'--u-bezier': cubicBezierEaseInOut,
|
|
80
|
+
'--u-gap': mergedGap
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
const themeClassHandle = inlineThemeDisabled
|
|
84
|
+
? useThemeClass('tag-group', computed(() => mergedSizeRef.value[0]), cssVarsRef, props)
|
|
85
|
+
: undefined;
|
|
86
|
+
return {
|
|
87
|
+
rtlEnabled: rtlEnabledRef,
|
|
88
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
89
|
+
mergedValue: mergedValueRef,
|
|
90
|
+
mergedSize: mergedSizeRef,
|
|
91
|
+
mergedDisabled: mergedDisabledRef,
|
|
92
|
+
doUpdateValue,
|
|
93
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
94
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
95
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
render() {
|
|
99
|
+
var _a;
|
|
100
|
+
const { mergedClsPrefix, mergedValue, mergedSize, mergedDisabled } = this;
|
|
101
|
+
const children = mapSlot(flatten(getSlot(this)), mergedValue, mergedSize, mergedDisabled, this.doUpdateValue);
|
|
102
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
103
|
+
return (h("div", { class: [
|
|
104
|
+
`${mergedClsPrefix}-tag-group`,
|
|
105
|
+
this.rtlEnabled && `${mergedClsPrefix}-tag-group--rtl`,
|
|
106
|
+
this.themeClass
|
|
107
|
+
], style: this.cssVars }, children));
|
|
108
|
+
}
|
|
109
|
+
});
|
|
@@ -115,4 +115,11 @@ export default cB('tag', `
|
|
|
115
115
|
background-color: var(--u-color-checkable-outline);
|
|
116
116
|
`, [cE('border', `
|
|
117
117
|
border: var(--u-border);
|
|
118
|
-
`)])]);
|
|
118
|
+
`)])]);
|
|
119
|
+
// vars:
|
|
120
|
+
// --u-gap
|
|
121
|
+
export const tagGroupStyle = cB('tag-group', `
|
|
122
|
+
display: inline-flex;
|
|
123
|
+
flex-wrap: wrap;
|
|
124
|
+
gap: var(--u-gap);
|
|
125
|
+
`);
|
package/es/tag/styles/light.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { ThemeCommonVars } from '../../_styles/common';
|
|
2
2
|
import type { Theme } from '../../_mixins';
|
|
3
3
|
export declare const self: (vars: ThemeCommonVars) => {
|
|
4
|
+
gapSmall: string;
|
|
5
|
+
gapMedium: string;
|
|
6
|
+
gapLarge: string;
|
|
4
7
|
closeIconSizeTiny: string;
|
|
5
8
|
closeIconSizeSmall: string;
|
|
6
9
|
closeIconSizeMedium: string;
|
package/es/tag/styles/light.js
CHANGED
|
@@ -4,6 +4,11 @@ export const self = (vars) => {
|
|
|
4
4
|
const { opacityDisabled, borderRadiusSmall: borderRadius, fontWeightStrong, fontWeight, elementsTertiary, fontBodySmall, fontBodyMedium, textQuaternary, elementsPrimary, elementsSecondary, elementsSenary, elementsQuinary, textPrimary, elementsQuaternary, transparencySecondary, staticDarkGrey, staticWhite, elementsDarkQuinary, staticBlack } = vars;
|
|
5
5
|
const borderTagWidth = 2;
|
|
6
6
|
return {
|
|
7
|
+
// tag-group
|
|
8
|
+
gapSmall: '4px',
|
|
9
|
+
gapMedium: '8px',
|
|
10
|
+
gapLarge: '12px',
|
|
11
|
+
// tag
|
|
7
12
|
closeIconSizeTiny: '16px',
|
|
8
13
|
closeIconSizeSmall: '16px',
|
|
9
14
|
closeIconSizeMedium: '16px',
|
package/es/themes/dark.js
CHANGED
|
@@ -88,6 +88,8 @@ import { flexDark } from '../flex/styles';
|
|
|
88
88
|
import { actionCardDark } from '../action-card/styles';
|
|
89
89
|
import { inputOtpDark } from '../styles';
|
|
90
90
|
import { chatDark } from '../chat/styles';
|
|
91
|
+
import { modalFullscreenDark } from '../modal-fullscreen/styles';
|
|
92
|
+
import { cropDark } from '../crop/styles';
|
|
91
93
|
export const darkTheme = {
|
|
92
94
|
name: 'dark',
|
|
93
95
|
common: commonDark,
|
|
@@ -179,5 +181,7 @@ export const darkTheme = {
|
|
|
179
181
|
Watermark: watermarkDark,
|
|
180
182
|
ToggleButton: toggleButtonDark,
|
|
181
183
|
Flex: flexDark,
|
|
182
|
-
Chat: chatDark
|
|
184
|
+
Chat: chatDark,
|
|
185
|
+
ModalFullscreen: modalFullscreenDark,
|
|
186
|
+
Crop: cropDark
|
|
183
187
|
};
|
package/es/themes/light.js
CHANGED
|
@@ -90,6 +90,8 @@ import { flexLight } from '../flex/styles';
|
|
|
90
90
|
import { actionCardLight } from '../action-card/styles';
|
|
91
91
|
import { inputOtpLight } from '../input-otp/styles';
|
|
92
92
|
import { chatLight } from '../chat/styles';
|
|
93
|
+
import { modalFullscreenLight } from '../modal-fullscreen/styles';
|
|
94
|
+
import { cropLight } from '../crop/styles';
|
|
93
95
|
export const lightTheme = {
|
|
94
96
|
name: 'light',
|
|
95
97
|
common: commonLight,
|
|
@@ -181,5 +183,7 @@ export const lightTheme = {
|
|
|
181
183
|
Watermark: watermarkLight,
|
|
182
184
|
ToggleButton: toggleButtonLight,
|
|
183
185
|
Flex: flexLight,
|
|
184
|
-
Chat: chatLight
|
|
186
|
+
Chat: chatLight,
|
|
187
|
+
ModalFullscreen: modalFullscreenLight,
|
|
188
|
+
Crop: cropLight
|
|
185
189
|
};
|
|
@@ -3538,8 +3538,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3538
3538
|
to: string | boolean | HTMLElement;
|
|
3539
3539
|
show: boolean | undefined;
|
|
3540
3540
|
placement: FollowerPlacement;
|
|
3541
|
-
clearable: boolean;
|
|
3542
3541
|
defaultValue: number | null;
|
|
3542
|
+
clearable: boolean;
|
|
3543
3543
|
stateful: boolean;
|
|
3544
3544
|
use12Hours: boolean;
|
|
3545
3545
|
format: string;
|
|
@@ -4252,8 +4252,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4252
4252
|
readonly filter: Filter;
|
|
4253
4253
|
readonly disabled: boolean | undefined;
|
|
4254
4254
|
readonly virtualScroll: boolean;
|
|
4255
|
-
readonly filterable: boolean;
|
|
4256
4255
|
readonly defaultValue: OptionValue[] | null;
|
|
4256
|
+
readonly filterable: boolean;
|
|
4257
4257
|
readonly options: Option[];
|
|
4258
4258
|
readonly showSelected: boolean;
|
|
4259
4259
|
readonly sourceFilterable: boolean;
|
|
@@ -3077,9 +3077,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3077
3077
|
readonly checkable: boolean;
|
|
3078
3078
|
readonly placement: FollowerPlacement;
|
|
3079
3079
|
readonly defaultShow: boolean;
|
|
3080
|
+
readonly defaultValue: string | number | (string | number)[] | null;
|
|
3080
3081
|
readonly filterable: boolean;
|
|
3081
3082
|
readonly clearable: boolean;
|
|
3082
|
-
readonly defaultValue: string | number | (string | number)[] | null;
|
|
3083
3083
|
readonly options: TreeSelectOption[];
|
|
3084
3084
|
readonly clearFilterAfterSelect: boolean;
|
|
3085
3085
|
readonly consistentMenuWidth: boolean;
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.
|
|
1
|
+
declare const _default: "1.10.1";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.
|
|
1
|
+
export default '1.10.1';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as UVirtualList, virtualListProps } from './src/VirtualList';
|
|
2
2
|
export type { VirtualListInst, VirtualListProps } from './src/VirtualList';
|
package/es/virtual-list/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as UVirtualList, virtualListProps } from './src/VirtualList';
|
|
@@ -111,9 +111,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
113
113
|
const heightDiff = contentHeight - containerHeight;
|
|
114
|
-
if (!heightDiff)
|
|
114
|
+
if (!heightDiff)
|
|
115
115
|
return 0;
|
|
116
|
-
}
|
|
117
116
|
return ((containerScrollTop / heightDiff) * (yRailSize - yBarSizeRef.value));
|
|
118
117
|
}
|
|
119
118
|
});
|
|
@@ -132,9 +131,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
132
131
|
}
|
|
133
132
|
else {
|
|
134
133
|
const widthDiff = contentWidth - containerWidth;
|
|
135
|
-
if (!widthDiff)
|
|
134
|
+
if (!widthDiff)
|
|
136
135
|
return 0;
|
|
137
|
-
}
|
|
138
136
|
return ((containerScrollLeft / widthDiff) * (xRailSize - xBarSizeRef.value));
|
|
139
137
|
}
|
|
140
138
|
});
|
|
@@ -165,22 +163,19 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
165
163
|
});
|
|
166
164
|
const mergedContainerRef = (0, vue_1.computed)(() => {
|
|
167
165
|
const { container } = props;
|
|
168
|
-
if (container)
|
|
166
|
+
if (container)
|
|
169
167
|
return container();
|
|
170
|
-
}
|
|
171
168
|
return containerRef.value;
|
|
172
169
|
});
|
|
173
170
|
const mergedContentRef = (0, vue_1.computed)(() => {
|
|
174
171
|
const { content } = props;
|
|
175
|
-
if (content)
|
|
172
|
+
if (content)
|
|
176
173
|
return content();
|
|
177
|
-
}
|
|
178
174
|
return contentRef.value;
|
|
179
175
|
});
|
|
180
176
|
const scrollTo = (options, y) => {
|
|
181
|
-
if (!props.scrollable)
|
|
177
|
+
if (!props.scrollable)
|
|
182
178
|
return;
|
|
183
|
-
}
|
|
184
179
|
if (typeof options === 'number') {
|
|
185
180
|
scrollToPosition(options, y !== null && y !== void 0 ? y : 0, 0, false, 'auto');
|
|
186
181
|
return;
|
|
@@ -214,15 +209,13 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
214
209
|
});
|
|
215
210
|
// methods
|
|
216
211
|
const handleContentResize = () => {
|
|
217
|
-
if (activateState.isDeactivated)
|
|
212
|
+
if (activateState.isDeactivated)
|
|
218
213
|
return;
|
|
219
|
-
}
|
|
220
214
|
sync();
|
|
221
215
|
};
|
|
222
216
|
const handleContainerResize = (e) => {
|
|
223
|
-
if (activateState.isDeactivated)
|
|
217
|
+
if (activateState.isDeactivated)
|
|
224
218
|
return;
|
|
225
|
-
}
|
|
226
219
|
const { onResize } = props;
|
|
227
220
|
if (onResize) {
|
|
228
221
|
onResize(e);
|
|
@@ -230,13 +223,11 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
230
223
|
sync();
|
|
231
224
|
};
|
|
232
225
|
const scrollBy = (options, y) => {
|
|
233
|
-
if (!props.scrollable)
|
|
226
|
+
if (!props.scrollable)
|
|
234
227
|
return;
|
|
235
|
-
}
|
|
236
228
|
const { value: container } = mergedContainerRef;
|
|
237
|
-
if (!container)
|
|
229
|
+
if (!container)
|
|
238
230
|
return;
|
|
239
|
-
}
|
|
240
231
|
if (typeof options === 'object') {
|
|
241
232
|
container.scrollBy(options);
|
|
242
233
|
}
|
|
@@ -246,9 +237,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
246
237
|
};
|
|
247
238
|
function scrollToPosition(left, top, elSize, debounce, behavior) {
|
|
248
239
|
const { value: container } = mergedContainerRef;
|
|
249
|
-
if (!container)
|
|
240
|
+
if (!container)
|
|
250
241
|
return;
|
|
251
|
-
}
|
|
252
242
|
if (debounce) {
|
|
253
243
|
const { scrollTop, offsetHeight } = container;
|
|
254
244
|
if (top > scrollTop) {
|
|
@@ -313,9 +303,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
313
303
|
}
|
|
314
304
|
function handleScroll(e) {
|
|
315
305
|
const { onScroll } = props;
|
|
316
|
-
if (onScroll)
|
|
306
|
+
if (onScroll)
|
|
317
307
|
onScroll(e);
|
|
318
|
-
}
|
|
319
308
|
syncScrollState();
|
|
320
309
|
}
|
|
321
310
|
function syncScrollState() {
|
|
@@ -374,9 +363,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
374
363
|
}
|
|
375
364
|
}
|
|
376
365
|
function sync() {
|
|
377
|
-
if (!props.scrollable)
|
|
366
|
+
if (!props.scrollable)
|
|
378
367
|
return;
|
|
379
|
-
}
|
|
380
368
|
if (props.useUnifiedContainer) {
|
|
381
369
|
syncUnifiedContainer();
|
|
382
370
|
}
|
|
@@ -401,9 +389,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
401
389
|
: e.clientX;
|
|
402
390
|
}
|
|
403
391
|
function handleXScrollMouseMove(e) {
|
|
404
|
-
if (!xBarPressed)
|
|
392
|
+
if (!xBarPressed)
|
|
405
393
|
return;
|
|
406
|
-
}
|
|
407
394
|
if (xBarVanishTimerId !== undefined) {
|
|
408
395
|
window.clearTimeout(xBarVanishTimerId);
|
|
409
396
|
}
|
|
@@ -413,9 +400,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
413
400
|
const { value: containerWidth } = containerWidthRef;
|
|
414
401
|
const { value: contentWidth } = contentWidthRef;
|
|
415
402
|
const { value: xBarSize } = xBarSizeRef;
|
|
416
|
-
if (containerWidth === null || contentWidth === null)
|
|
403
|
+
if (containerWidth === null || contentWidth === null)
|
|
417
404
|
return;
|
|
418
|
-
}
|
|
419
405
|
const dX = (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value)
|
|
420
406
|
? window.innerWidth - e.clientX - memoMouseX
|
|
421
407
|
: e.clientX - memoMouseX;
|
|
@@ -428,9 +414,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
428
414
|
if (container) {
|
|
429
415
|
container.scrollLeft = toScrollLeft * ((rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? -1 : 1);
|
|
430
416
|
const { internalOnUpdateScrollLeft } = props;
|
|
431
|
-
if (internalOnUpdateScrollLeft)
|
|
417
|
+
if (internalOnUpdateScrollLeft)
|
|
432
418
|
internalOnUpdateScrollLeft(toScrollLeft);
|
|
433
|
-
}
|
|
434
419
|
}
|
|
435
420
|
}
|
|
436
421
|
function handleXScrollMouseUp(e) {
|
|
@@ -454,9 +439,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
454
439
|
memoMouseY = e.clientY;
|
|
455
440
|
}
|
|
456
441
|
function handleYScrollMouseMove(e) {
|
|
457
|
-
if (!yBarPressed)
|
|
442
|
+
if (!yBarPressed)
|
|
458
443
|
return;
|
|
459
|
-
}
|
|
460
444
|
if (xBarVanishTimerId !== undefined) {
|
|
461
445
|
window.clearTimeout(xBarVanishTimerId);
|
|
462
446
|
}
|
|
@@ -466,9 +450,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
466
450
|
const { value: containerHeight } = containerHeightRef;
|
|
467
451
|
const { value: contentHeight } = contentHeightRef;
|
|
468
452
|
const { value: yBarSize } = yBarSizeRef;
|
|
469
|
-
if (containerHeight === null || contentHeight === null)
|
|
453
|
+
if (containerHeight === null || contentHeight === null)
|
|
470
454
|
return;
|
|
471
|
-
}
|
|
472
455
|
const dY = e.clientY - memoMouseY;
|
|
473
456
|
const dScrollTop = (dY * (contentHeight - containerHeight)) / (containerHeight - yBarSize);
|
|
474
457
|
const toScrollTopUpperBound = contentHeight - containerHeight;
|
|
@@ -523,9 +506,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
523
506
|
// if you pass inner to scrollbar, you may use a ref inside component
|
|
524
507
|
// however, when scrollbar is mounted, ref is not ready at component
|
|
525
508
|
// you need to init by yourself
|
|
526
|
-
if (props.container)
|
|
509
|
+
if (props.container)
|
|
527
510
|
return;
|
|
528
|
-
}
|
|
529
511
|
sync();
|
|
530
512
|
});
|
|
531
513
|
(0, vue_1.onBeforeUnmount)(() => {
|
|
@@ -599,9 +581,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
|
|
|
599
581
|
render() {
|
|
600
582
|
var _a;
|
|
601
583
|
const { $slots, mergedClsPrefix, triggerDisplayManually, rtlEnabled, internalHoistYRail, yPlacement, xPlacement, xScrollable } = this;
|
|
602
|
-
if (!this.scrollable)
|
|
584
|
+
if (!this.scrollable)
|
|
603
585
|
return (_a = $slots.default) === null || _a === void 0 ? void 0 : _a.call($slots);
|
|
604
|
-
}
|
|
605
586
|
const triggerIsNone = this.trigger === 'none';
|
|
606
587
|
const createYRail = (className, style) => {
|
|
607
588
|
return ((0, vue_1.h)("div", { ref: "yRailRef", class: [
|
|
@@ -1610,8 +1610,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1610
1610
|
readonly to: string | boolean | HTMLElement;
|
|
1611
1611
|
readonly resetMenuOnOptionsChange: boolean;
|
|
1612
1612
|
readonly placement: FollowerPlacement;
|
|
1613
|
-
readonly clearable: boolean;
|
|
1614
1613
|
readonly defaultValue: string | null;
|
|
1614
|
+
readonly clearable: boolean;
|
|
1615
1615
|
readonly options: AutoCompleteOptions;
|
|
1616
1616
|
readonly blurAfterSelect: boolean;
|
|
1617
1617
|
readonly clearAfterSelect: boolean;
|
|
@@ -3364,9 +3364,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3364
3364
|
readonly virtualScroll: boolean;
|
|
3365
3365
|
readonly valueField: string;
|
|
3366
3366
|
readonly placement: FollowerPlacement;
|
|
3367
|
+
readonly defaultValue: Value | null;
|
|
3367
3368
|
readonly filterable: boolean;
|
|
3368
3369
|
readonly clearable: boolean;
|
|
3369
|
-
readonly defaultValue: Value | null;
|
|
3370
3370
|
readonly options: CascaderOption[];
|
|
3371
3371
|
readonly clearFilterAfterSelect: boolean;
|
|
3372
3372
|
readonly remote: boolean;
|
|
@@ -96,11 +96,26 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
96
96
|
var _a;
|
|
97
97
|
(_a = props.onChatSelect) === null || _a === void 0 ? void 0 : _a.call(props, chatId);
|
|
98
98
|
};
|
|
99
|
+
const toKeyString = (value) => {
|
|
100
|
+
if (typeof value === 'symbol')
|
|
101
|
+
return value.toString();
|
|
102
|
+
if (typeof value === 'function') {
|
|
103
|
+
const result = value();
|
|
104
|
+
return typeof result === 'string' || typeof result === 'number'
|
|
105
|
+
? String(result)
|
|
106
|
+
: '';
|
|
107
|
+
}
|
|
108
|
+
return value != null ? String(value) : '';
|
|
109
|
+
};
|
|
99
110
|
const renderChatItem = (item) => {
|
|
100
111
|
var _a, _b;
|
|
101
112
|
const isSelected = props.selectedChatId === item.id;
|
|
102
113
|
const isTyping = (_b = (_a = props.typingChatIds) === null || _a === void 0 ? void 0 : _a.includes(item.id)) !== null && _b !== void 0 ? _b : false;
|
|
103
|
-
|
|
114
|
+
const { id, title, subtitle } = item;
|
|
115
|
+
const keyId = toKeyString(id);
|
|
116
|
+
const keyTitle = toKeyString(title);
|
|
117
|
+
const keySubtitle = toKeyString(subtitle);
|
|
118
|
+
return ((0, vue_1.h)(list_1.UListItem, { key: `${keyId}-${keyTitle}-${keySubtitle}`, showIcon: false, onClick: () => {
|
|
104
119
|
handleChatSelect(item.id);
|
|
105
120
|
}, class: [
|
|
106
121
|
`${mergedClsPrefixRef.value}-chat-sidebar__item`,
|
|
@@ -158,22 +158,36 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
158
158
|
el.scrollTop = el.scrollHeight;
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
|
+
const toKeyString = (value) => {
|
|
162
|
+
if (typeof value === 'symbol')
|
|
163
|
+
return value.toString();
|
|
164
|
+
if (typeof value === 'function') {
|
|
165
|
+
const result = value();
|
|
166
|
+
return typeof result === 'string' || typeof result === 'number'
|
|
167
|
+
? String(result)
|
|
168
|
+
: '';
|
|
169
|
+
}
|
|
170
|
+
return value != null ? String(value) : '';
|
|
171
|
+
};
|
|
161
172
|
const renderHeader = () => {
|
|
162
173
|
return ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__header` },
|
|
163
174
|
(0, vue_1.h)(flex_1.UFlex, { justify: "space-between", align: "flex-start", wrap: false }, {
|
|
164
|
-
default: () =>
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
(0, vue_1.h)(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
default: () => {
|
|
176
|
+
const chat = selectedChatRef.value;
|
|
177
|
+
const keyId = toKeyString(chat === null || chat === void 0 ? void 0 : chat.id);
|
|
178
|
+
const keyTitle = toKeyString(chat === null || chat === void 0 ? void 0 : chat.title);
|
|
179
|
+
return ((0, vue_1.h)(vue_1.Fragment, null,
|
|
180
|
+
(0, vue_1.h)(typography_1.UText, { key: `${keyId}-${keyTitle}`, variant: "heading-s-bold", class: `${mergedClsPrefixRef.value}-chat-main__header-title`, theme: mergedThemeRef.value.peers.Typography, themeOverrides: mergedThemeRef.value.peerOverrides.Typography }, {
|
|
181
|
+
default: () => { var _a, _b; return (_b = (_a = selectedChatRef.value) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : ''; }
|
|
182
|
+
}),
|
|
183
|
+
(0, vue_1.h)(flex_1.UFlex, { align: "center", size: "small", class: `${mergedClsPrefixRef.value}-chat-main__header-actions` }, {
|
|
184
|
+
default: () => (0, _utils_1.resolveSlot)(slots.headerActions, () => {
|
|
185
|
+
const shareButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerShareButtonPropsRef.value);
|
|
186
|
+
const profileButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerProfileButtonPropsRef.value);
|
|
187
|
+
const closeButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerCloseButtonPropsRef.value);
|
|
188
|
+
const shareIconProps = Object.assign(Object.assign({}, headerIconPropsRef.value), headerShareIconPropsRef.value);
|
|
189
|
+
const profileIconProps = Object.assign(Object.assign({}, headerIconPropsRef.value), headerProfileIconPropsRef.value);
|
|
190
|
+
const buttons = [];
|
|
177
191
|
buttons.push((0, vue_1.h)(tooltip_1.UTooltip, null, {
|
|
178
192
|
trigger: () => ((0, vue_1.h)(button_1.UButton, Object.assign({ secondary: true, circle: true, size: "large" }, shareButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
179
193
|
.Button, onClick: () => { var _a; return (_a = onChatShare === null || onChatShare === void 0 ? void 0 : onChatShare.value) === null || _a === void 0 ? void 0 : _a.call(onChatShare); } }), {
|
|
@@ -184,8 +198,6 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
184
198
|
})),
|
|
185
199
|
default: () => shareButtonTooltipRef.value
|
|
186
200
|
}));
|
|
187
|
-
}
|
|
188
|
-
if (profileButtonProps.disabled !== true) {
|
|
189
201
|
buttons.push((0, vue_1.h)(tooltip_1.UTooltip, null, {
|
|
190
202
|
trigger: () => ((0, vue_1.h)(button_1.UButton, Object.assign({ secondary: true, circle: true, size: "large" }, profileButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
191
203
|
.Button, onClick: () => { var _a; return (_a = onUserProfile === null || onUserProfile === void 0 ? void 0 : onUserProfile.value) === null || _a === void 0 ? void 0 : _a.call(onUserProfile); } }), {
|
|
@@ -196,15 +208,13 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
196
208
|
})),
|
|
197
209
|
default: () => profileButtonTooltipRef.value
|
|
198
210
|
}));
|
|
199
|
-
}
|
|
200
|
-
if (closeButtonProps.disabled !== true) {
|
|
201
211
|
buttons.push((0, vue_1.h)(button_1.UButton, Object.assign({ type: "primary", size: "large", round: true }, closeButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides.Button, onClick: () => { var _a; return (_a = onChatClose === null || onChatClose === void 0 ? void 0 : onChatClose.value) === null || _a === void 0 ? void 0 : _a.call(onChatClose); } }), {
|
|
202
212
|
default: () => closeButtonTextRef.value
|
|
203
213
|
}));
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
})
|
|
207
|
-
|
|
214
|
+
return buttons;
|
|
215
|
+
})
|
|
216
|
+
})));
|
|
217
|
+
}
|
|
208
218
|
})));
|
|
209
219
|
};
|
|
210
220
|
const renderMessages = () => {
|
package/lib/components.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export * from './menu';
|
|
|
57
57
|
export * from './mention';
|
|
58
58
|
export * from './message';
|
|
59
59
|
export * from './modal';
|
|
60
|
+
export * from './modal-fullscreen';
|
|
60
61
|
export * from './notification';
|
|
61
62
|
export * from './page-header';
|
|
62
63
|
export * from './pagination';
|
|
@@ -96,3 +97,4 @@ export * from './discrete';
|
|
|
96
97
|
export * from './equation';
|
|
97
98
|
export * from './toggle-button';
|
|
98
99
|
export * from './flex';
|
|
100
|
+
export * from './crop';
|
package/lib/components.js
CHANGED
|
@@ -73,6 +73,7 @@ __exportStar(require("./menu"), exports);
|
|
|
73
73
|
__exportStar(require("./mention"), exports);
|
|
74
74
|
__exportStar(require("./message"), exports);
|
|
75
75
|
__exportStar(require("./modal"), exports);
|
|
76
|
+
__exportStar(require("./modal-fullscreen"), exports);
|
|
76
77
|
__exportStar(require("./notification"), exports);
|
|
77
78
|
__exportStar(require("./page-header"), exports);
|
|
78
79
|
__exportStar(require("./pagination"), exports);
|
|
@@ -112,3 +113,4 @@ __exportStar(require("./discrete"), exports);
|
|
|
112
113
|
__exportStar(require("./equation"), exports);
|
|
113
114
|
__exportStar(require("./toggle-button"), exports);
|
|
114
115
|
__exportStar(require("./flex"), exports);
|
|
116
|
+
__exportStar(require("./crop"), exports);
|
|
@@ -102,6 +102,8 @@ import type { FlexTheme } from '../../flex/styles';
|
|
|
102
102
|
import { CardListTheme } from '../../card-list/styles';
|
|
103
103
|
import { ActionCardTheme } from '../../action-card';
|
|
104
104
|
import { ChatTheme } from '../../chat/styles';
|
|
105
|
+
import { ModalFullscreenTheme } from '../../modal-fullscreen/styles';
|
|
106
|
+
import { CropTheme } from '../../crop/styles';
|
|
105
107
|
export interface GlobalThemeWithoutCommon {
|
|
106
108
|
Alert?: AlertTheme;
|
|
107
109
|
Anchor?: AnchorTheme;
|
|
@@ -190,6 +192,8 @@ export interface GlobalThemeWithoutCommon {
|
|
|
190
192
|
Flex?: FlexTheme;
|
|
191
193
|
CardList?: CardListTheme;
|
|
192
194
|
Chat?: ChatTheme;
|
|
195
|
+
ModalFullscreen?: ModalFullscreenTheme;
|
|
196
|
+
Crop?: CropTheme;
|
|
193
197
|
InternalSelectMenu?: InternalSelectMenuTheme;
|
|
194
198
|
InternalSelection?: InternalSelectionTheme;
|
|
195
199
|
AccountOption?: AccountOptionTheme;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cropProps = exports.UCrop = void 0;
|
|
7
|
+
var Crop_1 = require("./src/Crop");
|
|
8
|
+
Object.defineProperty(exports, "UCrop", { enumerable: true, get: function () { return __importDefault(Crop_1).default; } });
|
|
9
|
+
Object.defineProperty(exports, "cropProps", { enumerable: true, get: function () { return Crop_1.cropProps; } });
|