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.
@@ -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
  */
@@ -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')" :style="{ textAlign: valueAlign }">
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="props.multiple ? 'default' : 'primary'"
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) && !multiple.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
  */
@@ -3,7 +3,7 @@
3
3
  &__content {
4
4
  position: relative;
5
5
  max-width: _var(popup-max-width, 100%);
6
- background-color: #fff;
6
+ background-color: _var(popup-background, #fff);
7
7
  border-radius: _var(popup-radius, 0);
8
8
  }
9
9
 
@@ -33,7 +33,7 @@
33
33
  }
34
34
 
35
35
  &--auto-height {
36
- line-height: _var(textarea-line-height, _var(textarea-font-size));
36
+ line-height: _var(textarea-line-height, _var(textarea-font-size, 14px));
37
37
  }
38
38
 
39
39
  &--disabled {
@@ -1,3 +1,4 @@
1
1
  <template>
2
2
  <pa-cell title="单元格" value="内容" />
3
+ <pa-cell title="单元格" label="描述信息" value="内容" />
3
4
  </template>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <pa-cell-group inset>
3
3
  <pa-cell title="单元格" value="内容" />
4
- <pa-cell title="单元格" value="内容" />
4
+ <pa-cell title="单元格" label="描述信息" value="内容" />
5
5
  </pa-cell-group>
6
6
  </template>
@@ -4,4 +4,5 @@
4
4
  value="内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容"
5
5
  center
6
6
  />
7
+ <pa-cell title="单元格" label="描述信息" value="内容" center />
7
8
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "papayaui",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "适用于uniapp的ui扩展库",
5
5
  "packageManager": "pnpm@8.6.0",
6
6
  "dependencies": {
package/.DS_Store DELETED
Binary file
package/fonts/.DS_Store DELETED
Binary file
package/images/.DS_Store DELETED
Binary file