@sdata/web-vue 3.24.1 → 3.25.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?: (props: {
96
+ default(props: {
97
97
  close: () => void;
98
+ disabled: boolean;
98
99
  open: () => void;
99
100
  visible: boolean;
100
- }) => any;
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
- declare var __VLS_10: {
5
- close: () => void;
6
- open: () => void;
7
- visible: boolean;
8
- };
9
- type __VLS_Slots = {} & {
10
- default?: (props: typeof __VLS_10) => any;
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(Button), {
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: _cache[0] || (_cache[0] = ($event) => unref(context).setVisible(!unref(context).visible.value))
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
  };
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "@sdata/web-vue",
5
- "version": "3.24.0",
5
+ "version": "3.24.1",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdata/web-vue",
3
- "version": "3.24.1",
3
+ "version": "3.25.0",
4
4
  "description": "SD Design Vue: A Vue.js 3 UI Library",
5
5
  "keywords": [
6
6
  "sd",