@sdata/web-vue 1.7.1 → 1.9.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 (155) hide show
  1. package/dist/sd.css +182 -1
  2. package/dist/sd.min.css +1 -1
  3. package/es/_components/input-label/input-label.js +30 -24
  4. package/es/_components/select-view/interface.d.ts +1 -0
  5. package/es/_components/select-view/select-view.d.ts +12 -3
  6. package/es/_components/select-view/select-view.js +38 -28
  7. package/es/_components/select-view/style/index.css +45 -0
  8. package/es/_hooks/use-allow-clear.d.ts +4 -0
  9. package/es/_hooks/use-allow-clear.js +20 -0
  10. package/es/_hooks/use-trigger.d.ts +4 -6
  11. package/es/_hooks/use-trigger.js +7 -5
  12. package/es/_utils/color.js +1 -18
  13. package/es/auto-complete/auto-complete.d.ts +1 -1
  14. package/es/auto-complete/auto-complete.js +4 -2
  15. package/es/auto-complete/index.d.ts +3 -3
  16. package/es/badge/badge.d.ts +1 -1
  17. package/es/badge/index.d.ts +3 -3
  18. package/es/carousel/carousel-arrow.vue.d.ts +1 -1
  19. package/es/carousel/carousel.d.ts +2 -2
  20. package/es/carousel/index.d.ts +6 -6
  21. package/es/cascader/cascader-panel.vue.d.ts +2 -2
  22. package/es/cascader/cascader.js +1 -1
  23. package/es/cascader/cascader.vue.d.ts +21 -11
  24. package/es/cascader/cascader.vue_vue_type_script_lang.js +4 -1
  25. package/es/cascader/index.d.ts +47 -26
  26. package/es/color-picker/color-picker.d.ts +115 -40
  27. package/es/color-picker/color-picker.js +146 -102
  28. package/es/color-picker/index.d.ts +217 -69
  29. package/es/color-picker/interface.d.ts +41 -0
  30. package/es/color-picker/palette.js +1 -1
  31. package/es/color-picker/panel.d.ts +73 -34
  32. package/es/color-picker/panel.js +423 -89
  33. package/es/color-picker/style/index.css +92 -1
  34. package/es/color-picker/style/index.scss +107 -1
  35. package/es/color-picker/utils.d.ts +89 -0
  36. package/es/color-picker/utils.js +456 -0
  37. package/es/config-provider/config-provider.vue.d.ts +10 -1
  38. package/es/config-provider/config-provider.vue_vue_type_script_lang.js +6 -1
  39. package/es/config-provider/context.d.ts +1 -0
  40. package/es/config-provider/index.d.ts +18 -3
  41. package/es/date-picker/index.d.ts +7 -6
  42. package/es/date-picker/picker.js +1 -1
  43. package/es/date-picker/picker.vue.d.ts +7 -6
  44. package/es/date-picker/picker.vue_vue_type_script_lang.js +4 -1
  45. package/es/date-picker/range-picker.js +1 -1
  46. package/es/date-picker/range-picker.vue.d.ts +7 -6
  47. package/es/date-picker/range-picker.vue_vue_type_script_lang.js +4 -1
  48. package/es/descriptions/descriptions.d.ts +2 -2
  49. package/es/descriptions/index.d.ts +6 -6
  50. package/es/drawer/drawer.vue_vue_type_script_lang.js +1 -1
  51. package/es/dropdown/dropdown-button.vue.d.ts +8 -8
  52. package/es/dropdown/dropdown-panel.vue.d.ts +2 -2
  53. package/es/dropdown/dropdown-submenu.vue.d.ts +8 -8
  54. package/es/dropdown/dropdown.vue.d.ts +8 -8
  55. package/es/dropdown/index.d.ts +32 -32
  56. package/es/ellipsis/ellipsis.vue.d.ts +13 -13
  57. package/es/ellipsis/ellipsis.vue_vue_type_script_lang.js +1 -1
  58. package/es/ellipsis/index.d.ts +56 -56
  59. package/es/ellipsis/performant-ellipsis.vue.d.ts +14 -14
  60. package/es/form/form-item-label.vue.d.ts +12 -12
  61. package/es/form/form-item.vue.d.ts +12 -12
  62. package/es/form/index.d.ts +12 -12
  63. package/es/grid/grid.vue.d.ts +1 -1
  64. package/es/grid/index.d.ts +3 -3
  65. package/es/image/image.vue.d.ts +12 -12
  66. package/es/image/preview-action.d.ts +12 -12
  67. package/es/image/preview-group.vue.d.ts +12 -12
  68. package/es/image/preview-toolbar.vue.d.ts +12 -12
  69. package/es/image/preview.vue.d.ts +12 -12
  70. package/es/index.css +182 -1
  71. package/es/index.js +2 -2
  72. package/es/input/input.js +4 -2
  73. package/es/input-number/input-number.js +4 -2
  74. package/es/input-tag/index.d.ts +6 -6
  75. package/es/input-tag/input-tag.d.ts +3 -3
  76. package/es/input-tag/input-tag.js +183 -32
  77. package/es/input-tag/style/index.css +45 -0
  78. package/es/input-tag/style/input-tag.scss +53 -0
  79. package/es/list/index.d.ts +3 -3
  80. package/es/list/list.d.ts +1 -1
  81. package/es/mention/mention.js +4 -2
  82. package/es/menu/sub-menu-pop.vue.d.ts +6 -6
  83. package/es/modal/modal.vue_vue_type_script_lang.js +1 -1
  84. package/es/overflow-list/index.d.ts +3 -3
  85. package/es/overflow-list/overflow-list.d.ts +1 -1
  86. package/es/pagination/page-options.vue.d.ts +188 -98
  87. package/es/popconfirm/index.d.ts +12 -12
  88. package/es/popconfirm/popconfirm.vue.d.ts +6 -6
  89. package/es/popover/index.d.ts +12 -12
  90. package/es/popover/popover.vue.d.ts +6 -6
  91. package/es/progress/index.d.ts +5 -5
  92. package/es/progress/line.vue.d.ts +1 -1
  93. package/es/progress/progress.vue.d.ts +2 -2
  94. package/es/rate/rate.js +4 -2
  95. package/es/scrollbar/index.d.ts +2 -2
  96. package/es/scrollbar/scrollbar.vue.d.ts +1 -1
  97. package/es/scrollbar/thumb.vue.d.ts +1 -1
  98. package/es/sd-vue.js +2 -2
  99. package/es/select/hooks/use-options.d.ts +9 -4
  100. package/es/select/hooks/use-options.js +2 -2
  101. package/es/select/hooks/use-select.d.ts +9 -4
  102. package/es/select/index.d.ts +188 -98
  103. package/es/select/interface.d.ts +57 -46
  104. package/es/select/select-dropdown.vue.d.ts +2 -2
  105. package/es/select/select.d.ts +107 -59
  106. package/es/select/select.js +182 -126
  107. package/es/select/utils.d.ts +1 -1
  108. package/es/select/utils.js +28 -10
  109. package/es/skeleton/index.d.ts +1 -1
  110. package/es/skeleton/line.vue.d.ts +1 -1
  111. package/es/slider/index.d.ts +27 -27
  112. package/es/slider/slider-button.vue.d.ts +12 -12
  113. package/es/slider/slider.vue.d.ts +13 -13
  114. package/es/space/index.d.ts +3 -3
  115. package/es/space/space.d.ts +1 -1
  116. package/es/statistic/index.d.ts +6 -6
  117. package/es/statistic/statistic.vue.d.ts +2 -2
  118. package/es/table/index.d.ts +6 -6
  119. package/es/table/table.d.ts +2 -2
  120. package/es/tabs/index.d.ts +9 -9
  121. package/es/tabs/tabs.d.ts +3 -3
  122. package/es/tag/index.d.ts +3 -3
  123. package/es/tag/tag.vue.d.ts +1 -1
  124. package/es/textarea/index.d.ts +3 -3
  125. package/es/textarea/textarea.vue.d.ts +1 -1
  126. package/es/textarea/textarea.vue_vue_type_script_lang.js +6 -2
  127. package/es/time-picker/index.d.ts +15 -12
  128. package/es/time-picker/time-picker.js +1 -1
  129. package/es/time-picker/time-picker.vue.d.ts +7 -6
  130. package/es/time-picker/time-picker.vue_vue_type_script_lang.js +4 -1
  131. package/es/tooltip/index.d.ts +12 -12
  132. package/es/tooltip/tooltip.vue.d.ts +6 -6
  133. package/es/transfer/index.d.ts +10 -10
  134. package/es/transfer/transfer-view.vue.d.ts +5 -5
  135. package/es/transfer/transfer.vue.d.ts +5 -5
  136. package/es/tree/index.d.ts +6 -6
  137. package/es/tree/tree.vue.d.ts +2 -2
  138. package/es/tree-select/hooks/use-selected-state.d.ts +2 -0
  139. package/es/tree-select/hooks/use-selected-state.js +26 -8
  140. package/es/tree-select/index.d.ts +268 -61
  141. package/es/tree-select/interface.d.ts +16 -3
  142. package/es/tree-select/panel.d.ts +6 -6
  143. package/es/tree-select/tree-select.js +29 -16
  144. package/es/tree-select/tree-select.vue.d.ts +144 -30
  145. package/es/tree-select/tree-select.vue_vue_type_script_lang.js +102 -22
  146. package/es/trigger/index.d.ts +6 -6
  147. package/es/trigger/trigger.d.ts +2 -2
  148. package/es/typography/operations.vue.d.ts +12 -12
  149. package/json/vetur-attributes.json +82 -178
  150. package/json/vetur-tags.json +24 -52
  151. package/json/web-types.json +164 -387
  152. package/package.json +9 -7
  153. package/es/color-picker/input-alpha.js +0 -32
  154. package/es/color-picker/input-hex.js +0 -73
  155. package/es/color-picker/input-rgb.js +0 -55
