@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.
Files changed (202) hide show
  1. package/README.md +0 -1
  2. package/dist/index.js +1333 -869
  3. package/dist/index.prod.js +3 -3
  4. package/es/_internal/checkbox/src/use-checkbox.js +3 -3
  5. package/es/_internal/radio/src/use-radio.js +3 -3
  6. package/es/_internal/typography/src/styles/text.cssr.js +0 -1
  7. package/es/_internal/typography/styles/light.js +1 -1
  8. package/es/_mixins/use-form-item.d.ts +4 -4
  9. package/es/_mixins/use-form-item.js +4 -4
  10. package/es/_styles/common/dark.js +1 -1
  11. package/es/_styles/common/light.d.ts +3 -0
  12. package/es/_styles/common/light.js +1 -1
  13. package/es/_utils/composable/composables.d.ts +11 -0
  14. package/es/_utils/composable/composables.js +40 -0
  15. package/es/_utils/index.d.ts +1 -1
  16. package/es/_utils/index.js +1 -1
  17. package/es/_utils/uzum/index.d.ts +1 -0
  18. package/es/_utils/uzum/index.js +1 -0
  19. package/es/_utils/uzum/value.d.ts +1 -0
  20. package/es/_utils/uzum/value.js +9 -0
  21. package/es/_utils/vue/resolve-slot.d.ts +1 -1
  22. package/es/alert/styles/light.js +6 -6
  23. package/es/auto-complete/src/AutoComplete.js +10 -10
  24. package/es/avatar/src/Avatar.d.ts +6 -0
  25. package/es/avatar/src/Avatar.js +9 -3
  26. package/es/card-list/src/CardList.js +1 -1
  27. package/es/card-list/src/CardListItem.d.ts +13 -0
  28. package/es/card-list/src/CardListItem.js +11 -4
  29. package/es/card-list/src/interface.d.ts +1 -0
  30. package/es/card-list/src/styles/index.cssr.js +6 -6
  31. package/es/card-list/styles/light.js +2 -2
  32. package/es/cascader/src/Cascader.js +7 -7
  33. package/es/checkbox/src/CheckboxGroup.js +9 -9
  34. package/es/color-picker/src/ColorPicker.js +6 -6
  35. package/es/components.d.ts +1 -0
  36. package/es/components.js +1 -0
  37. package/es/config-provider/src/internal-interface.d.ts +2 -0
  38. package/es/data-table/src/DataTable.d.ts +8 -0
  39. package/es/data-table/src/DataTable.js +21 -10
  40. package/es/data-table/src/TableParts/Body.d.ts +1 -0
  41. package/es/data-table/src/TableParts/Body.js +6 -5
  42. package/es/data-table/src/TableParts/Cell.js +85 -23
  43. package/es/data-table/src/interface.d.ts +13 -6
  44. package/es/data-table/src/interface.js +1 -1
  45. package/es/data-table/src/styles/index.cssr.js +5 -3
  46. package/es/data-table/src/use-mask.d.ts +3 -6
  47. package/es/data-table/src/utils.d.ts +2 -1
  48. package/es/data-table/src/utils.js +13 -0
  49. package/es/date-picker/src/DatePicker.js +7 -7
  50. package/es/dialog/src/DialogProvider.d.ts +6 -0
  51. package/es/dynamic-tags/src/DynamicTags.js +3 -3
  52. package/es/input/src/Input.js +8 -8
  53. package/es/input-number/src/InputNumber.js +7 -7
  54. package/es/input-otp/index.d.ts +3 -0
  55. package/es/input-otp/index.js +1 -0
  56. package/es/input-otp/src/InputOtp.d.ts +871 -0
  57. package/es/input-otp/src/InputOtp.js +250 -0
  58. package/es/input-otp/src/public-types.d.ts +25 -0
  59. package/es/input-otp/src/public-types.js +1 -0
  60. package/es/input-otp/src/styles/index.cssr.d.ts +2 -0
  61. package/es/input-otp/src/styles/index.cssr.js +20 -0
  62. package/es/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
  63. package/es/input-otp/src/styles/input-otp-rtl.cssr.js +5 -0
  64. package/es/input-otp/styles/dark.d.ts +3 -0
  65. package/es/input-otp/styles/dark.js +12 -0
  66. package/es/input-otp/styles/index.d.ts +4 -0
  67. package/es/input-otp/styles/index.js +3 -0
  68. package/es/input-otp/styles/light.d.ts +83 -0
  69. package/es/input-otp/styles/light.js +22 -0
  70. package/es/input-otp/styles/rtl.d.ts +2 -0
  71. package/es/input-otp/styles/rtl.js +5 -0
  72. package/es/legacy-transfer/src/Transfer.js +3 -3
  73. package/es/list/src/List.d.ts +41 -55
  74. package/es/list/src/List.js +6 -10
  75. package/es/list/src/ListItem.d.ts +84 -25
  76. package/es/list/src/ListItem.js +120 -98
  77. package/es/list/src/interface.d.ts +1 -0
  78. package/es/list/src/props.d.ts +70 -31
  79. package/es/list/src/props.js +25 -5
  80. package/es/list/src/styles/index.cssr.js +32 -90
  81. package/es/list/styles/light.d.ts +5 -8
  82. package/es/list/styles/light.js +6 -9
  83. package/es/mention/src/Mention.js +7 -7
  84. package/es/radio/src/RadioGroup.js +5 -5
  85. package/es/rate/src/Rate.js +3 -3
  86. package/es/select/src/Select.js +7 -7
  87. package/es/slider/src/Slider.js +3 -3
  88. package/es/styles.d.ts +1 -0
  89. package/es/styles.js +1 -0
  90. package/es/switch/src/Switch.js +7 -7
  91. package/es/tag/src/styles/index.cssr.js +5 -1
  92. package/es/tag/styles/light.js +2 -2
  93. package/es/theme-editor/src/ThemeEditor.d.ts +3 -0
  94. package/es/themes/dark.js +2 -0
  95. package/es/themes/light.js +2 -0
  96. package/es/time-picker/src/TimePicker.js +7 -7
  97. package/es/transfer/src/Transfer.js +3 -3
  98. package/es/tree-select/src/TreeSelect.js +5 -5
  99. package/es/upload/src/UploadFile.js +4 -3
  100. package/es/version.d.ts +1 -1
  101. package/es/version.js +1 -1
  102. package/lib/_internal/checkbox/src/use-checkbox.js +3 -3
  103. package/lib/_internal/radio/src/use-radio.js +3 -3
  104. package/lib/_internal/typography/src/styles/text.cssr.js +0 -1
  105. package/lib/_internal/typography/styles/light.js +1 -1
  106. package/lib/_mixins/use-form-item.d.ts +4 -4
  107. package/lib/_mixins/use-form-item.js +4 -4
  108. package/lib/_styles/common/dark.js +1 -1
  109. package/lib/_styles/common/light.d.ts +3 -0
  110. package/lib/_styles/common/light.js +1 -1
  111. package/lib/_utils/composable/composables.d.ts +11 -0
  112. package/lib/_utils/composable/composables.js +47 -0
  113. package/lib/_utils/index.d.ts +1 -1
  114. package/lib/_utils/index.js +2 -1
  115. package/lib/_utils/uzum/index.d.ts +1 -0
  116. package/lib/_utils/uzum/index.js +3 -1
  117. package/lib/_utils/uzum/value.d.ts +1 -0
  118. package/lib/_utils/uzum/value.js +12 -0
  119. package/lib/_utils/vue/resolve-slot.d.ts +1 -1
  120. package/lib/alert/styles/light.js +6 -6
  121. package/lib/auto-complete/src/AutoComplete.js +10 -10
  122. package/lib/avatar/src/Avatar.d.ts +6 -0
  123. package/lib/avatar/src/Avatar.js +9 -3
  124. package/lib/card-list/src/CardList.js +1 -1
  125. package/lib/card-list/src/CardListItem.d.ts +13 -0
  126. package/lib/card-list/src/CardListItem.js +11 -4
  127. package/lib/card-list/src/interface.d.ts +1 -0
  128. package/lib/card-list/src/styles/index.cssr.js +5 -5
  129. package/lib/card-list/styles/light.js +2 -2
  130. package/lib/cascader/src/Cascader.js +7 -7
  131. package/lib/checkbox/src/CheckboxGroup.js +9 -9
  132. package/lib/color-picker/src/ColorPicker.js +6 -6
  133. package/lib/components.d.ts +1 -0
  134. package/lib/components.js +1 -0
  135. package/lib/config-provider/src/internal-interface.d.ts +2 -0
  136. package/lib/data-table/src/DataTable.d.ts +8 -0
  137. package/lib/data-table/src/DataTable.js +21 -10
  138. package/lib/data-table/src/TableParts/Body.d.ts +1 -0
  139. package/lib/data-table/src/TableParts/Body.js +6 -5
  140. package/lib/data-table/src/TableParts/Cell.js +84 -22
  141. package/lib/data-table/src/interface.d.ts +13 -6
  142. package/lib/data-table/src/interface.js +1 -1
  143. package/lib/data-table/src/styles/index.cssr.js +5 -3
  144. package/lib/data-table/src/use-mask.d.ts +3 -6
  145. package/lib/data-table/src/utils.d.ts +2 -1
  146. package/lib/data-table/src/utils.js +14 -1
  147. package/lib/date-picker/src/DatePicker.js +7 -7
  148. package/lib/dialog/src/DialogProvider.d.ts +6 -0
  149. package/lib/dynamic-tags/src/DynamicTags.js +3 -3
  150. package/lib/input/src/Input.js +8 -8
  151. package/lib/input-number/src/InputNumber.js +7 -7
  152. package/lib/input-otp/index.d.ts +3 -0
  153. package/lib/input-otp/index.js +9 -0
  154. package/lib/input-otp/src/InputOtp.d.ts +871 -0
  155. package/lib/input-otp/src/InputOtp.js +256 -0
  156. package/lib/input-otp/src/public-types.d.ts +25 -0
  157. package/lib/input-otp/src/public-types.js +2 -0
  158. package/lib/input-otp/src/styles/index.cssr.d.ts +2 -0
  159. package/lib/input-otp/src/styles/index.cssr.js +25 -0
  160. package/lib/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
  161. package/lib/input-otp/src/styles/input-otp-rtl.cssr.js +10 -0
  162. package/lib/input-otp/styles/dark.d.ts +3 -0
  163. package/lib/input-otp/styles/dark.js +14 -0
  164. package/lib/input-otp/styles/index.d.ts +4 -0
  165. package/lib/input-otp/styles/index.js +12 -0
  166. package/lib/input-otp/styles/light.d.ts +83 -0
  167. package/lib/input-otp/styles/light.js +25 -0
  168. package/lib/input-otp/styles/rtl.d.ts +2 -0
  169. package/lib/input-otp/styles/rtl.js +11 -0
  170. package/lib/legacy-transfer/src/Transfer.js +3 -3
  171. package/lib/list/src/List.d.ts +41 -55
  172. package/lib/list/src/List.js +6 -10
  173. package/lib/list/src/ListItem.d.ts +84 -25
  174. package/lib/list/src/ListItem.js +119 -97
  175. package/lib/list/src/interface.d.ts +1 -0
  176. package/lib/list/src/props.d.ts +70 -31
  177. package/lib/list/src/props.js +25 -5
  178. package/lib/list/src/styles/index.cssr.js +32 -90
  179. package/lib/list/styles/light.d.ts +5 -8
  180. package/lib/list/styles/light.js +6 -9
  181. package/lib/mention/src/Mention.js +7 -7
  182. package/lib/radio/src/RadioGroup.js +5 -5
  183. package/lib/rate/src/Rate.js +3 -3
  184. package/lib/select/src/Select.js +7 -7
  185. package/lib/slider/src/Slider.js +3 -3
  186. package/lib/styles.d.ts +1 -0
  187. package/lib/styles.js +106 -103
  188. package/lib/switch/src/Switch.js +7 -7
  189. package/lib/tag/src/styles/index.cssr.js +5 -1
  190. package/lib/tag/styles/light.js +2 -2
  191. package/lib/theme-editor/src/ThemeEditor.d.ts +3 -0
  192. package/lib/themes/dark.js +2 -0
  193. package/lib/themes/light.js +2 -0
  194. package/lib/time-picker/src/TimePicker.js +7 -7
  195. package/lib/transfer/src/Transfer.js +3 -3
  196. package/lib/tree-select/src/TreeSelect.js +5 -5
  197. package/lib/upload/src/UploadFile.js +4 -3
  198. package/lib/version.d.ts +1 -1
  199. package/lib/version.js +1 -1
  200. package/package.json +1 -1
  201. package/volar.d.ts +1 -0
  202. package/web-types.json +180 -38
