@tplc/business 0.0.15 → 0.0.17

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.
@@ -6,6 +6,14 @@
6
6
  </template>
7
7
 
8
8
  <script setup lang="ts">
9
+ defineOptions({
10
+ name: 'ActionView',
11
+ options: {
12
+ addGlobalClass: true,
13
+ virtualHost: true,
14
+ styleIsolation: 'shared',
15
+ },
16
+ })
9
17
  defineProps({
10
18
  disabled: {
11
19
  type: Boolean,
@@ -24,6 +24,15 @@ import { ComponentGroupProps } from './type'
24
24
  import FilterSlider from '../FilterSlider/index.vue'
25
25
  import TagSelect from '../TagSelect/index.vue'
26
26
  import ActionView from '../ActionView/index.vue'
27
+ defineOptions({
28
+ name: 'ComponentGroup',
29
+ options: {
30
+ addGlobalClass: true,
31
+ virtualHost: true,
32
+ styleIsolation: 'shared',
33
+ },
34
+ })
35
+
27
36
  const props = defineProps<ComponentGroupProps>()
28
37
  const emits = defineEmits(['submit'])
29
38
  const innerFilter = ref<Record<string, any>>({})
@@ -1,4 +1,4 @@
1
- import { ComponentList } from 'components/lcb-filter/api'
1
+ import { ComponentList } from '../../api'
2
2
 
3
3
  export interface ComponentGroupProps {
4
4
  componentList?: ComponentList[]
@@ -17,6 +17,14 @@
17
17
  import { FilterSelectProps } from './type'
18
18
  import useSelect from '../../hooks/useSelect'
19
19
  import { watch, watchEffect } from 'vue'
20
+ defineOptions({
21
+ name: 'FilterSelect',
22
+ options: {
23
+ addGlobalClass: true,
24
+ virtualHost: true,
25
+ styleIsolation: 'shared',
26
+ },
27
+ })
20
28
  const props = defineProps<FilterSelectProps>()
21
29
  const model = defineModel<string | string[]>()
22
30
  const modelTitle = defineModel<string>('title')
@@ -18,7 +18,14 @@
18
18
  import { FilterSliderProps } from './types'
19
19
  import SelectTagView from '../SelectTagView/index.vue'
20
20
  import { ref, watch } from 'vue'
21
-
21
+ defineOptions({
22
+ name: 'FilterSlider',
23
+ options: {
24
+ addGlobalClass: true,
25
+ virtualHost: true,
26
+ styleIsolation: 'shared',
27
+ },
28
+ })
22
29
  const props = defineProps<FilterSliderProps>()
23
30
  const model = defineModel<number[]>()
24
31
  const innerValue = ref<number[]>()
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <view
3
3
  class="select-tag"
4
+ @click="emit('click')"
4
5
  :class="[{ 'select-tag-checked': checked, 'select-tag-small': size === 'small' }]"
5
6
  >
6
7
  {{ title }}
@@ -8,6 +9,15 @@
8
9
  </template>
9
10
 
10
11
  <script setup lang="ts">
12
+ const emit = defineEmits(['click'])
13
+ defineOptions({
14
+ name: 'SelectTagView',
15
+ options: {
16
+ addGlobalClass: true,
17
+ virtualHost: true,
18
+ styleIsolation: 'shared',
19
+ },
20
+ })
11
21
  defineProps<{ title: string; checked?: boolean; size?: 'small' | 'normal' }>()
12
22
  </script>
13
23
  <style lang="scss" scoped>
@@ -16,7 +16,7 @@
16
16
  v-model="inputValue"
17
17
  @input="onInput(item, $event)"
18
18
  @blur="onBlur(item)"
19
- @confirm="onConfirm"
19
+ @confirm="onBlur(item)"
20
20
  />
21
21
  </view>
22
22
  <template v-else>
@@ -44,6 +44,14 @@ import useSelect from '../../hooks/useSelect'
44
44
  import { ref, watchEffect, nextTick } from 'vue'
45
45
  import SelectTagView from '../SelectTagView/index.vue'
46
46
  import { Option } from '../../types'
47
+ defineOptions({
48
+ name: 'TagSelect',
49
+ options: {
50
+ addGlobalClass: true,
51
+ virtualHost: true,
52
+ styleIsolation: 'shared',
53
+ },
54
+ })
47
55
  const props = defineProps<TagSelectProps>()
48
56
  const model = defineModel<string | string[]>()
49
57
  const modelTitle = defineModel<string>('title')
@@ -77,9 +85,6 @@ const onBlur = (item: Option) => {
77
85
  }
78
86
  showInput.value = false
79
87
  }
80
- const onConfirm = () => {
81
- showInput.value = false
82
- }
83
88
  const onInput = (item: Option, e) => {
84
89
  if (item.max && parseInt(e.detail.value) > item.max) {
85
90
  uni.showToast({
@@ -56,6 +56,14 @@ import { TreeSelectProps } from './type'
56
56
  import useSelect from '../../hooks/useSelect'
57
57
  import SelectTagView from '../SelectTagView/index.vue'
58
58
  import ActionView from '../ActionView/index.vue'
59
+ defineOptions({
60
+ name: 'TreeSelect',
61
+ options: {
62
+ addGlobalClass: true,
63
+ virtualHost: true,
64
+ styleIsolation: 'shared',
65
+ },
66
+ })
59
67
  const props = defineProps<TreeSelectProps>()
60
68
  const model = defineModel<string | string[]>()
61
69
  const modelTitle = defineModel<string>('title')
@@ -1,3 +1,3 @@
1
- import { FilterItemProps } from 'components/lcb-filter/types'
1
+ import { FilterItemProps } from '../../types'
2
2
 
3
3
  export interface TreeSelectProps extends FilterItemProps {}
package/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LcbGlobal } from 'action'
2
2
 
3
- export const $lcb: LcbGlobal = {}
4
-
3
+ export const $lcb: LcbGlobal = {} as LcbGlobal
4
+ uni.$lcb = $lcb
5
5
  // #ifdef H5
6
6
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7
7
  // @ts-ignore
@@ -21,7 +21,6 @@ for (const key in importFn) {
21
21
  }
22
22
  // #endif
23
23
  const install = (Vue) => {
24
- uni.$lcb = $lcb
25
24
  // #ifdef H5
26
25
  components.forEach(function (component) {
27
26
  Vue.component(component.name, component)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -1,4 +1,4 @@
1
- import { ComponentList } from 'components/lcb-filter/api'
1
+ import { ComponentList } from '../../api'
2
2
  export interface ComponentGroupProps {
3
3
  componentList?: ComponentList[]
4
4
  filter?: Record<string, string>
@@ -10,7 +10,9 @@ declare const _default: import('vue').DefineComponent<
10
10
  {},
11
11
  import('vue').ComponentOptionsMixin,
12
12
  import('vue').ComponentOptionsMixin,
13
- {},
13
+ {
14
+ click: (...args: any[]) => void
15
+ },
14
16
  string,
15
17
  import('vue').PublicProps,
16
18
  Readonly<
@@ -21,7 +23,9 @@ declare const _default: import('vue').DefineComponent<
21
23
  size?: 'small' | 'normal'
22
24
  }>
23
25
  >
24
- >,
26
+ > & {
27
+ onClick?: ((...args: any[]) => any) | undefined
28
+ },
25
29
  {},
26
30
  {}
27
31
  >
@@ -1,2 +1,2 @@
1
- import { FilterItemProps } from 'components/lcb-filter/types'
1
+ import { FilterItemProps } from '../../types'
2
2
  export interface TreeSelectProps extends FilterItemProps {}