@@ -22,7 +22,18 @@ function getKeys(value) {
22
22
  }
23
23
  function useSelectedState(props) {
24
24
  var _defaultValue$value;
25
- const { defaultValue, modelValue, key2TreeNode, multiple, treeCheckable, fallbackOption, fieldNames } = toRefs(props);
25
+ const { defaultValue, modelValue, key2TreeNode, multiple, treeCheckable, fallbackOption, fieldNames, showPath, separator } = toRefs(props);
26
+ function getPathLabel(key, node) {
27
+ var _fieldNames$value, _separator$value;
28
+ if (!(showPath === null || showPath === void 0 ? void 0 : showPath.value) || !node) return;
29
+ const nodeDataTitle = (fieldNames === null || fieldNames === void 0 || (_fieldNames$value = fieldNames.value) === null || _fieldNames$value === void 0 ? void 0 : _fieldNames$value.title) || "title";
30
+ return [...node.pathParentKeys, key].map((pathKey) => key2TreeNode.value.get(pathKey)).filter((pathNode) => Boolean(pathNode)).map((pathNode) => {
31
+ const pathLabel = pathNode.treeNodeData[nodeDataTitle];
32
+ if (typeof pathLabel === "string" || typeof pathLabel === "number") return String(pathLabel);
33
+ if (typeof pathNode.title === "string" || typeof pathNode.title === "number") return String(pathNode.title);
34
+ return String(pathNode.key);
35
+ }).join((_separator$value = separator === null || separator === void 0 ? void 0 : separator.value) !== null && _separator$value !== void 0 ? _separator$value : " / ");
36
+ }
26
37
  function normalizeValue(value) {
27
38
  const validValue = (isArray(value) ? value : [value]).filter(isValidValue);
28
39
  return (multiple === null || multiple === void 0 ? void 0 : multiple.value) || (treeCheckable === null || treeCheckable === void 0 ? void 0 : treeCheckable.value) ? validValue : validValue.slice(0, 1);
@@ -36,12 +47,12 @@ function useSelectedState(props) {
36
47
  originValueMap.set(item.value, item);
37
48
  });
38
49
  validValue.forEach((item) => {
39
- var _fieldNames$value, _ref, _ref2, _ref3, _getLabel;
50
+ var _fieldNames$value2, _ref, _ref2, _ref3, _ref4, _getLabel;
40
51
  const key = getKey(item);
41
52
  const originValueItem = originValueMap.get(key);
42
53
  const node = key2TreeNode.value.get(key);
43
54
  let fallbackNodeData = null;
44
- const nodeDataTitle = (fieldNames === null || fieldNames === void 0 || (_fieldNames$value = fieldNames.value) === null || _fieldNames$value === void 0 ? void 0 : _fieldNames$value.title) || "title";
55
+ const nodeDataTitle = (fieldNames === null || fieldNames === void 0 || (_fieldNames$value2 = fieldNames.value) === null || _fieldNames$value2 === void 0 ? void 0 : _fieldNames$value2.title) || "title";
45
56
  if (!node) {
46
57
  const fallbackResult = isFunction(fallbackOption === null || fallbackOption === void 0 ? void 0 : fallbackOption.value) ? fallbackOption === null || fallbackOption === void 0 ? void 0 : fallbackOption.value(key) : fallbackOption === null || fallbackOption === void 0 ? void 0 : fallbackOption.value;
47
58
  if (fallbackResult === false) return;
@@ -49,7 +60,7 @@ function useSelectedState(props) {
49
60
  }
50
61
  res.push(_objectSpread2(_objectSpread2(_objectSpread2({}, isLabelValue(item) ? item : {}), originValueItem), {}, {
51
62
  value: key,
52
- label: (_ref = (_ref2 = (_ref3 = (_getLabel = getLabel(item)) !== null && _getLabel !== void 0 ? _getLabel : node === null || node === void 0 ? void 0 : node.title) !== null && _ref3 !== void 0 ? _ref3 : originValueItem === null || originValueItem === void 0 ? void 0 : originValueItem.label) !== null && _ref2 !== void 0 ? _ref2 : fallbackNodeData === null || fallbackNodeData === void 0 ? void 0 : fallbackNodeData[nodeDataTitle]) !== null && _ref !== void 0 ? _ref : key
63
+ label: (_ref = (_ref2 = (_ref3 = (_ref4 = (_getLabel = getLabel(item)) !== null && _getLabel !== void 0 ? _getLabel : getPathLabel(key, node)) !== null && _ref4 !== void 0 ? _ref4 : node === null || node === void 0 ? void 0 : node.title) !== null && _ref3 !== void 0 ? _ref3 : originValueItem === null || originValueItem === void 0 ? void 0 : originValueItem.label) !== null && _ref2 !== void 0 ? _ref2 : fallbackNodeData === null || fallbackNodeData === void 0 ? void 0 : fallbackNodeData[nodeDataTitle]) !== null && _ref !== void 0 ? _ref : key
53
64
  }));
54
65
  });
55
66
  }
@@ -67,11 +78,18 @@ function useSelectedState(props) {
67
78
  });
68
79
  const normalizeDefaultValue = normalizeValue((_defaultValue$value = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) !== null && _defaultValue$value !== void 0 ? _defaultValue$value : []);
69
80
  const defaultKeys = getKeys(normalizeDefaultValue);
70
- const defaultLabelValues = getLabelValues(defaultKeys, getLabelValues(normalizeDefaultValue));
81
+ const defaultLabelValues = computed(() => getLabelValues(defaultKeys, getLabelValues(normalizeDefaultValue)));
71
82
  const localValueKeys = ref(defaultKeys || []);
72
- const localValue = ref(defaultLabelValues);
73
- watch(localValueKeys, () => {
74
- localValue.value = getLabelValues(localValueKeys.value, defaultLabelValues);
83
+ const localValue = ref(defaultLabelValues.value);
84
+ watch([
85
+ localValueKeys,
86
+ key2TreeNode,
87
+ fieldNames,
88
+ showPath,
89
+ separator,
90
+ defaultLabelValues
91
+ ], () => {
92
+ localValue.value = getLabelValues(localValueKeys.value, defaultLabelValues.value);
75
93
  });
76
94
  watch([computedModelValueKeys, computedModelValue], ([valueKeys, value]) => {
77
95
  localValueKeys.value = valueKeys || [];