sard-uniapp 1.19.0 → 1.19.2
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 +29 -0
- package/README.md +1 -1
- package/components/action-sheet/variables.scss +1 -1
- package/components/calendar/calendar.vue +2 -2
- package/components/calendar-input/calendar-input.d.ts +3 -2
- package/components/calendar-input/calendar-input.vue +1 -0
- package/components/calendar-input/common.d.ts +2 -0
- package/components/calendar-popout/calendar-popout.d.ts +12 -2
- package/components/calendar-popout/calendar-popout.vue +7 -1
- package/components/calendar-popout/common.d.ts +2 -0
- package/components/cascader-input/cascader-input.d.ts +2 -1
- package/components/cascader-input/cascader-input.vue +7 -6
- package/components/cascader-input/common.d.ts +2 -0
- package/components/cascader-input/common.js +1 -0
- package/components/cascader-popout/cascader-popout.d.ts +1 -1
- package/components/cascader-popout/cascader-popout.vue +2 -2
- package/components/check-icon/variables.scss +1 -1
- package/components/checkbox/variables.scss +1 -1
- package/components/checkbox-input/checkbox-input.d.ts +1 -0
- package/components/checkbox-input/checkbox-input.vue +3 -2
- package/components/checkbox-input/common.d.ts +2 -0
- package/components/checkbox-input/common.js +5 -1
- package/components/config/index.d.ts +44 -1
- package/components/config/index.js +36 -0
- package/components/datetime-picker-input/common.d.ts +2 -0
- package/components/datetime-picker-input/common.js +1 -0
- package/components/datetime-picker-input/datetime-picker-input.d.ts +2 -1
- package/components/datetime-picker-input/datetime-picker-input.vue +1 -0
- package/components/datetime-picker-popout/datetime-picker-popout.d.ts +1 -1
- package/components/datetime-picker-popout/datetime-picker-popout.vue +2 -2
- package/components/datetime-range-picker-input/common.d.ts +2 -0
- package/components/datetime-range-picker-input/common.js +1 -0
- package/components/datetime-range-picker-input/datetime-range-picker-input.d.ts +1 -0
- package/components/datetime-range-picker-input/datetime-range-picker-input.vue +1 -0
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +2 -2
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog-agent/dialog-agent.d.ts +1 -1
- package/components/dropdown/common.d.ts +3 -1
- package/components/dropdown/dropdown.d.ts +1 -1
- package/components/dropdown/variables.scss +1 -1
- package/components/dropdown-item/dropdown-item.vue +27 -3
- package/components/empty/variables.scss +1 -1
- package/components/input/common.d.ts +1 -0
- package/components/input/index.scss +0 -20
- package/components/input/input.vue +16 -17
- package/components/input/variables.scss +2 -2
- package/components/picker/common.d.ts +1 -1
- package/components/picker/common.js +18 -6
- package/components/picker/picker.vue +30 -15
- package/components/picker-input/common.d.ts +2 -0
- package/components/picker-input/common.js +2 -0
- package/components/picker-input/picker-input.d.ts +2 -1
- package/components/picker-input/picker-input.vue +3 -2
- package/components/picker-popout/picker-popout.d.ts +1 -1
- package/components/picker-popout/picker-popout.vue +9 -4
- package/components/popout/common.d.ts +1 -0
- package/components/popout/popout.d.ts +1 -1
- package/components/popout/popout.vue +1 -0
- package/components/popout-input/popout-input.vue +1 -0
- package/components/popout-input/variables.scss +1 -1
- package/components/pull-down-refresh/pull-down-refresh.d.ts +1 -1
- package/components/qrcode/common.d.ts +2 -0
- package/components/qrcode/qrcode.vue +58 -61
- package/components/radio/variables.scss +1 -1
- package/components/radio-input/common.d.ts +3 -1
- package/components/radio-input/common.js +5 -1
- package/components/radio-input/radio-input.d.ts +1 -0
- package/components/radio-input/radio-input.vue +3 -2
- package/components/radio-popout/common.d.ts +1 -1
- package/components/rate/rate.d.ts +1 -1
- package/components/rate/variables.scss +1 -1
- package/components/search/variables.scss +1 -1
- package/components/share-sheet/variables.scss +1 -1
- package/components/stepper/variables.scss +1 -1
- package/components/style/variables-dark.scss +10 -6
- package/components/style/variables.scss +17 -11
- package/components/tag/common.d.ts +1 -1
- package/components/tag/index.scss +5 -1
- package/components/tag/tag.vue +2 -2
- package/components/timeline/variables.scss +1 -1
- package/components/tree/variables.scss +3 -3
- package/components/upload/common.d.ts +1 -0
- package/components/upload/upload.d.ts +1 -1
- package/components/upload/upload.vue +45 -26
- package/package.json +2 -2
- package/use/useFormPopout.d.ts +1 -1
- package/use/useFormPopout.js +4 -1
- package/use/usePopoutInput.d.ts +2 -1
- package/use/usePopoutInput.js +7 -4
package/use/useFormPopout.js
CHANGED
|
@@ -24,7 +24,10 @@ export function useFormPopout(props, emit, options = {}) {
|
|
|
24
24
|
options.onChange?.(value, ...args);
|
|
25
25
|
};
|
|
26
26
|
const onConfirm = () => {
|
|
27
|
-
options.onConfirmBefore?.();
|
|
27
|
+
const extraArgs = options.onConfirmBefore?.();
|
|
28
|
+
if (extraArgs) {
|
|
29
|
+
restArgs = extraArgs;
|
|
30
|
+
}
|
|
28
31
|
if (popoutValue.value !== innerValue.value) {
|
|
29
32
|
innerValue.value = popoutValue.value;
|
|
30
33
|
const args = [innerValue.value, ...restArgs];
|
package/use/usePopoutInput.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export interface UsePopoutInputProps {
|
|
2
2
|
visible?: boolean;
|
|
3
3
|
modelValue?: any;
|
|
4
|
+
valueOnClear?: () => any;
|
|
4
5
|
}
|
|
5
6
|
export interface UsePopoutInputEmits {
|
|
6
7
|
(e: 'update:visible', visible: boolean): void;
|
|
@@ -8,7 +9,7 @@ export interface UsePopoutInputEmits {
|
|
|
8
9
|
(e: 'change', ...args: any[]): void;
|
|
9
10
|
}
|
|
10
11
|
export declare function usePopoutInput(props: UsePopoutInputProps, emit: UsePopoutInputEmits, options?: {
|
|
11
|
-
onClear?: () => void;
|
|
12
|
+
onClear?: (value: any) => void;
|
|
12
13
|
}): {
|
|
13
14
|
innerVisible: import("vue").Ref<boolean | undefined, boolean | undefined>;
|
|
14
15
|
innerValue: import("vue").Ref<any, any>;
|
package/use/usePopoutInput.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ref, watch } from 'vue';
|
|
2
2
|
import { useTwoWayVisible } from './useTwoWayVisible';
|
|
3
|
+
import { defaultConfig } from '../components/config';
|
|
4
|
+
const defaultValueOnClear = () => undefined;
|
|
3
5
|
export function usePopoutInput(props, emit, options = {}) {
|
|
4
6
|
// visible
|
|
5
7
|
const { visible } = useTwoWayVisible(props, emit);
|
|
@@ -8,6 +10,7 @@ export function usePopoutInput(props, emit, options = {}) {
|
|
|
8
10
|
};
|
|
9
11
|
// value
|
|
10
12
|
const innerValue = ref(props.modelValue);
|
|
13
|
+
const getValueOnClear = () => (props.valueOnClear || defaultConfig.valueOnClear || defaultValueOnClear)();
|
|
11
14
|
watch(() => props.modelValue, () => {
|
|
12
15
|
innerValue.value = props.modelValue;
|
|
13
16
|
});
|
|
@@ -17,13 +20,13 @@ export function usePopoutInput(props, emit, options = {}) {
|
|
|
17
20
|
};
|
|
18
21
|
const onClear = () => {
|
|
19
22
|
inputValue.value = '';
|
|
20
|
-
innerValue.value =
|
|
23
|
+
innerValue.value = getValueOnClear();
|
|
21
24
|
if (options.onClear) {
|
|
22
|
-
options.onClear();
|
|
25
|
+
options.onClear(innerValue.value);
|
|
23
26
|
}
|
|
24
27
|
else {
|
|
25
|
-
emit('update:model-value',
|
|
26
|
-
emit('change',
|
|
28
|
+
emit('update:model-value', innerValue.value);
|
|
29
|
+
emit('change', innerValue.value);
|
|
27
30
|
}
|
|
28
31
|
};
|
|
29
32
|
// input
|