@sdata/web-vue 2.2.1 → 2.3.1

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 (83) hide show
  1. package/es/_components/picker/input-range.vue.d.ts +2 -2
  2. package/es/_utils/date.d.ts +10 -9
  3. package/es/_utils/date.js +23 -7
  4. package/es/anchor/anchor.vue.d.ts +52 -2
  5. package/es/anchor/anchor.vue_vue_type_script_setup_true_lang.js +75 -15
  6. package/es/anchor/index.d.ts +75 -0
  7. package/es/button/button.vue.d.ts +16 -3
  8. package/es/button/button.vue_vue_type_script_setup_true_lang.js +39 -9
  9. package/es/button/index.d.ts +19 -0
  10. package/es/button/interface.d.ts +1 -0
  11. package/es/config-provider/config-provider.vue.d.ts +9 -0
  12. package/es/config-provider/config-provider.vue_vue_type_script_setup_true_lang.js +10 -1
  13. package/es/config-provider/context.d.ts +1 -0
  14. package/es/config-provider/index.d.ts +15 -0
  15. package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +1 -0
  16. package/es/date-picker/hooks/use-cell-class-name.d.ts +1 -0
  17. package/es/date-picker/hooks/use-cell-class-name.js +3 -2
  18. package/es/date-picker/hooks/use-header-value.d.ts +2 -0
  19. package/es/date-picker/hooks/use-header-value.js +23 -19
  20. package/es/date-picker/hooks/use-picker-state.d.ts +2 -0
  21. package/es/date-picker/hooks/use-picker-state.js +3 -3
  22. package/es/date-picker/hooks/use-range-header-value.d.ts +2 -0
  23. package/es/date-picker/hooks/use-range-header-value.js +5 -1
  24. package/es/date-picker/hooks/use-range-picker-state.d.ts +2 -0
  25. package/es/date-picker/hooks/use-range-picker-state.js +3 -3
  26. package/es/date-picker/hooks/use-value-format.d.ts +5 -3
  27. package/es/date-picker/hooks/use-value-format.js +10 -8
  28. package/es/date-picker/index.d.ts +1361 -0
  29. package/es/date-picker/interface.d.ts +7 -0
  30. package/es/date-picker/panels/body.vue.d.ts +24 -6
  31. package/es/date-picker/panels/body.vue_vue_type_script_setup_true_lang.js +13 -12
  32. package/es/date-picker/panels/date/index.vue.d.ts +26 -8
  33. package/es/date-picker/panels/date/index.vue_vue_type_script_setup_true_lang.js +18 -9
  34. package/es/date-picker/panels/header.vue_vue_type_script_setup_true_lang.js +13 -20
  35. package/es/date-picker/panels/month/index.vue.d.ts +13 -8
  36. package/es/date-picker/panels/month/index.vue_vue_type_script_setup_true_lang.js +6 -6
  37. package/es/date-picker/panels/quarter/index.vue.d.ts +13 -8
  38. package/es/date-picker/panels/quarter/index.vue_vue_type_script_setup_true_lang.js +6 -6
  39. package/es/date-picker/panels/shortcuts.vue_vue_type_script_setup_true_lang.js +2 -6
  40. package/es/date-picker/panels/week/index.vue.d.ts +13 -1
  41. package/es/date-picker/panels/week/index.vue_vue_type_script_setup_true_lang.js +5 -2
  42. package/es/date-picker/panels/year/index.vue.d.ts +13 -8
  43. package/es/date-picker/panels/year/index.vue_vue_type_script_setup_true_lang.js +25 -15
  44. package/es/date-picker/picker-panel.vue.d.ts +56 -14
  45. package/es/date-picker/picker-panel.vue_vue_type_script_setup_true_lang.js +36 -19
  46. package/es/date-picker/picker.vue.d.ts +949 -1
  47. package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +91 -29
  48. package/es/date-picker/range-picker-panel.vue.d.ts +77 -15
  49. package/es/date-picker/range-picker-panel.vue_vue_type_script_setup_true_lang.js +52 -28
  50. package/es/date-picker/range-picker.vue.d.ts +1345 -1
  51. package/es/date-picker/range-picker.vue_vue_type_script_setup_true_lang.js +114 -34
  52. package/es/image/preview-toolbar.vue.d.ts +2 -3
  53. package/es/image/preview-toolbar.vue_vue_type_script_setup_true_lang.js +2 -3
  54. package/es/locale/interface.d.ts +2 -0
  55. package/es/locale/lang/ar-eg.js +46 -0
  56. package/es/locale/lang/de-de.js +46 -0
  57. package/es/locale/lang/es-es.js +46 -0
  58. package/es/locale/lang/fr-fr.js +46 -0
  59. package/es/locale/lang/id-id.js +46 -0
  60. package/es/locale/lang/it-it.js +46 -0
  61. package/es/locale/lang/km-kh.js +46 -0
  62. package/es/locale/lang/ko-kr.js +46 -0
  63. package/es/locale/lang/ms-my.js +46 -0
  64. package/es/locale/lang/pt-pt.js +46 -0
  65. package/es/locale/lang/th-th.js +46 -0
  66. package/es/locale/lang/vi-vn.js +46 -0
  67. package/es/mention/mention.js +2 -0
  68. package/es/menu/sub-menu-pop.vue_vue_type_script_setup_true_lang.js +3 -4
  69. package/es/modal/index.d.ts +7 -5
  70. package/es/modal/index.js +47 -11
  71. package/es/modal/interface.d.ts +5 -0
  72. package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +2 -2
  73. package/es/tree/base-node.vue_vue_type_script_setup_true_lang.js +6 -21
  74. package/es/tree/node-switcher.vue.d.ts +0 -11
  75. package/es/tree/node-switcher.vue_vue_type_script_lang.js +1 -5
  76. package/es/trigger/trigger.js +2 -1
  77. package/es/verification-code/verification-code.js +17 -7
  78. package/json/vetur-attributes.json +53 -0
  79. package/json/vetur-tags.json +14 -0
  80. package/json/web-types.json +113 -1
  81. package/package.json +1 -1
  82. package/es/_components/render-function.d.ts +0 -14
  83. package/es/_components/render-function.js +0 -14
