@sdata/web-vue 1.7.0 → 1.8.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/dist/sd.css +105 -1
- package/dist/sd.min.css +1 -1
- package/es/_hooks/use-allow-clear.d.ts +4 -0
- package/es/_hooks/use-allow-clear.js +20 -0
- package/es/_hooks/use-component-ref.d.ts +1 -1
- package/es/_hooks/use-teleport-container.d.ts +2 -2
- package/es/_hooks/use-teleport-container.js +7 -4
- package/es/_utils/color.js +1 -18
- package/es/auto-complete/auto-complete.js +4 -2
- package/es/cascader/cascader.js +1 -1
- package/es/cascader/cascader.vue.d.ts +1 -0
- package/es/cascader/cascader.vue_vue_type_script_lang.js +4 -1
- package/es/cascader/index.d.ts +3 -0
- package/es/color-picker/color-picker.d.ts +115 -40
- package/es/color-picker/color-picker.js +146 -102
- package/es/color-picker/index.d.ts +217 -69
- package/es/color-picker/interface.d.ts +41 -0
- package/es/color-picker/palette.js +1 -1
- package/es/color-picker/panel.d.ts +73 -34
- package/es/color-picker/panel.js +423 -89
- package/es/color-picker/style/index.css +92 -1
- package/es/color-picker/style/index.scss +107 -1
- package/es/color-picker/utils.d.ts +89 -0
- package/es/color-picker/utils.js +456 -0
- package/es/config-provider/config-provider.vue.d.ts +9 -0
- package/es/config-provider/config-provider.vue_vue_type_script_lang.js +6 -1
- package/es/config-provider/context.d.ts +3 -1
- package/es/config-provider/context.js +2 -1
- package/es/config-provider/index.d.ts +15 -0
- package/es/config-provider/style/css.js +1 -0
- package/es/config-provider/style/index.css +29 -0
- package/es/config-provider/style/index.d.ts +1 -1
- package/es/config-provider/style/index.js +1 -0
- package/es/config-provider/style/index.scss +17 -0
- package/es/config-provider/theme-provider.js +1 -3
- package/es/config-provider/theme-provider.vue_vue_type_script_setup_true_lang.js +44 -4
- package/es/date-picker/index.d.ts +1 -0
- package/es/date-picker/picker.js +1 -1
- package/es/date-picker/picker.vue.d.ts +1 -0
- package/es/date-picker/picker.vue_vue_type_script_lang.js +4 -1
- package/es/date-picker/range-picker.js +1 -1
- package/es/date-picker/range-picker.vue.d.ts +1 -0
- package/es/date-picker/range-picker.vue_vue_type_script_lang.js +4 -1
- package/es/drawer/drawer.vue.d.ts +1 -1
- package/es/drawer/index.d.ts +3 -3
- package/es/index.css +105 -1
- package/es/index.scss +1 -0
- package/es/input/input.js +4 -2
- package/es/input-number/input-number.js +4 -2
- package/es/input-tag/input-tag.js +4 -2
- package/es/mention/mention.js +4 -2
- package/es/modal/index.d.ts +3 -3
- package/es/modal/modal.vue.d.ts +1 -1
- package/es/rate/rate.js +4 -2
- package/es/select/select-dropdown.vue.d.ts +1 -1
- package/es/select/select.js +4 -2
- package/es/textarea/index.d.ts +3 -3
- package/es/textarea/textarea.vue.d.ts +1 -1
- package/es/textarea/textarea.vue_vue_type_script_lang.js +6 -2
- package/es/time-picker/index.d.ts +3 -0
- package/es/time-picker/time-picker.js +1 -1
- package/es/time-picker/time-picker.vue.d.ts +1 -0
- package/es/time-picker/time-picker.vue_vue_type_script_lang.js +4 -1
- package/es/tree-select/index.d.ts +3 -0
- package/es/tree-select/tree-select.js +1 -1
- package/es/tree-select/tree-select.vue.d.ts +1 -0
- package/es/tree-select/tree-select.vue_vue_type_script_lang.js +4 -1
- package/es/trigger/trigger.js +8 -4
- package/json/vetur-attributes.json +46 -20
- package/json/vetur-tags.json +14 -6
- package/json/web-types.json +86 -22
- package/package.json +3 -1
- package/es/color-picker/input-alpha.js +0 -32
- package/es/color-picker/input-hex.js +0 -73
- package/es/color-picker/input-rgb.js +0 -55
- package/es/web-vue.css +0 -5
|
@@ -15,6 +15,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
15
15
|
size: {
|
|
16
16
|
type: PropType<Size>;
|
|
17
17
|
};
|
|
18
|
+
allowClear: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
18
22
|
global: {
|
|
19
23
|
type: BooleanConstructor;
|
|
20
24
|
default: boolean;
|
|
@@ -52,6 +56,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
52
56
|
size: {
|
|
53
57
|
type: PropType<Size>;
|
|
54
58
|
};
|
|
59
|
+
allowClear: {
|
|
60
|
+
type: BooleanConstructor;
|
|
61
|
+
default: boolean;
|
|
62
|
+
};
|
|
55
63
|
global: {
|
|
56
64
|
type: BooleanConstructor;
|
|
57
65
|
default: boolean;
|
|
@@ -80,6 +88,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
80
88
|
};
|
|
81
89
|
}>> & Readonly<{}>, {
|
|
82
90
|
prefixCls: string;
|
|
91
|
+
allowClear: boolean;
|
|
83
92
|
updateAtScroll: boolean;
|
|
84
93
|
scrollToClose: boolean;
|
|
85
94
|
rtl: boolean;
|
|
@@ -12,6 +12,10 @@ var config_provider_vue_vue_type_script_lang_default = defineComponent({
|
|
|
12
12
|
},
|
|
13
13
|
locale: { type: Object },
|
|
14
14
|
size: { type: String },
|
|
15
|
+
allowClear: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
15
19
|
global: {
|
|
16
20
|
type: Boolean,
|
|
17
21
|
default: false
|
|
@@ -36,12 +40,13 @@ var config_provider_vue_vue_type_script_lang_default = defineComponent({
|
|
|
36
40
|
themeMode: { type: String }
|
|
37
41
|
},
|
|
38
42
|
setup(props, { slots }) {
|
|
39
|
-
const { prefixCls, locale, size, updateAtScroll, scrollToClose, exchangeTime, rtl } = toRefs(props);
|
|
43
|
+
const { prefixCls, locale, size, allowClear, updateAtScroll, scrollToClose, exchangeTime, rtl } = toRefs(props);
|
|
40
44
|
const config = reactive({
|
|
41
45
|
slots,
|
|
42
46
|
prefixCls,
|
|
43
47
|
locale,
|
|
44
48
|
size,
|
|
49
|
+
allowClear,
|
|
45
50
|
updateAtScroll,
|
|
46
51
|
scrollToClose,
|
|
47
52
|
exchangeTime,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InjectionKey, Slots } from 'vue';
|
|
1
|
+
import { InjectionKey, Ref, Slots } from 'vue';
|
|
2
2
|
import { Size } from '../_utils/constant';
|
|
3
3
|
import { SDLang } from '../locale/interface';
|
|
4
4
|
import { SDThemeNormalized } from './theme';
|
|
@@ -7,6 +7,7 @@ export interface ConfigProvider {
|
|
|
7
7
|
prefixCls?: string;
|
|
8
8
|
locale?: SDLang;
|
|
9
9
|
size?: Size;
|
|
10
|
+
allowClear?: boolean;
|
|
10
11
|
updateAtScroll?: boolean;
|
|
11
12
|
scrollToClose?: boolean;
|
|
12
13
|
exchangeTime?: boolean;
|
|
@@ -14,3 +15,4 @@ export interface ConfigProvider {
|
|
|
14
15
|
theme?: SDThemeNormalized;
|
|
15
16
|
}
|
|
16
17
|
export declare const configProviderInjectionKey: InjectionKey<ConfigProvider>;
|
|
18
|
+
export declare const themePopupContainerInjectionKey: InjectionKey<Ref<HTMLElement | null>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
//#region components/config-provider/context.ts
|
|
2
2
|
var configProviderInjectionKey = Symbol("SDConfigProvider");
|
|
3
|
+
var themePopupContainerInjectionKey = Symbol("SDThemePopupContainer");
|
|
3
4
|
//#endregion
|
|
4
|
-
export { configProviderInjectionKey };
|
|
5
|
+
export { configProviderInjectionKey, themePopupContainerInjectionKey };
|
|
@@ -13,6 +13,10 @@ declare const ConfigProvider: {
|
|
|
13
13
|
size: {
|
|
14
14
|
type: import("vue").PropType<import("..").Size>;
|
|
15
15
|
};
|
|
16
|
+
allowClear: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
16
20
|
global: {
|
|
17
21
|
type: BooleanConstructor;
|
|
18
22
|
default: boolean;
|
|
@@ -41,6 +45,7 @@ declare const ConfigProvider: {
|
|
|
41
45
|
};
|
|
42
46
|
}>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
43
47
|
prefixCls: string;
|
|
48
|
+
allowClear: boolean;
|
|
44
49
|
updateAtScroll: boolean;
|
|
45
50
|
scrollToClose: boolean;
|
|
46
51
|
rtl: boolean;
|
|
@@ -111,6 +116,10 @@ declare const ConfigProvider: {
|
|
|
111
116
|
size: {
|
|
112
117
|
type: import("vue").PropType<import("..").Size>;
|
|
113
118
|
};
|
|
119
|
+
allowClear: {
|
|
120
|
+
type: BooleanConstructor;
|
|
121
|
+
default: boolean;
|
|
122
|
+
};
|
|
114
123
|
global: {
|
|
115
124
|
type: BooleanConstructor;
|
|
116
125
|
default: boolean;
|
|
@@ -139,6 +148,7 @@ declare const ConfigProvider: {
|
|
|
139
148
|
};
|
|
140
149
|
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
141
150
|
prefixCls: string;
|
|
151
|
+
allowClear: boolean;
|
|
142
152
|
updateAtScroll: boolean;
|
|
143
153
|
scrollToClose: boolean;
|
|
144
154
|
rtl: boolean;
|
|
@@ -159,6 +169,10 @@ declare const ConfigProvider: {
|
|
|
159
169
|
size: {
|
|
160
170
|
type: import("vue").PropType<import("..").Size>;
|
|
161
171
|
};
|
|
172
|
+
allowClear: {
|
|
173
|
+
type: BooleanConstructor;
|
|
174
|
+
default: boolean;
|
|
175
|
+
};
|
|
162
176
|
global: {
|
|
163
177
|
type: BooleanConstructor;
|
|
164
178
|
default: boolean;
|
|
@@ -187,6 +201,7 @@ declare const ConfigProvider: {
|
|
|
187
201
|
};
|
|
188
202
|
}>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
189
203
|
prefixCls: string;
|
|
204
|
+
allowClear: boolean;
|
|
190
205
|
updateAtScroll: boolean;
|
|
191
206
|
scrollToClose: boolean;
|
|
192
207
|
rtl: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.css";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/******** borderSize *******/
|
|
2
|
+
/******** borderStyle *******/
|
|
3
|
+
/******** radius *******/
|
|
4
|
+
/******** shadow distance *******/
|
|
5
|
+
/******** size *******/
|
|
6
|
+
/******** spacing *******/
|
|
7
|
+
/******** shadow *******/
|
|
8
|
+
/******** opacity *******/
|
|
9
|
+
/******** fontSize *******/
|
|
10
|
+
/******** fontWeight ********/
|
|
11
|
+
/******** Primary *******/
|
|
12
|
+
/******** success *******/
|
|
13
|
+
/******** warning *******/
|
|
14
|
+
/******** danger *******/
|
|
15
|
+
/******** link *******/
|
|
16
|
+
/******** radius *******/
|
|
17
|
+
/********* icon hover *********/
|
|
18
|
+
.sd-theme-provider {
|
|
19
|
+
min-width: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.sd-theme-popup-container {
|
|
23
|
+
position: fixed;
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
width: 100vw;
|
|
27
|
+
height: 0;
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import './index.scss';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.scss";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use '@style/theme/index.scss' as theme;
|
|
2
|
+
@use 'sass:string';
|
|
3
|
+
|
|
4
|
+
$theme-prefix-cls: string.unquote('#{theme.$prefix}-theme');
|
|
5
|
+
|
|
6
|
+
.#{$theme-prefix-cls}-provider {
|
|
7
|
+
min-width: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.#{$theme-prefix-cls}-popup-container {
|
|
11
|
+
position: fixed;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
width: 100vw;
|
|
15
|
+
height: 0;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import _plugin_vue_export_helper_default from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
1
|
import theme_provider_vue_vue_type_script_setup_true_lang_default from "./theme-provider.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css */
|
|
4
2
|
//#region components/config-provider/theme-provider.vue
|
|
5
|
-
var theme_provider_default =
|
|
3
|
+
var theme_provider_default = theme_provider_vue_vue_type_script_setup_true_lang_default;
|
|
6
4
|
//#endregion
|
|
7
5
|
export { theme_provider_default as default };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { themePopupContainerInjectionKey } from "./context.js";
|
|
1
2
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.124.0/helpers/objectSpread2.js";
|
|
3
|
+
import { getPrefixCls } from "../_utils/global-config.js";
|
|
4
|
+
import usePopupManager from "../_hooks/use-popup-manager.js";
|
|
2
5
|
import { applyThemeCSSVariables, clearThemeCSSVariables, normalizeTheme } from "./theme.js";
|
|
3
|
-
import { computed, createBlock, defineComponent, onBeforeUnmount, openBlock, renderSlot, resolveDynamicComponent, shallowRef, watch, withCtx } from "vue";
|
|
6
|
+
import { computed, createBlock, defineComponent, normalizeClass, onBeforeUnmount, openBlock, provide, renderSlot, resolveDynamicComponent, shallowRef, unref, watch, withCtx } from "vue";
|
|
4
7
|
//#region components/config-provider/theme-provider.vue?vue&type=script&setup=true&lang.ts
|
|
5
8
|
var theme_provider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent(_objectSpread2(_objectSpread2({}, { name: "ThemeProvider" }), {}, {
|
|
6
9
|
__name: "theme-provider",
|
|
@@ -16,14 +19,48 @@ var theme_provider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
16
19
|
setup(__props) {
|
|
17
20
|
const props = __props;
|
|
18
21
|
const rootElement = shallowRef(null);
|
|
22
|
+
const popupContainer = shallowRef(null);
|
|
23
|
+
provide(themePopupContainerInjectionKey, popupContainer);
|
|
19
24
|
const normalizedTheme = computed(() => normalizeTheme(props.theme));
|
|
20
25
|
const usesLocalThemeContainer = computed(() => {
|
|
21
26
|
if (props.global) return false;
|
|
22
27
|
return Boolean(props.themeMode) || Object.keys(normalizedTheme.value.tokens).length > 0 || Object.keys(normalizedTheme.value.components).length > 0;
|
|
23
28
|
});
|
|
29
|
+
const themePopupContainerPrefixCls = getPrefixCls("theme-popup-container");
|
|
30
|
+
const { zIndex } = usePopupManager("popup", { visible: usesLocalThemeContainer });
|
|
24
31
|
let appliedThemeKeys = /* @__PURE__ */ new Set();
|
|
32
|
+
let appliedPopupThemeKeys = /* @__PURE__ */ new Set();
|
|
25
33
|
let activeTarget = null;
|
|
26
34
|
let previousGlobalThemeMode;
|
|
35
|
+
function cleanupPopupContainer() {
|
|
36
|
+
if (!popupContainer.value) return;
|
|
37
|
+
clearThemeCSSVariables(popupContainer.value, appliedPopupThemeKeys);
|
|
38
|
+
appliedPopupThemeKeys = /* @__PURE__ */ new Set();
|
|
39
|
+
popupContainer.value.removeAttribute("sd-theme");
|
|
40
|
+
if (popupContainer.value.parentNode) popupContainer.value.parentNode.removeChild(popupContainer.value);
|
|
41
|
+
popupContainer.value = null;
|
|
42
|
+
}
|
|
43
|
+
function ensurePopupContainer() {
|
|
44
|
+
if (popupContainer.value || typeof document === "undefined") return;
|
|
45
|
+
const containerElement = document.createElement("div");
|
|
46
|
+
containerElement.className = themePopupContainerPrefixCls;
|
|
47
|
+
document.body.appendChild(containerElement);
|
|
48
|
+
popupContainer.value = containerElement;
|
|
49
|
+
}
|
|
50
|
+
function syncPopupContainerTheme(target) {
|
|
51
|
+
var _target$closest;
|
|
52
|
+
if (props.global || !target || !usesLocalThemeContainer.value) {
|
|
53
|
+
cleanupPopupContainer();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
ensurePopupContainer();
|
|
57
|
+
if (!popupContainer.value) return;
|
|
58
|
+
popupContainer.value.style.zIndex = String(zIndex.value);
|
|
59
|
+
appliedPopupThemeKeys = applyThemeCSSVariables(popupContainer.value, normalizedTheme.value, appliedPopupThemeKeys);
|
|
60
|
+
const inheritedThemeMode = (_target$closest = target.closest("[sd-theme]")) === null || _target$closest === void 0 ? void 0 : _target$closest.getAttribute("sd-theme");
|
|
61
|
+
if (inheritedThemeMode) popupContainer.value.setAttribute("sd-theme", inheritedThemeMode);
|
|
62
|
+
else popupContainer.value.removeAttribute("sd-theme");
|
|
63
|
+
}
|
|
27
64
|
function resolveThemeTarget() {
|
|
28
65
|
if (typeof document === "undefined") return null;
|
|
29
66
|
if (props.global) return document.body || document.documentElement;
|
|
@@ -68,6 +105,7 @@ var theme_provider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
68
105
|
const nextTarget = resolveThemeTarget();
|
|
69
106
|
if (!nextTarget) {
|
|
70
107
|
resetActiveTarget();
|
|
108
|
+
cleanupPopupContainer();
|
|
71
109
|
return;
|
|
72
110
|
}
|
|
73
111
|
if (activeTarget && activeTarget !== nextTarget) cleanupTarget(activeTarget);
|
|
@@ -75,6 +113,7 @@ var theme_provider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
75
113
|
appliedThemeKeys = applyThemeCSSVariables(nextTarget, normalizedTheme.value, appliedThemeKeys);
|
|
76
114
|
restoreThemeMode(nextTarget);
|
|
77
115
|
activeTarget = nextTarget;
|
|
116
|
+
syncPopupContainerTheme(nextTarget);
|
|
78
117
|
}
|
|
79
118
|
watch([
|
|
80
119
|
normalizedTheme,
|
|
@@ -89,6 +128,7 @@ var theme_provider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
89
128
|
});
|
|
90
129
|
onBeforeUnmount(() => {
|
|
91
130
|
cleanupTarget(activeTarget);
|
|
131
|
+
cleanupPopupContainer();
|
|
92
132
|
activeTarget = null;
|
|
93
133
|
});
|
|
94
134
|
return (_ctx, _cache) => {
|
|
@@ -96,11 +136,11 @@ var theme_provider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
96
136
|
key: 0,
|
|
97
137
|
ref_key: "rootElement",
|
|
98
138
|
ref: rootElement,
|
|
99
|
-
class: "
|
|
139
|
+
class: normalizeClass(unref(getPrefixCls)("theme-provider"))
|
|
100
140
|
}, {
|
|
101
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default"
|
|
141
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
102
142
|
_: 3
|
|
103
|
-
},
|
|
143
|
+
}, 8, ["class"])) : renderSlot(_ctx.$slots, "default", { key: 1 });
|
|
104
144
|
};
|
|
105
145
|
}
|
|
106
146
|
}));
|
|
@@ -385,6 +385,7 @@ declare const DatePicker: {
|
|
|
385
385
|
panelValue: import("vue").ComputedRef<(import("dayjs").Dayjs | undefined)[]>;
|
|
386
386
|
inputValue: import("vue").Ref<(string | undefined)[] | undefined, (string | undefined)[] | undefined>;
|
|
387
387
|
focusedIndex: import("vue").Ref<number, number>;
|
|
388
|
+
mergedAllowClear: import("vue").ComputedRef<boolean | undefined>;
|
|
388
389
|
triggerDisabled: import("vue").ComputedRef<boolean>;
|
|
389
390
|
mergedSize: import("vue").ComputedRef<"mini" | "small" | "medium" | "large" | undefined>;
|
|
390
391
|
mergedError: import("vue").ComputedRef<boolean>;
|
package/es/date-picker/picker.js
CHANGED
|
@@ -33,7 +33,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
33
33
|
error: _ctx.error,
|
|
34
34
|
disabled: _ctx.mergedDisabled,
|
|
35
35
|
readonly: !_ctx.inputEditable || _ctx.disabledInput,
|
|
36
|
-
"allow-clear": _ctx.
|
|
36
|
+
"allow-clear": _ctx.mergedAllowClear && !_ctx.readonly,
|
|
37
37
|
placeholder: _ctx.computedPlaceholder,
|
|
38
38
|
"input-value": _ctx.inputValue,
|
|
39
39
|
value: _ctx.needConfirm ? _ctx.panelValue : _ctx.selectedValue,
|
|
@@ -197,6 +197,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
197
197
|
inputFormat: import("vue").ComputedRef<string | ((value: Dayjs) => string)>;
|
|
198
198
|
computedPlaceholder: import("vue").ComputedRef<string>;
|
|
199
199
|
panelVisible: import("vue").ComputedRef<boolean>;
|
|
200
|
+
mergedAllowClear: import("vue").ComputedRef<boolean | undefined>;
|
|
200
201
|
inputEditable: import("vue").ComputedRef<boolean>;
|
|
201
202
|
needConfirm: import("vue").ComputedRef<boolean>;
|
|
202
203
|
mergedDisabled: import("vue").ComputedRef<boolean>;
|
|
@@ -2,6 +2,7 @@ import { useFormItem } from "../_hooks/use-form-item.js";
|
|
|
2
2
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.124.0/helpers/objectSpread2.js";
|
|
3
3
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
4
4
|
import { isBoolean, isFunction } from "../_utils/is.js";
|
|
5
|
+
import { useAllowClear } from "../_hooks/use-allow-clear.js";
|
|
5
6
|
import { omit } from "../_utils/omit.js";
|
|
6
7
|
import pick from "../_utils/pick.js";
|
|
7
8
|
import useState from "../_hooks/use-state.js";
|
|
@@ -136,12 +137,13 @@ var picker_vue_vue_type_script_lang_default = defineComponent({
|
|
|
136
137
|
"update:pickerValue": (_value) => true
|
|
137
138
|
},
|
|
138
139
|
setup(props, { emit, slots }) {
|
|
139
|
-
const { mode, modelValue, defaultValue, format, valueFormat, placeholder, popupVisible, defaultPopupVisible, disabled, showTime, timePickerProps, disabledDate, disabledTime, readonly, locale, pickerValue, defaultPickerValue, dayStartOfWeek, previewShortcut, showConfirmBtn } = toRefs(props);
|
|
140
|
+
const { mode, modelValue, defaultValue, format, valueFormat, placeholder, popupVisible, defaultPopupVisible, disabled, showTime, timePickerProps, disabledDate, disabledTime, readonly, allowClear, locale, pickerValue, defaultPickerValue, dayStartOfWeek, previewShortcut, showConfirmBtn } = toRefs(props);
|
|
140
141
|
const { locale: globalLocal } = useI18n();
|
|
141
142
|
watchEffect(() => {
|
|
142
143
|
initializeDateLocale(globalLocal.value, dayStartOfWeek.value);
|
|
143
144
|
});
|
|
144
145
|
const { mergedDisabled, eventHandlers } = useFormItem({ disabled });
|
|
146
|
+
const { mergedAllowClear } = useAllowClear(allowClear);
|
|
145
147
|
const datePickerT = useDatePickerTransform(reactive({ locale }));
|
|
146
148
|
const prefixCls = getPrefixCls("picker");
|
|
147
149
|
const refInput = ref();
|
|
@@ -395,6 +397,7 @@ var picker_vue_vue_type_script_lang_default = defineComponent({
|
|
|
395
397
|
inputFormat,
|
|
396
398
|
computedPlaceholder,
|
|
397
399
|
panelVisible,
|
|
400
|
+
mergedAllowClear,
|
|
398
401
|
inputEditable,
|
|
399
402
|
needConfirm,
|
|
400
403
|
mergedDisabled,
|
|
@@ -33,7 +33,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
33
33
|
error: _ctx.error,
|
|
34
34
|
disabled: _ctx.disabled,
|
|
35
35
|
readonly: _ctx.readonly || _ctx.disabledInput,
|
|
36
|
-
"allow-clear": _ctx.
|
|
36
|
+
"allow-clear": _ctx.mergedAllowClear && !_ctx.readonly,
|
|
37
37
|
placeholder: _ctx.computedPlaceholder,
|
|
38
38
|
"input-value": _ctx.inputValue,
|
|
39
39
|
value: _ctx.panelValue,
|
|
@@ -132,6 +132,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
132
132
|
panelValue: import("vue").ComputedRef<(Dayjs | undefined)[]>;
|
|
133
133
|
inputValue: import("vue").Ref<(string | undefined)[] | undefined, (string | undefined)[] | undefined>;
|
|
134
134
|
focusedIndex: import("vue").Ref<number, number>;
|
|
135
|
+
mergedAllowClear: import("vue").ComputedRef<boolean | undefined>;
|
|
135
136
|
triggerDisabled: import("vue").ComputedRef<boolean>;
|
|
136
137
|
mergedSize: import("vue").ComputedRef<"mini" | "small" | "medium" | "large" | undefined>;
|
|
137
138
|
mergedError: import("vue").ComputedRef<boolean>;
|
|
@@ -3,6 +3,7 @@ import { configProviderInjectionKey } from "../config-provider/context.js";
|
|
|
3
3
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.124.0/helpers/objectSpread2.js";
|
|
4
4
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
5
5
|
import { isArray, isBoolean } from "../_utils/is.js";
|
|
6
|
+
import { useAllowClear } from "../_hooks/use-allow-clear.js";
|
|
6
7
|
import { omit } from "../_utils/omit.js";
|
|
7
8
|
import pick from "../_utils/pick.js";
|
|
8
9
|
import useState from "../_hooks/use-state.js";
|
|
@@ -138,7 +139,7 @@ var range_picker_vue_vue_type_script_lang_default = defineComponent({
|
|
|
138
139
|
}
|
|
139
140
|
},
|
|
140
141
|
setup(props, { emit, slots }) {
|
|
141
|
-
const { mode, showTime, format, modelValue, defaultValue, popupVisible, defaultPopupVisible, placeholder, timePickerProps, disabled, disabledDate, disabledTime, locale, pickerValue, defaultPickerValue, valueFormat, size, error, dayStartOfWeek, exchangeTime, previewShortcut, showConfirmBtn } = toRefs(props);
|
|
142
|
+
const { mode, showTime, format, modelValue, defaultValue, popupVisible, defaultPopupVisible, placeholder, timePickerProps, disabled, disabledDate, disabledTime, locale, pickerValue, defaultPickerValue, valueFormat, size, error, dayStartOfWeek, exchangeTime, previewShortcut, showConfirmBtn, allowClear } = toRefs(props);
|
|
142
143
|
const { locale: globalLocal } = useI18n();
|
|
143
144
|
const configCtx = inject(configProviderInjectionKey, void 0);
|
|
144
145
|
watchEffect(() => {
|
|
@@ -148,6 +149,7 @@ var range_picker_vue_vue_type_script_lang_default = defineComponent({
|
|
|
148
149
|
var _configCtx$exchangeTi;
|
|
149
150
|
return !(!exchangeTime.value || !((_configCtx$exchangeTi = configCtx === null || configCtx === void 0 ? void 0 : configCtx.exchangeTime) !== null && _configCtx$exchangeTi !== void 0 ? _configCtx$exchangeTi : true));
|
|
150
151
|
});
|
|
152
|
+
const { mergedAllowClear } = useAllowClear(allowClear);
|
|
151
153
|
const { mergedSize, mergedDisabled: formDisabled, mergedError, eventHandlers } = useFormItem({
|
|
152
154
|
size,
|
|
153
155
|
error
|
|
@@ -459,6 +461,7 @@ var range_picker_vue_vue_type_script_lang_default = defineComponent({
|
|
|
459
461
|
panelValue,
|
|
460
462
|
inputValue,
|
|
461
463
|
focusedIndex,
|
|
464
|
+
mergedAllowClear,
|
|
462
465
|
triggerDisabled,
|
|
463
466
|
mergedSize,
|
|
464
467
|
mergedError,
|
|
@@ -108,7 +108,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
108
108
|
handleClose: () => void;
|
|
109
109
|
handleMask: (e: Event) => void;
|
|
110
110
|
isFixed: import("vue").ComputedRef<boolean>;
|
|
111
|
-
teleportContainer: import("vue").Ref<string | HTMLElement | undefined, string | HTMLElement | undefined>;
|
|
111
|
+
teleportContainer: import("vue").Ref<string | HTMLElement | null | undefined, string | HTMLElement | null | undefined>;
|
|
112
112
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
113
113
|
'update:visible': (_visible: boolean) => true;
|
|
114
114
|
ok: (_e: Event) => true;
|
package/es/drawer/index.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ declare const Drawer: {
|
|
|
115
115
|
handleClose: () => void;
|
|
116
116
|
handleMask: (e: Event) => void;
|
|
117
117
|
isFixed: import("vue").ComputedRef<boolean>;
|
|
118
|
-
teleportContainer: import("vue").Ref<string | HTMLElement | undefined, string | HTMLElement | undefined>;
|
|
118
|
+
teleportContainer: import("vue").Ref<string | HTMLElement | null | undefined, string | HTMLElement | null | undefined>;
|
|
119
119
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
120
120
|
'update:visible': (_visible: boolean) => true;
|
|
121
121
|
ok: (_e: Event) => true;
|
|
@@ -850,7 +850,7 @@ declare const Drawer: {
|
|
|
850
850
|
handleClose: () => void;
|
|
851
851
|
handleMask: (e: Event) => void;
|
|
852
852
|
isFixed: import("vue").ComputedRef<boolean>;
|
|
853
|
-
teleportContainer: import("vue").Ref<string | HTMLElement | undefined, string | HTMLElement | undefined>;
|
|
853
|
+
teleportContainer: import("vue").Ref<string | HTMLElement | null | undefined, string | HTMLElement | null | undefined>;
|
|
854
854
|
}, {}, {}, {}, {
|
|
855
855
|
footer: boolean;
|
|
856
856
|
header: boolean;
|
|
@@ -984,7 +984,7 @@ declare const Drawer: {
|
|
|
984
984
|
handleClose: () => void;
|
|
985
985
|
handleMask: (e: Event) => void;
|
|
986
986
|
isFixed: import("vue").ComputedRef<boolean>;
|
|
987
|
-
teleportContainer: import("vue").Ref<string | HTMLElement | undefined, string | HTMLElement | undefined>;
|
|
987
|
+
teleportContainer: import("vue").Ref<string | HTMLElement | null | undefined, string | HTMLElement | null | undefined>;
|
|
988
988
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
989
989
|
'update:visible': (_visible: boolean) => true;
|
|
990
990
|
ok: (_e: Event) => true;
|
package/es/index.css
CHANGED
|
@@ -14669,6 +14669,75 @@ body {
|
|
|
14669
14669
|
border-radius: 2px;
|
|
14670
14670
|
box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.1);
|
|
14671
14671
|
}
|
|
14672
|
+
.sd-color-picker-panel .sd-color-picker-panel-head {
|
|
14673
|
+
display: flex;
|
|
14674
|
+
justify-content: center;
|
|
14675
|
+
padding: 8px 8px 0;
|
|
14676
|
+
}
|
|
14677
|
+
.sd-color-picker-panel .sd-color-picker-gradient-panel {
|
|
14678
|
+
padding: 8px 8px 0;
|
|
14679
|
+
}
|
|
14680
|
+
.sd-color-picker-panel .sd-color-picker-gradient-bar-shell {
|
|
14681
|
+
position: relative;
|
|
14682
|
+
display: flex;
|
|
14683
|
+
align-items: center;
|
|
14684
|
+
height: 28px;
|
|
14685
|
+
user-select: none;
|
|
14686
|
+
margin-inline: 8px;
|
|
14687
|
+
}
|
|
14688
|
+
.sd-color-picker-panel .sd-color-picker-gradient-bar {
|
|
14689
|
+
display: block;
|
|
14690
|
+
width: 100%;
|
|
14691
|
+
height: 8px;
|
|
14692
|
+
padding: 0;
|
|
14693
|
+
background-color: transparent;
|
|
14694
|
+
border: 1px solid var(--color-border-2);
|
|
14695
|
+
border-radius: 4px;
|
|
14696
|
+
cursor: pointer;
|
|
14697
|
+
}
|
|
14698
|
+
.sd-color-picker-panel .sd-color-picker-gradient-thumb {
|
|
14699
|
+
position: absolute;
|
|
14700
|
+
z-index: 1;
|
|
14701
|
+
width: 18px;
|
|
14702
|
+
height: 18px;
|
|
14703
|
+
padding: 2px;
|
|
14704
|
+
background: var(--color-bg-white);
|
|
14705
|
+
border: 1px solid var(--color-border-2);
|
|
14706
|
+
border-radius: 50%;
|
|
14707
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
|
|
14708
|
+
transform: translateX(-50%);
|
|
14709
|
+
cursor: pointer;
|
|
14710
|
+
touch-action: none;
|
|
14711
|
+
}
|
|
14712
|
+
.sd-color-picker-panel .sd-color-picker-gradient-thumb-active {
|
|
14713
|
+
border-color: var(--color-primary-6);
|
|
14714
|
+
box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.16);
|
|
14715
|
+
}
|
|
14716
|
+
.sd-color-picker-panel .sd-color-picker-gradient-thumb-inner {
|
|
14717
|
+
display: block;
|
|
14718
|
+
width: 100%;
|
|
14719
|
+
height: 100%;
|
|
14720
|
+
border-radius: 50%;
|
|
14721
|
+
}
|
|
14722
|
+
.sd-color-picker-panel .sd-color-picker-gradient-meta {
|
|
14723
|
+
display: flex;
|
|
14724
|
+
gap: 6px;
|
|
14725
|
+
align-items: center;
|
|
14726
|
+
margin-top: 8px;
|
|
14727
|
+
}
|
|
14728
|
+
.sd-color-picker-panel .sd-color-picker-gradient-label {
|
|
14729
|
+
color: var(--color-text-2);
|
|
14730
|
+
font-size: 12px;
|
|
14731
|
+
}
|
|
14732
|
+
.sd-color-picker-panel .sd-color-picker-gradient-degree {
|
|
14733
|
+
width: 72px;
|
|
14734
|
+
}
|
|
14735
|
+
.sd-color-picker-panel .sd-color-picker-gradient-preview {
|
|
14736
|
+
height: 32px;
|
|
14737
|
+
margin-top: 8px;
|
|
14738
|
+
border: 1px solid var(--color-border-2);
|
|
14739
|
+
border-radius: 4px;
|
|
14740
|
+
}
|
|
14672
14741
|
.sd-color-picker-panel .sd-color-picker-palette {
|
|
14673
14742
|
position: relative;
|
|
14674
14743
|
box-sizing: border-box;
|
|
@@ -14741,11 +14810,25 @@ body {
|
|
|
14741
14810
|
.sd-color-picker-panel .sd-color-picker-panel-colors .sd-color-picker-colors-section:not(:first-child) {
|
|
14742
14811
|
margin-top: 12px;
|
|
14743
14812
|
}
|
|
14813
|
+
.sd-color-picker-panel .sd-color-picker-panel-colors .sd-color-picker-colors-header {
|
|
14814
|
+
display: flex;
|
|
14815
|
+
gap: 6px;
|
|
14816
|
+
align-items: center;
|
|
14817
|
+
justify-content: space-between;
|
|
14818
|
+
}
|
|
14744
14819
|
.sd-color-picker-panel .sd-color-picker-panel-colors .sd-color-picker-colors-text {
|
|
14745
14820
|
color: var(--color-text-1);
|
|
14746
14821
|
font-weight: 400;
|
|
14747
14822
|
font-size: 12px;
|
|
14748
14823
|
}
|
|
14824
|
+
.sd-color-picker-panel .sd-color-picker-panel-colors .sd-color-picker-colors-action {
|
|
14825
|
+
padding: 0;
|
|
14826
|
+
color: var(--color-primary-6);
|
|
14827
|
+
font-size: 12px;
|
|
14828
|
+
background: transparent;
|
|
14829
|
+
border: 0;
|
|
14830
|
+
cursor: pointer;
|
|
14831
|
+
}
|
|
14749
14832
|
.sd-color-picker-panel .sd-color-picker-panel-colors .sd-color-picker-colors-empty {
|
|
14750
14833
|
margin: 12px 0;
|
|
14751
14834
|
color: var(--color-text-3);
|
|
@@ -14831,13 +14914,21 @@ body {
|
|
|
14831
14914
|
flex: 0 0 auto;
|
|
14832
14915
|
width: 52px;
|
|
14833
14916
|
}
|
|
14917
|
+
.sd-color-picker-panel .sd-color-picker-input-group {
|
|
14918
|
+
width: 100%;
|
|
14919
|
+
}
|
|
14920
|
+
.sd-color-picker-panel .sd-color-picker-format-input {
|
|
14921
|
+
min-width: 0;
|
|
14922
|
+
}
|
|
14834
14923
|
.sd-color-picker-panel .sd-color-picker-input-hex .sd-input {
|
|
14835
14924
|
padding-left: 4px;
|
|
14836
14925
|
}
|
|
14837
14926
|
.sd-color-picker-panel.sd-color-picker-panel-disabled .sd-color-picker-palette,
|
|
14838
14927
|
.sd-color-picker-panel.sd-color-picker-panel-disabled .sd-color-picker-control-bar,
|
|
14839
14928
|
.sd-color-picker-panel.sd-color-picker-panel-disabled .sd-color-picker-color-block,
|
|
14840
|
-
.sd-color-picker-panel.sd-color-picker-panel-disabled .sd-color-picker-preview
|
|
14929
|
+
.sd-color-picker-panel.sd-color-picker-panel-disabled .sd-color-picker-preview,
|
|
14930
|
+
.sd-color-picker-panel.sd-color-picker-panel-disabled .sd-color-picker-gradient-bar,
|
|
14931
|
+
.sd-color-picker-panel.sd-color-picker-panel-disabled .sd-color-picker-gradient-thumb {
|
|
14841
14932
|
cursor: not-allowed;
|
|
14842
14933
|
opacity: 0.8;
|
|
14843
14934
|
}
|
|
@@ -17868,4 +17959,17 @@ body {
|
|
|
17868
17959
|
.sd-affix {
|
|
17869
17960
|
position: fixed;
|
|
17870
17961
|
z-index: 999;
|
|
17962
|
+
}
|
|
17963
|
+
|
|
17964
|
+
.sd-theme-provider {
|
|
17965
|
+
min-width: 0;
|
|
17966
|
+
}
|
|
17967
|
+
|
|
17968
|
+
.sd-theme-popup-container {
|
|
17969
|
+
position: fixed;
|
|
17970
|
+
top: 0;
|
|
17971
|
+
left: 0;
|
|
17972
|
+
width: 100vw;
|
|
17973
|
+
height: 0;
|
|
17974
|
+
pointer-events: none;
|
|
17871
17975
|
}
|
package/es/index.scss
CHANGED
package/es/input/input.js
CHANGED
|
@@ -4,6 +4,7 @@ import { getPrefixCls } from "../_utils/global-config.js";
|
|
|
4
4
|
import { isFunction, isNull, isObject, isUndefined } from "../_utils/is.js";
|
|
5
5
|
import icon_hover_default from "../_components/icon-hover.js";
|
|
6
6
|
import IconClose from "../icon/icon-close/index.js";
|
|
7
|
+
import { useAllowClear } from "../_hooks/use-allow-clear.js";
|
|
7
8
|
import feedback_icon_default from "../_components/feedback-icon.js";
|
|
8
9
|
import { useCursor } from "../_hooks/use-cursor.js";
|
|
9
10
|
import { useSize } from "../_hooks/use-size.js";
|
|
@@ -68,7 +69,7 @@ var input_default = /* @__PURE__ */ defineComponent({
|
|
|
68
69
|
"blur": (_ev) => true
|
|
69
70
|
},
|
|
70
71
|
setup(props, { emit, slots, attrs }) {
|
|
71
|
-
const { size, disabled, error, modelValue } = toRefs(props);
|
|
72
|
+
const { size, disabled, error, modelValue, allowClear } = toRefs(props);
|
|
72
73
|
const prefixCls = getPrefixCls("input");
|
|
73
74
|
const inputRef = ref();
|
|
74
75
|
const { mergedSize: _mergedSize, mergedDisabled, mergedError: _mergedError, feedback, eventHandlers } = useFormItem({
|
|
@@ -77,6 +78,7 @@ var input_default = /* @__PURE__ */ defineComponent({
|
|
|
77
78
|
error
|
|
78
79
|
});
|
|
79
80
|
const { mergedSize } = useSize(_mergedSize);
|
|
81
|
+
const { mergedAllowClear } = useAllowClear(allowClear);
|
|
80
82
|
const [recordCursor, setCursor] = useCursor(inputRef);
|
|
81
83
|
const _value = ref(props.defaultValue);
|
|
82
84
|
const computedValue = computed(() => {
|
|
@@ -91,7 +93,7 @@ var input_default = /* @__PURE__ */ defineComponent({
|
|
|
91
93
|
preValue = oldValue;
|
|
92
94
|
});
|
|
93
95
|
const focused = ref(false);
|
|
94
|
-
const showClearBtn = computed(() =>
|
|
96
|
+
const showClearBtn = computed(() => mergedAllowClear.value && !props.readonly && !mergedDisabled.value && Boolean(computedValue.value));
|
|
95
97
|
const isComposition = ref(false);
|
|
96
98
|
const compositionValue = ref("");
|
|
97
99
|
const getValueLength = (value) => {
|