papayaui 0.2.4 → 0.2.5
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/cascader/cascader.vue +1 -1
- package/components/cascader/props.ts +8 -0
- package/components/cell/cell.vue +2 -2
- package/components/picker-popup/picker-popup.vue +5 -3
- package/components/picker-popup/props.ts +12 -0
- package/components/popup/popup.scss +1 -1
- package/components/textarea/textarea.scss +1 -1
- package/demos/cell/demo-1.vue +1 -0
- package/demos/cell/demo-2.vue +1 -1
- package/demos/cell/demo-7.vue +1 -0
- package/package.json +1 -1
- package/.DS_Store +0 -0
- package/fonts/.DS_Store +0 -0
- package/images/.DS_Store +0 -0
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
@closed="emit('closed')"
|
|
19
19
|
>
|
|
20
20
|
<view :class="ns.b('content')">
|
|
21
|
-
<Search v-if="showSearch" v-model="searchText" :class="ns.b('search')" />
|
|
21
|
+
<Search v-if="showSearch" v-model="searchText" v-bind="searchProps" :class="ns.b('search')" />
|
|
22
22
|
<view v-if="show" :class="ns.b('tab')">
|
|
23
23
|
<Tabs v-model="tabActive" :tabs="tabList" label-key="name" scrollable shrink />
|
|
24
24
|
</view>
|
|
@@ -3,6 +3,7 @@ import type { TreeNode, UseTreeFieldNames } from '../../core/useTree'
|
|
|
3
3
|
import { defaultFieldNames } from '../../core/useTree'
|
|
4
4
|
import { isArray, isObject } from '../../utils'
|
|
5
5
|
import { bottomPopupEmits, bottomPopupProps } from '../bottom-popup/props'
|
|
6
|
+
import type { SearchProps } from '../search'
|
|
6
7
|
|
|
7
8
|
export interface CascaderNode<T = any> {
|
|
8
9
|
props: T
|
|
@@ -50,6 +51,13 @@ export const cascaderProps = {
|
|
|
50
51
|
* 是否显示搜索
|
|
51
52
|
*/
|
|
52
53
|
showSearch: Boolean,
|
|
54
|
+
/**
|
|
55
|
+
* 搜索框的props
|
|
56
|
+
*/
|
|
57
|
+
searchProps: {
|
|
58
|
+
type: Object as PropType<Partial<SearchProps>>,
|
|
59
|
+
default: () => ({}),
|
|
60
|
+
},
|
|
53
61
|
/**
|
|
54
62
|
* 动态获取下一级节点数据
|
|
55
63
|
*/
|
package/components/cell/cell.vue
CHANGED
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
<view v-if="label" :class="ns.e('label')">{{ label }}</view>
|
|
23
23
|
</template>
|
|
24
24
|
</view>
|
|
25
|
-
<view :class="[ns.e('value'), valueClass]">
|
|
25
|
+
<view :class="[ns.e('value'), valueClass]" :style="{ textAlign: valueAlign }">
|
|
26
26
|
<slot v-if="$slots.default" />
|
|
27
27
|
<text v-else :selectable="selectable" :user-select="selectable">{{ value }}</text>
|
|
28
28
|
|
|
29
|
-
<view v-if="errorMessage" :class="ns.e('error-message')"
|
|
29
|
+
<view v-if="errorMessage" :class="ns.e('error-message')">
|
|
30
30
|
{{ errorMessage }}
|
|
31
31
|
</view>
|
|
32
32
|
</view>
|
|
@@ -20,9 +20,11 @@
|
|
|
20
20
|
@confirm="onOk"
|
|
21
21
|
>
|
|
22
22
|
<view :class="ns.e('content')">
|
|
23
|
+
<slot name="before" />
|
|
23
24
|
<Search
|
|
24
25
|
v-if="showSearch"
|
|
25
26
|
v-model="searchText"
|
|
27
|
+
v-bind="searchProps"
|
|
26
28
|
:class="ns.e('search')"
|
|
27
29
|
@change="debounceSearchChange"
|
|
28
30
|
/>
|
|
@@ -56,7 +58,7 @@
|
|
|
56
58
|
<ButtonComponent
|
|
57
59
|
v-if="showView.create"
|
|
58
60
|
:class="ns.e('create-button')"
|
|
59
|
-
:type="
|
|
61
|
+
:type="showView.confirm ? 'default' : 'primary'"
|
|
60
62
|
ellipsis
|
|
61
63
|
block
|
|
62
64
|
@click="onCreate"
|
|
@@ -138,7 +140,7 @@ const filterOptions = computed(() => {
|
|
|
138
140
|
|
|
139
141
|
const showView = computed(() => {
|
|
140
142
|
const create = props.allowCreate && !!searchText.value
|
|
141
|
-
const confirm = props.multiple
|
|
143
|
+
const confirm = props.multiple || props.showConfirm
|
|
142
144
|
return {
|
|
143
145
|
footer: create || confirm,
|
|
144
146
|
create,
|
|
@@ -225,7 +227,7 @@ const onCreate = async () => {
|
|
|
225
227
|
}
|
|
226
228
|
|
|
227
229
|
const onSelect = async (value: OptionValue) => {
|
|
228
|
-
if (_onSelect(value) && !
|
|
230
|
+
if (_onSelect(value) && !showView.value.confirm) {
|
|
229
231
|
onOk()
|
|
230
232
|
}
|
|
231
233
|
}
|
|
@@ -2,6 +2,7 @@ import type { CSSProperties, ExtractPropTypes, PropType } from 'vue'
|
|
|
2
2
|
import type { UseListProps } from '../../core/useList'
|
|
3
3
|
import { isArray, isNumber, isObject, isString } from '../../utils'
|
|
4
4
|
import { bottomPopupEmits, bottomPopupProps } from '../bottom-popup/props'
|
|
5
|
+
import type { SearchProps } from '../search'
|
|
5
6
|
|
|
6
7
|
export type Option = any
|
|
7
8
|
export type OptionValue = number | string
|
|
@@ -37,6 +38,13 @@ export const pickerPopupProps = {
|
|
|
37
38
|
* 是否显示搜索
|
|
38
39
|
*/
|
|
39
40
|
showSearch: Boolean,
|
|
41
|
+
/**
|
|
42
|
+
* 搜索框的props
|
|
43
|
+
*/
|
|
44
|
+
searchProps: {
|
|
45
|
+
type: Object as PropType<Partial<SearchProps>>,
|
|
46
|
+
default: () => ({}),
|
|
47
|
+
},
|
|
40
48
|
/**
|
|
41
49
|
* 是否多选
|
|
42
50
|
*/
|
|
@@ -84,6 +92,10 @@ export const pickerPopupProps = {
|
|
|
84
92
|
* 确定后是否重置数据
|
|
85
93
|
*/
|
|
86
94
|
resetAfterConfirm: Boolean,
|
|
95
|
+
/**
|
|
96
|
+
* 是否显示确认按钮,多选时强制开启
|
|
97
|
+
*/
|
|
98
|
+
showConfirm: Boolean,
|
|
87
99
|
/**
|
|
88
100
|
* 是否允许用户创建新条目,需配合 showSearch 使用
|
|
89
101
|
*/
|
package/demos/cell/demo-1.vue
CHANGED
package/demos/cell/demo-2.vue
CHANGED
package/demos/cell/demo-7.vue
CHANGED
package/package.json
CHANGED
package/.DS_Store
DELETED
|
Binary file
|
package/fonts/.DS_Store
DELETED
|
Binary file
|
package/images/.DS_Store
DELETED
|
Binary file
|