@sdata/web-vue 3.11.0 → 3.13.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.
Files changed (109) hide show
  1. package/dist/sd.css +147 -15
  2. package/dist/sd.min.css +43 -1
  3. package/es/_components/picker/input-range.vue.d.ts +6 -7
  4. package/es/_components/picker/input-range.vue_vue_type_script_setup_true_lang.js +63 -46
  5. package/es/_components/picker/input.vue.d.ts +5 -6
  6. package/es/_components/picker/input.vue_vue_type_script_setup_true_lang.js +52 -35
  7. package/es/_hooks/use-readonly-tip.d.ts +11 -0
  8. package/es/_hooks/use-readonly-tip.js +66 -0
  9. package/es/auto-complete/auto-complete.d.ts +9 -0
  10. package/es/auto-complete/auto-complete.js +11 -1
  11. package/es/auto-complete/index.d.ts +15 -0
  12. package/es/button/button.vue.d.ts +16 -7
  13. package/es/button/button.vue_vue_type_script_setup_true_lang.js +57 -31
  14. package/es/button/index.d.ts +11 -0
  15. package/es/button/interface.d.ts +2 -0
  16. package/es/card/card.d.ts +312 -0
  17. package/es/card/card.js +39 -7
  18. package/es/card/index.d.ts +616 -0
  19. package/es/card/style/index.css +23 -0
  20. package/es/card/style/index.scss +31 -0
  21. package/es/cascader/cascader.vue.d.ts +9 -8
  22. package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +149 -128
  23. package/es/cascader/types.d.ts +1 -0
  24. package/es/color-picker/color-picker.d.ts +9 -0
  25. package/es/color-picker/color-picker.js +33 -11
  26. package/es/color-picker/index.d.ts +15 -0
  27. package/es/config-provider/context.d.ts +9 -9
  28. package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +1 -1
  29. package/es/date-picker/index.d.ts +3 -6
  30. package/es/date-picker/picker.vue.d.ts +2 -3
  31. package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +5 -5
  32. package/es/date-picker/range-picker.vue.d.ts +2 -3
  33. package/es/date-picker/range-picker.vue_vue_type_script_setup_true_lang.js +4 -4
  34. package/es/drawer/drawer.vue_vue_type_script_setup_true_lang.js +3 -3
  35. package/es/empty/empty.js +1 -1
  36. package/es/file-previewer/file-previewer.vue_vue_type_script_setup_true_lang.js +1 -1
  37. package/es/image/image.vue_vue_type_script_setup_true_lang.js +1 -1
  38. package/es/image/preview-action.d.ts +7 -127
  39. package/es/image/preview.vue_vue_type_script_setup_true_lang.js +2 -2
  40. package/es/index.css +147 -15
  41. package/es/index.js +3 -3
  42. package/es/input/index.d.ts +6 -6
  43. package/es/input/input.d.ts +3 -3
  44. package/es/input/input.js +18 -6
  45. package/es/input-number/index.d.ts +9 -9
  46. package/es/input-number/input-number.d.ts +5 -5
  47. package/es/input-number/input-number.js +8 -8
  48. package/es/input-tag/index.d.ts +6 -6
  49. package/es/input-tag/input-tag.d.ts +3 -3
  50. package/es/input-tag/input-tag.js +16 -7
  51. package/es/locale/interface.d.ts +1 -0
  52. package/es/locale/lang/en-us.js +1 -0
  53. package/es/locale/lang/zh-cn.js +1 -0
  54. package/es/locale/lang/zh-tw.js +1 -0
  55. package/es/mention/index.d.ts +15 -0
  56. package/es/mention/mention.d.ts +9 -0
  57. package/es/mention/mention.js +12 -1
  58. package/es/menu/base-menu.vue_vue_type_script_setup_true_lang.js +1 -1
  59. package/es/modal/modal.vue_vue_type_script_setup_true_lang.js +3 -3
  60. package/es/pagination/pagination.js +1 -1
  61. package/es/popconfirm/popconfirm.vue_vue_type_script_setup_true_lang.js +2 -2
  62. package/es/popover/popover.vue_vue_type_script_setup_true_lang.js +1 -1
  63. package/es/rate/index.d.ts +6 -6
  64. package/es/rate/rate.d.ts +3 -3
  65. package/es/rate/rate.js +17 -7
  66. package/es/scrollbar/scrollbar.vue_vue_type_script_setup_true_lang.js +1 -1
  67. package/es/scrollbar/style/index.css +57 -15
  68. package/es/scrollbar/style/index.scss +63 -15
  69. package/es/sd-vue.js +3 -3
  70. package/es/secret/secret.vue_vue_type_script_setup_true_lang.js +1 -1
  71. package/es/select/index.d.ts +15 -0
  72. package/es/select/select.d.ts +9 -0
  73. package/es/select/select.js +28 -5
  74. package/es/style/normalize.scss +68 -0
  75. package/es/table/table-th.js +2 -2
  76. package/es/tabs/context.d.ts +2 -0
  77. package/es/tabs/index.d.ts +32 -0
  78. package/es/tabs/style/index.css +29 -0
  79. package/es/tabs/style/index.scss +38 -0
  80. package/es/tabs/tab-pane.vue.d.ts +4 -2
  81. package/es/tabs/tab-pane.vue_vue_type_script_setup_true_lang.js +19 -3
  82. package/es/tabs/tabs.d.ts +19 -0
  83. package/es/tabs/tabs.js +23 -2
  84. package/es/textarea/index.d.ts +15 -0
  85. package/es/textarea/textarea.vue.d.ts +11 -2
  86. package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +71 -46
  87. package/es/time-picker/index.d.ts +3 -6
  88. package/es/time-picker/panel.vue_vue_type_script_setup_true_lang.js +1 -1
  89. package/es/time-picker/time-picker.vue.d.ts +2 -3
  90. package/es/time-picker/time-picker.vue_vue_type_script_setup_true_lang.js +8 -5
  91. package/es/toolbar/toolbar.vue_vue_type_script_setup_true_lang.js +1 -1
  92. package/es/tooltip/index.d.ts +8 -127
  93. package/es/tooltip/interface.d.ts +17 -0
  94. package/es/tooltip/tooltip.vue.d.ts +5 -88
  95. package/es/tooltip/tooltip.vue_vue_type_script_setup_true_lang.js +8 -69
  96. package/es/tour/tour.vue_vue_type_script_setup_true_lang.js +1 -1
  97. package/es/tree/tree.vue_vue_type_script_setup_true_lang.js +1 -1
  98. package/es/tree-select/tree-select.vue.d.ts +16 -10
  99. package/es/tree-select/tree-select.vue_vue_type_script_setup_true_lang.js +156 -133
  100. package/es/typography/base.js +1 -1
  101. package/es/upload/upload-button.js +1 -1
  102. package/es/verification-code/index.d.ts +15 -6
  103. package/es/verification-code/verification-code.d.ts +9 -3
  104. package/es/verification-code/verification-code.js +4 -1
  105. package/json/vetur-attributes.json +48 -7
  106. package/json/vetur-tags.json +17 -5
  107. package/json/web-types.json +99 -10
  108. package/package.json +1 -1
  109. package/es/style/base.scss +0 -18
