@sdata/web-vue 3.24.1 → 3.26.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.
|
@@ -93,11 +93,12 @@ declare const ModelSelector: {
|
|
|
93
93
|
disabled?: boolean;
|
|
94
94
|
}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
95
95
|
$slots: {
|
|
96
|
-
default
|
|
96
|
+
default(props: {
|
|
97
97
|
close: () => void;
|
|
98
|
+
disabled: boolean;
|
|
98
99
|
open: () => void;
|
|
99
100
|
visible: boolean;
|
|
100
|
-
})
|
|
101
|
+
}): unknown;
|
|
101
102
|
};
|
|
102
103
|
});
|
|
103
104
|
Content: {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
disabled?: boolean;
|
|
3
3
|
};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
type __VLS_Slots = {
|
|
5
|
+
default(props: {
|
|
6
|
+
close: () => void;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
open: () => void;
|
|
9
|
+
visible: boolean;
|
|
10
|
+
}): unknown;
|
|
11
11
|
};
|
|
12
12
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
|
+
import { mergeFirstChild } from "../_utils/vue-utils.js";
|
|
3
4
|
import Button from "../button/index.js";
|
|
4
5
|
import { useModelSelectorContext } from "./use-model-selector-context.js";
|
|
5
|
-
import { createBlock, defineComponent, normalizeClass, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
6
|
+
import { createBlock, defineComponent, h, normalizeClass, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
6
7
|
//#region components/model-selector/model-selector-trigger.vue?vue&type=script&setup=true&lang.ts
|
|
7
8
|
var model_selector_trigger_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "ModelSelectorTrigger" }), {}, {
|
|
8
9
|
__name: "model-selector-trigger",
|
|
@@ -11,18 +12,39 @@ var model_selector_trigger_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
11
12
|
default: false
|
|
12
13
|
} },
|
|
13
14
|
setup(__props) {
|
|
15
|
+
const TriggerElement = defineComponent({
|
|
16
|
+
name: "ModelSelectorTriggerElement",
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
setup: (_, { attrs, slots }) => {
|
|
19
|
+
return () => {
|
|
20
|
+
var _slots$default, _slots$default2;
|
|
21
|
+
const children = (_slots$default = (_slots$default2 = slots.default) === null || _slots$default2 === void 0 ? void 0 : _slots$default2.call(slots)) !== null && _slots$default !== void 0 ? _slots$default : [];
|
|
22
|
+
if (mergeFirstChild(children, attrs)) return children;
|
|
23
|
+
return h(Button, attrs, { default: () => children });
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
14
27
|
const prefixCls = getPrefixCls("model-selector-trigger");
|
|
15
28
|
const context = useModelSelectorContext("ModelSelectorTrigger");
|
|
29
|
+
function handleClick(event) {
|
|
30
|
+
if (__props.disabled) {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
context.setVisible(!context.visible.value);
|
|
35
|
+
}
|
|
16
36
|
return (_ctx, _cache) => {
|
|
17
|
-
return openBlock(), createBlock(unref(
|
|
37
|
+
return openBlock(), createBlock(unref(TriggerElement), {
|
|
18
38
|
class: normalizeClass(unref(prefixCls)),
|
|
19
39
|
"aria-expanded": unref(context).visible.value,
|
|
40
|
+
"aria-disabled": __props.disabled || void 0,
|
|
20
41
|
"aria-haspopup": "dialog",
|
|
21
42
|
disabled: __props.disabled,
|
|
22
|
-
onClick:
|
|
43
|
+
onClick: handleClick
|
|
23
44
|
}, {
|
|
24
45
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {
|
|
25
46
|
close: () => unref(context).setVisible(false),
|
|
47
|
+
disabled: __props.disabled,
|
|
26
48
|
open: () => unref(context).setVisible(true),
|
|
27
49
|
visible: unref(context).visible.value
|
|
28
50
|
})]),
|
|
@@ -30,6 +52,7 @@ var model_selector_trigger_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
30
52
|
}, 8, [
|
|
31
53
|
"class",
|
|
32
54
|
"aria-expanded",
|
|
55
|
+
"aria-disabled",
|
|
33
56
|
"disabled"
|
|
34
57
|
]);
|
|
35
58
|
};
|
package/json/web-types.json
CHANGED