@@ -85,15 +85,4 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
85
85
  }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
86
86
  install: (app: import("vue").App, options?: import("../_utils/types.js").SDIconOptions) => void;
87
87
  };
88
- RenderFunction: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
89
- renderFunc: {
90
- type: PropType<import("../_components/render-function").RenderFunc>;
91
- required: true;
92
- };
93
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
94
- renderFunc: {
95
- type: PropType<import("../_components/render-function").RenderFunc>;
96
- required: true;
97
- };
98
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
99
88
  }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,7 +1,6 @@
1
1
  import icon_hover_default from "../_components/icon-hover.js";
2
2
  import IconLoading from "../icon/icon-loading/index.js";
3
3
  import usePickSlots from "../_hooks/use-pick-slots.js";
4
- import render_function_default from "../_components/render-function.js";
5
4
  import useTreeContext from "./hooks/use-tree-context.js";
6
5
  import IconCaretDown from "../icon/icon-caret-down/index.js";
7
6
  import IconFile from "../icon/icon-file/index.js";
@@ -9,10 +8,7 @@ import { defineComponent, h, toRefs } from "vue";
9
8
  //#region components/tree/node-switcher.vue?vue&type=script&lang.tsx
10
9
  var node_switcher_vue_vue_type_script_lang_default = /* @__PURE__ */ defineComponent({
11
10
  name: "TreeNodeSwitcher",
12
- components: {
13
- IconLoading,
14
- RenderFunction: render_function_default
15
- },
11
+ components: { IconLoading },
16
12
  props: {
17
13
  prefixCls: String,
18
14
  loading: Boolean,
@@ -513,6 +513,7 @@ var trigger_default = /* @__PURE__ */ defineComponent({
513
513
  var _firstElement$value, _popupRef$value;
514
514
  if (((_firstElement$value = firstElement.value) === null || _firstElement$value === void 0 ? void 0 : _firstElement$value.contains(e.target)) || ((_popupRef$value = popupRef.value) === null || _popupRef$value === void 0 ? void 0 : _popupRef$value.contains(e.target))) return;
515
515
  for (const item of childrenRefs) {
516
+ if (!item) continue;
516
517
  const element = "value" in item ? item.value : item;
517
518
  if (element === null || element === void 0 ? void 0 : element.contains(e.target)) return;
518
519
  }
@@ -554,7 +555,7 @@ var trigger_default = /* @__PURE__ */ defineComponent({
554
555
  const handlePopupMouseDown = (e) => {
555
556
  if (props.preventFocus) e.preventDefault();
556
557
  };
557
- triggerCtx === null || triggerCtx === void 0 || triggerCtx.addChildRef(popupRef.value);
558
+ if (popupRef.value) triggerCtx === null || triggerCtx === void 0 || triggerCtx.addChildRef(popupRef.value);
558
559
  const triggerCls = computed(() => {
559
560
  return computedVisible.value ? props.openedClass : void 0;
560
561
  });
@@ -1,5 +1,5 @@
1
1
  import { getPrefixCls } from "../_utils/global-config.js";
2
- import { isExist, isFunction, isString } from "../_utils/is.js";
2
+ import { isExist, isFunction, isString, isUndefined } from "../_utils/is.js";
3
3
  import { ArrowLeft, ArrowRight, Backspace } from "../_utils/keycode.js";
4
4
  import Input from "../input/index.js";
5
5
  import { Fragment, computed, createVNode, defineComponent, mergeProps, ref, watch } from "vue";
@@ -121,11 +121,20 @@ var verification_code_default = /* @__PURE__ */ defineComponent({
121
121
  };
122
122
  const handleFocus = (index) => inputRefList === null || inputRefList === void 0 ? void 0 : inputRefList.value[index].focus();
123
123
  const focusFirstEmptyInput = (index) => {
124
- if (isExist(index) && innerValue.value[index]) return;
125
- for (let i = 0; i < innerValue.value.length; i++) if (!innerValue.value[i]) {
126
- handleFocus(i);
127
- break;
128
- }
124
+ const values = innerValue.value;
125
+ const len = values.length;
126
+ if (!isUndefined(index) && values[index]) return;
127
+ const firstEmpty = values.findIndex((v) => !v);
128
+ handleFocus(firstEmpty === -1 ? len - 1 : firstEmpty);
129
+ };
130
+ const handleCursorToEnd = (e, i) => {
131
+ if (!innerValue.value[i]) return;
132
+ const target = e.target;
133
+ if (!(target === null || target === void 0 ? void 0 : target.setSelectionRange)) return;
134
+ e.preventDefault();
135
+ target.focus();
136
+ const end = target.value.length;
137
+ target.setSelectionRange(end, end);
129
138
  };
130
139
  const handlePaste = (e, index) => {
131
140
  e.preventDefault();
@@ -188,7 +197,8 @@ var verification_code_default = /* @__PURE__ */ defineComponent({
188
197
  "onInput": (v, e) => handleInput(i, v, e)
189
198
  }, {
190
199
  onKeydown: (e) => handleKeydown(i, e),
191
- onPaste: (e) => handlePaste(e, i)
200
+ onPaste: (e) => handlePaste(e, i),
201
+ onMousedown: (e) => handleCursorToEnd(e, i)
192
202
  }), null), (_props$separator = props.separator) === null || _props$separator === void 0 ? void 0 : _props$separator.call(props, i, c)]);
193
203
  })]);
194
204
  };
@@ -66,6 +66,28 @@
66
66
  "description": "Whether to show the left axis",
67
67
  "type": "boolean"
68
68
  },