@@ -5,9 +5,12 @@ const _utils_1 = require("../../_utils");
5
5
  const props_1 = require("./props");
6
6
  const icons_1 = require("../../_internal/icons");
7
7
  const _internal_1 = require("../../_internal");
8
+ const avatar_1 = require("../../avatar");
9
+ const icon_1 = require("../../icon");
10
+ const badge_1 = require("../../badge");
8
11
  exports.default = (0, vue_1.defineComponent)({
9
12
  name: 'ListItem',
10
- props: props_1.listItemProps,
13
+ props: Object.assign({}, props_1.listItemProps),
11
14
  setup(props, { slots }) {
12
15
  const listInjection = (0, vue_1.inject)(props_1.listInjectionKey, null);
13
16
  if (!listInjection) {
@@ -22,23 +25,21 @@ exports.default = (0, vue_1.defineComponent)({
22
25
  const mergedHoverable = createRef('hoverable');
23
26
  const mergedDisabled = createRef('disabled');
24
27
  const mergedLoading = createRef('loading');
25
- const mergedLoadingSkeleton = createRef('loadingSkeleton');
28
+ const mergedShowIcon = createRef('showIcon');
29
+ const mergedRounded = createRef('rounded');
26
30
  const mergedClickHandler = createRef('onClick');
27
31
  const mergedKeypressHandler = createRef('onKeypress');
28
32
  const mergedPressHandler = createRef('onPress');
29
33
  const mergedBlurHandler = createRef('onBlur');
30
34
  const mergedFocusHandler = createRef('onFocus');
31
- const hasFocus = (0, vue_1.computed)(() => {
32
- return !mergedDisabled.value && mergedHoverable.value;
33
- });
35
+ const hasFocus = (0, vue_1.computed)(() => !mergedDisabled.value && mergedHoverable.value);
34
36
  const isPressed = (0, vue_1.ref)(false);
35
37
  const handleClick = (e) => {
36
38
  if (!mergedDisabled.value) {
37
39
  if (mergedClickHandler.value)
38
40
  (0, _utils_1.call)(mergedClickHandler.value, e);
39
- if (e.which === 1 || e.button === 0) {
41
+ if (e.which === 1 || e.button === 0)
40
42
  handlePress('mouseup');
41
- }
42
43
  }
43
44
  };
44
45
  const handleKeyPress = (e) => {
@@ -46,61 +47,45 @@ exports.default = (0, vue_1.defineComponent)({
46
47
  const { code } = e;
47
48
  if (code === 'Enter' || code === 'Space' || code === 'NumpadEnter') {
48
49
  e.preventDefault();
49
- if (!e.repeat) {
50
+ if (!e.repeat)
50
51
  handlePress('keyup');
51
- }
52
52
  }
53
53
  if (mergedKeypressHandler.value)
54
54
  (0, _utils_1.call)(mergedKeypressHandler.value, e);
55
55
  }
56
56
  };
57
57
  const handleBlur = (e) => {
58
- if (hasFocus.value) {
59
- if (mergedBlurHandler.value)
60
- (0, _utils_1.call)(mergedBlurHandler.value, e);
58
+ if (hasFocus.value && mergedBlurHandler.value) {
59
+ (0, _utils_1.call)(mergedBlurHandler.value, e);
61
60
  }
62
61
  };
63
62
  const handleFocus = (e) => {
64
- if (hasFocus.value) {
65
- if (mergedFocusHandler.value)
66
- (0, _utils_1.call)(mergedFocusHandler.value, e);
63
+ if (hasFocus.value && mergedFocusHandler.value) {
64
+ (0, _utils_1.call)(mergedFocusHandler.value, e);
67
65
  }
68
66
  };
69
67
  const handlePress = (eventName) => {
70
- if (mergedDisabled.value ||
71
- mergedLoading.value ||
72
- mergedLoadingSkeleton.value) {
68
+ if (mergedDisabled.value || mergedLoading.value)
73
69
  return;
74
- }
75
70
  if (mergedPressHandler.value)
76
71
  (0, _utils_1.call)(mergedPressHandler.value);
77
72
  if (hasFocus.value) {
78
73
  isPressed.value = true;
79
74
  window.addEventListener(eventName, () => {
80
75
  isPressed.value = false;
81
- }, {
82
- once: true,
83
- passive: true
84
- });
76
+ }, { once: true, passive: true });
85
77
  }
86
78
  };
87
- const resolveFirst = (name) => {
88
- if (!(name in props))
89
- return null;
90
- return props[name] || slots[name] || listInjection[name].value || null;
91
- };
79
+ const resolveSlot = (name) => slots[name] || null;
92
80
  return {
93
81
  mergedClsPrefix: listInjection.mergedClsPrefix,
94
- mergedShowIcon: createRef('showIcon'),
95
- mergedDescriptionFirst: createRef('descriptionFirst'),
96
- mergedColumnsEven: createRef('columnsEven'),
97
- mergedRounded: createRef('rounded'),
82
+ mergedHoverable,
98
83
  mergedDisabled,
99
84
  mergedLoading,
100
- mergedLoadingSkeleton,
101
- mergedHoverable,
85
+ mergedShowIcon,
86
+ mergedRounded,
102
87
  mergedTag: createRef('tag'),
103
- resolveFirst,
88
+ resolveSlot,
104
89
  hasFocus,
105
90
  isPressed,
106
91
  handleClick,
@@ -108,14 +93,18 @@ exports.default = (0, vue_1.defineComponent)({
108
93
  handleBlur,
109
94
  handleFocus,
110
95
  bordered: listInjection.bordered,
111
- showDivider: listInjection.showDivider
96
+ showDivider: listInjection.showDivider,
97
+ size: listInjection.size
112
98
  };
113
99
  },
114
100
  render() {
115
- const { $slots, mergedClsPrefix, resolveFirst, showDivider } = this;
101
+ var _a, _b, _c, _d, _e, _f;
102
+ const { $slots, mergedClsPrefix, showDivider, prefixAlign, suffixAlign, size, resolveSlot } = this;
116
103
  const mergedTag = this.mergedTag || 'ul';
104
+ const skeletonOn = !!this.mergedLoading;
117
105
  const sharedCls = [
118
106
  `${mergedClsPrefix}-list-item`,
107
+ `${mergedClsPrefix}-list-item--${size}`,
119
108
  this.mergedHoverable && `${mergedClsPrefix}-list-item--hoverable`,
120
109
  this.mergedRounded && `${mergedClsPrefix}-list-item--rounded`,
121
110
  this.mergedDisabled && `${mergedClsPrefix}-list-item--disabled`,
@@ -129,70 +118,103 @@ exports.default = (0, vue_1.defineComponent)({
129
118
  onBlur: this.handleBlur,
130
119
  onFocus: this.handleFocus
131
120
  };
132
- const prefixNode = $slots.prefix && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__prefix` }, $slots.prefix()));
133
- const suffixNode = $slots.suffix && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__suffix` }, $slots.suffix()));
134
- if ($slots.default) {
135
- return (0, vue_1.h)(mergedTag, Object.assign({ class: [...sharedCls] }, sharedAttrs), [
136
- prefixNode,
137
- (0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__main` }, $slots.default()),
138
- suffixNode,
139
- showDivider && (0, vue_1.h)("hr", { class: `${mergedClsPrefix}-list-item__divider` })
140
- ]);
121
+ function renderIcon(icon) {
122
+ return () => (0, vue_1.h)(icon_1.UIcon, null, { default: () => (0, vue_1.h)(icon) });
141
123
  }
142
- else {
143
- let avatarNode, headerNode, descriptionNode, headerSideNode, descriptionSideNode, iconNode;
144
- const resolveAvatar = resolveFirst('avatar');
145
- const resolveHeader = resolveFirst('header');
146
- const resolveDescription = resolveFirst('description');
147
- const resolveHeaderSide = resolveFirst('headerSide');
148
- const resolveDescriptionSide = resolveFirst('descriptionSide');
149
- const resolveIcon = resolveFirst('icon');
150
- if (this.mergedLoading) {
151
- iconNode = ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__icon` },
152
- (0, vue_1.h)(_internal_1.UBaseLoading, { clsPrefix: mergedClsPrefix, key: "loading", strokeWidth: 20 })));
124
+ const renderAvatar = () => {
125
+ if (!Object.values(this.avatar).length)
126
+ return null;
127
+ const Avatar = ((0, vue_1.h)(avatar_1.UAvatar, Object.assign({ size: size }, this.avatar, { icon: undefined }), renderIcon(this.avatar.icon)));
128
+ return this.avatar.hasBadge ? ((0, vue_1.h)(badge_1.UBadge, Object.assign({}, this.badge), { default: () => Avatar })) : (Avatar);
129
+ };
130
+ const prefixSkeletonSizes = {
131
+ large: 54,
132
+ medium: 48,
133
+ small: 42
134
+ };
135
+ const prefixSkeletonSize = prefixSkeletonSizes[size];
136
+ const prefixSkeletonborderRadius = this.avatar.circle ? 100 : 12;
137
+ const prefixNode = $slots.prefix || renderAvatar() ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__prefix ${mergedClsPrefix}-align-${prefixAlign}` }, skeletonOn || this.loadingPrefix ? ((0, vue_1.h)(_internal_1.UBaseSkeleton, { width: `${prefixSkeletonSize}px`, height: `${prefixSkeletonSize}px`, style: { borderRadius: `${prefixSkeletonborderRadius}px` } })) : $slots.prefix ? ($slots.prefix()) : (renderAvatar()))) : null;
138
+ const header = ((_a = this.header) === null || _a === void 0 ? void 0 : _a.text) || resolveSlot('header');
139
+ const description = ((_b = this.description) === null || _b === void 0 ? void 0 : _b.text) || resolveSlot('description');
140
+ const hasLeft = !!(header || description);
141
+ const textVariant = {
142
+ large: {
143
+ title: 'body-l-medium',
144
+ subtitle: 'body-m-medium'
145
+ },
146
+ medium: {
147
+ title: 'body-m-medium',
148
+ subtitle: 'body-s-medium'
149
+ },
150
+ small: {
151
+ title: 'body-l-medium',
152
+ subtitle: 'body-m-medium'
153
153
  }
154
- if (this.mergedLoadingSkeleton) {
155
- avatarNode = resolveAvatar && ((0, vue_1.h)(_internal_1.UBaseSkeleton, { class: `${mergedClsPrefix}-list-item__avatar`, circle: true, height: "48px" }));
156
- headerNode = resolveHeader && ((0, vue_1.h)(_internal_1.UBaseSkeleton, { class: `${mergedClsPrefix}-list-item__title`, text: true, sharp: false, style: "border-radius: 4px;" }));
157
- descriptionNode = resolveDescription && ((0, vue_1.h)(_internal_1.UBaseSkeleton, { class: `${mergedClsPrefix}-list-item__subtitle`, text: true, sharp: false, width: "82%", style: "border-radius: 4px;" }));
158
- headerSideNode = resolveHeaderSide && ((0, vue_1.h)(_internal_1.UBaseSkeleton, { class: `${mergedClsPrefix}-list-item__title`, text: true, sharp: false, width: "60%", style: "border-radius: 4px;" }));
159
- descriptionSideNode = resolveDescriptionSide && ((0, vue_1.h)(_internal_1.UBaseSkeleton, { class: `${mergedClsPrefix}-list-item__subtitle`, text: true, sharp: false, style: "border-radius: 4px;" }));
160
- iconNode = resolveIcon && ((0, vue_1.h)(_internal_1.UBaseSkeleton, { class: `${mergedClsPrefix}-list-item__icon`, circle: true, height: "24px" }));
154
+ };
155
+ const defaultHeaderProps = {
156
+ position: 'top',
157
+ variant: textVariant[size].title,
158
+ align: 'center',
159
+ skeleton: {
160
+ sharp: false,
161
+ height: '24px'
161
162
  }
162
- else {
163
- avatarNode = resolveAvatar && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__avatar` }, resolveAvatar()));
164
- headerNode = resolveHeader && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__title` }, resolveHeader()));
165
- descriptionNode = resolveDescription && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__subtitle` }, resolveDescription()));
166
- headerSideNode = resolveHeaderSide && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__title` }, resolveHeaderSide()));
167
- descriptionSideNode = resolveDescriptionSide && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__subtitle` }, resolveDescriptionSide()));
168
- iconNode = this.mergedShowIcon ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__icon` }, resolveIcon ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__subtitle` }, resolveIcon())) : ((0, vue_1.h)(_internal_1.UBaseIcon, { clsPrefix: mergedClsPrefix }, () => (0, vue_1.h)(icons_1.ChevronRightIcon, null))))) : null;
163
+ };
164
+ const defaultDescriptionProps = {
165
+ position: 'bottom',
166
+ variant: textVariant[size].subtitle,
167
+ skeleton: {
168
+ sharp: false,
169
+ height: '24px'
169
170
  }
170
- const leftNode = headerNode || descriptionNode ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__content ${mergedClsPrefix}-list-item__content--left` },
171
- headerNode,
172
- descriptionNode)) : null;
173
- const rightNode = headerSideNode || descriptionSideNode ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__content ${mergedClsPrefix}-list-item__content--right` },
174
- headerSideNode,
175
- descriptionSideNode)) : null;
176
- return (0, vue_1.h)(mergedTag, Object.assign({ class: [
177
- ...sharedCls,
178
- `${mergedClsPrefix}-list-item--default`,
179
- this.mergedDescriptionFirst &&
180
- `${mergedClsPrefix}-list-item--description-first`,
181
- this.mergedColumnsEven &&
182
- `${mergedClsPrefix}-list-item--columns-even`,
183
- this.mergedLoadingSkeleton &&
184
- `${mergedClsPrefix}-list-item--loading-skeleton`
185
- ] }, sharedAttrs), [
186
- prefixNode,
187
- (0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__main` },
188
- avatarNode,
189
- (0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__text` },
190
- leftNode,
191
- rightNode),
192
- iconNode),
193
- suffixNode,
194
- showDivider && (0, vue_1.h)("hr", { class: `${mergedClsPrefix}-list-item__divider` })
195
- ]);
171
+ };
172
+ const headerProps = Object.assign(Object.assign(Object.assign({}, defaultHeaderProps), this.header), { skeleton: Object.assign(Object.assign({}, defaultHeaderProps.skeleton), (_c = this.header) === null || _c === void 0 ? void 0 : _c.skeleton) });
173
+ const descriptionProps = Object.assign(Object.assign(Object.assign({}, defaultDescriptionProps), this.description), { skeleton: Object.assign(Object.assign({}, defaultDescriptionProps.skeleton), (_d = this.description) === null || _d === void 0 ? void 0 : _d.skeleton) });
174
+ function renderTextNode(content, props, classSuffix) {
175
+ return content ? ((0, vue_1.h)(_internal_1.InternalUText, Object.assign({}, props, { text: undefined, align: undefined, skeleton: undefined, class: `${mergedClsPrefix}-list-item__${classSuffix}` }), {
176
+ default: () => skeletonOn || (props === null || props === void 0 ? void 0 : props.loading) ? ((0, vue_1.h)(_internal_1.UBaseSkeleton, Object.assign({}, props.skeletonPro, { style: { borderRadius: '6px' } }))) : typeof content === 'string' ? (props.text) : (content())
177
+ })) : null;
196
178
  }
