sard-uniapp 1.15.4 → 1.17.0
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 +25 -0
- package/components/calendar-input/calendar-input.vue +26 -89
- package/components/calendar-input/common.d.ts +7 -17
- package/components/calendar-input/common.js +2 -1
- package/components/calendar-popout/calendar-popout.d.ts +17 -0
- package/components/calendar-popout/calendar-popout.vue +102 -0
- package/components/calendar-popout/common.d.ts +27 -0
- package/components/calendar-popout/common.js +5 -0
- package/components/calendar-popout/index.d.ts +1 -0
- package/components/calendar-popout/index.js +1 -0
- package/components/cascader-input/cascader-input.vue +26 -89
- package/components/cascader-input/common.d.ts +5 -19
- package/components/cascader-input/common.js +3 -1
- package/components/cascader-popout/cascader-popout.d.ts +23 -0
- package/components/cascader-popout/cascader-popout.vue +88 -0
- package/components/cascader-popout/common.d.ts +27 -0
- package/components/cascader-popout/common.js +2 -0
- package/components/cascader-popout/index.d.ts +1 -0
- package/components/cascader-popout/index.js +1 -0
- package/components/checkbox-input/checkbox-input.vue +21 -141
- package/components/checkbox-input/common.d.ts +4 -11
- package/components/checkbox-input/common.js +2 -5
- package/components/checkbox-popout/checkbox-popout.d.ts +21 -0
- package/components/checkbox-popout/checkbox-popout.vue +136 -0
- package/components/checkbox-popout/common.d.ts +22 -0
- package/components/checkbox-popout/common.js +5 -0
- package/components/checkbox-popout/index.d.ts +1 -0
- package/components/checkbox-popout/index.js +1 -0
- package/components/{checkbox-input → checkbox-popout}/index.scss +2 -2
- package/components/{checkbox-input → checkbox-popout}/variables.scss +1 -1
- package/components/config/index.d.ts +9 -7
- package/components/config/index.js +9 -7
- package/components/count-down/count-down.vue +5 -3
- package/components/datetime-picker/common.d.ts +3 -0
- package/components/datetime-picker/datetime-picker.d.ts +9 -2
- package/components/datetime-picker-input/common.d.ts +5 -13
- package/components/datetime-picker-input/common.js +1 -1
- package/components/datetime-picker-input/datetime-picker-input.d.ts +9 -2
- package/components/datetime-picker-input/datetime-picker-input.vue +22 -109
- package/components/datetime-picker-popout/common.d.ts +22 -0
- package/components/datetime-picker-popout/common.js +5 -0
- package/components/datetime-picker-popout/datetime-picker-popout.d.ts +21 -0
- package/components/datetime-picker-popout/datetime-picker-popout.vue +113 -0
- package/components/datetime-picker-popout/index.d.ts +1 -0
- package/components/datetime-picker-popout/index.js +1 -0
- package/components/datetime-range-picker/common.d.ts +2 -3
- package/components/datetime-range-picker-input/common.d.ts +5 -13
- package/components/datetime-range-picker-input/common.js +1 -1
- package/components/datetime-range-picker-input/datetime-range-picker-input.d.ts +9 -2
- package/components/datetime-range-picker-input/datetime-range-picker-input.vue +23 -97
- package/components/datetime-range-picker-popout/common.d.ts +22 -0
- package/components/datetime-range-picker-popout/common.js +5 -0
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.d.ts +21 -0
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +102 -0
- package/components/datetime-range-picker-popout/index.d.ts +1 -0
- package/components/datetime-range-picker-popout/index.js +1 -0
- package/components/navbar/navbar.vue +1 -1
- package/components/navbar-pit/common.d.ts +6 -0
- package/components/navbar-pit/common.js +1 -0
- package/components/navbar-pit/index.d.ts +1 -0
- package/components/navbar-pit/index.js +1 -0
- package/components/navbar-pit/index.scss +11 -0
- package/components/navbar-pit/navbar-pit.d.ts +2 -1
- package/components/navbar-pit/navbar-pit.vue +29 -4
- package/components/picker/common.d.ts +11 -0
- package/components/picker/index.scss +0 -13
- package/components/picker/picker.d.ts +9 -2
- package/components/picker/picker.vue +31 -9
- package/components/picker/variables.scss +4 -1
- package/components/picker-input/common.d.ts +5 -12
- package/components/picker-input/common.js +2 -4
- package/components/picker-input/picker-input.d.ts +9 -2
- package/components/picker-input/picker-input.vue +37 -74
- package/components/picker-item/common.d.ts +12 -0
- package/components/picker-item/common.js +1 -0
- package/components/picker-item/index.d.ts +1 -0
- package/components/picker-item/index.js +1 -0
- package/components/picker-item/index.scss +12 -0
- package/components/picker-item/picker-item.d.ts +10 -0
- package/components/picker-item/picker-item.vue +41 -0
- package/components/picker-popout/common.d.ts +23 -0
- package/components/picker-popout/common.js +6 -0
- package/components/picker-popout/index.d.ts +1 -0
- package/components/picker-popout/index.js +1 -0
- package/components/picker-popout/picker-popout.d.ts +22 -0
- package/components/picker-popout/picker-popout.vue +112 -0
- package/components/popout-input/common.d.ts +2 -0
- package/components/popout-input/popout-input.d.ts +2 -0
- package/components/popout-input/popout-input.vue +4 -0
- package/components/popup/popup.vue +15 -3
- package/components/radio-input/common.d.ts +4 -11
- package/components/radio-input/common.js +2 -5
- package/components/radio-input/radio-input.vue +21 -140
- package/components/radio-popout/common.d.ts +23 -0
- package/components/radio-popout/common.js +5 -0
- package/components/radio-popout/index.d.ts +1 -0
- package/components/radio-popout/index.js +1 -0
- package/components/{radio-input → radio-popout}/index.scss +2 -2
- package/components/radio-popout/radio-popout.d.ts +22 -0
- package/components/radio-popout/radio-popout.vue +135 -0
- package/components/{radio-input → radio-popout}/variables.scss +1 -1
- package/components/signature/signature.d.ts +2 -2
- package/components/tabbar/common.d.ts +2 -0
- package/components/tabbar/index.scss +13 -0
- package/components/tabbar/tabbar.vue +10 -2
- package/components/tabbar/variables.scss +1 -0
- package/components/tabbar-pit/common.d.ts +13 -0
- package/components/tabbar-pit/common.js +1 -0
- package/components/tabbar-pit/index.d.ts +1 -0
- package/components/tabbar-pit/index.js +1 -0
- package/components/tabbar-pit/index.scss +12 -0
- package/components/tabbar-pit/tabbar-pit.d.ts +10 -0
- package/components/tabbar-pit/tabbar-pit.vue +46 -0
- package/components/tree/common.d.ts +11 -0
- package/components/tree/index.d.ts +1 -1
- package/components/tree/tree.d.ts +8 -2
- package/components/tree/tree.vue +28 -5
- package/components/tree/variables.scss +2 -2
- package/components/tree-node/index.scss +2 -1
- package/components/tree-node/tree-node.vue +25 -3
- package/global.d.ts +9 -0
- package/index.d.ts +10 -0
- package/index.js +10 -0
- package/index.scss +2 -2
- package/package.json +4 -4
- package/use/index.d.ts +3 -0
- package/use/index.js +3 -0
- package/use/useFormPopout.d.ts +20 -0
- package/use/useFormPopout.js +42 -0
- package/use/usePopoutInput.d.ts +19 -0
- package/use/usePopoutInput.js +39 -0
- package/use/useTwoWayVisible.d.ts +9 -0
- package/use/useTwoWayVisible.js +13 -0
|
@@ -8,59 +8,44 @@
|
|
|
8
8
|
:root-class="rootClass"
|
|
9
9
|
:root-style="rootStyle"
|
|
10
10
|
@clear="onClear"
|
|
11
|
-
@click="
|
|
11
|
+
@click="show"
|
|
12
12
|
>
|
|
13
|
-
<sar-popout
|
|
13
|
+
<sar-datetime-range-picker-popout
|
|
14
14
|
keep-render
|
|
15
|
-
:visible="innerVisible"
|
|
15
|
+
v-model:visible="innerVisible"
|
|
16
|
+
v-model="innerValue"
|
|
16
17
|
:title="title ?? placeholder"
|
|
17
18
|
:root-class="popoutClass"
|
|
18
19
|
:root-style="popoutStyle"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
:min="min"
|
|
30
|
-
:max="max"
|
|
31
|
-
:filter="filter"
|
|
32
|
-
:formatter="formatter"
|
|
33
|
-
:value-format="valueFormat"
|
|
34
|
-
:tabs="tabs"
|
|
35
|
-
/>
|
|
36
|
-
</template>
|
|
37
|
-
</sar-popout>
|
|
20
|
+
:type="type"
|
|
21
|
+
:min="min"
|
|
22
|
+
:max="max"
|
|
23
|
+
:filter="filter"
|
|
24
|
+
:formatter="formatter"
|
|
25
|
+
:value-format="valueFormat"
|
|
26
|
+
:tabs="tabs"
|
|
27
|
+
:validate-event="validateEvent"
|
|
28
|
+
@change="onChange"
|
|
29
|
+
/>
|
|
38
30
|
</sar-popout-input>
|
|
39
31
|
</template>
|
|
40
32
|
|
|
41
33
|
<script>
|
|
42
34
|
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
43
|
-
import {
|
|
35
|
+
import { watch } from "vue";
|
|
44
36
|
import SarPopoutInput from "../popout-input/popout-input.vue";
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
getInitialValue,
|
|
50
|
-
getMaxDate,
|
|
51
|
-
getMinDate
|
|
52
|
-
} from "../datetime-picker/common";
|
|
37
|
+
import SarDatetimeRangePickerPopout from "../datetime-range-picker-popout/datetime-range-picker-popout.vue";
|
|
38
|
+
import { formatDate, isString, parseDate } from "../../utils";
|
|
39
|
+
import { usePopoutInput } from "../../use";
|
|
53
40
|
import {
|
|
54
41
|
defaultDatetimeRangePickerInputProps
|
|
55
42
|
} from "./common";
|
|
56
43
|
import { mapTypeFormat } from "../datetime-picker-input/common";
|
|
57
|
-
import { useFormItemContext } from "../form/common";
|
|
58
44
|
import { useTranslate } from "../locale";
|
|
59
45
|
export default _defineComponent({
|
|
60
46
|
components: {
|
|
61
47
|
SarPopoutInput,
|
|
62
|
-
|
|
63
|
-
SarDatetimeRangePicker,
|
|
48
|
+
SarDatetimeRangePickerPopout,
|
|
64
49
|
},
|
|
65
50
|
...{
|
|
66
51
|
options: {
|
|
@@ -70,10 +55,9 @@ export default _defineComponent({
|
|
|
70
55
|
},
|
|
71
56
|
__name: "datetime-range-picker-input",
|
|
72
57
|
props: _mergeDefaults({
|
|
58
|
+
outletFormat: { type: String, required: false },
|
|
73
59
|
visible: { type: Boolean, required: false },
|
|
74
60
|
title: { type: String, required: false },
|
|
75
|
-
outletFormat: { type: String, required: false },
|
|
76
|
-
valueFormat: { type: String, required: false },
|
|
77
61
|
validateEvent: { type: Boolean, required: false },
|
|
78
62
|
popoutClass: { type: String, required: false },
|
|
79
63
|
popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
@@ -86,6 +70,7 @@ export default _defineComponent({
|
|
|
86
70
|
max: { type: [Date, String], required: false },
|
|
87
71
|
filter: { type: Function, required: false },
|
|
88
72
|
formatter: { type: Function, required: false },
|
|
73
|
+
valueFormat: { type: String, required: false },
|
|
89
74
|
placeholder: { type: String, required: false },
|
|
90
75
|
readonly: { type: Boolean, required: false },
|
|
91
76
|
disabled: { type: Boolean, required: false },
|
|
@@ -97,45 +82,7 @@ export default _defineComponent({
|
|
|
97
82
|
__expose();
|
|
98
83
|
const props = __props;
|
|
99
84
|
const emit = __emit;
|
|
100
|
-
const
|
|
101
|
-
const innerValue = ref(props.modelValue);
|
|
102
|
-
watch(
|
|
103
|
-
() => props.modelValue,
|
|
104
|
-
() => {
|
|
105
|
-
innerValue.value = props.modelValue;
|
|
106
|
-
if (props.validateEvent) {
|
|
107
|
-
formItemContext?.onChange();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
);
|
|
111
|
-
const popoutValue = ref(props.modelValue);
|
|
112
|
-
const onChange = (value) => {
|
|
113
|
-
popoutValue.value = value;
|
|
114
|
-
};
|
|
115
|
-
const onEnter = () => {
|
|
116
|
-
if (!isNullish(innerValue.value) && popoutValue.value !== innerValue.value) {
|
|
117
|
-
popoutValue.value = innerValue.value;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
const minDate = computed(
|
|
121
|
-
() => toDate(props.min || getMinDate(), props.valueFormat)
|
|
122
|
-
);
|
|
123
|
-
const maxDate = computed(() => {
|
|
124
|
-
const maxDate2 = toDate(props.max || getMaxDate(), props.valueFormat);
|
|
125
|
-
return maxDate2 < minDate.value ? new Date(minDate.value) : maxDate2;
|
|
126
|
-
});
|
|
127
|
-
const onConfirm = () => {
|
|
128
|
-
if (!popoutValue.value) {
|
|
129
|
-
const initialValue = getInitialValue(minDate.value, maxDate.value);
|
|
130
|
-
const singleValue = props.valueFormat ? formatDate(initialValue, props.valueFormat) : initialValue;
|
|
131
|
-
popoutValue.value = [singleValue, singleValue];
|
|
132
|
-
}
|
|
133
|
-
innerValue.value = popoutValue.value;
|
|
134
|
-
emit("update:model-value", popoutValue.value);
|
|
135
|
-
emit("change", popoutValue.value);
|
|
136
|
-
inputValue.value = getInputValue();
|
|
137
|
-
};
|
|
138
|
-
const inputValue = ref("");
|
|
85
|
+
const { innerVisible, innerValue, inputValue, show, onChange, onClear } = usePopoutInput(props, emit);
|
|
139
86
|
const { t } = useTranslate("datetimeRangePickerInput");
|
|
140
87
|
function getOutletTextMayByStr(date) {
|
|
141
88
|
if (isString(date) && props.valueFormat) {
|
|
@@ -170,28 +117,7 @@ export default _defineComponent({
|
|
|
170
117
|
immediate: true
|
|
171
118
|
}
|
|
172
119
|
);
|
|
173
|
-
const
|
|
174
|
-
inputValue.value = "";
|
|
175
|
-
innerValue.value = void 0;
|
|
176
|
-
emit("update:model-value", void 0);
|
|
177
|
-
emit("change", void 0);
|
|
178
|
-
};
|
|
179
|
-
const innerVisible = ref(props.visible);
|
|
180
|
-
watch(
|
|
181
|
-
() => props.visible,
|
|
182
|
-
() => {
|
|
183
|
-
innerVisible.value = props.visible;
|
|
184
|
-
}
|
|
185
|
-
);
|
|
186
|
-
const onVisible = (visible) => {
|
|
187
|
-
innerVisible.value = visible;
|
|
188
|
-
emit("update:visible", visible);
|
|
189
|
-
};
|
|
190
|
-
const onInputClick = () => {
|
|
191
|
-
innerVisible.value = true;
|
|
192
|
-
emit("update:visible", true);
|
|
193
|
-
};
|
|
194
|
-
const __returned__ = { props, emit, formItemContext, innerValue, popoutValue, onChange, onEnter, minDate, maxDate, onConfirm, inputValue, t, getOutletTextMayByStr, getOutletText, getInputValue, onClear, innerVisible, onVisible, onInputClick, SarPopoutInput, SarPopout, SarDatetimeRangePicker };
|
|
120
|
+
const __returned__ = { props, emit, innerVisible, innerValue, inputValue, show, onChange, onClear, t, getOutletTextMayByStr, getOutletText, getInputValue, SarPopoutInput, SarDatetimeRangePickerPopout };
|
|
195
121
|
return __returned__;
|
|
196
122
|
}
|
|
197
123
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type StyleValue } from 'vue';
|
|
2
|
+
import { type DatetimeRangePickerProps, type DatetimeRangePickerSlots } from '../datetime-range-picker/common';
|
|
3
|
+
export interface DatetimeRangePickerPopoutProps extends DatetimeRangePickerProps {
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
title?: string;
|
|
6
|
+
validateEvent?: boolean;
|
|
7
|
+
popoutClass?: string;
|
|
8
|
+
popoutStyle?: StyleValue;
|
|
9
|
+
}
|
|
10
|
+
export declare const defaultDatetimeRangePickerInputProps: () => {
|
|
11
|
+
validateEvent: boolean;
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
export interface DatetimeRangePickerPopoutSlots extends DatetimeRangePickerSlots {
|
|
15
|
+
}
|
|
16
|
+
export interface DatetimeRangePickerPopoutEmits {
|
|
17
|
+
(e: 'update:visible', visible: boolean): void;
|
|
18
|
+
(e: 'update:model-value', date: (Date | string)[] | undefined): void;
|
|
19
|
+
(e: 'change', date: (Date | string)[] | undefined): void;
|
|
20
|
+
}
|
|
21
|
+
export interface DatetimeRangePickerPopoutExpose {
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type DatetimeRangePickerPopoutProps, type DatetimeRangePickerPopoutSlots } from './common';
|
|
2
|
+
declare function __VLS_template(): Readonly<DatetimeRangePickerPopoutSlots> & DatetimeRangePickerPopoutSlots;
|
|
3
|
+
declare const __VLS_component: import("vue").DefineComponent<DatetimeRangePickerPopoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
|
+
"update:model-value": (date: (string | Date)[] | undefined) => any;
|
|
5
|
+
change: (date: (string | Date)[] | undefined) => any;
|
|
6
|
+
"update:visible": (visible: boolean) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<DatetimeRangePickerPopoutProps> & Readonly<{
|
|
8
|
+
"onUpdate:model-value"?: ((date: (string | Date)[] | undefined) => any) | undefined;
|
|
9
|
+
onChange?: ((date: (string | Date)[] | undefined) => any) | undefined;
|
|
10
|
+
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
11
|
+
}>, {
|
|
12
|
+
type: string;
|
|
13
|
+
validateEvent: boolean;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sar-popout
|
|
3
|
+
v-model:visible="innerVisible"
|
|
4
|
+
keep-render
|
|
5
|
+
:title="title"
|
|
6
|
+
:root-class="popoutClass"
|
|
7
|
+
:root-style="popoutStyle"
|
|
8
|
+
@confirm="onConfirm"
|
|
9
|
+
@enter="onEnter"
|
|
10
|
+
>
|
|
11
|
+
<template #visible="{ already }">
|
|
12
|
+
<sar-datetime-range-picker
|
|
13
|
+
v-if="already"
|
|
14
|
+
:model-value="popoutValue"
|
|
15
|
+
:type="type"
|
|
16
|
+
:min="min"
|
|
17
|
+
:max="max"
|
|
18
|
+
:filter="filter"
|
|
19
|
+
:formatter="formatter"
|
|
20
|
+
:value-format="valueFormat"
|
|
21
|
+
:tabs="tabs"
|
|
22
|
+
@change="onChange"
|
|
23
|
+
/>
|
|
24
|
+
</template>
|
|
25
|
+
</sar-popout>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
30
|
+
import { computed } from "vue";
|
|
31
|
+
import SarPopout from "../popout/popout.vue";
|
|
32
|
+
import SarDatetimeRangePicker from "../datetime-range-picker/datetime-range-picker.vue";
|
|
33
|
+
import {
|
|
34
|
+
defaultDatetimeRangePickerInputProps
|
|
35
|
+
} from "./common";
|
|
36
|
+
import { formatDate, isNullish, toDate } from "../../utils";
|
|
37
|
+
import {
|
|
38
|
+
getInitialValue,
|
|
39
|
+
getMaxDate,
|
|
40
|
+
getMinDate
|
|
41
|
+
} from "../datetime-picker/common";
|
|
42
|
+
import { useFormPopout } from "../../use";
|
|
43
|
+
export default _defineComponent({
|
|
44
|
+
components: {
|
|
45
|
+
SarPopout,
|
|
46
|
+
SarDatetimeRangePicker,
|
|
47
|
+
},
|
|
48
|
+
...{
|
|
49
|
+
options: {
|
|
50
|
+
virtualHost: true,
|
|
51
|
+
styleIsolation: "shared"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
__name: "datetime-range-picker-popout",
|
|
55
|
+
props: _mergeDefaults({
|
|
56
|
+
visible: { type: Boolean, required: false },
|
|
57
|
+
title: { type: String, required: false },
|
|
58
|
+
validateEvent: { type: Boolean, required: false },
|
|
59
|
+
popoutClass: { type: String, required: false },
|
|
60
|
+
popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
61
|
+
modelValue: { type: Array, required: false },
|
|
62
|
+
tabs: { type: Array, required: false },
|
|
63
|
+
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
64
|
+
rootClass: { type: String, required: false },
|
|
65
|
+
type: { type: String, required: false },
|
|
66
|
+
min: { type: [Date, String], required: false },
|
|
67
|
+
max: { type: [Date, String], required: false },
|
|
68
|
+
filter: { type: Function, required: false },
|
|
69
|
+
formatter: { type: Function, required: false },
|
|
70
|
+
valueFormat: { type: String, required: false }
|
|
71
|
+
}, defaultDatetimeRangePickerInputProps()),
|
|
72
|
+
emits: ["update:visible", "update:model-value", "change"],
|
|
73
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
74
|
+
__expose();
|
|
75
|
+
const props = __props;
|
|
76
|
+
const emit = __emit;
|
|
77
|
+
const minDate = computed(
|
|
78
|
+
() => toDate(props.min || getMinDate(), props.valueFormat)
|
|
79
|
+
);
|
|
80
|
+
const maxDate = computed(() => {
|
|
81
|
+
const maxDate2 = toDate(props.max || getMaxDate(), props.valueFormat);
|
|
82
|
+
return maxDate2 < minDate.value ? new Date(minDate.value) : maxDate2;
|
|
83
|
+
});
|
|
84
|
+
const { innerVisible, innerValue, popoutValue, onChange, onConfirm } = useFormPopout(props, emit, {
|
|
85
|
+
onConfirmBefore() {
|
|
86
|
+
if (!popoutValue.value) {
|
|
87
|
+
const initialValue = getInitialValue(minDate.value, maxDate.value);
|
|
88
|
+
const singleValue = props.valueFormat ? formatDate(initialValue, props.valueFormat) : initialValue;
|
|
89
|
+
popoutValue.value = [singleValue, singleValue];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
const onEnter = () => {
|
|
94
|
+
if (!isNullish(innerValue.value) && popoutValue.value !== innerValue.value) {
|
|
95
|
+
popoutValue.value = innerValue.value;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const __returned__ = { props, emit, minDate, maxDate, innerVisible, innerValue, popoutValue, onChange, onConfirm, onEnter, SarPopout, SarDatetimeRangePicker };
|
|
99
|
+
return __returned__;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { DatetimeRangePickerPopoutProps, DatetimeRangePickerPopoutSlots, DatetimeRangePickerPopoutEmits, DatetimeRangePickerPopoutExpose, } from './common';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { NavbarPitProps } from './common';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { type NavbarPitProps } from './common';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<NavbarPitProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NavbarPitProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
3
|
export default _default;
|
|
@@ -1,22 +1,47 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view>
|
|
3
|
-
<sar-status-bar />
|
|
4
|
-
<view
|
|
2
|
+
<view :class="navbarPitClass" :style="navbarPitStyle">
|
|
3
|
+
<sar-status-bar v-if="statusBar" />
|
|
4
|
+
<view :class="bem.e('content')"></view>
|
|
5
5
|
</view>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script>
|
|
9
9
|
import { defineComponent as _defineComponent } from "vue";
|
|
10
10
|
import SarStatusBar from "../status-bar/status-bar.vue";
|
|
11
|
+
import { classNames, createBem, stringifyStyle } from "../../utils";
|
|
12
|
+
import { computed } from "vue";
|
|
11
13
|
export default _defineComponent({
|
|
12
14
|
components: {
|
|
13
15
|
SarStatusBar,
|
|
14
16
|
},
|
|
17
|
+
...{
|
|
18
|
+
options: {
|
|
19
|
+
virtualHost: true,
|
|
20
|
+
styleIsolation: "shared"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
15
23
|
__name: "navbar-pit",
|
|
24
|
+
props: {
|
|
25
|
+
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
26
|
+
rootClass: { type: String, required: false },
|
|
27
|
+
statusBar: { type: Boolean, required: false }
|
|
28
|
+
},
|
|
16
29
|
setup(__props, { expose: __expose }) {
|
|
17
30
|
__expose();
|
|
18
|
-
const
|
|
31
|
+
const props = __props;
|
|
32
|
+
const bem = createBem("navbar-pit");
|
|
33
|
+
const navbarPitClass = computed(() => {
|
|
34
|
+
return classNames(bem.b(), props.rootClass);
|
|
35
|
+
});
|
|
36
|
+
const navbarPitStyle = computed(() => {
|
|
37
|
+
return stringifyStyle(props.rootStyle);
|
|
38
|
+
});
|
|
39
|
+
const __returned__ = { props, bem, navbarPitClass, navbarPitStyle, SarStatusBar };
|
|
19
40
|
return __returned__;
|
|
20
41
|
}
|
|
21
42
|
});
|
|
22
43
|
</script>
|
|
44
|
+
|
|
45
|
+
<style lang="scss">
|
|
46
|
+
@import './index.scss';
|
|
47
|
+
</style>
|
|
@@ -15,11 +15,22 @@ export interface PickerProps {
|
|
|
15
15
|
optionKeys?: PickerOptionKeys;
|
|
16
16
|
modelValue?: any;
|
|
17
17
|
immediateChange?: boolean;
|
|
18
|
+
internalCustom?: number;
|
|
18
19
|
}
|
|
19
20
|
export declare const defaultPickerProps: () => {
|
|
20
21
|
columns: () => never[];
|
|
21
22
|
immediateChange: boolean;
|
|
22
23
|
};
|
|
24
|
+
export interface PickerSlots {
|
|
25
|
+
custom?(props: {
|
|
26
|
+
columns: any[][];
|
|
27
|
+
value: number[];
|
|
28
|
+
pickerViewClass: string;
|
|
29
|
+
maskClass: string;
|
|
30
|
+
indicatorClass: string;
|
|
31
|
+
onChange: (event: any) => void;
|
|
32
|
+
}): any;
|
|
33
|
+
}
|
|
23
34
|
export interface PickerEmits {
|
|
24
35
|
(e: 'update:model-value', value: any, selectedOptions: PickerOption[], indexes: number[]): void;
|
|
25
36
|
(e: 'change', value: any, selectedOptions: PickerOption[], indexes: number[]): void;
|
|
@@ -5,17 +5,4 @@
|
|
|
5
5
|
@include universal;
|
|
6
6
|
height: var(--sar-picker-height);
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
@include e(picker-view) {
|
|
10
|
-
height: 100%;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@include e(item) {
|
|
14
|
-
height: var(--sar-picker-item-height);
|
|
15
|
-
line-height: var(--sar-picker-item-height);
|
|
16
|
-
font-size: var(--sar-picker-item-font-size);
|
|
17
|
-
text-align: center;
|
|
18
|
-
color: var(--sar-picker-item-color);
|
|
19
|
-
@include ellipsis;
|
|
20
|
-
}
|
|
21
8
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type PickerProps, type PickerOption } from './common';
|
|
2
|
-
declare
|
|
1
|
+
import { type PickerProps, type PickerSlots, type PickerOption } from './common';
|
|
2
|
+
declare function __VLS_template(): Readonly<PickerSlots> & PickerSlots;
|
|
3
|
+
declare const __VLS_component: import("vue").DefineComponent<PickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
3
4
|
"update:model-value": (value: any, selectedOptions: PickerOption[], indexes: number[]) => any;
|
|
4
5
|
change: (value: any, selectedOptions: PickerOption[], indexes: number[]) => any;
|
|
5
6
|
}, string, import("vue").PublicProps, Readonly<PickerProps> & Readonly<{
|
|
@@ -9,4 +10,10 @@ declare const _default: import("vue").DefineComponent<PickerProps, {}, {}, {}, {
|
|
|
9
10
|
columns: PickerOption[] | PickerOption[][];
|
|
10
11
|
immediateChange: boolean;
|
|
11
12
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
12
14
|
export default _default;
|
|
15
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view :class="pickerClass" :style="pickerStyle">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
:
|
|
3
|
+
<slot
|
|
4
|
+
v-if="isNumber(internalCustom) ? internalCustom : $slots.custom"
|
|
5
|
+
name="custom"
|
|
6
|
+
:columns="renderedColumns"
|
|
7
|
+
:picker-view-class="pickerViewClass"
|
|
8
|
+
:mask-class="maskClass"
|
|
9
|
+
:indicator-class="indicatorClass"
|
|
7
10
|
:value="columnIndexes"
|
|
11
|
+
:on-change="onChange"
|
|
12
|
+
></slot>
|
|
13
|
+
<picker-view
|
|
14
|
+
v-else
|
|
15
|
+
:class="pickerViewClass"
|
|
8
16
|
:immediate-change="immediateChange"
|
|
17
|
+
:indicator-class="indicatorClass"
|
|
18
|
+
:mask-class="maskClass"
|
|
19
|
+
:value="columnIndexes"
|
|
9
20
|
@change="onChange"
|
|
10
21
|
>
|
|
11
22
|
<picker-view-column v-for="(column, i) in renderedColumns" :key="i">
|
|
12
|
-
<
|
|
23
|
+
<sar-picker-item v-for="(option, j) in column" :key="j">
|
|
13
24
|
{{ getLabelByOption(option) }}
|
|
14
|
-
</
|
|
25
|
+
</sar-picker-item>
|
|
15
26
|
</picker-view-column>
|
|
16
27
|
</picker-view>
|
|
17
28
|
</view>
|
|
@@ -27,7 +38,8 @@ import {
|
|
|
27
38
|
nestedToMulti,
|
|
28
39
|
toArray,
|
|
29
40
|
arrayEqual,
|
|
30
|
-
isNullish
|
|
41
|
+
isNullish,
|
|
42
|
+
isNumber
|
|
31
43
|
} from "../../utils";
|
|
32
44
|
import {
|
|
33
45
|
defaultOptionKeys,
|
|
@@ -39,7 +51,11 @@ import {
|
|
|
39
51
|
getValueOrLabelByOption,
|
|
40
52
|
defaultPickerProps
|
|
41
53
|
} from "./common";
|
|
54
|
+
import SarPickerItem from "../picker-item/picker-item.vue";
|
|
42
55
|
export default _defineComponent({
|
|
56
|
+
components: {
|
|
57
|
+
SarPickerItem,
|
|
58
|
+
},
|
|
43
59
|
...{
|
|
44
60
|
options: {
|
|
45
61
|
virtualHost: true,
|
|
@@ -53,7 +69,8 @@ export default _defineComponent({
|
|
|
53
69
|
columns: { type: Array, required: false },
|
|
54
70
|
optionKeys: { type: Object, required: false },
|
|
55
71
|
modelValue: { type: null, required: false },
|
|
56
|
-
immediateChange: { type: Boolean, required: false }
|
|
72
|
+
immediateChange: { type: Boolean, required: false },
|
|
73
|
+
internalCustom: { type: Number, required: false }
|
|
57
74
|
}, defaultPickerProps()),
|
|
58
75
|
emits: ["update:model-value", "change"],
|
|
59
76
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -173,7 +190,12 @@ export default _defineComponent({
|
|
|
173
190
|
const pickerStyle = computed(() => {
|
|
174
191
|
return stringifyStyle(props.rootStyle);
|
|
175
192
|
});
|
|
176
|
-
const
|
|
193
|
+
const pickerViewClass = bem.e("picker-view");
|
|
194
|
+
const indicatorClass = bem.e("indicator");
|
|
195
|
+
const maskClass = bem.e("mask");
|
|
196
|
+
const __returned__ = { props, emit, bem, fieldKeys, columnsType, innerValue, columnIndexes, onChange, getRenderedColumns, renderedColumns, getLabelByOption, pickerClass, pickerStyle, pickerViewClass, indicatorClass, maskClass, get isNumber() {
|
|
197
|
+
return isNumber;
|
|
198
|
+
}, SarPickerItem };
|
|
177
199
|
return __returned__;
|
|
178
200
|
}
|
|
179
201
|
});
|
|
@@ -11,7 +11,8 @@ page,
|
|
|
11
11
|
|
|
12
12
|
--sar-picker-indicator-border-color: var(--sar-border-color);
|
|
13
13
|
|
|
14
|
-
--sar-picker-mask-bg-image:
|
|
14
|
+
--sar-picker-mask-bg-image:
|
|
15
|
+
linear-gradient(
|
|
15
16
|
to bottom,
|
|
16
17
|
rgba(var(--sar-emphasis-bg-rgb), 0.95),
|
|
17
18
|
rgba(var(--sar-emphasis-bg-rgb), 0.6)
|
|
@@ -27,6 +28,8 @@ page,
|
|
|
27
28
|
// 放到全局,兼容app
|
|
28
29
|
@include bem(picker) {
|
|
29
30
|
@include e(picker-view) {
|
|
31
|
+
height: var(--sar-picker-height);
|
|
32
|
+
|
|
30
33
|
@include e(indicator) {
|
|
31
34
|
height: var(--sar-picker-item-height);
|
|
32
35
|
&::before {
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import { type PickerProps } from '../picker/common';
|
|
2
1
|
import { type PopoutInputProps } from '../popout-input/common';
|
|
3
|
-
import { type
|
|
4
|
-
export interface PickerInputProps extends
|
|
5
|
-
visible?: boolean;
|
|
6
|
-
title?: string;
|
|
7
|
-
validateEvent?: boolean;
|
|
8
|
-
popoutClass?: string;
|
|
9
|
-
popoutStyle?: StyleValue;
|
|
2
|
+
import { type PickerPopoutSlots, type PickerPopoutEmits, type PickerPopoutProps } from '../picker-popout/common';
|
|
3
|
+
export interface PickerInputProps extends PickerPopoutProps, Omit<PopoutInputProps, 'modelValue'> {
|
|
10
4
|
}
|
|
11
5
|
export declare const defaultPickerInputProps: () => {
|
|
12
6
|
validateEvent: boolean;
|
|
13
7
|
columns: () => never[];
|
|
14
8
|
immediateChange: boolean;
|
|
15
9
|
};
|
|
16
|
-
export interface
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
(e: 'change', value: any): void;
|
|
10
|
+
export interface PickerInputSlots extends PickerPopoutSlots {
|
|
11
|
+
}
|
|
12
|
+
export interface PickerInputEmits extends PickerPopoutEmits {
|
|
20
13
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defaultConfig } from '../config';
|
|
1
|
+
import { defaultPickerPopoutProps, } from '../picker-popout/common';
|
|
3
2
|
export const defaultPickerInputProps = () => ({
|
|
4
|
-
...
|
|
5
|
-
...defaultConfig.pickerInput,
|
|
3
|
+
...defaultPickerPopoutProps(),
|
|
6
4
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type PickerOption } from '../picker/common';
|
|
2
|
-
import { type PickerInputProps } from './common';
|
|
3
|
-
declare
|
|
2
|
+
import { type PickerInputProps, type PickerInputSlots } from './common';
|
|
3
|
+
declare function __VLS_template(): Readonly<PickerInputSlots> & PickerInputSlots;
|
|
4
|
+
declare const __VLS_component: import("vue").DefineComponent<PickerInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
5
|
"update:model-value": (value: any) => any;
|
|
5
6
|
change: (value: any) => any;
|
|
6
7
|
"update:visible": (visible: boolean) => any;
|
|
@@ -13,4 +14,10 @@ declare const _default: import("vue").DefineComponent<PickerInputProps, {}, {},
|
|
|
13
14
|
validateEvent: boolean;
|
|
14
15
|
immediateChange: boolean;
|
|
15
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
16
18
|
export default _default;
|
|
19
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|