Skip to content

Commit 0e0f43c

Browse files
authored
Merge pull request element-plus#14285 from element-plus/dev
D2M
2 parents ab9e871 + 4cccc76 commit 0e0f43c

File tree

48 files changed

+973
-558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+973
-558
lines changed

‎CHANGELOG.en-US.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,37 @@
11
## Changelog
2+
3+
### 2.3.13
4+
5+
_2023-09-14_
6+
7+
#### Features
8+
9+
- Components [el-pagination] add teleported prop (#14072 by @boomboy4)
10+
- Components [image-viewer] Add rotate event when rotating images (#14138 by @HADB)
11+
- Components [upload] support async data (#14015 by @jianjunyuu)
12+
13+
#### Bug fixes
14+
15+
- Components [select] gurad value type error (#14074 by @sseinHu)
16+
- Components [collapse] allow nested inputs in ElCollapseItem (#14061 by @kinggq)
17+
- Components [rate] bind the textColor property (#14092 by @yj-liuzepeng)
18+
- Components [table] add tabindex to tbody to fix #13991 (#14020 by @FrankFang)
19+
- Components [form] improve types (#14062 by @ModyQyW)
20+
- Components [select] fix hover index error when creating option (#12635 by @wzc520pyfm)
21+
- I18n improve Dutch(nl) translation (#14164 by @JBtje)
22+
- Components [color-picker] first click should be trigger (#14209 by @wonderl17)
23+
- Docs [date-picker] `calendar-change` event parameter type error (#14237 by @btea)
24+
- Docs [upload] fix the version of supporting async data (#14242 by @HADB)
25+
- Components [collapse] fix accessibility issues (#13832 by @Karolis-Stoncius)
26+
- Components [date-picker] month range should emit `calendar-change` (#14262 by @Justineo)
27+
- Components [input] missing autofocus types (#14246 by @HeftyKoo)
28+
29+
#### Refactors
30+
31+
- Components [upload] reuse revkoeObjectURL function (#14126 by @HeftyKoo)
32+
- Components [collapse] replace `keypress` with `keydown` (#14137 by @btea)
33+
- Components [date-picker] add aria-labels to date picker btns (#14149 by @Karolis-Stoncius)
34+
- Components [date-picker] basic-date-table (#10344 by @jw-foss)
235

336
### 2.3.11
437

‎docs/.vitepress/vitepress/components/common/vp-theme-toggler.vue‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<script setup lang="ts">
22
import { ref, watch } from 'vue'
3-
import { isDark } from '../../composables/dark'
3+
import { isDark, toggleDark } from '../../composables/dark'
44
import DarkIcon from '../icons/dark.vue'
55
import LightIcon from '../icons/light.vue'
66
77
const darkMode = ref(isDark.value)
88
99
watch(
10-
() => isDark.value,
11-
(val) => {
12-
darkMode.value = val
10+
() => darkMode.value,
11+
() => {
12+
toggleDark()
1313
}
1414
)
1515
</script>
@@ -31,16 +31,19 @@ watch(
3131
--el-switch-on-color: var(--bg-color-mute);
3232
--el-switch-off-color: var(--bg-color-mute);
3333
--el-switch-border-color: var(--border-color);
34+
3435
.el-switch__action {
3536
width: 14px;
3637
height: 14px;
3738
}
3839
}
40+
3941
:deep(.dark-icon) {
4042
border-radius: 50%;
4143
color: #cfd3dc;
4244
background-color: #141414;
4345
}
46+
4447
:deep(.light-icon) {
4548
color: #606266;
4649
}

‎docs/.vitepress/vitepress/components/full-screen/vp-theme-toggler.vue‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import CommonThemeToggler from '../common/vp-theme-toggler.vue'
3-
import { isDark, toggleDark } from '../../composables/dark'
3+
import { isDark } from '../../composables/dark'
44
import { useNavbarLocale } from '../../composables/navbar-locale'
55
66
const locale = useNavbarLocale()
@@ -12,7 +12,6 @@ const locale = useNavbarLocale()
1212
<CommonThemeToggler
1313
:aria-label="locale['theme-toggler']"
1414
:aria-checked="isDark"
15-
@click="toggleDark()"
1615
/>
1716
</div>
1817
</template>

‎docs/.vitepress/vitepress/components/navbar/vp-theme-toggler.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { isDark, toggleDark } from '../../composables/dark'
2+
import { isDark } from '../../composables/dark'
33
import { useNavbarLocale } from '../../composables/navbar-locale'
44
import CommonThemeToggler from '../common/vp-theme-toggler.vue'
55
@@ -11,13 +11,13 @@ const locale = useNavbarLocale()
1111
<CommonThemeToggler
1212
:aria-label="locale['theme-toggler']"
1313
:aria-checked="isDark"
14-
@click="() => toggleDark()"
1514
/>
1615
</div>
1716
</template>
1817

1918
<style scoped lang="scss">
2019
@use '../../styles/mixins' as *;
20+
2121
.theme-toggler-content {
2222
@include with-bg;
2323
background-color: transparent;

‎docs/en-US/component/card.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ card/shadow
5151

5252
### Attributes
5353

54-
| Name | Description | Type | Default |
55-
| ---------- | ------------------------------------------------------------- | --------------------------------- | ------- |
56-
| header | title of the card. Also accepts a DOM passed by `slot#header` | ^[string] ||
57-
| body-style | CSS style of card body | ^[object]`CSSProperties` ||
54+
| Name | Description | Type | Default |
55+
| -------------------- | ------------------------------------------------------------- | --------------------------------- | ------- |
56+
| header | title of the card. Also accepts a DOM passed by `slot#header` | ^[string] ||
57+
| body-style | CSS style of card body | ^[object]`CSSProperties` ||
5858
| body-class ^(2.3.10) | custom class name of card body | ^[string] ||
59-
| shadow | when to show card shadows | ^[enum]`always \| never \| hover` | always |
59+
| shadow | when to show card shadows | ^[enum]`always \| never \| hover` | always |
6060

6161
### Slots
6262

‎docs/en-US/component/collapse.md‎

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,40 @@ collapse/customization
3737

3838
:::
3939

40-
## Collapse Attributes
40+
## Collapse API
4141

42-
| Name | Description | Type | Accepted Values | Default |
43-
| --------------------- | ---------------------------------- | ---------------------------------------------------- | --------------- | ------- |
44-
| model-value / v-model | currently active panel | string (accordion mode) / array (non-accordion mode) |||
45-
| accordion | whether to activate accordion mode | boolean || false |
42+
### Collapse Attributes
4643

47-
## Collapse Events
44+
| Name | Description | Type | Default |
45+
| --------------------- | ---------------------------------- | ---------------------------------------------------------- | ------- |
46+
| model-value / v-model | currently active panel | ^[string] (accordion mode) / ^[array] (non-accordion mode) ||
47+
| accordion | whether to activate accordion mode | ^[boolean] | false |
4848

49-
| Name | Description | Parameters |
50-
| ------ | ---------------------------------- | ------------------------------------------------------------------- |
51-
| change | triggers when active panels change | (activeNames: array (non-accordion mode) / string (accordion mode)) |
49+
### Collapse Events
5250

53-
## Collapse Slots
51+
| Name | Description | Parameters |
52+
| ------ | ---------------------------------- | --------------------------------------------------------------------- |
53+
| change | triggers when active panels change | `(activeNames: array (non-accordion mode) / string (accordion mode))` |
5454

55-
| Name | Description | Subtags |
56-
| ---- | ------------------------- | ------------- |
57-
| - | customize default content | Collapse Item |
55+
### Collapse Slots
5856

59-
## Collapse Item Attributes
57+
| Name | Description | Subtags |
58+
| ------- | ------------------------- | ------------- |
59+
| default | customize default content | Collapse Item |
6060

61-
| Name | Description | Type | Accepted Values | Default |
62-
| -------- | ---------------------------------- | ------------- | --------------- | ------- |
63-
| name | unique identification of the panel | string/number |||
64-
| title | title of the panel | string |||
65-
| disabled | disable the collapse item | boolean |||
61+
## Collapse Item API
6662

67-
## Collapse Item Slot
63+
### Collapse Item Attributes
6864

69-
| Name | Description |
70-
| ----- | ------------------------------ |
71-
|| content of Collapse Item |
72-
| title | content of Collapse Item title |
65+
| Name | Description | Type | Default |
66+
| -------- | ---------------------------------- | ------------------- | ------- |
67+
| name | unique identification of the panel | ^[string]/^[number] ||
68+
| title | title of the panel | ^[string] ||
69+
| disabled | disable the collapse item | ^[boolean] ||
70+
71+
### Collapse Item Slot
72+
73+
| Name | Description |
74+
| ------- | ------------------------------ |
75+
| default | content of Collapse Item |
76+
| title | content of Collapse Item title |

‎docs/en-US/component/date-picker.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,19 +177,19 @@ Note, date time locale (month name, first day of the week ...) are also configur
177177

178178
## Events
179179

180-
| Name | Description | Parameters |
181-
| --------------- | ------------------------------------------------------------------------- | ----------------------- |
182-
| change | triggers when user confirms the value | `(val: typeof v-model)` |
183-
| blur | triggers when Input blurs | `(e: FocusEvent)` |
184-
| focus | triggers when Input focuses | `(e: FocusEvent)` |
185-
| calendar-change | triggers when the calendar selected date is changed. Only for `daterange` | `(val: [Date, Date])` |
186-
| panel-change | triggers when the navigation button click. | `(date, mode, view)` |
187-
| visible-change | triggers when the DatePicker's dropdown appears/disappears | `(visibility: boolean)` |
180+
| Name | Description | Parameters |
181+
| --------------- | ---------------------------------------------------------- | ----------------------------- |
182+
| change | triggers when user confirms the value | `(val: typeof v-model)` |
183+
| blur | triggers when Input blurs | `(e: FocusEvent)` |
184+
| focus | triggers when Input focuses | `(e: FocusEvent)` |
185+
| calendar-change | triggers when the calendar selected date is changed. | `(val: [Date, null \| Date])` |
186+
| panel-change | triggers when the navigation button click. | `(date, mode, view)` |
187+
| visible-change | triggers when the DatePicker's dropdown appears/disappears | `(visibility: boolean)` |
188188

189189
## Methods
190190

191191
| Method | Description | Parameters |
192-
|-----------------------| --------------------------- | ---------- |
192+
| --------------------- | --------------------------- | ---------- |
193193
| focus | focus the Input component ||
194194
| handleOpen ^(2.2.16) | open the DatePicker popper ||
195195
| handleClose ^(2.2.16) | close the DatePicker popper ||

‎docs/en-US/component/form.md‎

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,39 @@ type FormValidateCallback = (
235235
interface FormItemRule extends RuleItem {
236236
trigger?: Arrayable<string>
237237
}
238-
type FormRules = Partial<Record<string, Arrayable<FormItemRule>>>
238+
239+
type Primitive = null | undefined | string | number | boolean | symbol | bigint
240+
type BrowserNativeObject = Date | FileList | File | Blob | RegExp
241+
type IsTuple<T extends ReadonlyArray<any>> = number extends T['length']
242+
? false
243+
: true
244+
type ArrayMethodKey = keyof any[]
245+
type TupleKey<T extends ReadonlyArray<any>> = Exclude<keyof T, ArrayMethodKey>
246+
type ArrayKey = number
247+
type PathImpl<K extends string | number, V> = V extends
248+
| Primitive
249+
| BrowserNativeObject
250+
? `${K}`
251+
: `${K}` | `${K}.${Path<V>}`
252+
type Path<T> = T extends ReadonlyArray<infer V>
253+
? IsTuple<T> extends true
254+
? {
255+
[K in TupleKey<T>]-?: PathImpl<Exclude<K, symbol>, T[K]>
256+
}[TupleKey<T>]
257+
: PathImpl<ArrayKey, V>
258+
: {
259+
[K in keyof T]-?: PathImpl<Exclude<K, symbol>, T[K]>
260+
}[keyof T]
261+
type FieldPath<T> = T extends object ? Path<T> : never
262+
// MaybeRef: see [@vueuse/core](https://github.com/vueuse/vueuse/blob/main/packages/shared/utils/types.ts)
263+
// UnwrapRef: see [vue](https://github.com/vuejs/core/blob/main/packages/reactivity/src/ref.ts)
264+
type FormRules<T extends MaybeRef<Record<string, any> | string> = string> =
265+
Partial<
266+
Record<
267+
UnwrapRef<T> extends string ? UnwrapRef<T> : FieldPath<UnwrapRef<T>>,
268+
Arrayable<FormItemRule>
269+
>
270+
>
239271
```
240272
241273
</details>

‎docs/en-US/component/image.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ image/image-preview
116116
| ------ | ------------------------------------------------------------------------------------------------- | ------------------------------------ |
117117
| close | trigger when clicking on close button or when `hide-on-click-modal` enabled clicking on backdrop. | ^[Function]`() => void` |
118118
| switch | trigger when switching images. | ^[Function]`(index: number) => void` |
119+
| rotate ^(2.3.13) | trigger when rotating images. | ^[Function]`(deg: number) => void` |
119120

120121
### Image Viewer Exposes
121122

‎docs/en-US/component/input-number.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ input-number/controlled
8484
### Attributes
8585

8686
| Name | Description | Type | Default |
87-
|-------------------------| ------------------------------------------------ | --------------------------------------------- | --------- |
87+
| ----------------------- | ------------------------------------------------ | --------------------------------------------- | --------- |
8888
| model-value / v-model | binding value | ^[number] ||
8989
| min | the minimum allowed value | ^[number] | -Infinity |
9090
| max | the maximum allowed value | ^[number] | Infinity |

0 commit comments

Comments
 (0)