sard-uniapp 1.2.2 → 1.4.0-alpha
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 +13 -0
- package/components/alert/alert.d.ts +35 -0
- package/components/alert/alert.vue +74 -0
- package/components/alert/common.d.ts +26 -0
- package/components/alert/common.js +8 -0
- package/components/alert/index.d.ts +1 -0
- package/components/alert/index.js +1 -0
- package/components/alert/index.scss +59 -0
- package/components/alert/variables.scss +14 -0
- package/components/button/button.d.ts +1 -1
- package/components/calendar-input/calendar-input.vue +8 -7
- package/components/cascader-input/cascader-input.vue +8 -7
- package/components/checkbox/common.d.ts +13 -0
- package/components/checkbox/common.js +4 -0
- package/components/checkbox-group/checkbox-group.vue +27 -7
- package/components/checkbox-input/checkbox-input.d.ts +35 -0
- package/components/checkbox-input/checkbox-input.vue +185 -0
- package/components/checkbox-input/common.d.ts +15 -0
- package/components/checkbox-input/common.js +5 -0
- package/components/checkbox-input/index.d.ts +1 -0
- package/components/checkbox-input/index.js +1 -0
- package/components/checkbox-input/index.scss +7 -0
- package/components/checkbox-input/variables.scss +5 -0
- package/components/config/index.d.ts +40 -0
- package/components/config/index.js +20 -0
- package/components/datetime-picker-input/datetime-picker-input.vue +2 -1
- package/components/form/variables.scss +2 -2
- package/components/input/common.d.ts +1 -0
- package/components/input/index.scss +21 -0
- package/components/input/input.vue +22 -4
- package/components/input/variables.scss +1 -0
- package/components/list/index.scss +6 -0
- package/components/list/list.vue +1 -0
- package/components/list-item/index.scss +1 -0
- package/components/notify/notify.d.ts +1 -1
- package/components/notify-agent/notify-agent.d.ts +1 -1
- package/components/picker-input/picker-input.vue +2 -1
- package/components/popout-input/common.d.ts +1 -0
- package/components/popout-input/popout-input.vue +6 -2
- package/components/qrcode/common.d.ts +23 -0
- package/components/qrcode/common.js +2 -0
- package/components/qrcode/index.d.ts +1 -0
- package/components/qrcode/index.js +1 -0
- package/components/qrcode/index.scss +17 -0
- package/components/qrcode/qrcode.d.ts +47 -0
- package/components/qrcode/qrcode.vue +107 -0
- package/components/qrcode/variables.scss +4 -0
- package/components/radio/common.d.ts +13 -0
- package/components/radio/common.js +4 -0
- package/components/radio-group/radio-group.vue +27 -7
- package/components/radio-input/common.d.ts +16 -0
- package/components/radio-input/common.js +5 -0
- package/components/radio-input/index.d.ts +1 -0
- package/components/radio-input/index.js +1 -0
- package/components/radio-input/index.scss +7 -0
- package/components/radio-input/radio-input.d.ts +38 -0
- package/components/radio-input/radio-input.vue +181 -0
- package/components/radio-input/variables.scss +5 -0
- package/components/result/result.d.ts +1 -1
- package/components/result/result.vue +1 -1
- package/components/tag/tag.d.ts +1 -1
- package/global.d.ts +9 -1
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/index.scss +4 -0
- package/package.json +2 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/is.d.ts +6 -0
- package/utils/is.js +8 -0
- package/utils/qrcode.d.ts +8 -0
- package/utils/qrcode.js +616 -0
|
@@ -9,19 +9,32 @@
|
|
|
9
9
|
:toggle="toggle"
|
|
10
10
|
:value="innerValue"
|
|
11
11
|
></slot>
|
|
12
|
-
<slot v-else
|
|
12
|
+
<slot v-else>
|
|
13
|
+
<template v-if="options">
|
|
14
|
+
<sar-radio
|
|
15
|
+
v-for="option in options"
|
|
16
|
+
:key="isPrimitive(option) ? option : option[fieldKeys.value]"
|
|
17
|
+
:value="isPrimitive(option) ? option : option[fieldKeys.value]"
|
|
18
|
+
:validate-event="false"
|
|
19
|
+
>
|
|
20
|
+
{{ isPrimitive(option) ? option : option[fieldKeys.label] }}
|
|
21
|
+
</sar-radio>
|
|
22
|
+
</template>
|
|
23
|
+
</slot>
|
|
13
24
|
</view>
|
|
14
25
|
</template>
|
|
15
26
|
|
|
16
27
|
<script>
|
|
17
28
|
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
18
|
-
import { ref, watch, provide, toRef, reactive } from "vue";
|
|
29
|
+
import { ref, watch, provide, toRef, reactive, computed } from "vue";
|
|
19
30
|
import {
|
|
20
31
|
radioContextSymbol,
|
|
21
|
-
radioGroupPropsDefaults
|
|
32
|
+
radioGroupPropsDefaults,
|
|
33
|
+
defaultOptionKeys
|
|
22
34
|
} from "../radio/common";
|
|
23
|
-
import { classNames, stringifyStyle, createBem } from "../../utils";
|
|
35
|
+
import { classNames, stringifyStyle, createBem, isPrimitive } from "../../utils";
|
|
24
36
|
import { useFormItemContext } from "../form/common";
|
|
37
|
+
import SarRadio from "../radio/radio.vue";
|
|
25
38
|
export default _defineComponent({
|
|
26
39
|
...{
|
|
27
40
|
options: {
|
|
@@ -40,7 +53,9 @@ export default _defineComponent({
|
|
|
40
53
|
type: { type: String, required: false },
|
|
41
54
|
checkedColor: { type: String, required: false },
|
|
42
55
|
direction: { type: String, required: false },
|
|
43
|
-
validateEvent: { type: Boolean, required: false }
|
|
56
|
+
validateEvent: { type: Boolean, required: false },
|
|
57
|
+
options: { type: Array, required: false },
|
|
58
|
+
optionKeys: { type: Object, required: false }
|
|
44
59
|
}, radioGroupPropsDefaults),
|
|
45
60
|
emits: ["click", "update:model-value"],
|
|
46
61
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -49,6 +64,9 @@ export default _defineComponent({
|
|
|
49
64
|
const emit = __emit;
|
|
50
65
|
const bem = createBem("radio-group");
|
|
51
66
|
const formItemContext = useFormItemContext();
|
|
67
|
+
const fieldKeys = computed(() => {
|
|
68
|
+
return Object.assign({}, defaultOptionKeys, props.optionKeys);
|
|
69
|
+
});
|
|
52
70
|
const innerValue = ref(props.modelValue);
|
|
53
71
|
watch(
|
|
54
72
|
() => props.modelValue,
|
|
@@ -74,11 +92,13 @@ export default _defineComponent({
|
|
|
74
92
|
toggle
|
|
75
93
|
})
|
|
76
94
|
);
|
|
77
|
-
const __returned__ = { props, emit, bem, formItemContext, innerValue, toggle, get classNames() {
|
|
95
|
+
const __returned__ = { props, emit, bem, formItemContext, fieldKeys, innerValue, toggle, get classNames() {
|
|
78
96
|
return classNames;
|
|
79
97
|
}, get stringifyStyle() {
|
|
80
98
|
return stringifyStyle;
|
|
81
|
-
}
|
|
99
|
+
}, get isPrimitive() {
|
|
100
|
+
return isPrimitive;
|
|
101
|
+
}, SarRadio };
|
|
82
102
|
return __returned__;
|
|
83
103
|
}
|
|
84
104
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type RadioGroupOption, type RadioGroupProps } from '../radio/common';
|
|
2
|
+
import { type PopoutInputProps } from '../popout-input/common';
|
|
3
|
+
export type RadioInputOption = RadioGroupOption;
|
|
4
|
+
export interface RadioInputProps extends RadioGroupProps, Omit<PopoutInputProps, 'modelValue'> {
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const radioInputPropsDefaults: {
|
|
9
|
+
options: () => never[];
|
|
10
|
+
validateEvent: boolean;
|
|
11
|
+
type: "record";
|
|
12
|
+
};
|
|
13
|
+
export interface RadioInputEmits {
|
|
14
|
+
(e: 'update:visible', visible: boolean): void;
|
|
15
|
+
(e: 'update:model-value', value: any): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { RadioInputProps, RadioInputEmits } from './common';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type RadioInputProps } from './common';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<RadioInputProps>, {
|
|
3
|
+
options: () => never[];
|
|
4
|
+
validateEvent: boolean;
|
|
5
|
+
type: "record";
|
|
6
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
"update:visible": (visible: boolean) => void;
|
|
8
|
+
"update:model-value": (value: any) => void;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<RadioInputProps>, {
|
|
10
|
+
options: () => never[];
|
|
11
|
+
validateEvent: boolean;
|
|
12
|
+
type: "record";
|
|
13
|
+
}>>> & {
|
|
14
|
+
"onUpdate:model-value"?: ((value: any) => any) | undefined;
|
|
15
|
+
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
options: import("../radio/common").RadioGroupOption[];
|
|
18
|
+
type: import("../radio/common").IconType;
|
|
19
|
+
validateEvent: boolean;
|
|
20
|
+
}, {}>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithDefaults<P, D> = {
|
|
23
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
24
|
+
default: D[K];
|
|
25
|
+
}> : P[K];
|
|
26
|
+
};
|
|
27
|
+
type __VLS_Prettify<T> = {
|
|
28
|
+
[K in keyof T]: T[K];
|
|
29
|
+
} & {};
|
|
30
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
31
|
+
type __VLS_TypePropsToOption<T> = {
|
|
32
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
33
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
34
|
+
} : {
|
|
35
|
+
type: import('vue').PropType<T[K]>;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sar-popout-input
|
|
3
|
+
v-model="inputValue"
|
|
4
|
+
:placeholder="placeholder"
|
|
5
|
+
:readonly="readonly"
|
|
6
|
+
:disabled="disabled"
|
|
7
|
+
:clearable="clearable"
|
|
8
|
+
@clear="onClear"
|
|
9
|
+
@click="onInputClick"
|
|
10
|
+
/>
|
|
11
|
+
|
|
12
|
+
<sar-popout
|
|
13
|
+
:root-class="rootClass"
|
|
14
|
+
:root-style="rootStyle"
|
|
15
|
+
:visible="innerVisible"
|
|
16
|
+
@update:visible="onVisible"
|
|
17
|
+
:title="title ?? placeholder"
|
|
18
|
+
:show-confirm="false"
|
|
19
|
+
@confirm="onConfirm"
|
|
20
|
+
>
|
|
21
|
+
<template #visible="{ already }">
|
|
22
|
+
<scroll-view v-if="already" scroll-y :class="bem.e('scroll')">
|
|
23
|
+
<sar-radio-group
|
|
24
|
+
:size="size"
|
|
25
|
+
:type="type"
|
|
26
|
+
:checkedColor="checkedColor"
|
|
27
|
+
:direction="direction"
|
|
28
|
+
:validate-event="false"
|
|
29
|
+
:model-value="popoutValue"
|
|
30
|
+
@update:model-value="onChange"
|
|
31
|
+
>
|
|
32
|
+
<template #custom="{ toggle }">
|
|
33
|
+
<sar-list inlaid>
|
|
34
|
+
<sar-list-item
|
|
35
|
+
v-for="option in options"
|
|
36
|
+
:key="option[fieldKeys.value]"
|
|
37
|
+
:title="option[fieldKeys.label]"
|
|
38
|
+
hover
|
|
39
|
+
@click="toggle(option[fieldKeys.value])"
|
|
40
|
+
>
|
|
41
|
+
<template #value>
|
|
42
|
+
<sar-radio readonly :value="option[fieldKeys.value]" />
|
|
43
|
+
</template>
|
|
44
|
+
</sar-list-item>
|
|
45
|
+
</sar-list>
|
|
46
|
+
</template>
|
|
47
|
+
</sar-radio-group>
|
|
48
|
+
</scroll-view>
|
|
49
|
+
</template>
|
|
50
|
+
</sar-popout>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script>
|
|
54
|
+
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
55
|
+
import { ref, watch, computed } from "vue";
|
|
56
|
+
import SarPopoutInput from "../popout-input/popout-input.vue";
|
|
57
|
+
import SarPopout from "../popout/popout.vue";
|
|
58
|
+
import SarRadioGroup from "../radio-group/radio-group.vue";
|
|
59
|
+
import SarRadio from "../radio/radio.vue";
|
|
60
|
+
import { defaultOptionKeys } from "../radio/common";
|
|
61
|
+
import {
|
|
62
|
+
radioInputPropsDefaults
|
|
63
|
+
} from "./common";
|
|
64
|
+
import { createBem, isNullish } from "../../utils";
|
|
65
|
+
import { useFormItemContext } from "../form/common";
|
|
66
|
+
export default _defineComponent({
|
|
67
|
+
...{
|
|
68
|
+
options: {
|
|
69
|
+
virtualHost: true,
|
|
70
|
+
styleIsolation: "shared"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
__name: "radio-input",
|
|
74
|
+
props: _mergeDefaults({
|
|
75
|
+
visible: { type: Boolean, required: false },
|
|
76
|
+
title: { type: String, required: false },
|
|
77
|
+
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
78
|
+
rootClass: { type: String, required: false },
|
|
79
|
+
modelValue: { type: null, required: false },
|
|
80
|
+
disabled: { type: Boolean, required: false },
|
|
81
|
+
readonly: { type: Boolean, required: false },
|
|
82
|
+
size: { type: String, required: false },
|
|
83
|
+
type: { type: String, required: false },
|
|
84
|
+
checkedColor: { type: String, required: false },
|
|
85
|
+
direction: { type: String, required: false },
|
|
86
|
+
validateEvent: { type: Boolean, required: false },
|
|
87
|
+
options: { type: Array, required: false },
|
|
88
|
+
optionKeys: { type: Object, required: false },
|
|
89
|
+
placeholder: { type: String, required: false },
|
|
90
|
+
clearable: { type: Boolean, required: false },
|
|
91
|
+
loading: { type: Boolean, required: false },
|
|
92
|
+
multiline: { type: Boolean, required: false }
|
|
93
|
+
}, radioInputPropsDefaults),
|
|
94
|
+
emits: ["update:visible", "update:model-value"],
|
|
95
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
96
|
+
__expose();
|
|
97
|
+
const props = __props;
|
|
98
|
+
const emit = __emit;
|
|
99
|
+
const bem = createBem("radio-input");
|
|
100
|
+
const formItemContext = useFormItemContext();
|
|
101
|
+
const fieldKeys = computed(() => {
|
|
102
|
+
return Object.assign({}, defaultOptionKeys, props.optionKeys);
|
|
103
|
+
});
|
|
104
|
+
const innerValue = ref(props.modelValue);
|
|
105
|
+
watch(
|
|
106
|
+
() => props.modelValue,
|
|
107
|
+
() => {
|
|
108
|
+
innerValue.value = props.modelValue;
|
|
109
|
+
if (props.validateEvent) {
|
|
110
|
+
formItemContext?.onChange();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
const popoutValue = ref(props.modelValue);
|
|
115
|
+
watch(innerValue, () => {
|
|
116
|
+
popoutValue.value = innerValue.value;
|
|
117
|
+
});
|
|
118
|
+
const onChange = (value) => {
|
|
119
|
+
popoutValue.value = value;
|
|
120
|
+
onConfirm();
|
|
121
|
+
innerVisible.value = false;
|
|
122
|
+
};
|
|
123
|
+
const onConfirm = () => {
|
|
124
|
+
innerValue.value = popoutValue.value;
|
|
125
|
+
emit("update:model-value", popoutValue.value);
|
|
126
|
+
inputValue.value = getInputValue();
|
|
127
|
+
};
|
|
128
|
+
const inputValue = ref("");
|
|
129
|
+
function getOutletText(options, optionKeys, value) {
|
|
130
|
+
return options.find((option) => option[optionKeys.value] === value)?.[optionKeys.label] || "";
|
|
131
|
+
}
|
|
132
|
+
function getInputValue() {
|
|
133
|
+
if (isNullish(innerValue.value) || innerValue.value.length === 0) {
|
|
134
|
+
return "";
|
|
135
|
+
}
|
|
136
|
+
return getOutletText(props.options, fieldKeys.value, innerValue.value);
|
|
137
|
+
}
|
|
138
|
+
watch(
|
|
139
|
+
innerValue,
|
|
140
|
+
() => {
|
|
141
|
+
inputValue.value = getInputValue();
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
immediate: true
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
watch(
|
|
148
|
+
() => props.options,
|
|
149
|
+
() => {
|
|
150
|
+
inputValue.value = getInputValue();
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
const onClear = () => {
|
|
154
|
+
inputValue.value = "";
|
|
155
|
+
innerValue.value = void 0;
|
|
156
|
+
emit("update:model-value", void 0);
|
|
157
|
+
};
|
|
158
|
+
const innerVisible = ref(props.visible);
|
|
159
|
+
watch(
|
|
160
|
+
() => props.visible,
|
|
161
|
+
() => {
|
|
162
|
+
innerVisible.value = props.visible;
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
const onVisible = (visible) => {
|
|
166
|
+
innerVisible.value = visible;
|
|
167
|
+
emit("update:visible", visible);
|
|
168
|
+
};
|
|
169
|
+
const onInputClick = () => {
|
|
170
|
+
innerVisible.value = true;
|
|
171
|
+
emit("update:visible", true);
|
|
172
|
+
};
|
|
173
|
+
const __returned__ = { props, emit, bem, formItemContext, fieldKeys, innerValue, popoutValue, onChange, onConfirm, inputValue, getOutletText, getInputValue, onClear, innerVisible, onVisible, onInputClick, SarPopoutInput, SarPopout, SarRadioGroup, SarRadio };
|
|
174
|
+
return __returned__;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
</script>
|
|
178
|
+
|
|
179
|
+
<style lang="scss">
|
|
180
|
+
@import './index.scss';
|
|
181
|
+
</style>
|
|
@@ -4,7 +4,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
4
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ResultProps>, {
|
|
5
5
|
status: "info";
|
|
6
6
|
}>>>, {
|
|
7
|
-
status: "success" | "info" | "
|
|
7
|
+
status: "success" | "info" | "warning" | "error" | "question";
|
|
8
8
|
}, {}>, Readonly<ResultSlots> & ResultSlots>;
|
|
9
9
|
export default _default;
|
|
10
10
|
type __VLS_WithDefaults<P, D> = {
|
package/components/tag/tag.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
13
13
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
14
14
|
}, {
|
|
15
15
|
size: "small" | "medium" | "large";
|
|
16
|
-
theme: "success" | "default" | "primary" | "info" | "
|
|
16
|
+
theme: "success" | "default" | "primary" | "info" | "warning" | "danger" | "secondary";
|
|
17
17
|
}, {}>, Readonly<TagSlots> & TagSlots>;
|
|
18
18
|
export default _default;
|
|
19
19
|
type __VLS_WithDefaults<P, D> = {
|
package/global.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import '@vue/runtime-core'
|
|
|
3
3
|
import SarAccordion from './components/accordion/accordion'
|
|
4
4
|
import SarAccordionItem from './components/accordion-item/accordion-item'
|
|
5
5
|
import SarActionSheet from './components/action-sheet/action-sheet'
|
|
6
|
+
import SarAlert from './components/alert/alert'
|
|
6
7
|
import SarAvatar from './components/avatar/avatar'
|
|
7
8
|
import SarBadge from './components/badge/badge'
|
|
8
9
|
import SarButton from './components/button/button'
|
|
@@ -13,6 +14,7 @@ import SarCascader from './components/cascader/cascader'
|
|
|
13
14
|
import SarCascaderInput from './components/cascader-input/cascader-input'
|
|
14
15
|
import SarCheckbox from './components/checkbox/checkbox'
|
|
15
16
|
import SarCheckboxGroup from './components/checkbox-group/checkbox-group'
|
|
17
|
+
import SarCheckboxInput from './components/checkbox-input/checkbox-input'
|
|
16
18
|
import SarCol from './components/col/col'
|
|
17
19
|
import SarCollapse from './components/collapse/collapse'
|
|
18
20
|
import SarCountDown from './components/count-down/count-down'
|
|
@@ -57,8 +59,10 @@ import SarPopup from './components/popup/popup'
|
|
|
57
59
|
import SarProgressBar from './components/progress-bar/progress-bar'
|
|
58
60
|
import SarProgressCircle from './components/progress-circle/progress-circle'
|
|
59
61
|
import SarPullDownRefresh from './components/pull-down-refresh/pull-down-refresh'
|
|
62
|
+
import SarQrcode from './components/qrcode/qrcode'
|
|
60
63
|
import SarRadio from './components/radio/radio'
|
|
61
64
|
import SarRadioGroup from './components/radio-group/radio-group'
|
|
65
|
+
import SarRadioInput from './components/radio-input/radio-input'
|
|
62
66
|
import SarRate from './components/rate/rate'
|
|
63
67
|
import SarResult from './components/result/result'
|
|
64
68
|
import SarRow from './components/row/row'
|
|
@@ -87,8 +91,9 @@ declare module '@vue/runtime-core' {
|
|
|
87
91
|
// GlobalComponents for Volar
|
|
88
92
|
export interface GlobalComponents {
|
|
89
93
|
SarAccordion: typeof SarAccordion
|
|
90
|
-
SarActionSheet: typeof SarActionSheet
|
|
91
94
|
SarAccordionItem: typeof SarAccordionItem
|
|
95
|
+
SarActionSheet: typeof SarActionSheet
|
|
96
|
+
SarAlert: typeof SarAlert
|
|
92
97
|
SarAvatar: typeof SarAvatar
|
|
93
98
|
SarBadge: typeof SarBadge
|
|
94
99
|
SarButton: typeof SarButton
|
|
@@ -99,6 +104,7 @@ declare module '@vue/runtime-core' {
|
|
|
99
104
|
SarCascaderInput: typeof SarCascaderInput
|
|
100
105
|
SarCheckbox: typeof SarCheckbox
|
|
101
106
|
SarCheckboxGroup: typeof SarCheckboxGroup
|
|
107
|
+
SarCheckboxInput: typeof SarCheckboxInput
|
|
102
108
|
SarCol: typeof SarCol
|
|
103
109
|
SarCollapse: typeof SarCollapse
|
|
104
110
|
SarCountDown: typeof SarCountDown
|
|
@@ -143,8 +149,10 @@ declare module '@vue/runtime-core' {
|
|
|
143
149
|
SarProgressBar: typeof SarProgressBar
|
|
144
150
|
SarProgressCircle: typeof SarProgressCircle
|
|
145
151
|
SarPullDownRefresh: typeof SarPullDownRefresh
|
|
152
|
+
SarQrcode: typeof SarQrcode
|
|
146
153
|
SarRadio: typeof SarRadio
|
|
147
154
|
SarRadioGroup: typeof SarRadioGroup
|
|
155
|
+
SarRadioInput: typeof SarRadioInput
|
|
148
156
|
SarRate: typeof SarRate
|
|
149
157
|
SarResult: typeof SarResult
|
|
150
158
|
SarRow: typeof SarRow
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './components/accordion';
|
|
2
2
|
export * from './components/action-sheet';
|
|
3
|
+
export * from './components/alert';
|
|
3
4
|
export * from './components/avatar';
|
|
4
5
|
export * from './components/badge';
|
|
5
6
|
export * from './components/button';
|
|
@@ -9,6 +10,7 @@ export * from './components/card';
|
|
|
9
10
|
export * from './components/cascader';
|
|
10
11
|
export * from './components/cascader-input';
|
|
11
12
|
export * from './components/checkbox';
|
|
13
|
+
export * from './components/checkbox-input';
|
|
12
14
|
export * from './components/collapse';
|
|
13
15
|
export * from './components/config';
|
|
14
16
|
export * from './components/count-down';
|
|
@@ -49,7 +51,9 @@ export * from './components/popup';
|
|
|
49
51
|
export * from './components/progress-bar';
|
|
50
52
|
export * from './components/progress-circle';
|
|
51
53
|
export * from './components/pull-down-refresh';
|
|
54
|
+
export * from './components/qrcode';
|
|
52
55
|
export * from './components/radio';
|
|
56
|
+
export * from './components/radio-input';
|
|
53
57
|
export * from './components/rate';
|
|
54
58
|
export * from './components/result';
|
|
55
59
|
export * from './components/search';
|
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './components/accordion';
|
|
2
2
|
export * from './components/action-sheet';
|
|
3
|
+
export * from './components/alert';
|
|
3
4
|
export * from './components/avatar';
|
|
4
5
|
export * from './components/badge';
|
|
5
6
|
export * from './components/button';
|
|
@@ -9,6 +10,7 @@ export * from './components/card';
|
|
|
9
10
|
export * from './components/cascader';
|
|
10
11
|
export * from './components/cascader-input';
|
|
11
12
|
export * from './components/checkbox';
|
|
13
|
+
export * from './components/checkbox-input';
|
|
12
14
|
export * from './components/collapse';
|
|
13
15
|
export * from './components/config';
|
|
14
16
|
export * from './components/count-down';
|
|
@@ -49,7 +51,9 @@ export * from './components/popup';
|
|
|
49
51
|
export * from './components/progress-bar';
|
|
50
52
|
export * from './components/progress-circle';
|
|
51
53
|
export * from './components/pull-down-refresh';
|
|
54
|
+
export * from './components/qrcode';
|
|
52
55
|
export * from './components/radio';
|
|
56
|
+
export * from './components/radio-input';
|
|
53
57
|
export * from './components/rate';
|
|
54
58
|
export * from './components/result';
|
|
55
59
|
export * from './components/search';
|
package/index.scss
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use './components/accordion/variables.scss' as *;
|
|
2
2
|
@use './components/action-sheet/variables.scss' as *;
|
|
3
|
+
@use './components/alert/variables.scss' as *;
|
|
3
4
|
@use './components/avatar/variables.scss' as *;
|
|
4
5
|
@use './components/badge/variables.scss' as *;
|
|
5
6
|
@use './components/button/variables.scss' as *;
|
|
@@ -7,6 +8,7 @@
|
|
|
7
8
|
@use './components/card/variables.scss' as *;
|
|
8
9
|
@use './components/cascader/variables.scss' as *;
|
|
9
10
|
@use './components/checkbox/variables.scss' as *;
|
|
11
|
+
@use './components/checkbox-input/variables.scss' as *;
|
|
10
12
|
@use './components/col/variables.scss' as *;
|
|
11
13
|
@use './components/collapse/variables.scss' as *;
|
|
12
14
|
@use './components/dialog/variables.scss' as *;
|
|
@@ -37,8 +39,10 @@
|
|
|
37
39
|
@use './components/progress-bar/variables.scss' as *;
|
|
38
40
|
@use './components/progress-circle/variables.scss' as *;
|
|
39
41
|
@use './components/pull-down-refresh/variables.scss' as *;
|
|
42
|
+
@use './components/qrcode/variables.scss' as *;
|
|
40
43
|
@use './components/rate/variables.scss' as *;
|
|
41
44
|
@use './components/radio/variables.scss' as *;
|
|
45
|
+
@use './components/radio-input/variables.scss' as *;
|
|
42
46
|
@use './components/result/variables.scss' as *;
|
|
43
47
|
@use './components/row/variables.scss' as *;
|
|
44
48
|
@use './components/search/variables.scss' as *;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "sard-uniapp",
|
|
3
3
|
"name": "sard-uniapp",
|
|
4
4
|
"displayName": "sard-uniapp",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.4.0-alpha",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"description": "sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库",
|
|
8
8
|
"keywords": [
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
34
34
|
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
35
35
|
"@vue/test-utils": "^2.4.6",
|
|
36
|
+
"canvas": "^2.11.2",
|
|
36
37
|
"region-data": "^1.2.1",
|
|
37
38
|
"vitest": "^1.0.4"
|
|
38
39
|
},
|
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
package/utils/is.d.ts
CHANGED
|
@@ -40,3 +40,9 @@ export declare function isUndefined(target: any): target is undefined;
|
|
|
40
40
|
* @return {boolean}
|
|
41
41
|
*/
|
|
42
42
|
export declare function isNullish(target: any): target is null | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* @description: 判断是否为原始类型
|
|
45
|
+
* @param {any} target
|
|
46
|
+
* @return {boolean}
|
|
47
|
+
*/
|
|
48
|
+
export declare function isPrimitive(target: any): target is string | number | boolean;
|
package/utils/is.js
CHANGED
|
@@ -54,3 +54,11 @@ export function isUndefined(target) {
|
|
|
54
54
|
export function isNullish(target) {
|
|
55
55
|
return target === null || target === undefined;
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* @description: 判断是否为原始类型
|
|
59
|
+
* @param {any} target
|
|
60
|
+
* @return {boolean}
|
|
61
|
+
*/
|
|
62
|
+
export function isPrimitive(target) {
|
|
63
|
+
return isString(target) || isNumber(target) || isBoolean(target);
|
|
64
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const ALPHANUMERIC_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
|
|
2
|
+
interface QrcodeOptions {
|
|
3
|
+
ecl?: ECL;
|
|
4
|
+
}
|
|
5
|
+
export type ECL = 'L' | 'M' | 'Q' | 'H';
|
|
6
|
+
export declare const ECLList: ECL[];
|
|
7
|
+
export declare function qrcode(text: string, options?: QrcodeOptions): number[][];
|
|
8
|
+
export {};
|