Skip to content

Commit

Permalink
test: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Javey committed Jan 25, 2024
1 parent 0c377b1 commit 9a37274
Show file tree
Hide file tree
Showing 45 changed files with 3,958 additions and 4,046 deletions.
2 changes: 1 addition & 1 deletion components/checkbox/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('Checkbox', () => {
}

const [instance, element] = mount(Demo);
const [checkbox1, checkbox2, checkbox3] = Array.from(element.querySelectorAll('.k-checkbox'));
const [checkbox1, checkbox2, checkbox3] = Array.from(element.querySelectorAll<HTMLElement>('.k-checkbox'));
checkbox2.click();
await wait();
expect(spy.callCount).to.eql(1);
Expand Down
3 changes: 1 addition & 2 deletions components/config/demos/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ import {ConfigProvider, Button, Input} from 'kpc';
```ts
import {Message} from 'kpc';

Message.classNamePrefix = 'kd';

export default class extends Component {
static template = template;

showMessage() {
Message.classNamePrefix = 'kd';
Message.info('Message with classNamePrefix');
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/diagram/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const downName = mxClient.IS_POINTER ? 'pointerdown' : 'mousedown';
const upName = mxClient.IS_POINTER ? 'pointerup' : 'mouseup';
const moveName = mxClient.IS_POINTER ? 'pointermove' : 'mousemove';

class BaseDemo<P = {}> extends Component<P> {
class BaseDemo<P extends {} = {}> extends Component<P> {
private Diagram = Diagram;
private DFlowLayout = DFlowLayout;
private DTreeLayout = DTreeLayout;
Expand Down
4 changes: 2 additions & 2 deletions components/select/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export interface BaseSelectEvents {
}

export interface BaseSelectBlocks<V> {
value: [V, Children]
values: [V[], Children[]]
value: [V, string]
values: [V[], string[]]
prefix: null
suffix: null
}
Expand Down
2 changes: 1 addition & 1 deletion components/transfer/demos/customFilter.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ componentWillUnmount() {
this.$unmounted = true;
}
setState<K extends keyof Props>(state: Pick<Props, K>, cb?: () => void) {
setState(state: any, cb?: () => void) {
if ('policy' in state) {
super.setState(state, this.fetch);
} else if ('keywords' in state) {
Expand Down
3 changes: 2 additions & 1 deletion components/tree/useNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import type {Tree} from './';
import {isNullOrUndefined} from 'intact-shared';

export type DataItem<K extends Key> = {
label?: Children
// label?: Children
label?: any
key?: K
disabled?: boolean
loaded?: boolean
Expand Down
2 changes: 1 addition & 1 deletion components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function isStringOrNumberNotEmpty(o: any): o is string | number {
return type === 'string' && !/^\s+$/.test(o) || type === 'number';
}

export function getRestProps<T>(component: Component<T>, props = component.get()) {
export function getRestProps<T extends {}>(component: Component<T>, props = component.get()) {
const Ctor = component.constructor as typeof Component;
const typeDefs = Ctor.typeDefs;
const events = (Ctor as any).events;
Expand Down
2 changes: 1 addition & 1 deletion hooks/useReceive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function useReceive<T extends Component>(
let shouldCall = false;
props.forEach(prop => {
instance.on(
`$receive:${prop}` as any,
`$receive:${prop as string}` as any,
(newValue: unknown, oldValue: unknown, init: boolean) => {
if (ignoreInit && init) return;
shouldCall = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/kpc-react/__tests__/__snapshots__/Dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#### `should render vNode as content`

```
"<div class=\"k-dialog-header\"></div><div class=\"k-dialog-body\"><div class=\"k-dialog-tip-icon\"><i class=\"k-icon test css-1s6te75\"></i></div><div class=\"k-alert-dialog-wrapper\"><div>test</div><!-- react-mount-point-unstable --></div></div><div class=\"k-dialog-footer\"><button class=\"k-btn k-dialog-cancel css-1832za1\" tabindex=\"0\" type=\"button\">取消</button><button class=\"k-btn k-primary k-dialog-ok css-1832za1\" tabindex=\"0\" type=\"button\">确定</button></div>"
"<div class=\"k-dialog-header\"></div><div class=\"k-dialog-body\"><div class=\"k-dialog-tip-icon\"><i class=\"k-icon test css-16qej3\"></i></div><div class=\"k-alert-dialog-wrapper\"><div>test</div><!-- react-mount-point-unstable --></div></div><div class=\"k-dialog-footer\"><button class=\"k-btn k-default k-dialog-cancel css-12pzj9v\" tabindex=\"0\" type=\"button\">取消</button><button class=\"k-btn k-primary k-dialog-ok css-12pzj9v\" tabindex=\"0\" type=\"button\">确定</button></div>"
```

514 changes: 260 additions & 254 deletions packages/kpc-react/__tests__/__snapshots__/React Demos.md

Large diffs are not rendered by default.

516 changes: 261 additions & 255 deletions packages/kpc-vue-next/__tests__/__snapshots__/Vue Next Demos.md

Large diffs are not rendered by default.

678 changes: 342 additions & 336 deletions packages/kpc-vue/__tests__/__snapshots__/Vue Legacy Demos.md

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions test/__snapshots__/Carousel.md

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions test/__snapshots__/Cascader.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
#### `basic test`

```
"<div class=\"k-dropdown-item k-cascader-option css-vj004t\">北京<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option k-active k-dropdown-open css-vj004t\">湖南<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal-->"
"<div class=\"k-dropdown-item k-cascader-option css-vj004t\">北京<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option k-active k-dropdown-open css-vj004t\">湖南<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal-->"
```

```
"<div class=\"k-select k-cascader css-1ti24q0\" tabindex=\"0\"><div class=\"k-select-main\"><input type=\"hidden\" value=\"hunan,yueyang,yueyangxian\"><div class=\"k-select-placeholder c-ellipsis k-fade-leave-from k-fade-leave-active\">请选择</div><div class=\"k-select-value c-ellipsis k-fade-enter-from k-fade-enter-active\">湖南 / 岳阳市 / 岳阳县</div></div><span class=\"k-select-suffix\"><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow k-icon-down css-1s6te75\"></i></span></span></div><!--portal-->
You selected: [\"hunan\",\"yueyang\",\"yueyangxian\"]<br><br><div class=\"k-select k-cascader css-1ti24q0\" tabindex=\"0\"><div class=\"k-select-main\"><input type=\"hidden\"><div class=\"k-select-placeholder c-ellipsis\">请选择</div></div><span class=\"k-select-suffix\"><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-rotate ion-load-c css-1s6te75\"></i></span></span></div><!--portal-->"
"<div class=\"k-select k-cascader css-1ti24q0\" tabindex=\"0\"><div class=\"k-select-main\"><input type=\"hidden\" value=\"hunan,yueyang,yueyangxian\"><div class=\"k-select-placeholder c-ellipsis k-fade-leave-from k-fade-leave-active\">请选择</div><div class=\"k-select-value c-ellipsis k-fade-enter-from k-fade-enter-active\">湖南 / 岳阳市 / 岳阳县</div></div><span class=\"k-select-suffix\"><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow k-icon-down css-16qej3\"></i></span></span></div><!--portal-->
You selected: [\"hunan\",\"yueyang\",\"yueyangxian\"]<br><br><div class=\"k-select k-cascader css-1ti24q0\" tabindex=\"0\"><div class=\"k-select-main\"><input type=\"hidden\"><div class=\"k-select-placeholder c-ellipsis\">请选择</div></div><span class=\"k-select-suffix\"><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-rotate ion-load-c css-16qej3\"></i></span></span></div><!--portal-->"
```

```
"<div class=\"k-dropdown-item k-cascader-option css-vj004t\">北京<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option k-active k-selected k-dropdown-open css-vj004t\">湖南<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal-->"
"<div class=\"k-dropdown-item k-cascader-option css-vj004t\">北京<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option k-active k-selected k-dropdown-open css-vj004t\">湖南<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal-->"
```

```
"<div class=\"k-dropdown-item k-cascader-option css-vj004t\">长沙市<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option k-active k-selected k-dropdown-open css-vj004t\">岳阳市<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal-->"
"<div class=\"k-dropdown-item k-cascader-option css-vj004t\">长沙市<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option k-active k-selected k-dropdown-open css-vj004t\">岳阳市<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal-->"
```

```
Expand All @@ -26,21 +26,21 @@
#### `custom label`

```
"<div class=\"k-select-main\"><input type=\"hidden\" value=\"beijing,haidian\"><div class=\"k-select-placeholder c-ellipsis k-fade-leave-from k-fade-leave-active\">请选择</div><div class=\"k-select-value c-ellipsis k-fade-enter-from k-fade-enter-active\"><div><i class=\"ion-ios-location\" style=\"line-height: 1; margin-right: 8px; vertical-align: middle;\"></i>海淀区</div></div></div><span class=\"k-select-suffix\"><i class=\"k-icon k-hoverable k-select-clear ion-ios-close k-show css-1s6te75\"></i><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow k-icon-down css-1s6te75\"></i></span></span>"
"<div class=\"k-select-main\"><input type=\"hidden\" value=\"beijing,haidian\"><div class=\"k-select-placeholder c-ellipsis k-fade-leave-from k-fade-leave-active\">请选择</div><div class=\"k-select-value c-ellipsis k-fade-enter-from k-fade-enter-active\"><div><i class=\"ion-ios-location\" style=\"line-height: 1; margin-right: 8px; vertical-align: middle;\"></i>海淀区</div></div></div><span class=\"k-select-suffix\"><i class=\"k-icon k-hoverable k-select-clear ion-ios-close k-show css-16qej3\"></i><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow k-icon-down css-16qej3\"></i></span></span>"
```

```
"<div class=\"k-select-main\"><input type=\"hidden\" value=\"hunan,yueyang,yueyangxian\"><div class=\"k-select-placeholder c-ellipsis k-fade-leave-from k-fade-leave-active\">请选择</div><div class=\"k-select-value c-ellipsis k-fade-enter-from k-fade-enter-active\"><div><i class=\"ion-ios-location\" style=\"line-height: 1; margin-right: 8px; vertical-align: middle;\"></i>岳阳县</div></div></div><span class=\"k-select-suffix\"><i class=\"k-icon k-hoverable k-select-clear ion-ios-close k-show css-1s6te75\"></i><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow k-icon-down css-1s6te75\"></i></span></span>"
"<div class=\"k-select-main\"><input type=\"hidden\" value=\"hunan,yueyang,yueyangxian\"><div class=\"k-select-placeholder c-ellipsis k-fade-leave-from k-fade-leave-active\">请选择</div><div class=\"k-select-value c-ellipsis k-fade-enter-from k-fade-enter-active\"><div><i class=\"ion-ios-location\" style=\"line-height: 1; margin-right: 8px; vertical-align: middle;\"></i>岳阳县</div></div></div><span class=\"k-select-suffix\"><i class=\"k-icon k-hoverable k-select-clear ion-ios-close k-show css-16qej3\"></i><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow k-icon-down css-16qej3\"></i></span></span>"
```

#### `load data asychronously`

```
"<i class=\"k-icon k-rotate ion-load-c k-cascader-loading css-1s6te75\"></i>"
"<i class=\"k-icon k-rotate ion-load-c k-cascader-loading css-16qej3\"></i>"
```

```
"<div class=\"k-dropdown-item k-cascader-option css-vj004t\">长沙市<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option css-vj004t\">岳阳市<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal-->"
"<div class=\"k-dropdown-item k-cascader-option css-vj004t\">长沙市<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option css-vj004t\">岳阳市<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal-->"
```

```
Expand All @@ -50,7 +50,7 @@
#### `filter`

```
"<div class=\"k-dropdown-item k-cascader-option k-hover css-vj004t\">北京<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option css-vj004t\">湖南<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal-->"
"<div class=\"k-dropdown-item k-cascader-option k-hover css-vj004t\">北京<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option css-vj004t\">湖南<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal-->"
```

```
Expand All @@ -74,10 +74,10 @@
#### `specify fields`

```
"<div class=\"k-dropdown-item k-cascader-option k-active k-dropdown-open css-vj004t\">北京<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option css-vj004t\">湖南<i class=\"k-icon k-cascader-arrow k-icon-right css-1s6te75\"></i></div><!--portal-->"
"<div class=\"k-dropdown-item k-cascader-option k-active k-dropdown-open css-vj004t\">北京<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal--><div class=\"k-dropdown-item k-cascader-option css-vj004t\">湖南<i class=\"k-icon k-cascader-arrow k-icon-right css-16qej3\"></i></div><!--portal-->"
```

```
"<div class=\"k-select-main\"><input type=\"hidden\" value=\"beijing,haidian\"><div class=\"k-select-placeholder c-ellipsis k-fade-leave-from k-fade-leave-active\">请选择</div><div class=\"k-select-value c-ellipsis k-fade-enter-from k-fade-enter-active\">北京 / 海淀区</div></div><span class=\"k-select-suffix\"><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow k-icon-down css-1s6te75\"></i></span></span>"
"<div class=\"k-select-main\"><input type=\"hidden\" value=\"beijing,haidian\"><div class=\"k-select-placeholder c-ellipsis k-fade-leave-from k-fade-leave-active\">请选择</div><div class=\"k-select-value c-ellipsis k-fade-enter-from k-fade-enter-active\">北京 / 海淀区</div></div><span class=\"k-select-suffix\"><span class=\"k-select-suffix-icon\"><i class=\"k-icon k-select-arrow k-icon-down css-16qej3\"></i></span></span>"
```

Loading

0 comments on commit 9a37274

Please sign in to comment.