69
+ "sd-anchor/affix": {
70
+ "description": "Whether to wrap anchor within Affix",
71
+ "type": "boolean"
72
+ },
73
+ "sd-anchor/affix-style": {
74
+ "description": "The style to be applied to Affix"
75
+ },
76
+ "sd-anchor/offset-top": {
77
+ "description": "Offset from the top of the viewport",
78
+ "type": "number"
79
+ },
80
+ "sd-anchor/offset-bottom": {
81
+ "description": "Offset from the bottom of the viewport",
82
+ "type": "number"
83
+ },
84
+ "sd-anchor/direction": {
85
+ "description": "Direction"
86
+ },
87
+ "sd-anchor/target-offset": {
88
+ "description": "The offset of the baseline relative to the top of the container. The value is half of the height of the scrolling container if not specified",
89
+ "type": "number"
90
+ },
69
91
  "sd-anchor/scroll-container": {
70
92
  "description": "Scroll container"
71
93
  },
@@ -295,6 +317,10 @@
295
317
  "description": "Whether the button is in the loading state",
296
318
  "type": "boolean"
297
319
  },
320
+ "sd-button/loading-fixed-width": {
321
+ "description": "The width of the button remains unchanged on loading.",
322
+ "type": "boolean"
323
+ },
298
324
  "sd-button/disabled": {
299
325
  "description": "Whether the button is disabled",
300
326
  "type": "boolean"
@@ -599,6 +625,10 @@
599
625
  "description": "Whether to enable clear buttons by default",
600
626
  "type": "boolean"
601
627
  },
