qidian-vue-ui 2.0.50 → 2.0.51
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/dist/components/dict/checkbox-group/index.css +1 -1
- package/dist/components/dict/checkbox-group/index.vue.mjs +1 -1
- package/dist/components/dict/checkbox-group/index.vue2.mjs +7 -2
- package/dist/components/dict/checkbox-group/types.d.ts +2 -2
- package/dist/components/dict/radio-group/index.css +1 -1
- package/dist/components/dict/radio-group/index.vue.mjs +1 -1
- package/dist/components/dict/radio-group/index.vue2.mjs +8 -2
- package/dist/components/dict/radio-group/types.d.ts +2 -2
- package/dist/components/dict/tag/index.css +2 -2
- package/dist/components/dict/tag/index.vue.mjs +1 -1
- package/dist/components/dict/tag/index.vue2.mjs +3 -3
- package/dist/components/dict/tag/types.d.ts +1 -1
- package/dist/hooks/useDict/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import './index.css'
|
|
|
2
2
|
import _sfc_main from "./index.vue2.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
5
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c38af75c"]]);
|
|
6
6
|
export {
|
|
7
7
|
index as default
|
|
8
8
|
};
|
|
@@ -19,6 +19,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
lazyLoad: { type: Boolean },
|
|
20
20
|
max: {},
|
|
21
21
|
name: {},
|
|
22
|
+
options: {},
|
|
22
23
|
readonly: { type: Boolean },
|
|
23
24
|
value: {},
|
|
24
25
|
defaultValue: {},
|
|
@@ -54,10 +55,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
55
|
});
|
|
55
56
|
const dictType = toRef(props, "dictType");
|
|
56
57
|
const reProps = computed(() => {
|
|
57
|
-
const { modelValue: modelValue2, dictType: dictType2, convStr, ...checkboxOptions } = props;
|
|
58
|
+
const { modelValue: modelValue2, dictType: dictType2, convStr, options, ...checkboxOptions } = props;
|
|
58
59
|
return {
|
|
59
60
|
dictType: dictType2,
|
|
60
61
|
convStr,
|
|
62
|
+
options,
|
|
61
63
|
checkboxOptions,
|
|
62
64
|
models: {
|
|
63
65
|
modelValue: modelValue2
|
|
@@ -65,12 +67,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
67
|
};
|
|
66
68
|
});
|
|
67
69
|
const { options: dictOptions, loading: dictLoading } = useDictDynamic(dictType);
|
|
70
|
+
const reDictOptions = computed(
|
|
71
|
+
() => isEmpty(reProps.value.options) ? dictOptions.value : reProps.value.options
|
|
72
|
+
);
|
|
68
73
|
return (_ctx, _cache) => {
|
|
69
74
|
return withDirectives((openBlock(), createBlock(unref(CheckboxGroup), mergeProps({
|
|
70
75
|
modelValue: reModelValue.value,
|
|
71
76
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => reModelValue.value = $event),
|
|
72
77
|
class: "qd-dict-checkbox-group"
|
|
73
|
-
}, reProps.value.checkboxOptions, { options:
|
|
78
|
+
}, reProps.value.checkboxOptions, { options: reDictOptions.value }), null, 16, ["modelValue", "options"])), [
|
|
74
79
|
[unref(vLoading), { loading: unref(dictLoading), size: "small" }]
|
|
75
80
|
]);
|
|
76
81
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CheckboxGroupValue, TdCheckboxGroupProps } from 'tdesign-vue-next';
|
|
2
|
-
export interface QdDictCheckboxGroupProps extends Omit<TdCheckboxGroupProps, 'modelValue'
|
|
3
|
-
dictType
|
|
2
|
+
export interface QdDictCheckboxGroupProps extends Omit<TdCheckboxGroupProps, 'modelValue'> {
|
|
3
|
+
dictType?: string;
|
|
4
4
|
convStr?: boolean | string;
|
|
5
5
|
modelValue?: CheckboxGroupValue | string;
|
|
6
6
|
}
|
|
@@ -2,7 +2,7 @@ import './index.css'
|
|
|
2
2
|
import _sfc_main from "./index.vue2.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
5
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4fba51da"]]);
|
|
6
6
|
export {
|
|
7
7
|
index as default
|
|
8
8
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './index.css'
|
|
2
2
|
import { defineComponent, mergeDefaults, toRef, computed, withDirectives, createBlock, openBlock, unref, mergeProps, isRef } from "vue";
|
|
3
3
|
import { useVModels } from "../../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.mjs";
|
|
4
|
+
import { isEmpty } from "qidian-shared";
|
|
4
5
|
import { RadioGroup, LoadingDirective } from "tdesign-vue-next";
|
|
5
6
|
import { qdDictRadioGroupProps } from "./props.mjs";
|
|
6
7
|
import { useDictDynamic } from "../../../hooks/useDict/index.mjs";
|
|
@@ -15,6 +16,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
15
16
|
direction: {},
|
|
16
17
|
disabled: { type: Boolean },
|
|
17
18
|
name: {},
|
|
19
|
+
options: {},
|
|
18
20
|
readonly: { type: Boolean },
|
|
19
21
|
size: {},
|
|
20
22
|
theme: {},
|
|
@@ -32,9 +34,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
32
34
|
const { modelValue } = useVModels(props, emit, { passive: true });
|
|
33
35
|
const dictType = toRef(props, "dictType");
|
|
34
36
|
const reProps = computed(() => {
|
|
35
|
-
const { modelValue: modelValue2, dictType: dictType2, ...radioOptions } = props;
|
|
37
|
+
const { modelValue: modelValue2, dictType: dictType2, options, ...radioOptions } = props;
|
|
36
38
|
return {
|
|
37
39
|
dictType: dictType2,
|
|
40
|
+
options,
|
|
38
41
|
radioOptions,
|
|
39
42
|
models: {
|
|
40
43
|
modelValue: modelValue2
|
|
@@ -42,12 +45,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
45
|
};
|
|
43
46
|
});
|
|
44
47
|
const { options: dictOptions, loading: dictLoading } = useDictDynamic(dictType);
|
|
48
|
+
const reDictOptions = computed(
|
|
49
|
+
() => isEmpty(reProps.value.options) ? dictOptions.value : reProps.value.options
|
|
50
|
+
);
|
|
45
51
|
return (_ctx, _cache) => {
|
|
46
52
|
return withDirectives((openBlock(), createBlock(unref(RadioGroup), mergeProps({
|
|
47
53
|
modelValue: unref(modelValue),
|
|
48
54
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
|
|
49
55
|
class: "qd-dict-radio-group"
|
|
50
|
-
}, reProps.value.radioOptions, { options:
|
|
56
|
+
}, reProps.value.radioOptions, { options: reDictOptions.value }), null, 16, ["modelValue", "options"])), [
|
|
51
57
|
[unref(vLoading), { loading: unref(dictLoading), size: "small" }]
|
|
52
58
|
]);
|
|
53
59
|
};
|
|
@@ -2,7 +2,7 @@ import './index.css'
|
|
|
2
2
|
import _sfc_main from "./index.vue2.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
5
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d996cafc"]]);
|
|
6
6
|
export {
|
|
7
7
|
index as default
|
|
8
8
|
};
|
|
@@ -12,7 +12,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12
12
|
},
|
|
13
13
|
__name: "index",
|
|
14
14
|
props: /* @__PURE__ */ mergeDefaults({
|
|
15
|
-
value: {},
|
|
15
|
+
value: { type: [String, Number, Boolean, Array, null] },
|
|
16
16
|
strict: { type: Boolean },
|
|
17
17
|
separator: {},
|
|
18
18
|
emptyText: {},
|
|
@@ -39,7 +39,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39
39
|
const { value, strict } = reProps.value;
|
|
40
40
|
if (isEmpty(value)) return [];
|
|
41
41
|
if (Array.isArray(value)) return value.map((item) => strict ? item : item.toString());
|
|
42
|
-
if (isNumber(value)) {
|
|
42
|
+
if (isNumber(value) || typeof value === "boolean") {
|
|
43
43
|
return strict ? [value] : [value.toString()];
|
|
44
44
|
}
|
|
45
45
|
return String(value).split(qdDictConvStrSeparator);
|
|
@@ -65,7 +65,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
65
|
], true) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(matchOptions.value, (item, index) => {
|
|
66
66
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
67
67
|
isTextItem(item) ? (openBlock(), createElementBlock("span", {
|
|
68
|
-
key: item.value,
|
|
68
|
+
key: item.value + "",
|
|
69
69
|
class: normalizeClass(item.class)
|
|
70
70
|
}, [
|
|
71
71
|
renderSlot(_ctx.$slots, "prefix", { item }, void 0, true),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TdTagProps } from 'tdesign-vue-next';
|
|
2
2
|
import type { QdDictItem } from '../../../hooks';
|
|
3
3
|
export interface QdDictTagProps extends Pick<TdTagProps, 'size' | 'shape'>, Pick<QdDictItem, 'theme' | 'variant'> {
|
|
4
|
-
value?:
|
|
4
|
+
value?: QdDictItem['value'] | QdDictItem['value'][] | null;
|
|
5
5
|
strict?: boolean;
|
|
6
6
|
separator?: string;
|
|
7
7
|
emptyText?: string;
|