@@ -193,6 +193,29 @@
193
193
  padding: 12px 16px;
194
194
  }
195
195
 
196
+ .sd-card-full-height {
197
+ display: flex;
198
+ flex-direction: column;
199
+ height: 100%;
200
+ overflow: hidden;
201
+ }
202
+ .sd-card-full-height .sd-card-header {
203
+ flex-shrink: 0;
204
+ }
205
+ .sd-card-full-height .sd-card-body {
206
+ flex: 1;
207
+ min-height: 0;
208
+ }
209
+ .sd-card-full-height .sd-card-body-native {
210
+ overflow: auto;
211
+ }
212
+ .sd-card-full-height .sd-card-body-scroll {
213
+ overflow: hidden;
214
+ }
215
+ .sd-card-full-height .sd-card-body-scroll .sd-card-body-scrollbar {
216
+ height: 100%;
217
+ }
218
+
196
219
  :where(body, [sd-theme])[sd-theme=dark] .sd-card-grid-hoverable:hover::before,
197
220
  :where(body, [sd-theme])[sd-theme=dark] .sd-card-hoverable:hover {
198
221
  box-shadow: 0 4px 10px rgb(var(--sd-gray-1), 40%);
@@ -227,6 +227,37 @@ $card-prefix-cls: string.unquote('#{theme.$prefix}-card');
227
227
  @include size(small, small);
228
228
  }
229
229
 
230
+ // full-height:撑满父容器高度,内容区域自动滚动
231
+ .#{$card-prefix-cls}-full-height {
232
+ display: flex;
233
+ flex-direction: column;
234
+ height: 100%;
235
+ overflow: hidden;
236
+
237
+ .#{$card-prefix-cls}-header {
238
+ flex-shrink: 0;
239
+ }
240
+
241
+ .#{$card-prefix-cls}-body {
242
+ flex: 1;
243
+ min-height: 0;
244
+ }
245
+
246
+ // scrollbar === false:使用原生 overflow 滚动
247
+ .#{$card-prefix-cls}-body-native {
248
+ overflow: auto;
249
+ }
250
+
251
+ // scrollbar !== false:使用 Scrollbar 组件
252
+ .#{$card-prefix-cls}-body-scroll {
253
+ overflow: hidden;
254
+
255
+ .#{$card-prefix-cls}-body-scrollbar {
256
+ height: 100%;
257
+ }
258
+ }
259
+ }
260
+
230
261
  // dark mode