628
+ "sd-config-provider/auto-insert-space-in-button": {
629
+ "description": "When there are two Chinese characters in the button, a space is automatically added between two Chinese characters.",
630
+ "type": "boolean"
631
+ },
602
632
  "sd-config-provider/allow-search": {
603
633
  "description": "Whether to enable search by default",
604
634
  "type": "boolean"
@@ -761,6 +791,9 @@
761
791
  "sd-range-picker/time-picker-props": {
762
792
  "description": "Time display parameters, refer to [TimePickerProps](/vue/component/time-picker)"
763
793
  },
794
+ "sd-range-picker/input-props": {
795
+ "description": "Native input attributes"
796
+ },
764
797
  "sd-range-picker/placeholder": {
765
798
  "description": "Prompt copy"
766
799
  },
@@ -778,6 +811,26 @@
778
811
  "description": "Whether the time will be exchanged, by default time will affect and participate in the ordering of start and end values, if you want to fix the time order, you can turn it off.",
779
812
  "type": "boolean"
780
813
  },
814
+ "sd-range-picker/fixed-time": {
815
+ "description": "Is it a fixed time?",
816
+ "type": "boolean"
817
+ },
818
+ "sd-range-picker/clear-range-on-reselect": {
819
+ "description": "When reselecting the range, the previous range will be cleared for next selection",
820
+ "type": "boolean"
821
+ },
822
+ "sd-range-picker/hide-not-in-view-dates": {
823
+ "description": "Hide gray dates that are not in the current time range in the panel",
824
+ "type": "boolean"
825
+ },
826
+ "sd-range-picker/utc-offset": {
827
+ "description": "Set the timezone offset. Set to 0 for UTC time.",
828
+ "type": "number"
829
+ },
830
+ "sd-range-picker/timezone": {
831
+ "description": "Set timezone. If `utcOffset` is set, `utcOffset` takes precedence.",
832
+ "type": "string"
833
+ },
781
834
  "sd-range-picker/disabled-input": {
782
835
  "description": "Whether input is disabled with the keyboard.",
783
836
  "type": "boolean"
@@ -32,6 +32,12 @@
32
32
  "change",
33
33
  "boundary",
34
34
  "line-less",
35
+ "affix",
36
+ "affix-style",
37
+ "offset-top",
38
+ "offset-bottom",
39
+ "direction",
40
+ "target-offset",
35
41
  "scroll-container",
36
42
  "change-hash",
37
43
  "smooth"
@@ -135,6 +141,7 @@
135
141
  "size",
136
142
  "long",
137
143
  "loading",
144
+ "loading-fixed-width",
138
145
  "disabled",
139
146
  "html-type",
140
147
  "autofocus",
@@ -276,6 +283,7 @@
276
283
  "locale",
277
284
  "size",
278
285
  "allow-clear",
286
+ "auto-insert-space-in-button",
279
287
  "allow-search",
280
288
  "virtual-list-props",
281
289
  "global",
@@ -337,11 +345,17 @@
337
345
  "value-format",
338
346
  "show-time",
339
347
  "time-picker-props",
348
+ "input-props",
340
349
  "placeholder",
341
350
  "disabled-date",
342
351
  "disabled-time",
343
352
  "separator",
344
353
  "exchange-time",
354
+ "fixed-time",
355
+ "clear-range-on-reselect",
356
+ "hide-not-in-view-dates",
357
+ "utc-offset",
358
+ "timezone",
345
359
  "disabled-input",
346
360
  "abbreviation"
347
361
  ]
@@ -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": "2.1.1",
5
+ "version": "2.2.1",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
@@ -158,6 +158,54 @@
158
158
  "kind": "expression"
159
159
  }
160
160
  },
161
+ {
162
+ "name": "affix",
163
+ "description": "Whether to wrap anchor within Affix",
164
+ "value": {
165
+ "type": "boolean",
166
+ "kind": "expression"
167
+ }
168
+ },
169
+ {
170
+ "name": "affix-style",
171
+ "description": "The style to be applied to Affix",
172
+ "value": {
173
+ "type": "CSSProperties",
174
+ "kind": "expression"
175
+ }
176
+ },
177
+ {
178
+ "name": "offset-top",
179
+ "description": "Offset from the top of the viewport",
180
+ "value": {
181
+ "type": "number",
182
+ "kind": "expression"
183
+ }
184
+ },
185
+ {
186
+ "name": "offset-bottom",
187
+ "description": "Offset from the bottom of the viewport",
188
+ "value": {
189
+ "type": "number",
190
+ "kind": "expression"
191
+ }
192
+ },
193
+ {
194
+ "name": "direction",
195
+ "description": "Direction",
196
+ "value": {
197
+ "type": "Direction",
198
+ "kind": "expression"
199
+ }
200
+ },
201
+ {
202
+ "name": "target-offset",
203
+ "description": "The offset of the baseline relative to the top of the container. The value is half of the height of the scrolling container if not specified",
204
+ "value": {
205
+ "type": "number",
206
+ "kind": "expression"
207
+ }
208
+ },
161
209
  {
162
210
  "name": "scroll-container",
163
211
  "description": "Scroll container",
@@ -755,6 +803,14 @@
755
803
  "kind": "expression"
756
804
  }
