@uzum-tech/ui 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/index.js +1333 -869
- package/dist/index.prod.js +3 -3
- package/es/_internal/checkbox/src/use-checkbox.js +3 -3
- package/es/_internal/radio/src/use-radio.js +3 -3
- package/es/_internal/typography/src/styles/text.cssr.js +0 -1
- package/es/_internal/typography/styles/light.js +1 -1
- package/es/_mixins/use-form-item.d.ts +4 -4
- package/es/_mixins/use-form-item.js +4 -4
- package/es/_styles/common/dark.js +1 -1
- package/es/_styles/common/light.d.ts +3 -0
- package/es/_styles/common/light.js +1 -1
- package/es/_utils/composable/composables.d.ts +11 -0
- package/es/_utils/composable/composables.js +40 -0
- package/es/_utils/index.d.ts +1 -1
- package/es/_utils/index.js +1 -1
- package/es/_utils/uzum/index.d.ts +1 -0
- package/es/_utils/uzum/index.js +1 -0
- package/es/_utils/uzum/value.d.ts +1 -0
- package/es/_utils/uzum/value.js +9 -0
- package/es/_utils/vue/resolve-slot.d.ts +1 -1
- package/es/alert/styles/light.js +6 -6
- package/es/auto-complete/src/AutoComplete.js +10 -10
- package/es/avatar/src/Avatar.d.ts +6 -0
- package/es/avatar/src/Avatar.js +9 -3
- package/es/card-list/src/CardList.js +1 -1
- package/es/card-list/src/CardListItem.d.ts +13 -0
- package/es/card-list/src/CardListItem.js +11 -4
- package/es/card-list/src/interface.d.ts +1 -0
- package/es/card-list/src/styles/index.cssr.js +6 -6
- package/es/card-list/styles/light.js +2 -2
- package/es/cascader/src/Cascader.js +7 -7
- package/es/checkbox/src/CheckboxGroup.js +9 -9
- package/es/color-picker/src/ColorPicker.js +6 -6
- package/es/components.d.ts +1 -0
- package/es/components.js +1 -0
- package/es/config-provider/src/internal-interface.d.ts +2 -0
- package/es/data-table/src/DataTable.d.ts +8 -0
- package/es/data-table/src/DataTable.js +21 -10
- package/es/data-table/src/TableParts/Body.d.ts +1 -0
- package/es/data-table/src/TableParts/Body.js +6 -5
- package/es/data-table/src/TableParts/Cell.js +85 -23
- package/es/data-table/src/interface.d.ts +13 -6
- package/es/data-table/src/interface.js +1 -1
- package/es/data-table/src/styles/index.cssr.js +5 -3
- package/es/data-table/src/use-mask.d.ts +3 -6
- package/es/data-table/src/utils.d.ts +2 -1
- package/es/data-table/src/utils.js +13 -0
- package/es/date-picker/src/DatePicker.js +7 -7
- package/es/dialog/src/DialogProvider.d.ts +6 -0
- package/es/dynamic-tags/src/DynamicTags.js +3 -3
- package/es/input/src/Input.js +8 -8
- package/es/input-number/src/InputNumber.js +7 -7
- package/es/input-otp/index.d.ts +3 -0
- package/es/input-otp/index.js +1 -0
- package/es/input-otp/src/InputOtp.d.ts +871 -0
- package/es/input-otp/src/InputOtp.js +250 -0
- package/es/input-otp/src/public-types.d.ts +25 -0
- package/es/input-otp/src/public-types.js +1 -0
- package/es/input-otp/src/styles/index.cssr.d.ts +2 -0
- package/es/input-otp/src/styles/index.cssr.js +20 -0
- package/es/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
- package/es/input-otp/src/styles/input-otp-rtl.cssr.js +5 -0
- package/es/input-otp/styles/dark.d.ts +3 -0
- package/es/input-otp/styles/dark.js +12 -0
- package/es/input-otp/styles/index.d.ts +4 -0
- package/es/input-otp/styles/index.js +3 -0
- package/es/input-otp/styles/light.d.ts +83 -0
- package/es/input-otp/styles/light.js +22 -0
- package/es/input-otp/styles/rtl.d.ts +2 -0
- package/es/input-otp/styles/rtl.js +5 -0
- package/es/legacy-transfer/src/Transfer.js +3 -3
- package/es/list/src/List.d.ts +41 -55
- package/es/list/src/List.js +6 -10
- package/es/list/src/ListItem.d.ts +84 -25
- package/es/list/src/ListItem.js +120 -98
- package/es/list/src/interface.d.ts +1 -0
- package/es/list/src/props.d.ts +70 -31
- package/es/list/src/props.js +25 -5
- package/es/list/src/styles/index.cssr.js +32 -90
- package/es/list/styles/light.d.ts +5 -8
- package/es/list/styles/light.js +6 -9
- package/es/mention/src/Mention.js +7 -7
- package/es/radio/src/RadioGroup.js +5 -5
- package/es/rate/src/Rate.js +3 -3
- package/es/select/src/Select.js +7 -7
- package/es/slider/src/Slider.js +3 -3
- package/es/styles.d.ts +1 -0
- package/es/styles.js +1 -0
- package/es/switch/src/Switch.js +7 -7
- package/es/tag/src/styles/index.cssr.js +5 -1
- package/es/tag/styles/light.js +2 -2
- package/es/theme-editor/src/ThemeEditor.d.ts +3 -0
- package/es/themes/dark.js +2 -0
- package/es/themes/light.js +2 -0
- package/es/time-picker/src/TimePicker.js +7 -7
- package/es/transfer/src/Transfer.js +3 -3
- package/es/tree-select/src/TreeSelect.js +5 -5
- package/es/upload/src/UploadFile.js +4 -3
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/checkbox/src/use-checkbox.js +3 -3
- package/lib/_internal/radio/src/use-radio.js +3 -3
- package/lib/_internal/typography/src/styles/text.cssr.js +0 -1
- package/lib/_internal/typography/styles/light.js +1 -1
- package/lib/_mixins/use-form-item.d.ts +4 -4
- package/lib/_mixins/use-form-item.js +4 -4
- package/lib/_styles/common/dark.js +1 -1
- package/lib/_styles/common/light.d.ts +3 -0
- package/lib/_styles/common/light.js +1 -1
- package/lib/_utils/composable/composables.d.ts +11 -0
- package/lib/_utils/composable/composables.js +47 -0
- package/lib/_utils/index.d.ts +1 -1
- package/lib/_utils/index.js +2 -1
- package/lib/_utils/uzum/index.d.ts +1 -0
- package/lib/_utils/uzum/index.js +3 -1
- package/lib/_utils/uzum/value.d.ts +1 -0
- package/lib/_utils/uzum/value.js +12 -0
- package/lib/_utils/vue/resolve-slot.d.ts +1 -1
- package/lib/alert/styles/light.js +6 -6
- package/lib/auto-complete/src/AutoComplete.js +10 -10
- package/lib/avatar/src/Avatar.d.ts +6 -0
- package/lib/avatar/src/Avatar.js +9 -3
- package/lib/card-list/src/CardList.js +1 -1
- package/lib/card-list/src/CardListItem.d.ts +13 -0
- package/lib/card-list/src/CardListItem.js +11 -4
- package/lib/card-list/src/interface.d.ts +1 -0
- package/lib/card-list/src/styles/index.cssr.js +5 -5
- package/lib/card-list/styles/light.js +2 -2
- package/lib/cascader/src/Cascader.js +7 -7
- package/lib/checkbox/src/CheckboxGroup.js +9 -9
- package/lib/color-picker/src/ColorPicker.js +6 -6
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -0
- package/lib/config-provider/src/internal-interface.d.ts +2 -0
- package/lib/data-table/src/DataTable.d.ts +8 -0
- package/lib/data-table/src/DataTable.js +21 -10
- package/lib/data-table/src/TableParts/Body.d.ts +1 -0
- package/lib/data-table/src/TableParts/Body.js +6 -5
- package/lib/data-table/src/TableParts/Cell.js +84 -22
- package/lib/data-table/src/interface.d.ts +13 -6
- package/lib/data-table/src/interface.js +1 -1
- package/lib/data-table/src/styles/index.cssr.js +5 -3
- package/lib/data-table/src/use-mask.d.ts +3 -6
- package/lib/data-table/src/utils.d.ts +2 -1
- package/lib/data-table/src/utils.js +14 -1
- package/lib/date-picker/src/DatePicker.js +7 -7
- package/lib/dialog/src/DialogProvider.d.ts +6 -0
- package/lib/dynamic-tags/src/DynamicTags.js +3 -3
- package/lib/input/src/Input.js +8 -8
- package/lib/input-number/src/InputNumber.js +7 -7
- package/lib/input-otp/index.d.ts +3 -0
- package/lib/input-otp/index.js +9 -0
- package/lib/input-otp/src/InputOtp.d.ts +871 -0
- package/lib/input-otp/src/InputOtp.js +256 -0
- package/lib/input-otp/src/public-types.d.ts +25 -0
- package/lib/input-otp/src/public-types.js +2 -0
- package/lib/input-otp/src/styles/index.cssr.d.ts +2 -0
- package/lib/input-otp/src/styles/index.cssr.js +25 -0
- package/lib/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
- package/lib/input-otp/src/styles/input-otp-rtl.cssr.js +10 -0
- package/lib/input-otp/styles/dark.d.ts +3 -0
- package/lib/input-otp/styles/dark.js +14 -0
- package/lib/input-otp/styles/index.d.ts +4 -0
- package/lib/input-otp/styles/index.js +12 -0
- package/lib/input-otp/styles/light.d.ts +83 -0
- package/lib/input-otp/styles/light.js +25 -0
- package/lib/input-otp/styles/rtl.d.ts +2 -0
- package/lib/input-otp/styles/rtl.js +11 -0
- package/lib/legacy-transfer/src/Transfer.js +3 -3
- package/lib/list/src/List.d.ts +41 -55
- package/lib/list/src/List.js +6 -10
- package/lib/list/src/ListItem.d.ts +84 -25
- package/lib/list/src/ListItem.js +119 -97
- package/lib/list/src/interface.d.ts +1 -0
- package/lib/list/src/props.d.ts +70 -31
- package/lib/list/src/props.js +25 -5
- package/lib/list/src/styles/index.cssr.js +32 -90
- package/lib/list/styles/light.d.ts +5 -8
- package/lib/list/styles/light.js +6 -9
- package/lib/mention/src/Mention.js +7 -7
- package/lib/radio/src/RadioGroup.js +5 -5
- package/lib/rate/src/Rate.js +3 -3
- package/lib/select/src/Select.js +7 -7
- package/lib/slider/src/Slider.js +3 -3
- package/lib/styles.d.ts +1 -0
- package/lib/styles.js +106 -103
- package/lib/switch/src/Switch.js +7 -7
- package/lib/tag/src/styles/index.cssr.js +5 -1
- package/lib/tag/styles/light.js +2 -2
- package/lib/theme-editor/src/ThemeEditor.d.ts +3 -0
- package/lib/themes/dark.js +2 -0
- package/lib/themes/light.js +2 -0
- package/lib/time-picker/src/TimePicker.js +7 -7
- package/lib/transfer/src/Transfer.js +3 -3
- package/lib/tree-select/src/TreeSelect.js +5 -5
- package/lib/upload/src/UploadFile.js +4 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/volar.d.ts +1 -0
- package/web-types.json +180 -38
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.5.
|
|
1
|
+
declare const _default: "1.5.3";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.5.
|
|
1
|
+
export default '1.5.3';
|
|
@@ -103,7 +103,7 @@ const useCheckbox = (props) => {
|
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
105
105
|
const { onChange, 'onUpdate:checked': _onUpdateCheck, onUpdateChecked } = props;
|
|
106
|
-
const {
|
|
106
|
+
const { triggerFormInput, triggerFormChange } = formItem;
|
|
107
107
|
const nextChecked = renderedCheckedRef.value
|
|
108
108
|
? props.uncheckedValue
|
|
109
109
|
: props.checkedValue;
|
|
@@ -115,8 +115,8 @@ const useCheckbox = (props) => {
|
|
|
115
115
|
}
|
|
116
116
|
if (onChange)
|
|
117
117
|
(0, _utils_1.call)(onChange, nextChecked, e); // deprecated
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
triggerFormInput();
|
|
119
|
+
triggerFormChange();
|
|
120
120
|
uncontrolledCheckedRef.value = nextChecked;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
@@ -88,15 +88,15 @@ function useRadio(props) {
|
|
|
88
88
|
}
|
|
89
89
|
else {
|
|
90
90
|
const { onUpdateChecked, 'onUpdate:checked': _onUpdateChecked, onChange } = props;
|
|
91
|
-
const {
|
|
91
|
+
const { triggerFormInput, triggerFormChange } = formItem;
|
|
92
92
|
if (onUpdateChecked)
|
|
93
93
|
(0, _utils_1.call)(onUpdateChecked, true);
|
|
94
94
|
if (_onUpdateChecked)
|
|
95
95
|
(0, _utils_1.call)(_onUpdateChecked, true);
|
|
96
96
|
if (onChange)
|
|
97
97
|
onChange(e);
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
triggerFormInput();
|
|
99
|
+
triggerFormChange();
|
|
100
100
|
uncontrolledCheckedRef.value = true;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -76,7 +76,6 @@ exports.default = (0, cssr_1.cB)('text', `
|
|
|
76
76
|
`), (0, cssr_1.c)('p&', `
|
|
77
77
|
box-sizing: border-box;
|
|
78
78
|
transition: color .3s var(--u-bezier);
|
|
79
|
-
margin: var(--u-margin);
|
|
80
79
|
font-size: var(--u-font-size);
|
|
81
80
|
line-height: var(--u-line-height);
|
|
82
81
|
color: var(--u-text-color);
|
|
@@ -5,7 +5,7 @@ const styles_1 = require("../../../styles");
|
|
|
5
5
|
const self = (vars) => {
|
|
6
6
|
const { borderRadiusSmall, brandPrimary500, elementsQuaternary, textPrimary, brandQuaternary500, staticRed, staticOrange, staticGreen, elementsTertiary, fontBodyMedium, lineHeightBodyMedium, codeBorder } = vars;
|
|
7
7
|
return {
|
|
8
|
-
margin: '
|
|
8
|
+
margin: '0px',
|
|
9
9
|
aTextColor: brandPrimary500,
|
|
10
10
|
blockquoteTextColor: textPrimary,
|
|
11
11
|
blockquotePrefixColor: elementsQuaternary,
|
|
@@ -28,10 +28,10 @@ export interface UseFormItem<T> {
|
|
|
28
28
|
mergedSizeRef: ComputedRef<T>;
|
|
29
29
|
mergedDisabledRef: ComputedRef<boolean>;
|
|
30
30
|
mergedStatusRef: ComputedRef<FormValidationStatus | undefined>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
triggerFormBlur: () => void;
|
|
32
|
+
triggerFormChange: () => void;
|
|
33
|
+
triggerFormFocus: () => void;
|
|
34
|
+
triggerFormInput: () => void;
|
|
35
35
|
}
|
|
36
36
|
export default function useFormItem<T extends AllowedSize = FormItemSize>(props: UseFormItemProps<T>, { defaultSize, mergedSize, mergedDisabled }?: UseFormItemOptions<T>): UseFormItem<T>;
|
|
37
37
|
export {};
|
|
@@ -49,22 +49,22 @@ function useFormItem(props, { defaultSize = 'medium', mergedSize, mergedDisabled
|
|
|
49
49
|
mergedSizeRef,
|
|
50
50
|
mergedDisabledRef,
|
|
51
51
|
mergedStatusRef,
|
|
52
|
-
|
|
52
|
+
triggerFormBlur() {
|
|
53
53
|
if (UFormItem) {
|
|
54
54
|
UFormItem.handleContentBlur();
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
-
|
|
57
|
+
triggerFormChange() {
|
|
58
58
|
if (UFormItem) {
|
|
59
59
|
UFormItem.handleContentChange();
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
|
|
62
|
+
triggerFormFocus() {
|
|
63
63
|
if (UFormItem) {
|
|
64
64
|
UFormItem.handleContentFocus();
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
|
|
67
|
+
triggerFormInput() {
|
|
68
68
|
if (UFormItem) {
|
|
69
69
|
UFormItem.handleContentInput();
|
|
70
70
|
}
|
|
@@ -4,6 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const _common_1 = __importDefault(require("./_common"));
|
|
7
|
-
const derived = Object.assign(Object.assign({ name: 'common' }, _common_1.default), { scrollbarColor: 'rgba(255, 255, 255, 0.25)', scrollbarColorHover: 'rgba(255, 255, 255, 0.4)', scrollbarWidth: '5px', scrollbarHeight: '5px', scrollbarBorderRadius: '5px', opacityDisabled: '0.5', brandPrimary50: '#2B204E', brandPrimary100: '#412A89', brandPrimary200: '#6A40ED', brandPrimary300: '#BBA2FD', brandPrimary400: '#7748F1', brandPrimary500: '#8967F1', brandPrimary550: '#6607DF', brandPrimary600: '#5D46A6', brandSecondary500: '#FFFF54', brandSecondary300: '#FDF5A6', brandSecondary600: '#F9DE6D', brandTertiary500: '#C4ED70', brandTertiary300: '#DCF0AF', brandTertiary600: '#9DED70', brandQuaternary500: '#90DDFB', brandQuaternary300: '#C5ECFD', brandQuaternary600: '#54B8F9', brandQuinary500: '#EC616A', brandQuinary300: '#F19EDA', brandQuinary600: '#EA3E68', brandQuinary100: '#FAD6D9', surfacePrimary: '#101010', surfaceSecondary: '#1D1D1D', containerPrimary: '#1D1D1D', containerSecondary: '#313135', textPrimary: '#F3F4F6', textSecondary: '#808080', textTertiary: '#999999', textQuaternary: '#101010', textBrand: '#F3F4F6', elementsPrimary: '#F3F4F6', elementsSecondary: '#101010', elementsTertiary: '#222222', elementsQuaternary: '#424247', elementsQuinary: '#707479', elementsDarkQuinary: '#919396', elementsSenary: '#DFDFDF', elementsOnContainer: '#101010', transparencyPrimary: 'rgba(255, 255, 255, 0.1)', transparencySecondary: 'rgba(255, 255, 255, 0.07)', transparencyTertiary: 'rgba(255, 255, 255, 0.16)', transparencyQuinary: 'rgba(255, 255, 255, 0.32)', transparencyModal: 'rgba(0, 0, 0, 0.75)', staticBlack: '#101010', staticDarkGrey: '#2C2C2D', staticWhite: '#FFFFFF', staticRed: '#F24835', staticOrange: '#F48C2C', staticGreen: '#09B849', staticDeepBlue: '#2F53CD', staticErrorAccent: '#CB0000', shadowDepth2: '0 0 0 1px #424247', shadowDepth: '0px 8px 8px 0px rgba(255, 255, 255, 0.25)' // В дизайне тень вообще отсутствует, пока что пусть побудет визуально как border
|
|
7
|
+
const derived = Object.assign(Object.assign({ name: 'common' }, _common_1.default), { scrollbarColor: 'rgba(255, 255, 255, 0.25)', scrollbarColorHover: 'rgba(255, 255, 255, 0.4)', scrollbarWidth: '5px', scrollbarHeight: '5px', scrollbarBorderRadius: '5px', opacityDisabled: '0.5', brand150: '#FFF3D3', brand350: '#F1F9DF', brand550: '#FFF3F4', brandPrimary50: '#2B204E', brandPrimary100: '#412A89', brandPrimary200: '#6A40ED', brandPrimary300: '#BBA2FD', brandPrimary400: '#7748F1', brandPrimary500: '#8967F1', brandPrimary550: '#6607DF', brandPrimary600: '#5D46A6', brandSecondary500: '#FFFF54', brandSecondary300: '#FDF5A6', brandSecondary600: '#F9DE6D', brandTertiary500: '#C4ED70', brandTertiary300: '#DCF0AF', brandTertiary600: '#9DED70', brandQuaternary500: '#90DDFB', brandQuaternary300: '#C5ECFD', brandQuaternary600: '#54B8F9', brandQuinary500: '#EC616A', brandQuinary300: '#F19EDA', brandQuinary600: '#EA3E68', brandQuinary100: '#FAD6D9', surfacePrimary: '#101010', surfaceSecondary: '#1D1D1D', containerPrimary: '#1D1D1D', containerSecondary: '#313135', textPrimary: '#F3F4F6', textSecondary: '#808080', textTertiary: '#999999', textQuaternary: '#101010', textBrand: '#F3F4F6', elementsPrimary: '#F3F4F6', elementsSecondary: '#101010', elementsTertiary: '#222222', elementsQuaternary: '#424247', elementsQuinary: '#707479', elementsDarkQuinary: '#919396', elementsSenary: '#DFDFDF', elementsOnContainer: '#101010', transparencyPrimary: 'rgba(255, 255, 255, 0.1)', transparencySecondary: 'rgba(255, 255, 255, 0.07)', transparencyTertiary: 'rgba(255, 255, 255, 0.16)', transparencyQuinary: 'rgba(255, 255, 255, 0.32)', transparencyModal: 'rgba(0, 0, 0, 0.75)', staticBlack: '#101010', staticDarkGrey: '#2C2C2D', staticWhite: '#FFFFFF', staticRed: '#F24835', staticOrange: '#F48C2C', staticGreen: '#09B849', staticDeepBlue: '#2F53CD', staticErrorAccent: '#CB0000', shadowDepth2: '0 0 0 1px #424247', shadowDepth: '0px 8px 8px 0px rgba(255, 255, 255, 0.25)' // В дизайне тень вообще отсутствует, пока что пусть побудет визуально как border
|
|
8
8
|
});
|
|
9
9
|
exports.default = derived;
|
|
@@ -4,5 +4,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const _common_1 = __importDefault(require("./_common"));
|
|
7
|
-
const derived = Object.assign(Object.assign({ name: 'common' }, _common_1.default), { scrollbarColor: 'rgba(0, 0, 0, 0.25)', scrollbarColorHover: 'rgba(0, 0, 0, 0.4)', scrollbarWidth: '5px', scrollbarHeight: '5px', scrollbarBorderRadius: '5px', opacityDisabled: '0.5', brandPrimary50: '#F8F2FF', brandPrimary100: '#EAE2FF', brandPrimary200: '#DACCFF', brandPrimary300: '#BBA2FD', brandPrimary400: '#7748F1', brandPrimary500: '#7000FF', brandPrimary550: '#6607DF', brandPrimary600: '#5B34C1', brandSecondary500: '#FFFF54', brandSecondary300: '#FDF5A6', brandSecondary600: '#F9DE6D', brandTertiary500: '#C4ED70', brandTertiary300: '#DCF0AF', brandTertiary600: '#9DED70', brandQuaternary500: '#90DDFB', brandQuaternary300: '#C5ECFD', brandQuaternary600: '#54B8F9', brandQuinary500: '#EC616A', brandQuinary300: '#F19EDA', brandQuinary600: '#EA3E68', brandQuinary100: '#FAD6D9', surfacePrimary: '#fff', surfaceSecondary: '#1d1d1d', containerPrimary: '#fff', containerSecondary: '#F3F4F6', textPrimary: '#101010', textSecondary: '#808080', textTertiary: '#999999', textQuaternary: '#FFFFFF', textBrand: '#7000FF', elementsPrimary: '#101010', elementsSecondary: '#fff', elementsTertiary: '#F3F4F6', elementsQuaternary: '#E7E8EA', elementsQuinary: '#C5C7CA', elementsDarkQuinary: '#919396', elementsSenary: '#4E4D4D', elementsOnContainer: '#fff', transparencyPrimary: 'rgba(0, 0, 0, 0.35)', transparencySecondary: 'rgba(0, 0, 0, 0.07)', transparencyTertiary: 'rgba(255, 255, 255, 0.16)', transparencyQuinary: 'rgba(255, 255, 255, 0.32)', transparencyModal: 'rgba(0, 0, 0, 0.40)', staticBlack: '#101010', staticDarkGrey: '#2C2C2D', staticWhite: '#FFFFFF', staticRed: '#F24835', staticOrange: '#F48C2C', staticGreen: '#09B849', staticDeepBlue: '#2F53CD', staticErrorAccent: '#CB0000', shadowDepth2: '0px 20px 80px 0px rgba(0, 0, 0, 0.07)', shadowDepth: '0px 8px 8px 0px rgba(0, 0, 0, 0.25)' });
|
|
7
|
+
const derived = Object.assign(Object.assign({ name: 'common' }, _common_1.default), { scrollbarColor: 'rgba(0, 0, 0, 0.25)', scrollbarColorHover: 'rgba(0, 0, 0, 0.4)', scrollbarWidth: '5px', scrollbarHeight: '5px', scrollbarBorderRadius: '5px', opacityDisabled: '0.5', brand150: '#FFF3D3', brand350: '#F1F9DF', brand550: '#FFF3F4', brandPrimary50: '#F8F2FF', brandPrimary100: '#EAE2FF', brandPrimary200: '#DACCFF', brandPrimary300: '#BBA2FD', brandPrimary400: '#7748F1', brandPrimary500: '#7000FF', brandPrimary550: '#6607DF', brandPrimary600: '#5B34C1', brandSecondary500: '#FFFF54', brandSecondary300: '#FDF5A6', brandSecondary600: '#F9DE6D', brandTertiary500: '#C4ED70', brandTertiary300: '#DCF0AF', brandTertiary600: '#9DED70', brandQuaternary500: '#90DDFB', brandQuaternary300: '#C5ECFD', brandQuaternary600: '#54B8F9', brandQuinary500: '#EC616A', brandQuinary300: '#F19EDA', brandQuinary600: '#EA3E68', brandQuinary100: '#FAD6D9', surfacePrimary: '#fff', surfaceSecondary: '#1d1d1d', containerPrimary: '#fff', containerSecondary: '#F3F4F6', textPrimary: '#101010', textSecondary: '#808080', textTertiary: '#999999', textQuaternary: '#FFFFFF', textBrand: '#7000FF', elementsPrimary: '#101010', elementsSecondary: '#fff', elementsTertiary: '#F3F4F6', elementsQuaternary: '#E7E8EA', elementsQuinary: '#C5C7CA', elementsDarkQuinary: '#919396', elementsSenary: '#4E4D4D', elementsOnContainer: '#fff', transparencyPrimary: 'rgba(0, 0, 0, 0.35)', transparencySecondary: 'rgba(0, 0, 0, 0.07)', transparencyTertiary: 'rgba(255, 255, 255, 0.16)', transparencyQuinary: 'rgba(255, 255, 255, 0.32)', transparencyModal: 'rgba(0, 0, 0, 0.40)', staticBlack: '#101010', staticDarkGrey: '#2C2C2D', staticWhite: '#FFFFFF', staticRed: '#F24835', staticOrange: '#F48C2C', staticGreen: '#09B849', staticDeepBlue: '#2F53CD', staticErrorAccent: '#CB0000', shadowDepth2: '0px 20px 80px 0px rgba(0, 0, 0, 0.07)', shadowDepth: '0px 8px 8px 0px rgba(0, 0, 0, 0.25)' });
|
|
8
8
|
exports.default = derived;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare function useIsMobile(): import("vue").ComputedRef<boolean>;
|
|
3
|
+
export declare function useIsTablet(): import("vue").ComputedRef<boolean>;
|
|
4
|
+
export declare function useIsSmallDesktop(): import("vue").ComputedRef<boolean>;
|
|
5
|
+
export declare const i18n: {
|
|
6
|
+
(data: Record<string, Record<string, string>>): {
|
|
7
|
+
locale: Ref<string>;
|
|
8
|
+
t(key: string): string;
|
|
9
|
+
};
|
|
10
|
+
provide(localeRef: Ref): void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.i18n = void 0;
|
|
4
|
+
exports.useIsMobile = useIsMobile;
|
|
5
|
+
exports.useIsTablet = useIsTablet;
|
|
6
|
+
exports.useIsSmallDesktop = useIsSmallDesktop;
|
|
7
|
+
const vooks_1 = require("vooks");
|
|
8
|
+
const vue_1 = require("vue");
|
|
9
|
+
function useIsMobile() {
|
|
10
|
+
const breakpointRef = (0, vooks_1.useBreakpoint)();
|
|
11
|
+
return (0, vooks_1.useMemo)(() => {
|
|
12
|
+
return breakpointRef.value === 'xs';
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function useIsTablet() {
|
|
16
|
+
const breakpointRef = (0, vooks_1.useBreakpoint)();
|
|
17
|
+
return (0, vooks_1.useMemo)(() => {
|
|
18
|
+
return breakpointRef.value === 's';
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function useIsSmallDesktop() {
|
|
22
|
+
const breakpointRef = (0, vooks_1.useBreakpoint)();
|
|
23
|
+
return (0, vooks_1.useMemo)(() => {
|
|
24
|
+
return breakpointRef.value === 'm';
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
const i18n = function (data) {
|
|
28
|
+
const localeReactive = (0, vue_1.inject)('i18n', null);
|
|
29
|
+
if (!localeReactive) {
|
|
30
|
+
throw new Error('i18n context not provided');
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
locale: (0, vue_1.toRef)(localeReactive, 'locale'),
|
|
34
|
+
t(key) {
|
|
35
|
+
const { locale } = localeReactive;
|
|
36
|
+
return data[locale][key];
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
exports.i18n = i18n;
|
|
41
|
+
exports.i18n.provide = function (localeRef) {
|
|
42
|
+
const localeReactive = (0, vue_1.reactive)({ locale: '' });
|
|
43
|
+
(0, vue_1.watchEffect)(() => {
|
|
44
|
+
localeReactive.locale = localeRef.value;
|
|
45
|
+
});
|
|
46
|
+
(0, vue_1.provide)('i18n', localeReactive);
|
|
47
|
+
};
|
package/lib/_utils/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { call, keep, omit, flatten, getSlot, getVNodeChildren, keysOf, render, getFirstSlotVNode, createDataKey, createRefSetter, createInjectionKey, resolveSlot, resolveSlotWithProps, resolveWrappedSlot, isSlotEmpty, mergeEventHandlers, isNodeVShowFalse, resolveWrappedSlotWithProps, Wrapper } from './vue';
|
|
2
2
|
export type { MaybeArray } from './vue';
|
|
3
|
-
export { warn, warnOnce, throwError, smallerSize, largerSize, getTitleAttribute } from './uzum';
|
|
3
|
+
export { warn, warnOnce, throwError, smallerSize, largerSize, getTitleAttribute, isArrayShallowEqual } from './uzum';
|
|
4
4
|
export type { ExtractPublicPropTypes, ExtractInternalPropTypes, Mutable } from './uzum';
|
|
5
5
|
export { formatLength, color2Class } from './css';
|
|
6
6
|
export { createKey } from './cssr';
|
package/lib/_utils/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.createStylesWithSingleColor = exports.markEventEffectPerformed = exports.eventEffectNotPerformed = exports.isBrowser = exports.isJsdom = exports.createKey = exports.color2Class = exports.formatLength = exports.getTitleAttribute = exports.largerSize = exports.smallerSize = exports.throwError = exports.warnOnce = exports.warn = exports.Wrapper = exports.resolveWrappedSlotWithProps = exports.isNodeVShowFalse = exports.mergeEventHandlers = exports.isSlotEmpty = exports.resolveWrappedSlot = exports.resolveSlotWithProps = exports.resolveSlot = exports.createInjectionKey = exports.createRefSetter = exports.createDataKey = exports.getFirstSlotVNode = exports.render = exports.keysOf = exports.getVNodeChildren = exports.getSlot = exports.flatten = exports.omit = exports.keep = exports.call = void 0;
|
|
17
|
+
exports.createStylesWithSingleColor = exports.markEventEffectPerformed = exports.eventEffectNotPerformed = exports.isBrowser = exports.isJsdom = exports.createKey = exports.color2Class = exports.formatLength = exports.isArrayShallowEqual = exports.getTitleAttribute = exports.largerSize = exports.smallerSize = exports.throwError = exports.warnOnce = exports.warn = exports.Wrapper = exports.resolveWrappedSlotWithProps = exports.isNodeVShowFalse = exports.mergeEventHandlers = exports.isSlotEmpty = exports.resolveWrappedSlot = exports.resolveSlotWithProps = exports.resolveSlot = exports.createInjectionKey = exports.createRefSetter = exports.createDataKey = exports.getFirstSlotVNode = exports.render = exports.keysOf = exports.getVNodeChildren = exports.getSlot = exports.flatten = exports.omit = exports.keep = exports.call = void 0;
|
|
18
18
|
var vue_1 = require("./vue");
|
|
19
19
|
Object.defineProperty(exports, "call", { enumerable: true, get: function () { return vue_1.call; } });
|
|
20
20
|
Object.defineProperty(exports, "keep", { enumerable: true, get: function () { return vue_1.keep; } });
|
|
@@ -43,6 +43,7 @@ Object.defineProperty(exports, "throwError", { enumerable: true, get: function (
|
|
|
43
43
|
Object.defineProperty(exports, "smallerSize", { enumerable: true, get: function () { return uzum_1.smallerSize; } });
|
|
44
44
|
Object.defineProperty(exports, "largerSize", { enumerable: true, get: function () { return uzum_1.largerSize; } });
|
|
45
45
|
Object.defineProperty(exports, "getTitleAttribute", { enumerable: true, get: function () { return uzum_1.getTitleAttribute; } });
|
|
46
|
+
Object.defineProperty(exports, "isArrayShallowEqual", { enumerable: true, get: function () { return uzum_1.isArrayShallowEqual; } });
|
|
46
47
|
var css_1 = require("./css");
|
|
47
48
|
Object.defineProperty(exports, "formatLength", { enumerable: true, get: function () { return css_1.formatLength; } });
|
|
48
49
|
Object.defineProperty(exports, "color2Class", { enumerable: true, get: function () { return css_1.color2Class; } });
|
|
@@ -3,3 +3,4 @@ export { smallerSize, largerSize } from './prop';
|
|
|
3
3
|
export { getTitleAttribute } from './attribute';
|
|
4
4
|
export type { ExtractPublicPropTypes, ExtractInternalPropTypes } from './extract-public-props';
|
|
5
5
|
export type { Mutable } from './mutable';
|
|
6
|
+
export { isArrayShallowEqual } from './value';
|
package/lib/_utils/uzum/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTitleAttribute = exports.largerSize = exports.smallerSize = exports.throwError = exports.warnOnce = exports.warn = void 0;
|
|
3
|
+
exports.isArrayShallowEqual = exports.getTitleAttribute = exports.largerSize = exports.smallerSize = exports.throwError = exports.warnOnce = exports.warn = void 0;
|
|
4
4
|
var warn_1 = require("./warn");
|
|
5
5
|
Object.defineProperty(exports, "warn", { enumerable: true, get: function () { return warn_1.warn; } });
|
|
6
6
|
Object.defineProperty(exports, "warnOnce", { enumerable: true, get: function () { return warn_1.warnOnce; } });
|
|
@@ -10,3 +10,5 @@ Object.defineProperty(exports, "smallerSize", { enumerable: true, get: function
|
|
|
10
10
|
Object.defineProperty(exports, "largerSize", { enumerable: true, get: function () { return prop_1.largerSize; } });
|
|
11
11
|
var attribute_1 = require("./attribute");
|
|
12
12
|
Object.defineProperty(exports, "getTitleAttribute", { enumerable: true, get: function () { return attribute_1.getTitleAttribute; } });
|
|
13
|
+
var value_1 = require("./value");
|
|
14
|
+
Object.defineProperty(exports, "isArrayShallowEqual", { enumerable: true, get: function () { return value_1.isArrayShallowEqual; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isArrayShallowEqual<T extends readonly unknown[]>(left: T | null, right: T | null): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isArrayShallowEqual = isArrayShallowEqual;
|
|
4
|
+
function isArrayShallowEqual(left, right) {
|
|
5
|
+
if (left === right)
|
|
6
|
+
return true;
|
|
7
|
+
if (left === null || right === null)
|
|
8
|
+
return false;
|
|
9
|
+
if (left.length !== right.length)
|
|
10
|
+
return false;
|
|
11
|
+
return left.every((item, index) => item === right[index]);
|
|
12
|
+
}
|
|
@@ -3,7 +3,7 @@ import { type Slot, type VNodeArrayChildren, type VNodeChild } from 'vue';
|
|
|
3
3
|
* We shouldn't use the following functions with slot flags `_: 1, 2, 3`
|
|
4
4
|
*/
|
|
5
5
|
export declare function resolveSlot(slot: Slot | undefined, fallback: () => VNodeArrayChildren): VNodeArrayChildren;
|
|
6
|
-
export declare function resolveSlotWithProps<T>(slot: Slot | undefined, props: T, fallback: (props: T) => VNodeArrayChildren): VNodeArrayChildren;
|
|
6
|
+
export declare function resolveSlotWithProps<T>(slot: Slot<T> | undefined, props: T, fallback: (props: T) => VNodeArrayChildren): VNodeArrayChildren;
|
|
7
7
|
/**
|
|
8
8
|
* Resolve slot with wrapper if content exists, no fallback
|
|
9
9
|
*/
|
|
@@ -7,20 +7,20 @@ exports.alertSelf = exports.self = void 0;
|
|
|
7
7
|
const common_1 = require("../../_styles/common");
|
|
8
8
|
const _common_1 = __importDefault(require("./_common"));
|
|
9
9
|
const self = (vars) => {
|
|
10
|
-
const { iconMedium, closeMedium, fontTitleSmall, lineHeightTitleSmall, fontWeightStrong, fontWeightBold, fontBodyLarge, lineHeightBodyLarge, fontWeight,
|
|
11
|
-
return Object.assign(Object.assign({}, _common_1.default), { iconSize: iconMedium, closeIconSize:
|
|
10
|
+
const { iconMedium, closeMedium, fontTitleSmall, lineHeightTitleSmall, fontWeightStrong, fontWeightBold, fontBodyLarge, lineHeightBodyLarge, fontWeight, borderRadius, staticBlack, staticWhite, transparencyTertiary, transparencyQuinary, transparencySecondary, transparencyPrimary, elementsTertiary, textPrimary, brand150, brand350, brand550, brandPrimary50, staticRed } = vars;
|
|
11
|
+
return Object.assign(Object.assign({}, _common_1.default), { iconSize: iconMedium, closeIconSize: '18px', closeSize: closeMedium, titleFontSizeAlert: fontTitleSmall, titleLineHeightAlert: lineHeightTitleSmall, titleFontWeightAlert: fontWeightStrong, descriptionFontSizeAlert: fontBodyLarge, descriptionLineHeightAlert: lineHeightBodyLarge, descriptionFontWeightAlert: fontWeight, titleFontSizeBanner: fontBodyLarge, titleLineHeightBanner: lineHeightBodyLarge, titleFontWeightBanner: fontWeightBold, descriptionFontSizeBanner: fontBodyLarge, descriptionLineHeightBanner: lineHeightBodyLarge, descriptionFontWeightBanner: fontWeight, borderRadius,
|
|
12
12
|
// Default
|
|
13
13
|
color: staticBlack, titleTextColor: staticWhite, iconColor: staticWhite, contentTextColor: staticWhite, closeColorHover: transparencyTertiary, closeColorPressed: transparencyQuinary, closeIconColor: staticWhite, closeIconColorHover: staticWhite, closeIconColorPressed: staticWhite,
|
|
14
14
|
// Info
|
|
15
15
|
colorInfo: elementsTertiary, titleTextColorInfo: textPrimary, iconColorInfo: textPrimary, contentTextColorInfo: textPrimary, closeColorHoverInfo: transparencySecondary, closeColorPressedInfo: transparencyPrimary, closeIconColorInfo: textPrimary, closeIconColorHoverInfo: textPrimary, closeIconColorPressedInfo: textPrimary,
|
|
16
16
|
// Success
|
|
17
|
-
colorSuccess:
|
|
17
|
+
colorSuccess: brand350, titleTextColorSuccess: staticBlack, iconColorSuccess: staticBlack, contentTextColorSuccess: staticBlack, closeColorHoverSuccess: transparencyTertiary, closeColorPressedSuccess: transparencyQuinary, closeIconColorSuccess: staticBlack, closeIconColorHoverSuccess: staticBlack, closeIconColorPressedSuccess: staticBlack,
|
|
18
18
|
// Warning
|
|
19
|
-
colorWarning:
|
|
19
|
+
colorWarning: brand150, titleTextColorWarning: staticBlack, iconColorWarning: staticBlack, contentTextColorWarning: staticBlack, closeColorHoverWarning: transparencyTertiary, closeColorPressedWarning: transparencyQuinary, closeIconColorWarning: staticBlack, closeIconColorHoverWarning: staticBlack, closeIconColorPressedWarning: staticBlack,
|
|
20
20
|
// Error
|
|
21
|
-
colorError:
|
|
21
|
+
colorError: brand550, titleTextColorError: staticBlack, iconColorError: staticRed, contentTextColorError: staticBlack, closeColorHoverError: transparencyTertiary, closeColorPressedError: transparencyQuinary, closeIconColorError: staticBlack, closeIconColorHoverError: staticBlack, closeIconColorPressedError: staticBlack,
|
|
22
22
|
// Primary
|
|
23
|
-
colorPrimary:
|
|
23
|
+
colorPrimary: brandPrimary50, titleTextColorPrimary: staticBlack, iconColorPrimary: staticBlack, contentTextColorPrimary: staticBlack, closeColorHoverPrimary: transparencyTertiary, closeColorPressedPrimary: transparencyQuinary, closeIconColorPrimary: staticBlack, closeIconColorHoverPrimary: staticBlack, closeIconColorPressedPrimary: staticBlack });
|
|
24
24
|
};
|
|
25
25
|
exports.self = self;
|
|
26
26
|
exports.alertSelf = exports.self;
|
|
@@ -85,7 +85,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
85
85
|
const treeMateRef = (0, vue_1.computed)(() => (0, treemate_1.createTreeMate)(selectOptionsRef.value, (0, utils_1.createTmOptions)('value', 'children')));
|
|
86
86
|
function doUpdateValue(value) {
|
|
87
87
|
const { 'onUpdate:value': _onUpdateValue, onUpdateValue, onInput } = props;
|
|
88
|
-
const {
|
|
88
|
+
const { triggerFormInput, triggerFormChange } = formItem;
|
|
89
89
|
if (onUpdateValue)
|
|
90
90
|
(0, _utils_1.call)(onUpdateValue, value);
|
|
91
91
|
if (_onUpdateValue)
|
|
@@ -93,30 +93,30 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
93
93
|
if (onInput)
|
|
94
94
|
(0, _utils_1.call)(onInput, value);
|
|
95
95
|
uncontrolledValueRef.value = value;
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
triggerFormInput();
|
|
97
|
+
triggerFormChange();
|
|
98
98
|
}
|
|
99
99
|
function doSelect(value) {
|
|
100
100
|
const { onSelect } = props;
|
|
101
|
-
const {
|
|
101
|
+
const { triggerFormInput, triggerFormChange } = formItem;
|
|
102
102
|
if (onSelect)
|
|
103
103
|
(0, _utils_1.call)(onSelect, value);
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
triggerFormInput();
|
|
105
|
+
triggerFormChange();
|
|
106
106
|
}
|
|
107
107
|
function doBlur(e) {
|
|
108
108
|
const { onBlur } = props;
|
|
109
|
-
const {
|
|
109
|
+
const { triggerFormBlur } = formItem;
|
|
110
110
|
if (onBlur)
|
|
111
111
|
(0, _utils_1.call)(onBlur, e);
|
|
112
|
-
|
|
112
|
+
triggerFormBlur();
|
|
113
113
|
}
|
|
114
114
|
function doFocus(e) {
|
|
115
115
|
const { onFocus } = props;
|
|
116
|
-
const {
|
|
116
|
+
const { triggerFormFocus } = formItem;
|
|
117
117
|
if (onFocus)
|
|
118
118
|
(0, _utils_1.call)(onFocus, e);
|
|
119
|
-
|
|
119
|
+
triggerFormFocus();
|
|
120
120
|
}
|
|
121
121
|
function doScroll(e) {
|
|
122
122
|
const { onScroll } = props;
|
|
@@ -28,6 +28,8 @@ export declare const avatarProps: {
|
|
|
28
28
|
readonly imgProps: PropType<ImgHTMLAttributes>;
|
|
29
29
|
readonly disabled: BooleanConstructor;
|
|
30
30
|
readonly loading: BooleanConstructor;
|
|
31
|
+
readonly iconColor: StringConstructor;
|
|
32
|
+
readonly iconSize: PropType<string | number>;
|
|
31
33
|
readonly theme: PropType<import("../../_mixins").Theme<"Avatar", {
|
|
32
34
|
borderRadius: string;
|
|
33
35
|
fontSize: string;
|
|
@@ -98,6 +100,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
98
100
|
readonly imgProps: PropType<ImgHTMLAttributes>;
|
|
99
101
|
readonly disabled: BooleanConstructor;
|
|
100
102
|
readonly loading: BooleanConstructor;
|
|
103
|
+
readonly iconColor: StringConstructor;
|
|
104
|
+
readonly iconSize: PropType<string | number>;
|
|
101
105
|
readonly theme: PropType<import("../../_mixins").Theme<"Avatar", {
|
|
102
106
|
borderRadius: string;
|
|
103
107
|
fontSize: string;
|
|
@@ -191,6 +195,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
191
195
|
readonly imgProps: PropType<ImgHTMLAttributes>;
|
|
192
196
|
readonly disabled: BooleanConstructor;
|
|
193
197
|
readonly loading: BooleanConstructor;
|
|
198
|
+
readonly iconColor: StringConstructor;
|
|
199
|
+
readonly iconSize: PropType<string | number>;
|
|
194
200
|
readonly theme: PropType<import("../../_mixins").Theme<"Avatar", {
|
|
195
201
|
borderRadius: string;
|
|
196
202
|
fontSize: string;
|
package/lib/avatar/src/Avatar.js
CHANGED
|
@@ -24,7 +24,7 @@ exports.avatarProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props),
|
|
|
24
24
|
}, bordered: {
|
|
25
25
|
type: Boolean,
|
|
26
26
|
default: undefined
|
|
27
|
-
}, onError: Function, fallbackSrc: String, intersectionObserverOptions: Object, lazy: Boolean, onLoad: Function, renderPlaceholder: Function, renderFallback: Function, imgProps: Object, disabled: Boolean, loading: Boolean });
|
|
27
|
+
}, onError: Function, fallbackSrc: String, intersectionObserverOptions: Object, lazy: Boolean, onLoad: Function, renderPlaceholder: Function, renderFallback: Function, imgProps: Object, disabled: Boolean, loading: Boolean, iconColor: String, iconSize: [String, Number] });
|
|
28
28
|
exports.default = (0, vue_1.defineComponent)({
|
|
29
29
|
name: 'Avatar',
|
|
30
30
|
props: exports.avatarProps,
|
|
@@ -109,6 +109,12 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
109
109
|
const getBackgroundColor = (color) => {
|
|
110
110
|
return props.disabled || size === 'small' ? 'rgba(0,0,0,0)' : color;
|
|
111
111
|
};
|
|
112
|
+
const resolveSize = (value, fallback) => {
|
|
113
|
+
if (value === undefined)
|
|
114
|
+
return fallback;
|
|
115
|
+
value = String(value);
|
|
116
|
+
return /^\d+$/.test(value) ? `${value}px` : value;
|
|
117
|
+
};
|
|
112
118
|
return {
|
|
113
119
|
'--u-font-size': fontSize,
|
|
114
120
|
'--u-font-weight': fontWeight,
|
|
@@ -116,10 +122,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
116
122
|
'--u-border-radius': round ? '50%' : borderRadius,
|
|
117
123
|
'--u-color': getBackgroundColor(color),
|
|
118
124
|
'--u-text-color': textColor,
|
|
119
|
-
'--u-icon-color': iconColor,
|
|
125
|
+
'--u-icon-color': props.iconColor || iconColor,
|
|
120
126
|
'--u-bezier': cubicBezierEaseInOut,
|
|
121
127
|
'--u-merged-size': `var(--u-avatar-size-override, ${height})`,
|
|
122
|
-
'--u-icon-size': iconSize
|
|
128
|
+
'--u-icon-size': resolveSize(props.iconSize, iconSize)
|
|
123
129
|
};
|
|
124
130
|
});
|
|
125
131
|
const themeClassHandle = inlineThemeDisabled
|
|
@@ -69,7 +69,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
69
69
|
return (0, vue_1.h)(Grid_1.default, Object.assign({ class: [`${mergedClsPrefix}-card-list`, themeClass], style: cssVars, cols,
|
|
70
70
|
xGap,
|
|
71
71
|
yGap }, gridProps), () => items.map((card, idx) => (0, vue_1.h)(GridItem_1.default, { key: idx, span: card.span || 1 }, () => [
|
|
72
|
-
(0, vue_1.h)(CardListItem_1.default, Object.assign(Object.assign({ title: card.title, subtitle: card.subtitle, items: card.items, direction: card.direction, dropdown: card.dropdown }, cardProps), { renderDivider: showDivider ? renderDivider : () => null }))
|
|
72
|
+
(0, vue_1.h)(CardListItem_1.default, Object.assign(Object.assign({ title: card.title, subtitle: card.subtitle, items: card.items, direction: card.direction, embedded: card.embedded, dropdown: card.dropdown }, cardProps), { renderDivider: showDivider ? renderDivider : () => null }))
|
|
73
73
|
])));
|
|
74
74
|
}
|
|
75
75
|
});
|
|
@@ -13,6 +13,10 @@ declare const cardListItemProps: {
|
|
|
13
13
|
readonly default: "horizontal";
|
|
14
14
|
};
|
|
15
15
|
readonly dropdown: BooleanConstructor;
|
|
16
|
+
readonly embedded: {
|
|
17
|
+
readonly type: BooleanConstructor;
|
|
18
|
+
readonly default: false;
|
|
19
|
+
};
|
|
16
20
|
readonly renderDivider: PropType<({ index, count, direction }: {
|
|
17
21
|
index: number;
|
|
18
22
|
count: number;
|
|
@@ -32,6 +36,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
36
|
readonly default: "horizontal";
|
|
33
37
|
};
|
|
34
38
|
readonly dropdown: BooleanConstructor;
|
|
39
|
+
readonly embedded: {
|
|
40
|
+
readonly type: BooleanConstructor;
|
|
41
|
+
readonly default: false;
|
|
42
|
+
};
|
|
35
43
|
readonly renderDivider: PropType<({ index, count, direction }: {
|
|
36
44
|
index: number;
|
|
37
45
|
count: number;
|
|
@@ -58,6 +66,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
58
66
|
readonly default: "horizontal";
|
|
59
67
|
};
|
|
60
68
|
readonly dropdown: BooleanConstructor;
|
|
69
|
+
readonly embedded: {
|
|
70
|
+
readonly type: BooleanConstructor;
|
|
71
|
+
readonly default: false;
|
|
72
|
+
};
|
|
61
73
|
readonly renderDivider: PropType<({ index, count, direction }: {
|
|
62
74
|
index: number;
|
|
63
75
|
count: number;
|
|
@@ -66,5 +78,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
66
78
|
}>>, {
|
|
67
79
|
readonly direction: "vertical" | "horizontal";
|
|
68
80
|
readonly dropdown: boolean;
|
|
81
|
+
readonly embedded: boolean;
|
|
69
82
|
}, {}>;
|
|
70
83
|
export default _default;
|
|
@@ -17,6 +17,10 @@ const cardListItemProps = {
|
|
|
17
17
|
default: 'horizontal'
|
|
18
18
|
},
|
|
19
19
|
dropdown: Boolean,
|
|
20
|
+
embedded: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
20
24
|
renderDivider: Function
|
|
21
25
|
};
|
|
22
26
|
exports.default = (0, vue_1.defineComponent)({
|
|
@@ -63,7 +67,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
63
67
|
const isGrouped = !this.dropdown &&
|
|
64
68
|
(this.direction === 'horizontal' || this.direction === 'vertical');
|
|
65
69
|
const isDropdown = this.dropdown;
|
|
66
|
-
return ((0, vue_1.h)("div", { class:
|
|
70
|
+
return ((0, vue_1.h)("div", { class: [
|
|
71
|
+
`${mergedClsPrefix}-card-list-item`,
|
|
72
|
+
this.embedded && `${mergedClsPrefix}-card-list-item--embedded`
|
|
73
|
+
], onClick: isDropdown && items.length ? this.toggle : undefined, ref: "selfRef" },
|
|
67
74
|
isDropdown && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-card-list-item__wrapper` },
|
|
68
75
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-card-list-item__wrapper-content` },
|
|
69
76
|
this.title && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-card-list-item__title` }, this.title)),
|
|
@@ -79,7 +86,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
79
86
|
isGrouped && items.length > 0 && ((0, vue_1.h)("div", { class: [
|
|
80
87
|
`${mergedClsPrefix}-card-list-item__items`,
|
|
81
88
|
this.direction,
|
|
82
|
-
this.direction === '
|
|
89
|
+
this.direction === 'horizontal' &&
|
|
83
90
|
`${mergedClsPrefix}-card-list-item__items--grid`
|
|
84
91
|
] }, items.map((item, idx) => [
|
|
85
92
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-card-list-item__item`, key: idx },
|
|
@@ -95,10 +102,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
95
102
|
: (0, vue_1.h)('div', {
|
|
96
103
|
class: [
|
|
97
104
|
`${mergedClsPrefix}-card-list-item__divider`,
|
|
98
|
-
this.direction === '
|
|
105
|
+
this.direction === 'horizontal'
|
|
99
106
|
? `${mergedClsPrefix}-card-list-item__divider--vertical`
|
|
100
107
|
: `${mergedClsPrefix}-card-list-item__divider--horizontal`,
|
|
101
|
-
this.direction === '
|
|
108
|
+
this.direction === 'horizontal' &&
|
|
102
109
|
`${mergedClsPrefix}-card-list-item__divider--grid`
|
|
103
110
|
]
|
|
104
111
|
}))
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
const cssr_1 = require("../../../_utils/cssr");
|
|
7
7
|
exports.default = (0, cssr_1.cB)('card-list-item', [(0, cssr_1.c)('&', {
|
|
8
8
|
padding: '16px',
|
|
9
|
-
backgroundColor: 'var(--u-color-embedded)',
|
|
10
9
|
borderRadius: 'var(--u-border-radius)',
|
|
11
|
-
boxShadow: 'var(--u-box-shadow)',
|
|
12
10
|
display: 'flex',
|
|
13
11
|
flexDirection: 'column',
|
|
14
12
|
gap: '8px',
|
|
15
13
|
position: 'relative'
|
|
16
|
-
}
|
|
14
|
+
}, [(0, cssr_1.cM)('embedded', {
|
|
15
|
+
backgroundColor: 'var(--u-color-embedded)'
|
|
16
|
+
})]), (0, cssr_1.cB)('card-list-item__title', {
|
|
17
17
|
fontSize: 'var(--u-title-font-size)',
|
|
18
18
|
lineHeight: 'var(--u-title-line-height)',
|
|
19
19
|
fontWeight: 'var(--u-title-font-weight)',
|
|
@@ -27,10 +27,10 @@ exports.default = (0, cssr_1.cB)('card-list-item', [(0, cssr_1.c)('&', {
|
|
|
27
27
|
display: 'flex',
|
|
28
28
|
gap: '0'
|
|
29
29
|
}, [(0, cssr_1.c)('&.horizontal', {
|
|
30
|
-
flexDirection: 'column'
|
|
31
|
-
}), (0, cssr_1.c)('&.vertical', {
|
|
32
30
|
flexDirection: 'row',
|
|
33
31
|
alignItems: 'stretch'
|
|
32
|
+
}), (0, cssr_1.c)('&.vertical', {
|
|
33
|
+
flexDirection: 'column'
|
|
34
34
|
})]), (0, cssr_1.cB)('card-list-item__items--grid', {
|
|
35
35
|
display: 'grid',
|
|
36
36
|
gridAutoFlow: 'column',
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.self = void 0;
|
|
4
4
|
const common_1 = require("../../_styles/common");
|
|
5
5
|
const self = (vars) => {
|
|
6
|
-
const { textSecondary, textPrimary, fontWeight, fontWeightBold, fontBodyLarge, fontBodyMedium, lineHeightBodyMedium, borderRadiusLarge, containerSecondary, shadowDepth2,
|
|
6
|
+
const { textSecondary, textPrimary, fontWeight, fontWeightBold, fontBodyLarge, fontBodyMedium, lineHeightBodyMedium, borderRadiusLarge, containerSecondary, shadowDepth2, elementsQuaternary, elementsSecondary } = vars;
|
|
7
7
|
return {
|
|
8
8
|
textColor: textSecondary,
|
|
9
9
|
textLineHeight: lineHeightBodyMedium,
|
|
@@ -17,7 +17,7 @@ const self = (vars) => {
|
|
|
17
17
|
borderRadius: borderRadiusLarge,
|
|
18
18
|
boxShadow: shadowDepth2,
|
|
19
19
|
colorEmbedded: containerSecondary,
|
|
20
|
-
dividerColor:
|
|
20
|
+
dividerColor: elementsQuaternary,
|
|
21
21
|
dropDownBgColor: elementsSecondary
|
|
22
22
|
};
|
|
23
23
|
};
|