231
262
  #{global.$sd-theme-tag}[sd-theme='dark'] {
232
263
  .#{$card-prefix-cls}-grid-hoverable:hover::before,
@@ -1,20 +1,20 @@
1
1
  import type { CascaderModelValue, CascaderOption } from './interface';
2
2
  import type { CascaderProps } from './types';
3
- declare var __VLS_24: any, __VLS_27: {}, __VLS_30: {}, __VLS_33: {}, __VLS_36: {}, __VLS_46: {}, __VLS_55: {};
3
+ declare var __VLS_30: any, __VLS_33: {}, __VLS_36: {}, __VLS_39: {}, __VLS_42: {}, __VLS_52: {}, __VLS_61: {};
4
4
  type __VLS_Slots = {} & {
5
- label?: (props: typeof __VLS_24) => any;
5
+ label?: (props: typeof __VLS_30) => any;
6
6
  } & {
7
- prefix?: (props: typeof __VLS_27) => any;
7
+ prefix?: (props: typeof __VLS_33) => any;
8
8
  } & {
9
- 'arrow-icon'?: (props: typeof __VLS_30) => any;
9
+ 'arrow-icon'?: (props: typeof __VLS_36) => any;
10
10
  } & {
11
- 'loading-icon'?: (props: typeof __VLS_33) => any;
11
+ 'loading-icon'?: (props: typeof __VLS_39) => any;
12
12
  } & {
13
- 'search-icon'?: (props: typeof __VLS_36) => any;
13
+ 'search-icon'?: (props: typeof __VLS_42) => any;
14
14
  } & {
15
- empty?: (props: typeof __VLS_46) => any;
15
+ empty?: (props: typeof __VLS_52) => any;
16
16
  } & {
17
- empty?: (props: typeof __VLS_55) => any;
17
+ empty?: (props: typeof __VLS_61) => any;
18
18
  };
19
19
  declare const __VLS_base: import("vue").DefineComponent<CascaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
20
  search: (value: string) => any;
