@tplc/business 0.0.79 → 0.0.80

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/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.80](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.78...v0.0.80) (2024-11-26)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.0.79 ([f149975](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/f1499756bccbee4fe6e1c3794e58604606c6ad00))
11
+
12
+
13
+ ### ✨ Features | 新功能
14
+
15
+ * 新增 按钮模式 ([e839a01](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/e839a01dd81996dae49a5259940cbfea6d03acca))
16
+ * 新增usertop点击路径 ([3e37a4d](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/3e37a4d49806be2d756102fa1cc80b72b4e487fb))
17
+
5
18
  ### [0.0.79](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.73...v0.0.79) (2024-11-26)
6
19
 
7
20
 
@@ -10,12 +10,12 @@
10
10
  :use-page-scroll="!autoHeight"
11
11
  :height="autoHeight ? height : ''"
12
12
  >
13
- <slot :items="normalizeDataList"></slot>
13
+ <slot />
14
14
  </z-paging>
15
15
  </template>
16
16
 
17
17
  <script setup lang="ts">
18
- import { computed, getCurrentInstance, onMounted, ref, watch } from 'vue'
18
+ import { computed, getCurrentInstance, onMounted, ref, watch, watchEffect } from 'vue'
19
19
  import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging'
20
20
  import { LcbFilterListProps } from './type'
21
21
  import { formatJson } from '../../../../utils/utils'
@@ -35,8 +35,10 @@ const paging = ref()
35
35
  const viewPageHeight = uni.getSystemInfoSync().windowHeight
36
36
  const height = ref('')
37
37
  useZPaging(paging)