179
+ const headerNode = renderTextNode(header, headerProps, 'title');
180
+ const descriptionNode = renderTextNode(description, descriptionProps, 'subtitle');
181
+ const headerSide = ((_e = this.headerSide) === null || _e === void 0 ? void 0 : _e.text) || resolveSlot('headerSide');
182
+ const descriptionSide = ((_f = this.descriptionSide) === null || _f === void 0 ? void 0 : _f.text) || resolveSlot('descriptionSide');
183
+ const hasRight = !!(headerSide || descriptionSide);
184
+ const headerSideProps = Object.assign(Object.assign({}, defaultHeaderProps), this.headerSide);
185
+ const descriptionSideProps = Object.assign(Object.assign({}, defaultDescriptionProps), this.descriptionSide);
186
+ const headerSideNode = renderTextNode(headerSide, headerSideProps, 'title');
187
+ const descriptionSideNode = renderTextNode(descriptionSide, descriptionSideProps, 'subtitle');
188
+ const leftNode = hasLeft ? ((0, vue_1.h)("div", { class: [
189
+ `${mergedClsPrefix}-list-item__content`,
190
+ `${mergedClsPrefix}-list-item__content--left`,
191
+ headerProps.align && `${mergedClsPrefix}-align-${headerProps.align}`,
192
+ !(headerSide || descriptionSide) &&
193
+ `${mergedClsPrefix}-list-item__content--full`
194
+ ] }, (headerProps === null || headerProps === void 0 ? void 0 : headerProps.position) === 'top' &&
195
+ descriptionProps.position === 'bottom'
196
+ ? [headerNode, descriptionNode]
197
+ : [descriptionNode, headerNode])) : null;
198
+ const rightNode = hasRight ? ((0, vue_1.h)("div", { class: [
199
+ `${mergedClsPrefix}-list-item__content`,
200
+ `${mergedClsPrefix}-list-item__content--right`,
201
+ headerSideProps.align &&
202
+ `${mergedClsPrefix}-align-${headerSideProps.align}`,
203
+ !(header || description) &&
204
+ `${mergedClsPrefix}-list-item__content--full`
205
+ ] }, (headerSideProps === null || headerSideProps === void 0 ? void 0 : headerSideProps.position) === 'top' &&
206
+ descriptionSideProps.position === 'bottom'
207
+ ? [headerSideNode, descriptionSideNode]
208
+ : [descriptionSideNode, headerSideNode])) : null;
209
+ const suffixIcon = !skeletonOn && this.mergedShowIcon ? ((0, vue_1.h)(_internal_1.UBaseIcon, { clsPrefix: mergedClsPrefix }, () => (0, vue_1.h)(icons_1.ChevronRightIcon, null))) : null;
210
+ const suffixSkeletonSize = 24;
211
+ const suffixNode = ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__suffix ${mergedClsPrefix}-align-${suffixAlign}` }, (skeletonOn || this.loadingSuffix) && this.mergedShowIcon ? ((0, vue_1.h)(_internal_1.UBaseSkeleton, { width: `${suffixSkeletonSize}px`, height: `${suffixSkeletonSize}px`, circle: true })) : ([$slots.suffix ? $slots.suffix() : suffixIcon])));
212
+ return (0, vue_1.h)(mergedTag, Object.assign({ class: sharedCls }, sharedAttrs), [
213
+ prefixNode,
214
+ (0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__main` },
215
+ (0, vue_1.h)("div", { class: `${mergedClsPrefix}-list-item__text` }, $slots.default ? $slots.default() : [leftNode, rightNode])),
216
+ suffixNode,
217
+ showDivider && (0, vue_1.h)("hr", { class: `${mergedClsPrefix}-list-item__divider` })
218
+ ]);
197
219
  }