@@ -43,6 +43,7 @@ declare const __VLS_base: import("vue").DefineComponent<CascaderProps, {}, {}, {
43
43
  }>, {
44
44
  options: CascaderOption[];
45
45
  error: boolean;
46
+ readonly: boolean | string;
46
47
  defaultPopupVisible: boolean;
47
48
  disabled: boolean;
48
49
  allowClear: boolean;
@@ -4,8 +4,10 @@ import { isArray, isFunction, isNull, isUndefined } from "../_utils/is.js";
4
4
  import { useAllowClear } from "../_hooks/use-allow-clear.js";
5
5
  import { useDropdownVirtualListProps } from "../_hooks/use-dropdown-virtual-list-props.js";
6
6
  import { resolveDropdownVirtualListProps } from "../_utils/virtual-dropdown.js";
7
- import { KEYBOARD_KEY, getKeyDownHandler } from "../_utils/keyboard.js";
7
+ import { useReadonlyTip, useReadonlyTipText } from "../_hooks/use-readonly-tip.js";
8
8
  import Trigger from "../trigger/index.js";
9
+ import Tooltip from "../tooltip/index.js";
10
+ import { KEYBOARD_KEY, getKeyDownHandler } from "../_utils/keyboard.js";
9
11
  import { useTrigger } from "../_hooks/use-trigger.js";
10
12
  import { cascaderInjectionKey } from "./context.js";
11
13
  import { getCheckedStatus, getLeafOptionInfos, getLeafOptionKeys, getOptionInfos, getOptionLabel, getValidValues, getValueKey } from "./utils.js";
@@ -15,7 +17,7 @@ import select_view_default from "../_components/select-view/select-view.js";
15
17
  import { useAllowSearch } from "../_hooks/use-allow-search.js";
16
18
  import { debounce } from "../_utils/debounce.js";
17
19
  import cascader_search_panel_default from "./cascader-search-panel.js";
18
- import { computed, createBlock, createSlots, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, mergeProps, normalizeProps, openBlock, provide, reactive, ref, renderSlot, toRefs, unref, useAttrs, useSlots, watch, withCtx } from "vue";
20
+ import { computed, createBlock, createSlots, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, mergeProps, normalizeProps, openBlock, provide, reactive, ref, renderSlot, toRef, toRefs, unref, useAttrs, useSlots, watch, withCtx } from "vue";
19
21
  //#region components/cascader/cascader.vue?vue&type=script&setup=true&lang.ts
20
22
  var DEFAULT_CASCADER_VIRTUAL_ITEM_SIZE = 36;
21
23
  var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, {
@@ -39,6 +41,10 @@ var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
39
41
  type: Boolean,
40
42
  default: false
41
43
  },
44
+ readonly: {
45
+ type: [Boolean, String],
46
+ default: false
47
+ },
42
48
  error: {
43
49
  type: Boolean,
44
50
  default: false
@@ -155,7 +161,7 @@ var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
155
161
  const mergedShow = computed(() => {
156
162
  if (hasTriggerProp(["show"])) return props.show;
157
163
  });
158
- const { computedPopupVisible, handlePopupVisibleChange } = useTrigger({
164
+ const { computedPopupVisible, handlePopupVisibleChange: _handlePopupVisibleChange } = useTrigger({
159
165
  popupVisible: mergedPopupVisible,
160
166
  defaultPopupVisible: computed(() => {
161
167
  if (hasTriggerProp(["defaultPopupVisible", "default-popup-visible"])) return props.defaultPopupVisible;
@@ -166,6 +172,15 @@ var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
166
172
  }),
167
173
  emit
168
174
  });
175
+ const { tipVisible, show: showReadonlyTip } = useReadonlyTip(toRef(props, "readonly"), mergedDisabled);
176
+ const readonlyTipText = useReadonlyTipText(toRef(props, "readonly"));
177
+ const handlePopupVisibleChange = (visible) => {
178
+ if (visible && props.readonly && !mergedDisabled.value) {
179
+ showReadonlyTip();
180
+ return;
181
+ }
182
+ _handlePopupVisibleChange(visible);
183
+ };
169
184
  const mergedTriggerProps = computed(() => {
170
185
  var _props$triggerProps;
171
186
  return (_props$triggerProps = props.triggerProps) !== null && _props$triggerProps !== void 0 ? _props$triggerProps : {};
@@ -451,136 +466,142 @@ var cascader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
451
466
  return result;
452
467
  });
453
468
  return (_ctx, _cache) => {
454
- return openBlock(), createBlock(unref(Trigger), mergeProps(mergedTriggerProps.value, {
455
- trigger: "click",
456
- "animation-name": "slide-dynamic-origin",
457
- "auto-fit-transform-origin": "",
458
- "popup-visible": unref(computedPopupVisible),
459
- position: "bl",
460
- disabled: unref(mergedDisabled),
461
- "popup-offset": 4,
462
- "auto-fit-popup-width": showSearchPanel.value,
463
- "popup-container": unref(popupContainer),
464
- "prevent-focus": true,
465
- "click-to-close": !Boolean(unref(mergedAllowSearch)),
466
- onPopupVisibleChange: unref(handlePopupVisibleChange)
467
- }), {
468
- content: withCtx(() => [showSearchPanel.value ? (openBlock(), createBlock(unref(cascader_search_panel_default), {
469
- key: 0,
470
- options: filteredLeafOptions.value,
471
- "active-key": unref(activeKey),
472
- multiple: unref(multiple),
473
- "check-strictly": unref(checkStrictly),
474
- loading: unref(loading),
475
- "path-label": !unref(searchOptionOnlyLabel)
476
- }, createSlots({ _: 2 }, [_ctx.$slots.empty ? {
477
- name: "empty",
478
- fn: withCtx(() => [renderSlot(_ctx.$slots, "empty")]),
479
- key: "0"
480
- } : void 0]), 1032, [
481
- "options",
482
- "active-key",
483
- "multiple",
484
- "check-strictly",
485
- "loading",
486
- "path-label"
487
- ])) : (openBlock(), createBlock(unref(base_cascader_panel_default), {
488
- key: 1,
489
- "display-columns": unref(displayColumns),
490
- "selected-path": unref(selectedPath),
491
- "active-key": unref(activeKey),
492
- multiple: unref(multiple),
493
- "total-level": totalLevel.value,
494
- "check-strictly": unref(checkStrictly),
495
- loading: unref(loading),
496
- "virtual-list-props": resolvedVirtualListProps.value,
497
- dropdown: ""
498
- }, createSlots({ _: 2 }, [_ctx.$slots.empty ? {
499
- name: "empty",
500
- fn: withCtx(() => [renderSlot(_ctx.$slots, "empty")]),
501
- key: "0"
502
- } : void 0]), 1032, [
503
- "display-columns",
504
- "selected-path",
505
- "active-key",
506
- "multiple",
507
- "total-level",
508
- "check-strictly",
509
- "loading",
510
- "virtual-list-props"
511
- ]))]),
512
- default: withCtx(() => [createVNode(unref(select_view_default), mergeProps({
513
- "model-value": selectViewValue.value,
514
- "input-value": computedInputValue.value,
469
+ return openBlock(), createBlock(unref(Tooltip), {
470
+ "popup-visible": unref(tipVisible),
471
+ content: unref(readonlyTipText),
472
+ position: "top"
473
+ }, {
474
+ default: withCtx(() => [createVNode(unref(Trigger), mergeProps(mergedTriggerProps.value, {
475
+ trigger: "click",
476
+ "animation-name": "slide-dynamic-origin",
477
+ "auto-fit-transform-origin": "",
478
+ "popup-visible": unref(computedPopupVisible),
479
+ position: "bl",
515
480
  disabled: unref(mergedDisabled),
516
- error: unref(error),
517
- multiple: unref(multiple),
518
- "allow-clear": unref(mergedAllowClear),
519
- "allow-search": Boolean(unref(mergedAllowSearch)),
520
- size: unref(size),
521
- opened: unref(computedPopupVisible),
522
- placeholder: unref(placeholder),
523
- loading: unref(loading),
524
- "max-tag-count": unref(maxTagCount),
525
- "tag-nowrap": unref(tagNowrap)
526
- }, unref(attrs), {
527
- onInputValueChange: handleInputValueChange,
528
- onClear: handleClear,
529
- onFocus: handleFocus,
530
- onBlur: handleBlur,
531
- onRemove: handleRemove,
532
- onKeydown: unref(handleKeyDown)
533
- }), createSlots({ _: 2 }, [
534
- _ctx.$slots.label ? {
535
- name: "label",
536
- fn: withCtx((data) => [renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps(data)))]),
481
+ "popup-offset": 4,
482
+ "auto-fit-popup-width": showSearchPanel.value,
483
+ "popup-container": unref(popupContainer),
484
+ "prevent-focus": true,
485
+ "click-to-close": !Boolean(unref(mergedAllowSearch)),
486
+ onPopupVisibleChange: handlePopupVisibleChange
487
+ }), {
488
+ content: withCtx(() => [showSearchPanel.value ? (openBlock(), createBlock(unref(cascader_search_panel_default), {
489
+ key: 0,
490
+ options: filteredLeafOptions.value,
491
+ "active-key": unref(activeKey),
492
+ multiple: unref(multiple),
493
+ "check-strictly": unref(checkStrictly),
494
+ loading: unref(loading),
495
+ "path-label": !unref(searchOptionOnlyLabel)
496
+ }, createSlots({ _: 2 }, [_ctx.$slots.empty ? {
497
+ name: "empty",
498
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "empty")]),
499
+ key: "0"
500
+ } : void 0]), 1032, [
501
+ "options",
502
+ "active-key",
503
+ "multiple",
504
+ "check-strictly",
505
+ "loading",
506
+ "path-label"
507
+ ])) : (openBlock(), createBlock(unref(base_cascader_panel_default), {
508
+ key: 1,
509
+ "display-columns": unref(displayColumns),
510
+ "selected-path": unref(selectedPath),
511
+ "active-key": unref(activeKey),
512
+ multiple: unref(multiple),
513
+ "total-level": totalLevel.value,
514
+ "check-strictly": unref(checkStrictly),
515
+ loading: unref(loading),
516
+ "virtual-list-props": resolvedVirtualListProps.value,
517
+ dropdown: ""
518
+ }, createSlots({ _: 2 }, [_ctx.$slots.empty ? {
519
+ name: "empty",
520
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "empty")]),
537
521
  key: "0"
538
- } : void 0,
539
- _ctx.$slots.prefix ? {
540
- name: "prefix",
541
- fn: withCtx(() => [renderSlot(_ctx.$slots, "prefix")]),
542
- key: "1"
543
- } : void 0,
544
- _ctx.$slots["arrow-icon"] ? {
545
- name: "arrow-icon",
546
- fn: withCtx(() => [renderSlot(_ctx.$slots, "arrow-icon")]),
547
- key: "2"
548
- } : void 0,
549
- _ctx.$slots["loading-icon"] ? {
550
- name: "loading-icon",
551
- fn: withCtx(() => [renderSlot(_ctx.$slots, "loading-icon")]),
552
- key: "3"
553
- } : void 0,
554
- _ctx.$slots["search-icon"] ? {
555
- name: "search-icon",
556
- fn: withCtx(() => [renderSlot(_ctx.$slots, "search-icon")]),
557
- key: "4"
558
- } : void 0
559
- ]), 1040, [
560
- "model-value",
561
- "input-value",
522
+ } : void 0]), 1032, [
523
+ "display-columns",
524
+ "selected-path",
525
+ "active-key",
526
+ "multiple",
527
+ "total-level",
528
+ "check-strictly",
529
+ "loading",
530
+ "virtual-list-props"
531
+ ]))]),
532
+ default: withCtx(() => [createVNode(unref(select_view_default), mergeProps({
533
+ "model-value": selectViewValue.value,
534
+ "input-value": computedInputValue.value,
535
+ disabled: unref(mergedDisabled),
536
+ error: unref(error),
537
+ multiple: unref(multiple),
538
+ "allow-clear": unref(mergedAllowClear),
539
+ "allow-search": Boolean(unref(mergedAllowSearch)),
540
+ size: unref(size),
541
+ opened: unref(computedPopupVisible),
542
+ placeholder: unref(placeholder),
543
+ loading: unref(loading),
544
+ "max-tag-count": unref(maxTagCount),
545
+ "tag-nowrap": unref(tagNowrap)
546
+ }, unref(attrs), {
547
+ onInputValueChange: handleInputValueChange,
548
+ onClear: handleClear,
549
+ onFocus: handleFocus,
550
+ onBlur: handleBlur,
551
+ onRemove: handleRemove,
552
+ onKeydown: unref(handleKeyDown)
553
+ }), createSlots({ _: 2 }, [
554
+ _ctx.$slots.label ? {
555
+ name: "label",
556
+ fn: withCtx((data) => [renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps(data)))]),
557
+ key: "0"
558
+ } : void 0,
559
+ _ctx.$slots.prefix ? {
560
+ name: "prefix",
561
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "prefix")]),
562
+ key: "1"
563
+ } : void 0,
564
+ _ctx.$slots["arrow-icon"] ? {
565
+ name: "arrow-icon",
566
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "arrow-icon")]),
567
+ key: "2"
568
+ } : void 0,
569
+ _ctx.$slots["loading-icon"] ? {
570
+ name: "loading-icon",
571
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "loading-icon")]),
572
+ key: "3"
573
+ } : void 0,
574
+ _ctx.$slots["search-icon"] ? {
575
+ name: "search-icon",
576
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "search-icon")]),
577
+ key: "4"
578
+ } : void 0
579
+ ]), 1040, [
580
+ "model-value",
581
+ "input-value",
582
+ "disabled",
583
+ "error",
584
+ "multiple",
585
+ "allow-clear",
586
+ "allow-search",
587
+ "size",
588
+ "opened",
589
+ "placeholder",
590
+ "loading",
591
+ "max-tag-count",
592
+ "tag-nowrap",
593
+ "onKeydown"
594
+ ])]),
595
+ _: 3
596
+ }, 16, [
597
+ "popup-visible",
562
598
  "disabled",
563
- "error",
564
- "multiple",
565
- "allow-clear",
566
- "allow-search",
567
- "size",
568
- "opened",
569
- "placeholder",
570
- "loading",
571
- "max-tag-count",
572
- "tag-nowrap",
573
- "onKeydown"
599
+ "auto-fit-popup-width",
600
+ "popup-container",
601
+ "click-to-close"
574
602
  ])]),