38
-
39
- const normalizeDataList = computed(() => {
38
+ const modelValue = defineModel<unknown[]>({
39
+ default: [],
40
+ })
41
+ watchEffect(() => {
40
42
  const list = dataList.value?.map?.((item: any) => {
41
43
  const imgArr = formatJson(item.coverImg, [])
42
44
  const tags = formatJson(item.tags, [])
@@ -50,7 +52,7 @@ const normalizeDataList = computed(() => {
50
52
  tags,
51
53
  }
52
54
  })
53
- return list
55
+ modelValue.value = list
54
56
  })
55
57
 
56
58
  watch(
@@ -18,21 +18,19 @@
18
18
  :sticky="sticky"
19
19
  />
20
20
 
21
- <FilterList v-bind="{ ...info.listInfo, listType, filter, ...attrs }" :autoHeight="!isSticky">
22
- <template #default="{ items }">
23
- <slot name="list" :items="items">
24
- <lcb-product v-bind="{ ...attrs }" :listType="listType" :items="items" v-if="$slots.item">
25
- <template #item="{ item }">
26
- <slot name="item" :item="item"></slot>
27
- </template>
28
- </lcb-product>
29
- <lcb-product
30
- v-bind="{ ...attrs }"
31
- :listType="listType"
32
- :items="items"
33
- v-else
34
- ></lcb-product>
35
- </slot>
21
+ <FilterList
22
+ v-bind="{ ...info.listInfo, listType, filter, ...attrs }"
23
+ :autoHeight="!isSticky"
24
+ v-model="items"
25
+ >
26
+ <slot name="list" :items="items" v-if="$slots.list" />
27
+ <template v-else>
28
+ <lcb-product v-bind="{ ...attrs }" :listType="listType" :items="items" v-if="$slots.item">
29
+ <template #item="{ item }">
30
+ <slot name="item" :item="item"></slot>
31
+ </template>
32
+ </lcb-product>
33
+ <lcb-product v-bind="{ ...attrs }" :listType="listType" :items="items" v-else></lcb-product>
36
34
  </template>
37
35
  </FilterList>
38
36
  </template>
@@ -50,6 +48,7 @@ import './index.scss'
50
48
  const attrs = useAttrs()
51
49
  /** 是否悬停 */
52
50
  const sticky = ref(false)
51
+ const items = ref([])
53
52
  defineOptions({
54
53
  name: 'LcbList',
55
54
  options: {
@@ -27,7 +27,11 @@ defineSlots<{
27
27
  <template>
28
28
  <lcb-block v-bind="$props">
29
29
  <view class="flex flex-col gap-2 p-2" v-if="listType === 'list'">
30
- <view v-for="(item, index) in items" :key="`${item?.productId}:${index}`">
30
+ <lcb-action-view
31
+ v-for="(item, index) in items"
32
+ :key="`${item?.productId}:${index}`"
33
+ v-bind="item.link"
34
+ >
31
35
  <slot name="item" :item="item">
32
36
  <lcb-product-item
33
37
  v-bind="{ ...item, ...attrs }"
@@ -65,7 +69,7 @@ defineSlots<{
65
69
  </template> -->
66
70
  </lcb-product-item>
67
71
  </slot>
68
- </view>
72
+ </lcb-action-view>
69
73
  </view>
70
74
 
71
75
  <view class="flex p-1 flex-wrap" v-if="listType === 'grid'">
@@ -1,7 +1,14 @@
1
1
  <script setup lang="ts">
2
2
  import { inject, computed, useAttrs } from 'vue'
3
3
  import { isArray } from '@tplc/wot/components/common/util'
4
-
4
+ defineOptions({
5
+ name: 'LcbProductItemView',
6
+ options: {
7
+ addGlobalClass: true,
8
+ virtualHost: true,
9
+ styleIsolation: 'shared',
10
+ },
11
+ })
5
12
  // const attrs = useAttrs()
6
13
 
7
14
  const itemProps: any = inject('lcb-product-item-props')
@@ -2,9 +2,6 @@
2
2
  import { computed, provide, useAttrs } from 'vue'
3
3
  import { LcbProductItemProps } from './types'
4
4
  import ItemValue from './components/ItemValue.vue'
5
-
6
- const isNumber = (value: any) => typeof value === 'number'
7
-
8
5
  defineOptions({
9
6
  name: 'LcbProductItem',
10
7
  options: {
@@ -13,6 +10,7 @@ defineOptions({
13
10
  styleIsolation: 'shared',
14
11
  },
15
12
  })
13
+ const isNumber = (value: any) => typeof value === 'number'
16
14
 
17
15
  const props = withDefaults(defineProps<LcbProductItemProps>(), {
18
16
  layoutType: 'horizontal',
@@ -139,7 +137,9 @@ defineSlots<{
139
137
  <template #title="{ value }"><slot name="title" :value="value" /></template>
140
138
  <template #subTitle="{ value }"><slot name="subTitle" :value="value" /></template>
141
139
  <template #price="{ value }"><slot name="price" :value="value" /></template>
142
- <template #priceUnit="{ value }"><slot name="priceUnit" :value="value" /></template>
140
+ <template #priceUnit="{ value }">
141
+ <slot name="priceUnit" :value="value" />
142
+ </template>
143
143
  <template #priceSuffix="{ value }">
144
144
  <slot name="priceSuffix" :value="value" />
145
145
  </template>
@@ -169,7 +169,9 @@ defineSlots<{
169
169
  <template #title="{ value }"><slot name="title" :value="value" /></template>
170
170
  <template #subTitle="{ value }"><slot name="subTitle" :value="value" /></template>
171
171
  <template #price="{ value }"><slot name="price" :value="value" /></template>
172
- <template #priceUnit="{ value }"><slot name="priceUnit" :value="value" /></template>
172
+ <template #priceUnit="{ value }">
173
+ <slot name="priceUnit" :value="value" />
174
+ </template>
173
175
  <template #priceSuffix="{ value }">
174
176
  <slot name="priceSuffix" :value="value" />
175
177
  </template>
@@ -256,7 +258,9 @@ defineSlots<{
256
258
  <template #title="{ value }"><slot name="title" :value="value" /></template>
257
259
  <template #subTitle="{ value }"><slot name="subTitle" :value="value" /></template>
258
260
  <template #price="{ value }"><slot name="price" :value="value" /></template>
259
- <template #priceUnit="{ value }"><slot name="priceUnit" :value="value" /></template>
261
+ <template #priceUnit="{ value }">
262
+ <slot name="priceUnit" :value="value" />
263
+ </template>
260
264
  <template #priceSuffix="{ value }">
261
265
  <slot name="priceSuffix" :value="value" />
262
266
  </template>
@@ -286,7 +290,9 @@ defineSlots<{
286
290
  <template #title="{ value }"><slot name="title" :value="value" /></template>
287
291
  <template #subTitle="{ value }"><slot name="subTitle" :value="value" /></template>
288
292
  <template #price="{ value }"><slot name="price" :value="value" /></template>
289
- <template #priceUnit="{ value }"><slot name="priceUnit" :value="value" /></template>
293
+ <template #priceUnit="{ value }">
294
+ <slot name="priceUnit" :value="value" />
295
+ </template>
290
296
  <template #priceSuffix="{ value }">
291
297
  <slot name="priceSuffix" :value="value" />
292
298
  </template>
package/package.json CHANGED
@@ -1,17 +1,26 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.0.79",
3
+ "version": "0.0.80",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
7
7
  "type": "module",
8
+ "scripts": {
9
+ "pub": "pnpm dts && pnpm publish --no-git-checks",
10
+ "dts": "rm -rf types && vue-tsc --project ./tsconfig.dts.json && pnpm prettier --write types",
11
+ "release-major": "standard-version --release-as major ",
12
+ "release-minor": "standard-version --release-as minor",
13
+ "release-patch": "standard-version --release-as patch ",
14
+ "generateComponent": "node ./scripts/createComponent.mjs",
15
+ "generateGlobalDts": "node ./scripts/generateGlobalDts.mjs"
16
+ },
8
17
  "publishConfig": {
9
18
  "access": "public",
10
19
  "registry": "https://registry.npmjs.org/"
11
20
  },
12
21
  "peerDependencies": {
13
- "vue": ">=3.2.47",
14
- "@tplc/wot": "0.1.39"
22
+ "@tplc/wot": "workspace:*",
23
+ "vue": ">=3.2.47"
15
24
  },
16
25
  "engines": {
17
26
  "node": ">=18",
@@ -24,14 +33,5 @@
24
33
  },
25
34
  "devDependencies": {
26
35
  "standard-version": "^9.5.0"
27
- },
28
- "scripts": {
29
- "pub": "pnpm dts && pnpm publish --no-git-checks",
30
- "dts": "rm -rf types && vue-tsc --project ./tsconfig.dts.json && pnpm prettier --write types",
31
- "release-major": "standard-version --release-as major ",
32
- "release-minor": "standard-version --release-as minor",
33
- "release-patch": "standard-version --release-as patch ",
34
- "generateComponent": "node ./scripts/createComponent.mjs",
35
- "generateGlobalDts": "node ./scripts/generateGlobalDts.mjs"
36
36
  }
37
- }
37
+ }
@@ -1,19 +1,27 @@
1
1
  import { LcbFilterListProps } from './type'
2
+ declare let __VLS_typeProps: LcbFilterListProps
3
+ type __VLS_PublicProps = {
4
+ modelValue?: unknown[]
5
+ } & typeof __VLS_typeProps
2
6
  declare function __VLS_template(): {
3
- default?(_: { items: any[] }): any
7
+ default?(_: {}): any
4
8
  }
5
9
  declare const __VLS_component: import('vue').DefineComponent<
6
- __VLS_TypePropsToOption<LcbFilterListProps>,
10
+ __VLS_TypePropsToOption<__VLS_PublicProps>,
7
11
  {},
8
12
  unknown,
9
13
  {},
10
14
  {},
11
15
  import('vue').ComponentOptionsMixin,
12
16
  import('vue').ComponentOptionsMixin,
13
- {},
17
+ {
18
+ 'update:modelValue': (modelValue: unknown[]) => void
19
+ },
14
20
  string,
15
21
  import('vue').PublicProps,
16
- Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<LcbFilterListProps>>>,
22
+ Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
23
+ 'onUpdate:modelValue'?: ((modelValue: unknown[]) => any) | undefined
24
+ },
17
25
  {},
18
26
  {}
19
27
  >