@king-design/intact 3.3.0 → 3.3.2
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/components/breadcrumb/index.ts +1 -1
- package/components/breadcrumb/index.vdt +5 -1
- package/components/cascader/demos/filterable.md +4 -0
- package/components/cascader/index.spec.ts +23 -0
- package/components/cascader/index.ts +2 -1
- package/components/cascader/index.vdt +5 -3
- package/components/cascader/styles.ts +3 -0
- package/components/cascader/useFilterable.ts +13 -4
- package/components/config/demos/disableWave.md +47 -0
- package/components/config/index.md +2 -1
- package/components/config/index.ts +3 -1
- package/components/datepicker/index.ts +1 -0
- package/components/dropdown/menu.ts +1 -1
- package/components/input/index.ts +2 -2
- package/components/menu/.DS_Store +0 -0
- package/components/menu/demos/.DS_Store +0 -0
- package/components/menu/styles.ts +5 -5
- package/components/select/useInput.ts +5 -1
- package/components/table/styles.ts +5 -2
- package/components/tooltip/styles.ts +0 -1
- package/components/upload/index.vdt +3 -2
- package/components/upload/styles.ts +11 -0
- package/components/wave/index.ts +3 -0
- package/es/components/breadcrumb/index.js +1 -1
- package/es/components/breadcrumb/index.vdt.js +6 -2
- package/es/components/cascader/index.js +2 -1
- package/es/components/cascader/index.spec.js +32 -0
- package/es/components/cascader/index.vdt.js +8 -3
- package/es/components/cascader/styles.js +1 -1
- package/es/components/cascader/useFilterable.d.ts +2 -1
- package/es/components/cascader/useFilterable.js +15 -4
- package/es/components/config/index.d.ts +2 -0
- package/es/components/config/index.js +3 -0
- package/es/components/datepicker/index.d.ts +1 -0
- package/es/components/datepicker/index.js +2 -0
- package/es/components/dialog/base.d.ts +1 -0
- package/es/components/dropdown/menu.js +1 -1
- package/es/components/input/index.d.ts +1 -1
- package/es/components/input/index.js +1 -1
- package/es/components/menu/styles.js +3 -3
- package/es/components/select/base.d.ts +1 -0
- package/es/components/select/useInput.js +5 -1
- package/es/components/table/styles.js +3 -3
- package/es/components/tabs/index.d.ts +1 -0
- package/es/components/tooltip/styles.js +1 -1
- package/es/components/upload/index.vdt.js +4 -2
- package/es/components/upload/styles.js +1 -1
- package/es/components/wave/index.js +2 -0
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/cascader/demos/filterable/index.d.ts +2 -0
- package/es/site/data/components/cascader/demos/filterable/index.js +1 -0
- package/es/site/data/components/cascader/demos/filterable/react.d.ts +2 -0
- package/es/site/data/components/cascader/demos/filterable/react.js +12 -0
- package/es/site/data/components/config/demos/disableWave/index.d.ts +14 -0
- package/es/site/data/components/config/demos/disableWave/index.js +20 -0
- package/es/site/data/components/config/demos/disableWave/react.d.ts +14 -0
- package/es/site/data/components/config/demos/disableWave/react.js +67 -0
- package/es/site/src/pages/layout.d.ts +1 -0
- package/index.ts +2 -2
- package/package.json +2 -2
|
@@ -19,7 +19,7 @@ const typeDefs: Required<TypeDefs<BreadcrumbProps>> = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const defaults = (): Partial<BreadcrumbProps> => ({
|
|
22
|
-
separator: '
|
|
22
|
+
separator: ''
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
export class Breadcrumb extends Component<BreadcrumbProps, BreadcrumbEvents, BreadcrumbBlocks> {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {getRestProps, mapChildren} from '../utils';
|
|
2
2
|
import {BreadcrumbItem} from './item';
|
|
3
3
|
import { makeStyles } from './styles';
|
|
4
|
+
import { Icon } from '../icon';
|
|
4
5
|
|
|
5
6
|
const {children, separator, className} = this.get();
|
|
6
7
|
const { k } = this.config;
|
|
@@ -13,7 +14,10 @@ const classNameObj = {
|
|
|
13
14
|
|
|
14
15
|
const separatorVNode = (
|
|
15
16
|
<span class={`${k}-breadcrumb-separator`}>
|
|
16
|
-
<
|
|
17
|
+
<template v-if={!$blocks.separator && !separator}>
|
|
18
|
+
<Icon class="k-icon-right" />
|
|
19
|
+
</template>
|
|
20
|
+
<b:separator v-else>{separator}</b:separator>
|
|
17
21
|
</span>
|
|
18
22
|
);
|
|
19
23
|
const vNodes = [];
|
|
@@ -11,12 +11,15 @@ import {Cascader} from 'kpc';
|
|
|
11
11
|
|
|
12
12
|
<div>
|
|
13
13
|
<Cascader data={this.get('data')} v-model="value" filterable />
|
|
14
|
+
<br /><br />
|
|
15
|
+
<Cascader data={this.get('data')} v-model="values" filterable multiple />
|
|
14
16
|
</div>
|
|
15
17
|
```
|
|
16
18
|
|
|
17
19
|
```ts
|
|
18
20
|
interface Props {
|
|
19
21
|
value?: string[] | null
|
|
22
|
+
values?: string[][] | null
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
export default class extends Component<Props> {
|
|
@@ -25,6 +28,7 @@ export default class extends Component<Props> {
|
|
|
25
28
|
static defaults() {
|
|
26
29
|
return {
|
|
27
30
|
value: [] as string[],
|
|
31
|
+
values: [] as string[][],
|
|
28
32
|
data: [
|
|
29
33
|
{
|
|
30
34
|
value: 'beijing',
|
|
@@ -310,4 +310,27 @@ describe('Cascader', () => {
|
|
|
310
310
|
await wait();
|
|
311
311
|
expect(instance.get('value')).to.eql(['hunan']);
|
|
312
312
|
});
|
|
313
|
+
|
|
314
|
+
it('should only show submenu while the root menu will show', async () => {
|
|
315
|
+
const [instance, element] = mount(FilterDemo);
|
|
316
|
+
instance.set('values', [['beijing', 'haidian']]);
|
|
317
|
+
await wait();
|
|
318
|
+
|
|
319
|
+
const [, dom] = element.querySelectorAll<HTMLDivElement>('.k-cascader');
|
|
320
|
+
|
|
321
|
+
dispatchEvent(dom, 'click');
|
|
322
|
+
await wait();
|
|
323
|
+
|
|
324
|
+
const input = dom.querySelector<HTMLInputElement>('.k-input-inner')!;
|
|
325
|
+
|
|
326
|
+
// should show layer when input empty string
|
|
327
|
+
input.value = 's';
|
|
328
|
+
dispatchEvent(input, 'input');
|
|
329
|
+
await wait();
|
|
330
|
+
|
|
331
|
+
document.body.click();
|
|
332
|
+
await wait();
|
|
333
|
+
|
|
334
|
+
expect(getElement('.k-cascader-menu')).to.not.exist;
|
|
335
|
+
});
|
|
313
336
|
});
|
|
@@ -80,7 +80,8 @@ export class Cascader<
|
|
|
80
80
|
private filterable = useFilterable(
|
|
81
81
|
this.input.keywords,
|
|
82
82
|
this.value.setValue,
|
|
83
|
-
this.fields
|
|
83
|
+
this.fields,
|
|
84
|
+
this.value.values
|
|
84
85
|
);
|
|
85
86
|
private positionObj = {my: 'left top', at: 'right top', collisionDirection: ['left']};
|
|
86
87
|
|
|
@@ -3,7 +3,7 @@ import {Icon} from '../icon';
|
|
|
3
3
|
import {_$} from '../../i18n';
|
|
4
4
|
import {makeMenuStyles, makeFilterMenuStyles} from './styles';
|
|
5
5
|
|
|
6
|
-
const {data, trigger, filterable, fields, multiple} = this.get();
|
|
6
|
+
const {data, trigger, filterable, fields, multiple, show} = this.get();
|
|
7
7
|
const { k } = this.config;
|
|
8
8
|
const baseMenuStyles = makeMenuStyles(k);
|
|
9
9
|
const classNameObj = {
|
|
@@ -24,7 +24,7 @@ const Options = (data, level, loaded, parentSelected) => {
|
|
|
24
24
|
|
|
25
25
|
return data.map((item, index) => {
|
|
26
26
|
const value = getField(item, 'value');
|
|
27
|
-
const showed = isShowed(value, level);
|
|
27
|
+
const showed = show && isShowed(value, level);
|
|
28
28
|
const selected = parentSelected && isSelected(value, level);
|
|
29
29
|
const children = getField(item, 'children');
|
|
30
30
|
|
|
@@ -69,7 +69,7 @@ const Options = (data, level, loaded, parentSelected) => {
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
const {filter, keywords: {value: keywords}, selectByFilter} = this.filterable;
|
|
72
|
+
const {filter, keywords: {value: keywords}, selectByFilter, isSelectedItem} = this.filterable;
|
|
73
73
|
<t:super class={`${k}-cascader`}>
|
|
74
74
|
<b:base-menu>
|
|
75
75
|
<DropdownMenu
|
|
@@ -94,6 +94,8 @@ const {filter, keywords: {value: keywords}, selectByFilter} = this.filterable;
|
|
|
94
94
|
return <DropdownItem v-for={items}
|
|
95
95
|
ev-select={selectByFilter.bind(null, $value)}
|
|
96
96
|
disabled={$value.disabled}
|
|
97
|
+
hideOnSelect={!multiple}
|
|
98
|
+
class={{[`${k}-selected`]: isSelectedItem($value)}}
|
|
97
99
|
>
|
|
98
100
|
{(() => {
|
|
99
101
|
// highlight keywords
|
|
@@ -3,11 +3,13 @@ import type {Cascader, CascaderData, BaseCascaderData} from './';
|
|
|
3
3
|
import {State} from '../../hooks/useState';
|
|
4
4
|
import type {Value} from './useValue';
|
|
5
5
|
import type {useFields} from './useFields';
|
|
6
|
+
import { isEqualArray } from '../utils';
|
|
6
7
|
|
|
7
8
|
export function useFilterable(
|
|
8
9
|
keywords: State<string>,
|
|
9
10
|
setValue: (value: Value) => void,
|
|
10
|
-
getField: ReturnType<typeof useFields
|
|
11
|
+
getField: ReturnType<typeof useFields>,
|
|
12
|
+
values: State<Value[]>
|
|
11
13
|
) {
|
|
12
14
|
const instance = useInstance() as Cascader;
|
|
13
15
|
|
|
@@ -48,9 +50,16 @@ export function useFilterable(
|
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
function selectByFilter(data: CascaderData<any>[]) {
|
|
51
|
-
|
|
52
|
-
setValue(value);
|
|
53
|
+
setValue(getValue(data));
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
function isSelectedItem(data: CascaderData<any>[]) {
|
|
57
|
+
return !!values.value.find((value) => isEqualArray(value, getValue(data)));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function getValue(data: CascaderData<any>[]) {
|
|
61
|
+
return data.map(item => getField(item, 'value'));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return {filter, selectByFilter, keywords, isSelectedItem};
|
|
56
65
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 控制全局水波纹动效
|
|
3
|
+
order: 1
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
通过配置`disableWave`,可以控制是否开启水波纹动效,默认`false`
|
|
7
|
+
|
|
8
|
+
```vdt
|
|
9
|
+
import {ConfigProvider, Button, Input, Checkbox, Radio, Select, Option} from 'kpc';
|
|
10
|
+
|
|
11
|
+
<ConfigProvider value={{disableWave: true}}>
|
|
12
|
+
<Button>Button</Button>
|
|
13
|
+
<Input />
|
|
14
|
+
<Checkbox v-model="value">checkbox</Checkbox>
|
|
15
|
+
<Radio v-model="value">radio</Radio>
|
|
16
|
+
<Select v-model="day">
|
|
17
|
+
<Option value="Monday">星期一</Option>
|
|
18
|
+
<Option value="Tuesday">星期二</Option>
|
|
19
|
+
<Option value="Wednesday">星期三</Option>
|
|
20
|
+
<Option value="Thursday">星期四</Option>
|
|
21
|
+
<Option value="Friday">星期五</Option>
|
|
22
|
+
<Option value="Saturday">星期六</Option>
|
|
23
|
+
<Option value="Sunday">星期天</Option>
|
|
24
|
+
</Select>
|
|
25
|
+
</ConfigProvider>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```styl
|
|
29
|
+
.k-input, .k-input, .k-checkbox, .k-radio
|
|
30
|
+
margin 0 10px
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
interface Props {
|
|
35
|
+
value?: boolean,
|
|
36
|
+
day?: string | null
|
|
37
|
+
}
|
|
38
|
+
export default class extends Component<Props> {
|
|
39
|
+
static template = template;
|
|
40
|
+
static defaults() {
|
|
41
|
+
return {
|
|
42
|
+
value: false,
|
|
43
|
+
day: ''
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
@@ -2,7 +2,8 @@ import { createContext, ProviderProps } from '../context';
|
|
|
2
2
|
import { EMPTY_OBJ, Component } from 'intact';
|
|
3
3
|
|
|
4
4
|
export interface ConfigProps {
|
|
5
|
-
classNamePrefix?: string
|
|
5
|
+
classNamePrefix?: string,
|
|
6
|
+
disableWave?: boolean,
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
const {
|
|
@@ -17,6 +18,7 @@ function useConfigContext() {
|
|
|
17
18
|
return {
|
|
18
19
|
cls: (name: string) => `${config.value!.classNamePrefix || 'k'}-${name}`,
|
|
19
20
|
get k() { return config.value!.classNamePrefix || 'k' },
|
|
21
|
+
get disableWave() { return config.value!.disableWave || false }
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
|
|
@@ -67,7 +67,7 @@ function useKeyboardForDropdownMenu(dropdown: Dropdown) {
|
|
|
67
67
|
const focus = () => focusByIndex(0);
|
|
68
68
|
|
|
69
69
|
// In Cascader the menu may have been replaced by another menu, in this case,
|
|
70
|
-
// if the dropdown has showed while we mounted the menu, add keydown listener
|
|
70
|
+
// if the dropdown has showed while we mounted the menu, add the keydown listener
|
|
71
71
|
if (dropdown.get('value')) {
|
|
72
72
|
onShow();
|
|
73
73
|
}
|
|
@@ -56,7 +56,7 @@ export interface InputProps<V extends Value = Value> extends InputHTMLAttributes
|
|
|
56
56
|
type?: HTMLInputTypes
|
|
57
57
|
value?: V
|
|
58
58
|
defaultValue?: string | number
|
|
59
|
-
placeholder?: string
|
|
59
|
+
placeholder?: string | number
|
|
60
60
|
readonly?: boolean
|
|
61
61
|
clearable?: boolean
|
|
62
62
|
disabled?: boolean
|
|
@@ -98,7 +98,7 @@ const typeDefs: Required<TypeDefs<Omit<InputProps, keyof InputHTMLAttributes>>>
|
|
|
98
98
|
type: String,
|
|
99
99
|
value: [String, Number],
|
|
100
100
|
defaultValue: [String, Number],
|
|
101
|
-
placeholder: String,
|
|
101
|
+
placeholder: [String, Number],
|
|
102
102
|
readonly: Boolean,
|
|
103
103
|
clearable: Boolean,
|
|
104
104
|
disabled: Boolean,
|
|
Binary file
|
|
Binary file
|
|
@@ -17,7 +17,7 @@ const defaults = {
|
|
|
17
17
|
|
|
18
18
|
item: {
|
|
19
19
|
height: '40px',
|
|
20
|
-
padding: '0
|
|
20
|
+
padding: '0 12px',
|
|
21
21
|
bodyPadding: '0 4px',
|
|
22
22
|
color: '#aeaeb9',
|
|
23
23
|
hoverColor: '#fff',
|
|
@@ -30,7 +30,7 @@ const defaults = {
|
|
|
30
30
|
|
|
31
31
|
title: {
|
|
32
32
|
height: '40px',
|
|
33
|
-
padding: '0
|
|
33
|
+
padding: '0 12px',
|
|
34
34
|
color: '#fff',
|
|
35
35
|
},
|
|
36
36
|
|
|
@@ -114,7 +114,7 @@ export const makeMenuStyles = cache(function makeMenuStyles(k: string) {
|
|
|
114
114
|
// header
|
|
115
115
|
.${k}-menu-header {
|
|
116
116
|
height: ${menu.header.height};
|
|
117
|
-
padding: 0
|
|
117
|
+
padding: 0 16px;
|
|
118
118
|
color: ${menu.header.color};
|
|
119
119
|
font-size: ${menu.header.fontSize};
|
|
120
120
|
font-weight: bold;
|
|
@@ -125,6 +125,7 @@ export const makeMenuStyles = cache(function makeMenuStyles(k: string) {
|
|
|
125
125
|
max-height: calc(100% - ${menu.header.height});
|
|
126
126
|
overflow-y: auto;
|
|
127
127
|
overflow-x: hidden;
|
|
128
|
+
scrollbar-width: none;
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
// menu title
|
|
@@ -169,8 +170,7 @@ export const makeMenuStyles = cache(function makeMenuStyles(k: string) {
|
|
|
169
170
|
|
|
170
171
|
// theme light
|
|
171
172
|
&.${k}-light {
|
|
172
|
-
border: 1px solid ${theme.color.disabledBg};
|
|
173
|
-
border-top: 0;
|
|
173
|
+
border-right: 1px solid ${theme.color.disabledBg};
|
|
174
174
|
background: ${menu.light.bgColor};
|
|
175
175
|
.${k}-menu-header {
|
|
176
176
|
color: ${menu.light.title.color};
|
|
@@ -54,7 +54,11 @@ export function useInput(resetKeywords: (keywords: State<string>) => void) {
|
|
|
54
54
|
const {multiple, filterable} = component.get();
|
|
55
55
|
if (multiple && filterable) {
|
|
56
56
|
focusInput();
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* don't reset keywords on multiple mode for continue selection
|
|
59
|
+
* https://github.com/ksc-fe/kpc/issues/983
|
|
60
|
+
*/
|
|
61
|
+
// resetKeywords(keywords);
|
|
58
62
|
}
|
|
59
63
|
});
|
|
60
64
|
|
|
@@ -19,7 +19,7 @@ const defaults = {
|
|
|
19
19
|
thead: {
|
|
20
20
|
get bgColor() { return theme.color.bg },
|
|
21
21
|
get color() { return theme.color.lightBlack },
|
|
22
|
-
padding: `0
|
|
22
|
+
padding: `0 8px 0 12px`,
|
|
23
23
|
fontSize: `12px`,
|
|
24
24
|
fontWeight: `bold`,
|
|
25
25
|
textAlign: 'left',
|
|
@@ -31,7 +31,7 @@ const defaults = {
|
|
|
31
31
|
// tbody
|
|
32
32
|
tbody: {
|
|
33
33
|
get hoverBgcolor() { return theme.color.bg },
|
|
34
|
-
padding: `11px
|
|
34
|
+
padding: `11px 8px 11px 12px`,
|
|
35
35
|
},
|
|
36
36
|
|
|
37
37
|
// stripe
|
|
@@ -129,6 +129,9 @@ export const makeStyles = cache(function makeStyles(k: string) {
|
|
|
129
129
|
top: 50%;
|
|
130
130
|
transform: translateY(-50%);
|
|
131
131
|
}
|
|
132
|
+
&.${k}-fixed-right:before {
|
|
133
|
+
left: -2px;
|
|
134
|
+
}
|
|
132
135
|
&:first-of-type:before {
|
|
133
136
|
display: none;
|
|
134
137
|
}
|
|
@@ -150,7 +150,6 @@ export const makeStyles = cache(function makeStyles(k: string) {
|
|
|
150
150
|
const borderDirection = directionMap[direction as keyof typeof directionMap];
|
|
151
151
|
return css`
|
|
152
152
|
&.${k}-${direction} {
|
|
153
|
-
border-${borderDirection}-color: ${borderColor};
|
|
154
153
|
&:before {
|
|
155
154
|
border-${borderDirection}-color: ${bgColor};
|
|
156
155
|
}
|
|
@@ -10,7 +10,7 @@ import {UploadFileStatus} from './useUpload';
|
|
|
10
10
|
|
|
11
11
|
const {
|
|
12
12
|
className, accept, multiple, limit,
|
|
13
|
-
files, children, type, directory
|
|
13
|
+
files, children, type, directory, disabled
|
|
14
14
|
} = this.get();
|
|
15
15
|
|
|
16
16
|
const drag = this.drag;
|
|
@@ -22,6 +22,7 @@ const classNameObj = {
|
|
|
22
22
|
[`${k}-drag`]: type === 'drag',
|
|
23
23
|
[`${k}-dragover`]: drag.dragOver.value,
|
|
24
24
|
[`${k}-gallery`]: type === 'gallery',
|
|
25
|
+
[`${k}-disabled`]: disabled,
|
|
25
26
|
[makeStyles(k)]: true,
|
|
26
27
|
};
|
|
27
28
|
|
|
@@ -40,7 +41,7 @@ const handle = (
|
|
|
40
41
|
<b:content>
|
|
41
42
|
<b:children v-if={children}>{children}</b:children>
|
|
42
43
|
<template v-else-if={type !== 'gallery'}>
|
|
43
|
-
<Button v-if={type === 'select'}>
|
|
44
|
+
<Button disabled={disabled} v-if={type === 'select'}>
|
|
44
45
|
<Icon class={`${k}-icon-upload`} />
|
|
45
46
|
{_$('点击上传')}
|
|
46
47
|
</Button>
|
|
@@ -256,6 +256,17 @@ export const makeStyles = cache(function makeStyles(k: string) {
|
|
|
256
256
|
transform: translateY(-50%);
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
+
&.${k}-disabled {
|
|
260
|
+
.${k}-upload-add, .${k}-upload-handle {
|
|
261
|
+
cursor: auto;
|
|
262
|
+
a {
|
|
263
|
+
color: ${upload.color};
|
|
264
|
+
}
|
|
265
|
+
&:hover {
|
|
266
|
+
border-color: ${theme.color.border}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
259
270
|
`;
|
|
260
271
|
});
|
|
261
272
|
|
package/components/wave/index.ts
CHANGED
|
@@ -72,6 +72,9 @@ export class Wave extends Component<WaveProps> {
|
|
|
72
72
|
const {disabled} = this.get();
|
|
73
73
|
const node = e.target as HTMLElement;
|
|
74
74
|
|
|
75
|
+
// configProvider全局禁用动效
|
|
76
|
+
if (this.config.disableWave) return;
|
|
77
|
+
|
|
75
78
|
// 点击输入框中的icon时,此时输入框不需要动效
|
|
76
79
|
const isInput = instance!.classList.contains('k-input-wrapper');
|
|
77
80
|
if (disabled || isInput && node!.classList.contains(this.config.cls('icon'))) return;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
|
|
3
|
-
import { createElementVNode as _$ce, noop as _$no, className as _$cn, createVNode as _$cv } from 'intact';
|
|
3
|
+
import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc, noop as _$no, className as _$cn, createVNode as _$cv } from 'intact';
|
|
4
4
|
import { getRestProps, mapChildren } from '../utils';
|
|
5
5
|
import { BreadcrumbItem } from './item';
|
|
6
6
|
import { makeStyles } from './styles';
|
|
7
|
+
import { Icon } from '../icon';
|
|
8
|
+
var _$tmp0 = {
|
|
9
|
+
'className': 'k-icon-right'
|
|
10
|
+
};
|
|
7
11
|
export default function ($props, $blocks, $__proto__) {
|
|
8
12
|
var _classNameObj;
|
|
9
13
|
$blocks || ($blocks = {});
|
|
@@ -17,7 +21,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
17
21
|
className = _this$get.className;
|
|
18
22
|
var k = this.config.k;
|
|
19
23
|
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-breadcrumb"] = true, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
20
|
-
var separatorVNode = _$ce(2, 'span', (_$blocks['separator'] = function ($super) {
|
|
24
|
+
var separatorVNode = _$ce(2, 'span', !$blocks.separator && !separator ? _$cc(Icon, _$tmp0) : (_$blocks['separator'] = function ($super) {
|
|
21
25
|
return separator;
|
|
22
26
|
}, __$blocks['separator'] = function ($super, data) {
|
|
23
27
|
var block = $blocks['separator'];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
3
3
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
4
|
+
import _valuesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/values";
|
|
4
5
|
import template from './index.vdt';
|
|
5
6
|
import { BaseSelect } from '../select/base';
|
|
6
7
|
import { _$ } from '../../i18n';
|
|
@@ -41,7 +42,7 @@ export var Cascader = /*#__PURE__*/function (_BaseSelect) {
|
|
|
41
42
|
_this.value = useValue();
|
|
42
43
|
_this.label = useLabel(_this.fields);
|
|
43
44
|
_this.load = useLoad(_this.fields);
|
|
44
|
-
_this.filterable = useFilterable(_this.input.keywords, _this.value.setValue, _this.fields);
|
|
45
|
+
_this.filterable = useFilterable(_this.input.keywords, _this.value.setValue, _this.fields, _valuesInstanceProperty(_this.value));
|
|
45
46
|
_this.positionObj = {
|
|
46
47
|
my: 'left top',
|
|
47
48
|
at: 'right top',
|
|
@@ -433,4 +433,36 @@ describe('Cascader', function () {
|
|
|
433
433
|
}
|
|
434
434
|
}, _callee10);
|
|
435
435
|
})));
|
|
436
|
+
it('should only show submenu while the root menu will show', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
437
|
+
var _mount10, instance, element, _element$querySelecto2, dom, input;
|
|
438
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context14) {
|
|
439
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
440
|
+
case 0:
|
|
441
|
+
_mount10 = mount(FilterDemo), instance = _mount10[0], element = _mount10[1];
|
|
442
|
+
instance.set('values', [['beijing', 'haidian']]);
|
|
443
|
+
_context14.next = 4;
|
|
444
|
+
return wait();
|
|
445
|
+
case 4:
|
|
446
|
+
_element$querySelecto2 = element.querySelectorAll('.k-cascader'), dom = _element$querySelecto2[1];
|
|
447
|
+
dispatchEvent(dom, 'click');
|
|
448
|
+
_context14.next = 8;
|
|
449
|
+
return wait();
|
|
450
|
+
case 8:
|
|
451
|
+
input = dom.querySelector('.k-input-inner'); // should show layer when input empty string
|
|
452
|
+
input.value = 's';
|
|
453
|
+
dispatchEvent(input, 'input');
|
|
454
|
+
_context14.next = 13;
|
|
455
|
+
return wait();
|
|
456
|
+
case 13:
|
|
457
|
+
document.body.click();
|
|
458
|
+
_context14.next = 16;
|
|
459
|
+
return wait();
|
|
460
|
+
case 16:
|
|
461
|
+
expect(getElement('.k-cascader-menu')).to.not.exist;
|
|
462
|
+
case 17:
|
|
463
|
+
case "end":
|
|
464
|
+
return _context14.stop();
|
|
465
|
+
}
|
|
466
|
+
}, _callee11);
|
|
467
|
+
})));
|
|
436
468
|
});
|
|
@@ -17,7 +17,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
17
17
|
trigger = _this$get.trigger,
|
|
18
18
|
filterable = _this$get.filterable,
|
|
19
19
|
fields = _this$get.fields,
|
|
20
|
-
multiple = _this$get.multiple
|
|
20
|
+
multiple = _this$get.multiple,
|
|
21
|
+
show = _this$get.show;
|
|
21
22
|
var k = this.config.k;
|
|
22
23
|
var baseMenuStyles = makeMenuStyles(k);
|
|
23
24
|
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-cascader-menu"] = true, _classNameObj[makeMenuStyles(k)] = true, _classNameObj);
|
|
@@ -41,7 +42,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
41
42
|
}
|
|
42
43
|
return _mapInstanceProperty(data).call(data, function (item, index) {
|
|
43
44
|
var value = getField(item, 'value');
|
|
44
|
-
var showed = isShowed(value, level);
|
|
45
|
+
var showed = show && isShowed(value, level);
|
|
45
46
|
var selected = parentSelected && isSelected(value, level);
|
|
46
47
|
var children = getField(item, 'children');
|
|
47
48
|
var Item = function Item() {
|
|
@@ -74,7 +75,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
74
75
|
var _this$filterable = this.filterable,
|
|
75
76
|
filter = _filterInstanceProperty(_this$filterable),
|
|
76
77
|
keywords = _this$filterable.keywords.value,
|
|
77
|
-
selectByFilter = _this$filterable.selectByFilter
|
|
78
|
+
selectByFilter = _this$filterable.selectByFilter,
|
|
79
|
+
isSelectedItem = _this$filterable.isSelectedItem;
|
|
78
80
|
return _$su.call($this, {
|
|
79
81
|
'className': _$cn(k + "-cascader")
|
|
80
82
|
}, function ($blocks) {
|
|
@@ -93,9 +95,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
93
95
|
var items = filter();
|
|
94
96
|
if (!items.length) return _$ce(2, 'div', _$('无匹配数据'), 0, _$cn(k + "-cascader-empty"));
|
|
95
97
|
return _$ma(items, function ($value, $key) {
|
|
98
|
+
var _$cn4;
|
|
96
99
|
return _$cc(DropdownItem, {
|
|
97
100
|
'ev-select': selectByFilter.bind(null, $value),
|
|
98
101
|
'disabled': $value.disabled,
|
|
102
|
+
'hideOnSelect': !multiple,
|
|
103
|
+
'className': _$cn((_$cn4 = {}, _$cn4[k + "-selected"] = isSelectedItem($value), _$cn4)),
|
|
99
104
|
'children': function () {
|
|
100
105
|
// highlight keywords
|
|
101
106
|
var label = _mapInstanceProperty($value).call($value, function (item) {
|
|
@@ -43,5 +43,5 @@ export var makeMenuStyles = cache(function makeMenuStyles(k) {
|
|
|
43
43
|
return /*#__PURE__*/css("min-width:", cascader.width, "!important;height:", cascader.height, ";overflow:auto;.", k, "-cascader-arrow{float:right;height:100%;margin-left:", cascader.arrowGap, ";line-height:inherit;}.", k, "-cascader-loading{display:block;text-align:center;margin-top:", cascader.loadingGap, ";}.", k, "-cascader-empty{padding:", cascader.empty.padding, ";color:", cascader.empty.color, ";text-align:center;}.", k, "-cascader-option{&.", k, "-selected{color:", cascader.selectedColor, ";}&.", k, "-active{background:", cascader.activeBgColor, ";}}");
|
|
44
44
|
});
|
|
45
45
|
export var makeFilterMenuStyles = cache(function makeFilterMenuStyles(k) {
|
|
46
|
-
return /*#__PURE__*/css("min-width:", _filterInstanceProperty(cascader).minWidth, "!important;height:auto;max-height:", _filterInstanceProperty(cascader).maxHeight, ";em{font-style:normal;color:", _filterInstanceProperty(cascader).highlightColor, ";}");
|
|
46
|
+
return /*#__PURE__*/css("min-width:", _filterInstanceProperty(cascader).minWidth, "!important;height:auto;max-height:", _filterInstanceProperty(cascader).maxHeight, ";em{font-style:normal;color:", _filterInstanceProperty(cascader).highlightColor, ";}.", k, "-dropdown-item.", k, "-selected{color:", cascader.selectedColor, ";}");
|
|
47
47
|
});
|
|
@@ -2,8 +2,9 @@ import type { CascaderData } from './';
|
|
|
2
2
|
import { State } from '../../hooks/useState';
|
|
3
3
|
import type { Value } from './useValue';
|
|
4
4
|
import type { useFields } from './useFields';
|
|
5
|
-
export declare function useFilterable(keywords: State<string>, setValue: (value: Value) => void, getField: ReturnType<typeof useFields>): {
|
|
5
|
+
export declare function useFilterable(keywords: State<string>, setValue: (value: Value) => void, getField: ReturnType<typeof useFields>, values: State<Value[]>): {
|
|
6
6
|
filter: () => CascaderData<any>[][];
|
|
7
7
|
selectByFilter: (data: CascaderData<any>[]) => void;
|
|
8
8
|
keywords: State<string>;
|
|
9
|
+
isSelectedItem: (data: CascaderData<any>[]) => boolean;
|
|
9
10
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
|
|
2
2
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
3
3
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slice";
|
|
4
|
+
import _findInstanceProperty from "@babel/runtime-corejs3/core-js/instance/find";
|
|
4
5
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
5
6
|
import { useInstance } from 'intact';
|
|
6
|
-
|
|
7
|
+
import { isEqualArray } from '../utils';
|
|
8
|
+
export function useFilterable(keywords, setValue, getField, values) {
|
|
7
9
|
var instance = useInstance();
|
|
8
10
|
function filter() {
|
|
9
11
|
var ret = [];
|
|
@@ -44,14 +46,23 @@ export function useFilterable(keywords, setValue, getField) {
|
|
|
44
46
|
return ret;
|
|
45
47
|
}
|
|
46
48
|
function selectByFilter(data) {
|
|
47
|
-
|
|
49
|
+
setValue(getValue(data));
|
|
50
|
+
}
|
|
51
|
+
function isSelectedItem(data) {
|
|
52
|
+
var _context2;
|
|
53
|
+
return !!_findInstanceProperty(_context2 = values.value).call(_context2, function (value) {
|
|
54
|
+
return isEqualArray(value, getValue(data));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function getValue(data) {
|
|
58
|
+
return _mapInstanceProperty(data).call(data, function (item) {
|
|
48
59
|
return getField(item, 'value');
|
|
49
60
|
});
|
|
50
|
-
setValue(value);
|
|
51
61
|
}
|
|
52
62
|
return {
|
|
53
63
|
filter: filter,
|
|
54
64
|
selectByFilter: selectByFilter,
|
|
55
|
-
keywords: keywords
|
|
65
|
+
keywords: keywords,
|
|
66
|
+
isSelectedItem: isSelectedItem
|
|
56
67
|
};
|
|
57
68
|
}
|
|
@@ -2,11 +2,13 @@ import { ProviderProps } from '../context';
|
|
|
2
2
|
import { Component } from 'intact';
|
|
3
3
|
export interface ConfigProps {
|
|
4
4
|
classNamePrefix?: string;
|
|
5
|
+
disableWave?: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare const ConfigConsumer: import("intact").ComponentConstructor<Component<import("../context").ConsumerProps<ConfigProps>, {}, {}, {}>>;
|
|
7
8
|
declare function useConfigContext(): {
|
|
8
9
|
cls: (name: string) => string;
|
|
9
10
|
readonly k: string;
|
|
11
|
+
readonly disableWave: boolean;
|
|
10
12
|
};
|
|
11
13
|
/**
|
|
12
14
|
* for vue/react type checking
|
|
@@ -4,6 +4,7 @@ import { State } from '../../hooks/useState';
|
|
|
4
4
|
import { Shortcut } from './shortcuts';
|
|
5
5
|
import { BasePicker, BasePickerProps, BasePickerEvents, BasePickerBlocks, Value } from './basepicker';
|
|
6
6
|
export * as shortcuts from './shortcuts';
|
|
7
|
+
export { dayjs };
|
|
7
8
|
export interface DatepickerProps<V extends Value = Value, M extends boolean = boolean, R extends boolean = boolean> extends BasePickerProps<V extends string ? V : V | string, M, R> {
|
|
8
9
|
type?: 'date' | 'datetime' | 'year' | 'month';
|
|
9
10
|
shortcuts?: Shortcut[];
|
|
@@ -5,6 +5,7 @@ import { __decorate } from "tslib";
|
|
|
5
5
|
import { provide } from 'intact';
|
|
6
6
|
import template from './index.vdt';
|
|
7
7
|
import { DATEPICKER } from './constants';
|
|
8
|
+
import dayjs from './dayjs';
|
|
8
9
|
import { useValue } from './useValue';
|
|
9
10
|
import { isNullOrUndefined } from 'intact-shared';
|
|
10
11
|
import { _$ } from '../../i18n';
|
|
@@ -17,6 +18,7 @@ import { useKeyboards } from './useKeyboards';
|
|
|
17
18
|
import { BasePicker } from './basepicker';
|
|
18
19
|
import * as _shortcuts from './shortcuts';
|
|
19
20
|
export { _shortcuts as shortcuts };
|
|
21
|
+
export { dayjs };
|
|
20
22
|
var typeDefs = _extends({}, BasePicker.typeDefs, {
|
|
21
23
|
type: ['date', 'datetime', 'year', 'month'],
|
|
22
24
|
shortcuts: Array
|
|
@@ -75,7 +75,7 @@ function useKeyboardForDropdownMenu(dropdown) {
|
|
|
75
75
|
return focusByIndex(0);
|
|
76
76
|
};
|
|
77
77
|
// In Cascader the menu may have been replaced by another menu, in this case,
|
|
78
|
-
// if the dropdown has showed while we mounted the menu, add keydown listener
|
|
78
|
+
// if the dropdown has showed while we mounted the menu, add the keydown listener
|
|
79
79
|
if (dropdown.get('value')) {
|
|
80
80
|
onShow();
|
|
81
81
|
}
|
|
@@ -15,7 +15,7 @@ export interface InputProps<V extends Value = Value> extends InputHTMLAttributes
|
|
|
15
15
|
type?: HTMLInputTypes;
|
|
16
16
|
value?: V;
|
|
17
17
|
defaultValue?: string | number;
|
|
18
|
-
placeholder?: string;
|
|
18
|
+
placeholder?: string | number;
|
|
19
19
|
readonly?: boolean;
|
|
20
20
|
clearable?: boolean;
|
|
21
21
|
disabled?: boolean;
|
|
@@ -20,7 +20,7 @@ var defaults = {
|
|
|
20
20
|
},
|
|
21
21
|
item: {
|
|
22
22
|
height: '40px',
|
|
23
|
-
padding: '0
|
|
23
|
+
padding: '0 12px',
|
|
24
24
|
bodyPadding: '0 4px',
|
|
25
25
|
color: '#aeaeb9',
|
|
26
26
|
hoverColor: '#fff',
|
|
@@ -36,7 +36,7 @@ var defaults = {
|
|
|
36
36
|
},
|
|
37
37
|
title: {
|
|
38
38
|
height: '40px',
|
|
39
|
-
padding: '0
|
|
39
|
+
padding: '0 12px',
|
|
40
40
|
color: '#fff'
|
|
41
41
|
},
|
|
42
42
|
icon: {
|
|
@@ -112,7 +112,7 @@ export { menu };
|
|
|
112
112
|
export var makeMenuStyles = cache(function makeMenuStyles(k) {
|
|
113
113
|
// we must increase the priority by adding &.${k}-menu
|
|
114
114
|
// to override the css of dropdownMenu
|
|
115
|
-
return /*#__PURE__*/css("&.", k, "-menu{width:", menu.width, ";transition:width ", menu.transition, ";background:", menu.bgColor, ";font-size:", menu.fontSize, ";position:relative;}.", k, "-icon{width:", menu.icon.width, ";margin-right:", menu.icon.gap, ";text-align:center;flex-shrink:0;}.", k, "-menu-header{height:", menu.header.height, ";padding:0
|
|
115
|
+
return /*#__PURE__*/css("&.", k, "-menu{width:", menu.width, ";transition:width ", menu.transition, ";background:", menu.bgColor, ";font-size:", menu.fontSize, ";position:relative;}.", k, "-icon{width:", menu.icon.width, ";margin-right:", menu.icon.gap, ";text-align:center;flex-shrink:0;}.", k, "-menu-header{height:", menu.header.height, ";padding:0 16px;color:", menu.header.color, ";font-size:", menu.header.fontSize, ";font-weight:bold;}.", k, "-menu-body{padding:", menu.item.bodyPadding, ";max-height:calc(100% - ", menu.header.height, ");overflow-y:auto;overflow-x:hidden;scrollbar-width:none;}.", k, "-menu-title{height:", menu.title.height, ";border-top:", menu.border, ";margin-top:4px;.", k, "-menu-name{transition:all ", menu.transition, ";height:", menu.title.height, ";color:", menu.title.color, ";font-weight:bold;}}.", k, "-menu-arrow-box{width:14px;height:60px;cursor:pointer;background:", menu.bgColor, ";border-radius:0 8px 8px 0;position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:calc(", menu.width, " - 2px);transition:left ", menu.transition, ";transform:translateY(-50%);border:", menu.border, ";border-left:none;.", k, "-icon{margin-right:0;}&:hover{.", k, "-menu-arrow:before{color:", menu.item.activeBgColor, ";}}}&.", k, "-light{border-right:1px solid ", theme.color.disabledBg, ";background:", menu.light.bgColor, ";.", k, "-menu-header{color:", menu.light.title.color, ";}.", k, "-menu-item{.", k, "-menu-item-title{color:", menu.light.item.color, ";&:hover{background:", menu.light.item.hoverBg, ";}}.", k, "-menu-item-arrow{color:", menu.light.item.color, ";}&.", k, "-highlighted{>.", k, "-menu-item-title{color:", menu.light.item.hoverColor, ";}}&.", k, "-disabled{>.", k, "-menu-item-title{color:", menu.light.item.disabledColor, "!important;}}}.", k, "-menu-title{border-top:", menu.light.border, ";.", k, "-menu-name{color:", menu.light.title.color, ";}}.", k, "-menu-arrow-box{background:", menu.light.bgColor, ";border:", menu.light.border, ";border-left:none;&:hover{.", k, "-menu-arrow:before{color:", menu.light.active.color, ";}}}.", k, "-menu:not(.", k, "-dropdown-menu){background:", menu.light.bgColor, ";}&.", k, "-horizontal{.", k, "-menu-header{border-right:", menu.light.border, ";}.", k, "-menu-body>.", k, "-menu-title{border-right:", menu.light.border, ";}}.", k, "-menu-item.", k, "-active{>.", k, "-menu-item-title{color:", menu.light.active.color, "!important;background:", menu.light.active.bgColor, ";}}.", k, "-sub-menu{.", k, "-menu-item-title,.", k, "-menu-item-arrow{color:", menu.light.item.subTitleColor, "!important;}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
116
116
|
var styles = menu[size];
|
|
117
117
|
return /*#__PURE__*/css("&.", k, "-", size, "{width:", styles.width, ";font-size:", styles.fontSize, ";.", k, "-menu{font-size:", styles.fontSize, ";}.", k, "-menu-arrow-box{left:calc(", styles.width, " - 2px);}}");
|
|
118
118
|
}), "&.", k, "-collapsed{width:calc(", menu.icon.width, " + (", getLeft(menu.item.padding), " + ", getLeft(menu.item.bodyPadding), ") * 2);.", k, "-icon{margin-right:0;}.", k, "-menu-item-arrow{display:none;}}&.", k, "-collapsed-arrow{width:0px;border-left:none;.", k, "-menu-body{overflow:hidden;padding:0;}.", k, "-menu-arrow-box{left:0;.", k, "-menu-arrow:before{transform:rotateY(180deg);}}}&.", k, "-dropdown-menu{width:fit-content;min-width:", menu.dropdown.minWidth, ";.", k, "-menu-item-arrow{transform:rotate(-90deg);}}&.", k, "-horizontal{width:auto;display:flex;.", k, "-menu-body{display:flex;align-items:center;.", k, "-menu-title{border-top:none;border-right:", menu.border, ";}}}");
|
|
@@ -54,6 +54,7 @@ export declare abstract class BaseSelect<T extends BaseSelectProps<any> = BaseSe
|
|
|
54
54
|
protected config: {
|
|
55
55
|
cls: (name: string) => string;
|
|
56
56
|
readonly k: string;
|
|
57
|
+
readonly disableWave: boolean;
|
|
57
58
|
};
|
|
58
59
|
init(): void;
|
|
59
60
|
protected abstract getPlaceholder(): Children;
|
|
@@ -36,7 +36,11 @@ export function useInput(resetKeywords) {
|
|
|
36
36
|
filterable = _component$get.filterable;
|
|
37
37
|
if (multiple && filterable) {
|
|
38
38
|
focusInput();
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* don't reset keywords on multiple mode for continue selection
|
|
41
|
+
* https://github.com/ksc-fe/kpc/issues/983
|
|
42
|
+
*/
|
|
43
|
+
// resetKeywords(keywords);
|
|
40
44
|
}
|
|
41
45
|
});
|
|
42
46
|
return {
|
|
@@ -29,7 +29,7 @@ var defaults = {
|
|
|
29
29
|
get color() {
|
|
30
30
|
return theme.color.lightBlack;
|
|
31
31
|
},
|
|
32
|
-
padding: "0
|
|
32
|
+
padding: "0 8px 0 12px",
|
|
33
33
|
fontSize: "12px",
|
|
34
34
|
fontWeight: "bold",
|
|
35
35
|
textAlign: 'left',
|
|
@@ -42,7 +42,7 @@ var defaults = {
|
|
|
42
42
|
get hoverBgcolor() {
|
|
43
43
|
return theme.color.bg;
|
|
44
44
|
},
|
|
45
|
-
padding: "11px
|
|
45
|
+
padding: "11px 8px 11px 12px"
|
|
46
46
|
},
|
|
47
47
|
// stripe
|
|
48
48
|
stripeBgColor: '#f9f9fc',
|
|
@@ -90,7 +90,7 @@ setDefault(function () {
|
|
|
90
90
|
makeGroupMenuStyles == null || makeGroupMenuStyles.clearCache();
|
|
91
91
|
});
|
|
92
92
|
export var makeStyles = cache(function makeStyles(k) {
|
|
93
|
-
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-table-arrow{width:", table.arrow.width, "!important;margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
|
|
93
|
+
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&.", k, "-fixed-right:before{left:-2px;}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-table-arrow{width:", table.arrow.width, "!important;margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
|
|
94
94
|
return /*#__PURE__*/css(".", k, "-align-", type, "{text-align:", type, ";}");
|
|
95
95
|
}), ">.", k, "-pagination{margin:16px 0;}&.", k, "-fix-header{min-height:0;.", k, "-table-wrapper{height:100%;}}");
|
|
96
96
|
});
|
|
@@ -71,7 +71,7 @@ export var makeStyles = cache(function makeStyles(k) {
|
|
|
71
71
|
}
|
|
72
72
|
return /*#__PURE__*/css("&.", k, "-", theme, "{background:", bgColor, ";color:", color, ";.", k, "-tooltip-arrow{", _mapInstanceProperty(_context = _Object$keys(directionMap)).call(_context, function (direction) {
|
|
73
73
|
var borderDirection = directionMap[direction];
|
|
74
|
-
return /*#__PURE__*/css("&.", k, "-", direction, "{
|
|
74
|
+
return /*#__PURE__*/css("&.", k, "-", direction, "{&:before{border-", borderDirection, "-color:", bgColor, ";}}");
|
|
75
75
|
}), ";}}");
|
|
76
76
|
}), ".", k, "-tooltip-footer{padding-top:", tooltip.confirm.gaps, ";.", k, "-btn:not(:first-of-type){margin-left:", tooltip.confirm.gaps, ";}}&.", k, "-small{padding:", tooltip.smallPadding, ";}}");
|
|
77
77
|
});
|
|
@@ -24,10 +24,11 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
24
24
|
files = _this$get.files,
|
|
25
25
|
children = _this$get.children,
|
|
26
26
|
type = _this$get.type,
|
|
27
|
-
directory = _this$get.directory
|
|
27
|
+
directory = _this$get.directory,
|
|
28
|
+
disabled = _this$get.disabled;
|
|
28
29
|
var drag = this.drag;
|
|
29
30
|
var k = this.config.k;
|
|
30
|
-
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-upload"] = true, _classNameObj[className] = className, _classNameObj[k + "-drag"] = type === 'drag', _classNameObj[k + "-dragover"] = drag.dragOver.value, _classNameObj[k + "-gallery"] = type === 'gallery', _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
31
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-upload"] = true, _classNameObj[className] = className, _classNameObj[k + "-drag"] = type === 'drag', _classNameObj[k + "-dragover"] = drag.dragOver.value, _classNameObj[k + "-gallery"] = type === 'gallery', _classNameObj[k + "-disabled"] = disabled, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
31
32
|
var events = {
|
|
32
33
|
'ev-click': this.selectFile
|
|
33
34
|
};
|
|
@@ -49,6 +50,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
49
50
|
};
|
|
50
51
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
51
52
|
}, __$blocks['children'](_$no)) : type !== 'gallery' ? type === 'select' ? _$cc(Button, {
|
|
53
|
+
'disabled': disabled,
|
|
52
54
|
'children': [_$cc(Icon, {
|
|
53
55
|
'className': _$cn(k + "-icon-upload")
|
|
54
56
|
}), _$('点击上传')]
|
|
@@ -113,7 +113,7 @@ setDefault(function () {
|
|
|
113
113
|
makeUploadDialogStyles == null || makeUploadDialogStyles.clearCache();
|
|
114
114
|
});
|
|
115
115
|
export var makeStyles = cache(function makeStyles(k) {
|
|
116
|
-
return /*#__PURE__*/css("font-size:", upload.fontSize, ";position:relative;.", k, "-icon-upload{position:relative;top:-1px;}.", k, "-upload-handle{display:inline-block;vertical-align:middle;color:", upload.color, ";}.", k, "-upload-tip{margin-top:", upload.tip.gap, ";color:", upload.color, ";}.", k, "-upload-files{margin-top:", upload.filesGap, ";}.", k, "-upload-file{margin:", upload.file.margin, ";padding-right:", upload.file.delete.width, ";position:relative;&:hover{.", k, "-upload-close{display:inline-flex;position:absolute;right:", upload.file.delete.right, ";top:", upload.file.delete.top, ";}.", k, "-upload-file-main{background:", upload.file.bgColor, ";}}}.", k, "-upload-file-main{padding:", upload.file.padding, ";border-radius:", upload.file.borderRadius, ";}.", k, "-upload-name{display:flex;align-items:center;height:", upload.file.height, ";}.", k, "-upload-file-icon{margin-right:", upload.file.fileIconGap, ";}.", k, "-upload-file-name{flex:1;}.", k, "-upload-status-icon{color:", upload.file.status.color, ";margin-right:", upload.file.status.offsetRight, ";}.", k, "-upload-close{display:none;}.", k, "-upload-file.", k, "-error{color:", upload.file.errorColor, ";.", k, "-upload-status-icon{color:", upload.file.status.errorColor, ";}}.", k, "-upload-progress{.", k, "-progress-text{width:auto!important;}}&.", k, "-drag{.", k, "-upload-handle{display:block;border:", upload.drag.border, ";border-radius:", upload.drag.borderRadius, ";cursor:pointer;text-align:center;transition:border-color ", upload.transition, ";background:", upload.drag.bgColor, ";&:hover{border-color:", upload.drag.hoverBorderColor, ";}}.", k, "-upload-area{padding:", upload.drag.padding, ";.", k, "-icon{display:inline-block;font-size:", upload.drag.icon.fontSize, ";margin-bottom:", upload.drag.icon.gap, ";}}&.", k, "-dragover{.", k, "-upload-handle{border-color:", upload.drag.overBorderColor, ";}}}.", k, "-upload-pictures{display:inline-block;vertical-align:middle;}.", k, "-upload-picture{padding:", upload.gallery.padding, ";position:relative;vertical-align:middle;&.", k, "-error{border-color:", upload.gallery.errorBorderColor, ";}.", k, "-upload-close{display:inline-flex;}&:hover{.", k, "-upload-icons{opacity:1;}}.", k, "-upload-img{display:inline-block;width:100%;height:100%;}.", k, "-upload-icons{opacity:0;transition:opacity ", upload.transition, ";}}.", k, "-upload-picture-card{display:inline-flex;width:", upload.gallery.width, ";height:", upload.gallery.height, ";border-radius:", upload.gallery.borderRadius, ";border:", upload.gallery.border, ";margin:", upload.gallery.margin, ";background:", upload.gallery.bgColor, ";align-items:center;justify-content:center;flex-direction:column;}.", k, "-upload-add{border:", upload.gallery.add.border, ";cursor:pointer;&:hover{border-color:", upload.gallery.add.hoverBorderColor, ";}}.", k, "-upload-overlap{position:absolute;width:100%;height:100%;left:0;top:0;background:", upload.overlap.bgColor, ";display:flex;align-items:center;justify-content:center;gap:", upload.overlap.iconGap, ";color:", upload.overlap.color, ";.", k, "-icon:not(:hover){color:inherit;}.", k, "-upload-progress{position:absolute;width:100%;top:50%;padding:", upload.gallery.padding, ";transform:translateY(-50%);}}");
|
|
116
|
+
return /*#__PURE__*/css("font-size:", upload.fontSize, ";position:relative;.", k, "-icon-upload{position:relative;top:-1px;}.", k, "-upload-handle{display:inline-block;vertical-align:middle;color:", upload.color, ";}.", k, "-upload-tip{margin-top:", upload.tip.gap, ";color:", upload.color, ";}.", k, "-upload-files{margin-top:", upload.filesGap, ";}.", k, "-upload-file{margin:", upload.file.margin, ";padding-right:", upload.file.delete.width, ";position:relative;&:hover{.", k, "-upload-close{display:inline-flex;position:absolute;right:", upload.file.delete.right, ";top:", upload.file.delete.top, ";}.", k, "-upload-file-main{background:", upload.file.bgColor, ";}}}.", k, "-upload-file-main{padding:", upload.file.padding, ";border-radius:", upload.file.borderRadius, ";}.", k, "-upload-name{display:flex;align-items:center;height:", upload.file.height, ";}.", k, "-upload-file-icon{margin-right:", upload.file.fileIconGap, ";}.", k, "-upload-file-name{flex:1;}.", k, "-upload-status-icon{color:", upload.file.status.color, ";margin-right:", upload.file.status.offsetRight, ";}.", k, "-upload-close{display:none;}.", k, "-upload-file.", k, "-error{color:", upload.file.errorColor, ";.", k, "-upload-status-icon{color:", upload.file.status.errorColor, ";}}.", k, "-upload-progress{.", k, "-progress-text{width:auto!important;}}&.", k, "-drag{.", k, "-upload-handle{display:block;border:", upload.drag.border, ";border-radius:", upload.drag.borderRadius, ";cursor:pointer;text-align:center;transition:border-color ", upload.transition, ";background:", upload.drag.bgColor, ";&:hover{border-color:", upload.drag.hoverBorderColor, ";}}.", k, "-upload-area{padding:", upload.drag.padding, ";.", k, "-icon{display:inline-block;font-size:", upload.drag.icon.fontSize, ";margin-bottom:", upload.drag.icon.gap, ";}}&.", k, "-dragover{.", k, "-upload-handle{border-color:", upload.drag.overBorderColor, ";}}}.", k, "-upload-pictures{display:inline-block;vertical-align:middle;}.", k, "-upload-picture{padding:", upload.gallery.padding, ";position:relative;vertical-align:middle;&.", k, "-error{border-color:", upload.gallery.errorBorderColor, ";}.", k, "-upload-close{display:inline-flex;}&:hover{.", k, "-upload-icons{opacity:1;}}.", k, "-upload-img{display:inline-block;width:100%;height:100%;}.", k, "-upload-icons{opacity:0;transition:opacity ", upload.transition, ";}}.", k, "-upload-picture-card{display:inline-flex;width:", upload.gallery.width, ";height:", upload.gallery.height, ";border-radius:", upload.gallery.borderRadius, ";border:", upload.gallery.border, ";margin:", upload.gallery.margin, ";background:", upload.gallery.bgColor, ";align-items:center;justify-content:center;flex-direction:column;}.", k, "-upload-add{border:", upload.gallery.add.border, ";cursor:pointer;&:hover{border-color:", upload.gallery.add.hoverBorderColor, ";}}.", k, "-upload-overlap{position:absolute;width:100%;height:100%;left:0;top:0;background:", upload.overlap.bgColor, ";display:flex;align-items:center;justify-content:center;gap:", upload.overlap.iconGap, ";color:", upload.overlap.color, ";.", k, "-icon:not(:hover){color:inherit;}.", k, "-upload-progress{position:absolute;width:100%;top:50%;padding:", upload.gallery.padding, ";transform:translateY(-50%);}}&.", k, "-disabled{.", k, "-upload-add,.", k, "-upload-handle{cursor:auto;a{color:", upload.color, ";}&:hover{border-color:", theme.color.border, ";}}}");
|
|
117
117
|
});
|
|
118
118
|
export var makeUploadDialogStyles = cache(function makeUploadDialogStyles(k) {
|
|
119
119
|
return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? {
|
|
@@ -62,6 +62,8 @@ export var Wave = /*#__PURE__*/function (_Component) {
|
|
|
62
62
|
var _this$get2 = this.get(),
|
|
63
63
|
disabled = _this$get2.disabled;
|
|
64
64
|
var node = e.target;
|
|
65
|
+
// configProvider全局禁用动效
|
|
66
|
+
if (this.config.disableWave) return;
|
|
65
67
|
// 点击输入框中的icon时,此时输入框不需要动效
|
|
66
68
|
var isInput = instance.classList.contains('k-input-wrapper');
|
|
67
69
|
if (disabled || isInput && node.classList.contains(this.config.cls('icon'))) return;
|
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.3.
|
|
2
|
+
* @king-design v3.3.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -63,4 +63,4 @@ export * from './components/treeSelect';
|
|
|
63
63
|
export * from './components/upload';
|
|
64
64
|
export * from './components/view';
|
|
65
65
|
export * from './components/wave';
|
|
66
|
-
export declare const version = "3.3.
|
|
66
|
+
export declare const version = "3.3.2";
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.3.
|
|
2
|
+
* @king-design v3.3.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -64,5 +64,5 @@ export * from './components/treeSelect';
|
|
|
64
64
|
export * from './components/upload';
|
|
65
65
|
export * from './components/view';
|
|
66
66
|
export * from './components/wave';
|
|
67
|
-
export var version = '3.3.
|
|
67
|
+
export var version = '3.3.2';
|
|
68
68
|
/* generate end */
|
|
@@ -2,11 +2,13 @@ export { default as data } from './index.json';
|
|
|
2
2
|
import { Component } from 'intact';
|
|
3
3
|
interface Props {
|
|
4
4
|
value?: string[] | null;
|
|
5
|
+
values?: string[][] | null;
|
|
5
6
|
}
|
|
6
7
|
export default class extends Component<Props> {
|
|
7
8
|
static template: string | import("intact").Template<any>;
|
|
8
9
|
static defaults(): {
|
|
9
10
|
value: string[];
|
|
11
|
+
values: string[][];
|
|
10
12
|
data: ({
|
|
11
13
|
value: string;
|
|
12
14
|
label: string;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface Props {
|
|
3
3
|
value?: string[] | null;
|
|
4
|
+
values?: string[][] | null;
|
|
4
5
|
}
|
|
5
6
|
export default class Demo extends React.Component<{}, Props> {
|
|
6
7
|
state: {
|
|
7
8
|
value: string[];
|
|
9
|
+
values: string[][];
|
|
8
10
|
data: ({
|
|
9
11
|
value: string;
|
|
10
12
|
label: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
+
import _valuesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/values";
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { Cascader } from '@king-design/react';
|
|
5
6
|
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
@@ -13,6 +14,7 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
13
14
|
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
14
15
|
_this.state = {
|
|
15
16
|
value: [],
|
|
17
|
+
values: [],
|
|
16
18
|
data: [{
|
|
17
19
|
value: 'beijing',
|
|
18
20
|
label: '北京',
|
|
@@ -64,6 +66,16 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
64
66
|
});
|
|
65
67
|
},
|
|
66
68
|
filterable: true
|
|
69
|
+
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Cascader, {
|
|
70
|
+
data: this.state.data,
|
|
71
|
+
value: _valuesInstanceProperty(this.state),
|
|
72
|
+
onChangeValue: function onChangeValue(values) {
|
|
73
|
+
return _this2.setState({
|
|
74
|
+
values: values
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
filterable: true,
|
|
78
|
+
multiple: true
|
|
67
79
|
}));
|
|
68
80
|
};
|
|
69
81
|
return Demo;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { default as data } from './index.json';
|
|
2
|
+
import { Component } from 'intact';
|
|
3
|
+
import './index.styl';
|
|
4
|
+
interface Props {
|
|
5
|
+
value?: boolean;
|
|
6
|
+
day?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export default class extends Component<Props> {
|
|
9
|
+
static template: string | import("intact").Template<any>;
|
|
10
|
+
static defaults(): {
|
|
11
|
+
value: boolean;
|
|
12
|
+
day: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
export { default as data } from './index.json';
|
|
3
|
+
import { Component } from 'intact';
|
|
4
|
+
import template from './index.vdt';
|
|
5
|
+
import './index.styl';
|
|
6
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
|
+
_inheritsLoose(default_1, _Component);
|
|
8
|
+
function default_1() {
|
|
9
|
+
return _Component.apply(this, arguments) || this;
|
|
10
|
+
}
|
|
11
|
+
default_1.defaults = function defaults() {
|
|
12
|
+
return {
|
|
13
|
+
value: false,
|
|
14
|
+
day: ''
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
return default_1;
|
|
18
|
+
}(Component);
|
|
19
|
+
default_1.template = template;
|
|
20
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.styl';
|
|
3
|
+
interface Props {
|
|
4
|
+
value?: boolean;
|
|
5
|
+
day?: string | null;
|
|
6
|
+
}
|
|
7
|
+
export default class Demo extends React.Component<{}, Props> {
|
|
8
|
+
state: {
|
|
9
|
+
value: boolean;
|
|
10
|
+
day: string;
|
|
11
|
+
};
|
|
12
|
+
render(): React.JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ConfigProvider, Button, Input, Checkbox, Radio, Select, Option } from '@king-design/react';
|
|
5
|
+
import './index.styl';
|
|
6
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
7
|
+
_inheritsLoose(Demo, _React$Component);
|
|
8
|
+
function Demo() {
|
|
9
|
+
var _context;
|
|
10
|
+
var _this;
|
|
11
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12
|
+
args[_key] = arguments[_key];
|
|
13
|
+
}
|
|
14
|
+
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
15
|
+
_this.state = {
|
|
16
|
+
value: false,
|
|
17
|
+
day: ''
|
|
18
|
+
};
|
|
19
|
+
return _this;
|
|
20
|
+
}
|
|
21
|
+
var _proto = Demo.prototype;
|
|
22
|
+
_proto.render = function render() {
|
|
23
|
+
var _this2 = this;
|
|
24
|
+
return /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
25
|
+
value: {
|
|
26
|
+
disableWave: true
|
|
27
|
+
}
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Button, null, "Button"), /*#__PURE__*/React.createElement(Input, null), /*#__PURE__*/React.createElement(Checkbox, {
|
|
29
|
+
value: this.state.value,
|
|
30
|
+
onChangeValue: function onChangeValue(value) {
|
|
31
|
+
return _this2.setState({
|
|
32
|
+
value: value
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}, "checkbox"), /*#__PURE__*/React.createElement(Radio, {
|
|
36
|
+
value: this.state.value,
|
|
37
|
+
onChangeValue: function onChangeValue(value) {
|
|
38
|
+
return _this2.setState({
|
|
39
|
+
value: value
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}, "radio"), /*#__PURE__*/React.createElement(Select, {
|
|
43
|
+
value: this.state.day,
|
|
44
|
+
onChangeValue: function onChangeValue(day) {
|
|
45
|
+
return _this2.setState({
|
|
46
|
+
day: day
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Option, {
|
|
50
|
+
value: "Monday"
|
|
51
|
+
}, "\u661F\u671F\u4E00"), /*#__PURE__*/React.createElement(Option, {
|
|
52
|
+
value: "Tuesday"
|
|
53
|
+
}, "\u661F\u671F\u4E8C"), /*#__PURE__*/React.createElement(Option, {
|
|
54
|
+
value: "Wednesday"
|
|
55
|
+
}, "\u661F\u671F\u4E09"), /*#__PURE__*/React.createElement(Option, {
|
|
56
|
+
value: "Thursday"
|
|
57
|
+
}, "\u661F\u671F\u56DB"), /*#__PURE__*/React.createElement(Option, {
|
|
58
|
+
value: "Friday"
|
|
59
|
+
}, "\u661F\u671F\u4E94"), /*#__PURE__*/React.createElement(Option, {
|
|
60
|
+
value: "Saturday"
|
|
61
|
+
}, "\u661F\u671F\u516D"), /*#__PURE__*/React.createElement(Option, {
|
|
62
|
+
value: "Sunday"
|
|
63
|
+
}, "\u661F\u671F\u5929")));
|
|
64
|
+
};
|
|
65
|
+
return Demo;
|
|
66
|
+
}(React.Component);
|
|
67
|
+
export { Demo as default };
|
|
@@ -13,6 +13,7 @@ export default class Layout<T extends LayoutProps = LayoutProps> extends Compone
|
|
|
13
13
|
protected config: {
|
|
14
14
|
cls: (name: string) => string;
|
|
15
15
|
readonly k: string;
|
|
16
|
+
readonly disableWave: boolean;
|
|
16
17
|
};
|
|
17
18
|
handleColorChange(color: string): void;
|
|
18
19
|
showColorList(): void;
|
package/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.3.
|
|
2
|
+
* @king-design v3.3.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -68,6 +68,6 @@ export * from './components/upload';
|
|
|
68
68
|
export * from './components/view';
|
|
69
69
|
export * from './components/wave';
|
|
70
70
|
|
|
71
|
-
export const version = '3.3.
|
|
71
|
+
export const version = '3.3.2';
|
|
72
72
|
|
|
73
73
|
/* generate end */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-design/intact",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "A component library written in Intact for Intact, Vue, React and Angular",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"@emotion/css": "^11.5.0",
|
|
181
181
|
"dayjs": "^1.10.7",
|
|
182
182
|
"enquire.js": "^2.1.6",
|
|
183
|
-
"intact": "^3.0.
|
|
183
|
+
"intact": "^3.0.34",
|
|
184
184
|
"monaco-editor": "^0.26.1",
|
|
185
185
|
"mxgraphx": "^4.0.7",
|
|
186
186
|
"resize-observer-polyfill": "^1.5.1",
|