575
603
  _: 3
576
- }, 16, [
577
- "popup-visible",
578
- "disabled",
579
- "auto-fit-popup-width",
580
- "popup-container",
581
- "click-to-close",
582
- "onPopupVisibleChange"
583
- ]);
604
+ }, 8, ["popup-visible", "content"]);
584
605
  };
585
606
  }
586
607
  }));
@@ -10,6 +10,7 @@ export interface CascaderProps {
10
10
  defaultValue?: CascaderModelValue;
11
11
  options?: CascaderOption[];
12
12
  disabled?: boolean;
13
+ readonly?: boolean | string;
13
14
  error?: boolean;
14
15
  size?: Size;
15
16
  allowSearch?: boolean;
@@ -50,6 +50,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
50
50
  type: BooleanConstructor;
51
51
  default: boolean;
52
52
  };
53
+ readonly: {
54
+ type: (StringConstructor | BooleanConstructor)[];
55
+ default: boolean;
56
+ };
53
57
  hideTrigger: BooleanConstructor;
54
58
  triggerProps: {
55
59
  type: PropType<Partial<TriggerProps>>;
@@ -116,6 +120,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
116
120
  type: BooleanConstructor;
117
121
  default: boolean;
118
122
  };
123
+ readonly: {
124
+ type: (StringConstructor | BooleanConstructor)[];
125
+ default: boolean;
126
+ };
119
127
  hideTrigger: BooleanConstructor;