198
220
  });
@@ -1,6 +1,7 @@
1
1
  import { ExtractPublicPropTypes } from '../../_utils';
2
2
  import type { PropType, Ref } from 'vue';
3
3
  import { VNodeChild } from 'vue';
4
+ export type Size = 'small' | 'medium' | 'large';
4
5
  export interface BooleanProp {
5
6
  type: BooleanConstructor;
6
7
  default: undefined;
@@ -1,6 +1,10 @@
1
1
  import { ArrayMouseHandler, ArrayKeyboardHandler, ArrayEmptyHandler, ArrayFocusHandler, ExtractPublicPropTypes } from '../../_utils';
2
- import type { PropType, Ref } from 'vue';
3
- import { ListItemPropsBoolean, ListItemPropsRenderable, ExtractIntoInjection, ListInjectionBoolean, ListInjectionRenderable } from './interface';
2
+ import type { Component, PropType, Ref } from 'vue';
3
+ import { ListItemPropsBoolean, ListItemPropsRenderable, ExtractIntoInjection, ListInjectionBoolean, ListInjectionRenderable, Size } from './interface';
4
+ import { InternalTextProps } from '../../_internal/typography';
5
+ import { SkeletonProps } from '../../_internal/skeleton';
6
+ import { AvatarProps } from '../../avatar';
7
+ import { BadgeProps } from '../../badge';
4
8
  export declare const listItemPropsBoolean: Array<keyof ListItemPropsBoolean>;
5
9
  export declare const listItemPropsRenderable: Array<keyof ListItemPropsRenderable>;
6
10
  export declare const listItemBaseProps: {
@@ -39,11 +43,55 @@ export declare const listItemBaseProps: {
39
43
  icon: import("./interface").RenderableProp;
40
44
  avatar: import("./interface").RenderableProp;
41
45
  };
46
+ export type HeaderPropObject = InternalTextProps & Partial<{
47
+ loading: boolean;
48
+ position: 'top' | 'bottom';
49
+ skeleton: SkeletonProps;
50
+ align: 'stretch' | 'start' | 'center' | 'end';
51
+ }>;
52
+ export type DescriptionPropsObject = InternalTextProps & Partial<{
53
+ loading: boolean;
54
+ position: 'top' | 'bottom';
55
+ skeleton: SkeletonProps;
56
+ }>;
42
57
  export declare const listItemProps: {
58
+ avatar: {
59
+ type: PropType<AvatarProps & {
60
+ icon: Component;
61
+ hasBadge?: boolean;
62
+ }>;
63
+ default: () => {};
64
+ };
65
+ badge: {
66
+ type: PropType<BadgeProps>;
67
+ default: () => {};
68
+ };
43
69
  tag: {
44
70
  type: StringConstructor;
45
71
  default: undefined;
46
72
  };
73
+ prefixAlign: {
74
+ type: PropType<"start" | "center" | "end">;
75
+ default: string;
76
+ };
77
+ suffixAlign: {
78
+ type: PropType<"start" | "center" | "end">;
79
+ default: string;
80
+ };
81
+ loadingPrefix: BooleanConstructor;
82
+ loadingSuffix: BooleanConstructor;
83
+ header: {
84
+ type: PropType<HeaderPropObject>;
85
+ };
86
+ description: {
87
+ type: PropType<DescriptionPropsObject>;
88
+ };
89
+ headerSide: {
90
+ type: PropType<HeaderPropObject>;
91
+ };
92
+ descriptionSide: {
93
+ type: PropType<DescriptionPropsObject>;
94
+ };
47
95
  onClick: {
48
96
  type: PropType<ArrayMouseHandler | undefined>;
49
97
  default: undefined;
@@ -72,14 +120,13 @@ export declare const listItemProps: {
72
120
  disabled: import("./interface").BooleanProp;
73
121
  loading: import("./interface").BooleanProp;
74
122
  loadingSkeleton: import("./interface").BooleanProp;
75
- header: import("./interface").RenderableProp;
76
- description: import("./interface").RenderableProp;
77
- headerSide: import("./interface").RenderableProp;
78
- descriptionSide: import("./interface").RenderableProp;
79
123
  icon: import("./interface").RenderableProp;
80
- avatar: import("./interface").RenderableProp;
81
124
  };
82
125
  export declare const listProps: {
126
+ size: {
127
+ type: PropType<Size>;
128
+ default: string;
129
+ };
83
130
  showIcon: {
84
131
  type: BooleanConstructor;
85
132
  default: boolean;
@@ -129,18 +176,12 @@ export declare const listProps: {
129
176
  icon: import("./interface").RenderableProp;
130
177
  avatar: import("./interface").RenderableProp;
131
178
  theme: PropType<import("../../_mixins").Theme<"List", {
132
- padding: string;
133
179
  iconSize: string;
134
180
  iconSpace: string;
135
181
  suffixSpace: string;
136
182
  prefixSpace: string;
137
- titleSize: string;
138
- titleLineHeight: string;
139
- subtitleSize: string;
140
- subtitleLineHeight: string;
141
183
  subtitleColor: string;
142
184
  avatarSpace: string;
143
- minHeight: string;
144
185
  colorFocus: string;
145
186
  pressedScale: string;
146
187
  textColorDisabled: string;
@@ -154,22 +195,19 @@ export declare const listProps: {
154
195
  borderColor: string;
155
196
  borderColorModal: string;
156
197
  borderColorPopover: string;
157
- borderRadius: string;
158
- fontSize: string;
198
+ borderRadiusLarge: string;
199
+ borderRadiusMedium: string;
200
+ borderRadiusSmall: string;
201
+ padding: string;
202
+ suffixSize: string;
159
203
  }, any>>;
160
204
  themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"List", {
161
- padding: string;
162
205
  iconSize: string;
163
206
  iconSpace: string;
164
207
  suffixSpace: string;
165
208
  prefixSpace: string;
166
- titleSize: string;
167
- titleLineHeight: string;
168
- subtitleSize: string;
169
- subtitleLineHeight: string;
170
209
  subtitleColor: string;
171
210
  avatarSpace: string;
172
- minHeight: string;
173
211
  colorFocus: string;
174
212
  pressedScale: string;
175
213
  textColorDisabled: string;
@@ -183,22 +221,19 @@ export declare const listProps: {
183
221
  borderColor: string;
184
222
  borderColorModal: string;
185
223
  borderColorPopover: string;
186
- borderRadius: string;
187
- fontSize: string;
224
+ borderRadiusLarge: string;
225
+ borderRadiusMedium: string;
226
+ borderRadiusSmall: string;
227
+ padding: string;
228
+ suffixSize: string;
188
229
  }, any>>>;
189
230
  builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"List", {
190
- padding: string;
191
231
  iconSize: string;
192
232
  iconSpace: string;
193
233
  suffixSpace: string;
194
234
  prefixSpace: string;
195
- titleSize: string;
196
- titleLineHeight: string;
197
- subtitleSize: string;
198
- subtitleLineHeight: string;
199
235
  subtitleColor: string;
200
236
  avatarSpace: string;
201
- minHeight: string;
202
237
  colorFocus: string;
203
238
  pressedScale: string;
204
239
  textColorDisabled: string;
@@ -212,8 +247,11 @@ export declare const listProps: {
212
247
  borderColor: string;
213
248
  borderColorModal: string;
214
249
  borderColorPopover: string;
215
- borderRadius: string;
216
- fontSize: string;
250
+ borderRadiusLarge: string;
251
+ borderRadiusMedium: string;
252
+ borderRadiusSmall: string;
253
+ padding: string;
254
+ suffixSize: string;
217
255
  }, any>>>;
218
256
  };
219
257
  export type ListInjection = ExtractIntoInjection<typeof listItemBaseProps> & ListInjectionBoolean & ListInjectionRenderable & {
@@ -222,6 +260,7 @@ export type ListInjection = ExtractIntoInjection<typeof listItemBaseProps> & Lis
222
260
  bordered: Ref<boolean>;
223
261
  clickable: Ref<boolean>;
224
262
  showDivider: Ref<boolean>;
263
+ size: Ref<Size>;
225
264
  };
226
265
  export declare const listInjectionKey: import("vue").InjectionKey<ListInjection>;
227
266
  export type ListItemProps = ExtractPublicPropTypes<typeof listItemProps>;
@@ -10,8 +10,7 @@ exports.listItemPropsBoolean = [
10
10
  'hoverable',
11
11
  'rounded',
12
12
  'disabled',
13
- 'loading',
14
- 'loadingSkeleton'
13
+ 'loading'
15
14
  ];
16
15
  exports.listItemPropsRenderable = [
17
16
  'header',
@@ -45,11 +44,32 @@ exports.listItemBaseProps = Object.assign(Object.assign(Object.assign({}, export
45
44
  type: [Function, Array, undefined],
46
45
  default: undefined
47
46
  } });
48
- exports.listItemProps = Object.assign(Object.assign({}, exports.listItemBaseProps), { tag: {
47
+ const headerProps = {
48
+ type: Object
49
+ };
50
+ const descriptionProps = {
51
+ type: Object
52
+ };
53
+ exports.listItemProps = Object.assign(Object.assign({}, exports.listItemBaseProps), { avatar: {
54
+ type: Object,
55
+ default: () => ({})
56
+ }, badge: {
57
+ type: Object,
58
+ default: () => ({})
59
+ }, tag: {
49
60
  type: String,
50
61
  default: undefined
51
- } });
52
- exports.listProps = Object.assign(Object.assign(Object.assign({}, _mixins_1.useTheme.props), exports.listItemBaseProps), { showIcon: {
62
+ }, prefixAlign: {
63
+ type: String,
64
+ default: 'start'
65
+ }, suffixAlign: {
66
+ type: String,
67
+ default: 'start'
68
+ }, loadingPrefix: Boolean, loadingSuffix: Boolean, header: headerProps, description: descriptionProps, headerSide: headerProps, descriptionSide: descriptionProps });
69
+ exports.listProps = Object.assign(Object.assign(Object.assign({}, _mixins_1.useTheme.props), exports.listItemBaseProps), { size: {
70
+ type: [String],
71
+ default: 'medium'
72
+ }, showIcon: {
53
73
  type: Boolean,
54
74
  default: true
55
75
  }, tag: {