757
805
  },
806
+ {
807
+ "name": "loading-fixed-width",
808
+ "description": "The width of the button remains unchanged on loading.",
809
+ "value": {
810
+ "type": "boolean",
811
+ "kind": "expression"
812
+ }
813
+ },
758
814
  {
759
815
  "name": "disabled",
760
816
  "description": "Whether the button is disabled",
@@ -1579,6 +1635,14 @@
1579
1635
  "kind": "expression"
1580
1636
  }
1581
1637
  },
1638
+ {
1639
+ "name": "auto-insert-space-in-button",
1640
+ "description": "When there are two Chinese characters in the button, a space is automatically added between two Chinese characters.",
1641
+ "value": {
1642
+ "type": "boolean",
1643
+ "kind": "expression"
1644
+ }
1645
+ },
1582
1646
  {
1583
1647
  "name": "allow-search",
1584
1648
  "description": "Whether to enable search by default",
@@ -1909,6 +1973,14 @@
1909
1973
  "kind": "expression"
1910
1974
  }
1911
1975
  },
1976
+ {
1977
+ "name": "input-props",
1978
+ "description": "Native input attributes",
1979
+ "value": {
1980
+ "type": "Record<string, any>[]",
1981
+ "kind": "expression"
1982
+ }
1983
+ },
1912
1984
  {
1913
1985
  "name": "placeholder",
1914
1986
  "description": "Prompt copy",
@@ -1949,6 +2021,46 @@
1949
2021
  "kind": "expression"
1950
2022
  }
1951
2023
  },
2024
+ {
2025
+ "name": "fixed-time",
2026
+ "description": "Is it a fixed time?",
2027
+ "value": {
2028
+ "type": "boolean",
2029
+ "kind": "expression"
2030
+ }
2031
+ },
2032
+ {
2033
+ "name": "clear-range-on-reselect",
2034
+ "description": "When reselecting the range, the previous range will be cleared for next selection",
2035
+ "value": {
2036
+ "type": "boolean",
2037
+ "kind": "expression"
2038
+ }
2039
+ },
2040
+ {
2041
+ "name": "hide-not-in-view-dates",
2042
+ "description": "Hide gray dates that are not in the current time range in the panel",
2043
+ "value": {
2044
+ "type": "boolean",
2045
+ "kind": "expression"
2046
+ }
2047
+ },
2048
+ {
2049
+ "name": "utc-offset",
2050
+ "description": "Set the timezone offset. Set to 0 for UTC time.",
2051
+ "value": {
2052
+ "type": "number",
2053
+ "kind": "expression"
2054
+ }
2055
+ },
2056
+ {
2057
+ "name": "timezone",
2058
+ "description": "Set timezone. If `utcOffset` is set, `utcOffset` takes precedence.",
2059
+ "value": {
2060
+ "type": "string",
2061
+ "kind": "expression"
2062
+ }
2063
+ },
1952
2064
  {
1953
2065
  "name": "disabled-input",
1954
2066
  "description": "Whether input is disabled with the keyboard.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdata/web-vue",
3
- "version": "2.2.1",
3
+ "version": "2.3.1",
4
4
  "description": "SD Design Vue: A Vue.js 3 UI Library",
5
5
  "keywords": [
6
6
  "sd",
@@ -1,14 +0,0 @@
1
- import { PropType, VNodeTypes } from 'vue';
2
- export type RenderFunc = (props: Record<string, unknown>) => VNodeTypes;
3
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
- renderFunc: {
5
- type: PropType<RenderFunc>;
6
- required: true;
7
- };
8
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
- renderFunc: {
10
- type: PropType<RenderFunc>;
11
- required: true;
12
- };
13
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
14
- export default _default;
@@ -1,14 +0,0 @@
1
- import { defineComponent } from "vue";
2
- //#region components/_components/render-function.ts
3
- var render_function_default = defineComponent({
4
- name: "RenderFunction",
5
- props: { renderFunc: {
6
- type: Function,
7
- required: true
8
- } },
9
- render() {
10
- return this.renderFunc(this.$attrs);
11
- }
12
- });
13
- //#endregion
14
- export { render_function_default as default };