120
128
  triggerProps: {
121
129
  type: PropType<Partial<TriggerProps>>;
@@ -135,6 +143,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
135
143
  }) => any) | undefined;
136
144
  "onRecent-colors-change"?: ((_value: string[]) => any) | undefined;
137
145
  }>, {
146
+ readonly: string | boolean;
138
147
  size: "small" | "mini" | "medium" | "large";
139
148
  disabled: boolean;
140
149
  defaultValue: string;
@@ -1,11 +1,13 @@
1
1
  import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
2
2
  import { getPrefixCls } from "../_utils/global-config.js";
3
- import Input from "../input/index.js";
3
+ import { useReadonlyTip, useReadonlyTipText } from "../_hooks/use-readonly-tip.js";
4
4
  import Trigger from "../trigger/index.js";
5
+ import Tooltip from "../tooltip/index.js";
6
+ import Input from "../input/index.js";
5
7
  import { colors } from "./colors.js";
6
8
  import { formatColorState, getColorBackground, getColorObject, normalizeFormat, parseColorState } from "./utils.js";
7
9
  import panel_default from "./panel.js";
8
- import { computed, createVNode, defineComponent, mergeProps, ref } from "vue";
10
+ import { computed, createVNode, defineComponent, mergeProps, ref, toRef } from "vue";
9
11
  //#region components/color-picker/color-picker.tsx
10
12
  var color_picker_default = /* @__PURE__ */ defineComponent({
11
13
  name: "ColorPicker",
@@ -101,6 +103,14 @@ var color_picker_default = /* @__PURE__ */ defineComponent({
101
103
  default: false
102
104
  },
103
105
  /**
106
+ * @zh 是否为只读状态
107
+ * @en Whether it is read-only
108
+ */
109
+ readonly: {
110
+ type: [Boolean, String],
111
+ default: false
112
+ },
113
+ /**
104
114
  * @zh 是否内联面板
105
115
  * @en Render panel inline
106
116
  */
@@ -193,24 +203,31 @@ var color_picker_default = /* @__PURE__ */ defineComponent({
193
203
  const onPopupVisibleChange = (visible) => {
194
204
  emit("popup-visible-change", visible, triggerInputValue.value);
195
205
  };
206
+ const { tipVisible, show: showReadonlyTip } = useReadonlyTip(toRef(props, "readonly"), toRef(props, "disabled"));
207
+ const readonlyTipText = useReadonlyTipText(toRef(props, "readonly"));
196
208
  const mergedTriggerProps = computed(() => _objectSpread2({
197
209
  trigger: "click",
198
210
  position: "bl",
199
- disabled: props.disabled,
211
+ disabled: props.disabled || !!props.readonly,
200
212
  popupOffset: 4,
201
213
  animationName: "slide-dynamic-origin"
202
214
  }, props.triggerProps));
203
215
  const renderTriggerInput = () => {
204
- return createVNode("div", { "class": {
205
- [prefixCls]: true,
206
- [`${prefixCls}-size-${props.size}`]: props.size,
207
- [`${prefixCls}-disabled`]: props.disabled,
208
- [`${prefixCls}-borderless`]: props.borderless
209
- } }, [createVNode(Input, mergeProps({
216
+ return createVNode("div", {
217
+ "class": {
218
+ [prefixCls]: true,
219
+ [`${prefixCls}-size-${props.size}`]: props.size,
220
+ [`${prefixCls}-disabled`]: props.disabled,
221
+ [`${prefixCls}-readonly`]: !!props.readonly,
222
+ [`${prefixCls}-borderless`]: props.borderless
223
+ },
224
+ "onClick": showReadonlyTip
225
+ }, [createVNode(Input, mergeProps({
210
226
  "class": `${prefixCls}-trigger-input`,
211
227
  "size": props.size === "mini" ? "mini" : props.size,
212
228
  "allowClear": props.clearable,
213
229
  "disabled": props.disabled,
230
+ "readonly": props.readonly,
214
231
  "modelValue": triggerInputValue.value,
215
232
  "onChange": handleTriggerInputChange,
216
233
  "onClear": handleClear
@@ -238,10 +255,15 @@ var color_picker_default = /* @__PURE__ */ defineComponent({
238
255
  }, null);
239
256
  };
240
257
  return () => {
241
- return props.hideTrigger ? renderPanel() : createVNode(Trigger, mergeProps({ "onPopupVisibleChange": onPopupVisibleChange }, mergedTriggerProps.value), {
258
+ if (props.hideTrigger) return renderPanel();
259
+ return createVNode(Tooltip, {
260
+ "popupVisible": tipVisible.value,
261
+ "content": readonlyTipText.value,
262
+ "position": "top"
263
+ }, { default: () => [createVNode(Trigger, mergeProps({ "onPopupVisibleChange": onPopupVisibleChange }, mergedTriggerProps.value), {
242
264
  default: () => [slots.default ? slots.default() : renderTriggerInput()],
243
265
  content: renderPanel
244
- });
266
+ })] });
245
267
  };
246
268
  }
247
269
  });
@@ -50,6 +50,10 @@ declare const ColorPicker: {
50
50
  type: BooleanConstructor;
51
51
  default: boolean;
52
52
  };
53
+ readonly: {
54
+ type: (StringConstructor | BooleanConstructor)[];
55
+ default: boolean;
56
+ };
53
57
  hideTrigger: BooleanConstructor;
54
58
  triggerProps: {
55
59
  type: import("vue").PropType<Partial<import("..").TriggerProps>>;
@@ -83,6 +87,7 @@ declare const ColorPicker: {
83
87
  }) => true;
84
88
  'recent-colors-change': (_value: string[]) => true;
85
89
  }, import("vue").PublicProps, {
90
+ readonly: string | boolean;
86
91
  size: "small" | "mini" | "medium" | "large";
87
92
  disabled: boolean;
88
93
  defaultValue: string;
@@ -152,6 +157,10 @@ declare const ColorPicker: {
152
157
  type: BooleanConstructor;
153
158
  default: boolean;
154
159
  };
160
+ readonly: {
161
+ type: (StringConstructor | BooleanConstructor)[];
162
+ default: boolean;
163
+ };
155
164
  hideTrigger: BooleanConstructor;
156
165
  triggerProps: {
157
166
  type: import("vue").PropType<Partial<import("..").TriggerProps>>;
@@ -171,6 +180,7 @@ declare const ColorPicker: {
171
180
  }) => any) | undefined;
172
181
  "onRecent-colors-change"?: ((_value: string[]) => any) | undefined;
173
182
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
183
+ readonly: string | boolean;
174
184
  size: "small" | "mini" | "medium" | "large";
175
185
  disabled: boolean;
176
186
  defaultValue: string;
@@ -237,6 +247,10 @@ declare const ColorPicker: {
237
247
  type: BooleanConstructor;
238
248
  default: boolean;
239
249
  };
250
+ readonly: {
251
+ type: (StringConstructor | BooleanConstructor)[];
252
+ default: boolean;
253
+ };
240
254
  hideTrigger: BooleanConstructor;
241
255
  triggerProps: {
242
256
  type: import("vue").PropType<Partial<import("..").TriggerProps>>;
@@ -270,6 +284,7 @@ declare const ColorPicker: {
270
284
  }) => true;
271
285
  'recent-colors-change': (_value: string[]) => true;
272
286
  }, string, {
287
+ readonly: string | boolean;
273
288
  size: "small" | "mini" | "medium" | "large";
274
289
  disabled: boolean;
275
290
  defaultValue: string;
@@ -1,14 +1,14 @@
1
- import { CSSProperties, InjectionKey, Ref, Slots } from 'vue';
1
+ import type { CSSProperties, InjectionKey, Ref, Slots } from 'vue';
2
2
  export type { JsonFormProviderConfig } from '../json-form/types';
3
+ import type { VirtualListProps } from '../_components/virtual-list/interface';
4
+ import type { Size } from '../_utils/constant';
5
+ import type { ButtonProps } from '../button';
6
+ import type { ShortcutType, WeekStart } from '../date-picker/interface';
7
+ import type { EllipsisTooltipProps } from '../ellipsis';
3
8
  import type { JsonFormProviderConfig } from '../json-form/types';
4
- import { VirtualListProps } from '../_components/virtual-list/interface';
5
- import { Size } from '../_utils/constant';
6
- import { ButtonProps } from '../button';
7
- import { ShortcutType, WeekStart } from '../date-picker/interface';
8
- import { EllipsisTooltipProps } from '../ellipsis';
9
- import { SdLang } from '../locale/interface';
10
- import { PaginationSelectProps } from '../pagination/interface';
11
- import { SDThemeNormalized } from './theme';
9
+ import type { SdLang } from '../locale/interface';
10
+ import type { PaginationSelectProps } from '../pagination/interface';
11
+ import type { SDThemeNormalized } from './theme';
12
12
  export interface ConfigProviderModal {
13
13
  mask?: boolean;
14
14
  maskClosable?: boolean;
@@ -1,8 +1,8 @@
1
1
  import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
2
2
  import { getPrefixCls } from "../_utils/global-config.js";
3
3
  import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/asyncToGenerator.js";
4
- import Button from "../button/index.js";
5
4
  import Tooltip from "../tooltip/index.js";
5
+ import Button from "../button/index.js";
6
6
  import IconCopy from "../icon/icon-copy/index.js";
7
7
  import Link from "../link/index.js";
8
8
  import Message from "../message/index.js";