@varlet/ui 3.7.4 → 3.8.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 (41) hide show
  1. package/es/action-sheet/style/index.mjs +1 -1
  2. package/es/checkbox/Checkbox.mjs +11 -13
  3. package/es/checkbox/checkbox.css +1 -1
  4. package/es/checkbox-group/CheckboxGroup.mjs +0 -5
  5. package/es/index.bundle.mjs +1 -1
  6. package/es/index.mjs +1 -1
  7. package/es/menu/Menu.mjs +5 -0
  8. package/es/menu/menu.css +1 -1
  9. package/es/menu/props.mjs +4 -1
  10. package/es/menu/usePopover.mjs +11 -0
  11. package/es/menu-option/MenuOption.mjs +104 -21
  12. package/es/menu-option/menuOption.css +1 -1
  13. package/es/menu-option/props.mjs +7 -2
  14. package/es/menu-option/style/index.mjs +1 -0
  15. package/es/menu-select/MenuChildren.mjs +237 -0
  16. package/es/menu-select/MenuSelect.mjs +200 -20
  17. package/es/menu-select/menuSelect.css +1 -1
  18. package/es/menu-select/props.mjs +6 -1
  19. package/es/option/Option.mjs +9 -5
  20. package/es/option/props.mjs +4 -0
  21. package/es/radio/Radio.mjs +2 -5
  22. package/es/radio/radio.css +1 -1
  23. package/es/select/Select.mjs +3 -2
  24. package/es/select/useSelectController.mjs +12 -5
  25. package/es/snackbar/style/index.mjs +1 -1
  26. package/es/style.css +1 -1
  27. package/es/uploader/Uploader.mjs +17 -11
  28. package/es/utils/elements.mjs +14 -1
  29. package/es/varlet.esm.js +7264 -6858
  30. package/highlight/web-types.en-US.json +27 -1
  31. package/highlight/web-types.zh-CN.json +27 -1
  32. package/lib/style.css +1 -1
  33. package/lib/varlet.cjs.js +1149 -610
  34. package/package.json +7 -7
  35. package/types/checkbox.d.ts +1 -1
  36. package/types/checkboxGroup.d.ts +2 -2
  37. package/types/menuSelect.d.ts +9 -1
  38. package/types/radioGroup.d.ts +2 -2
  39. package/types/select.d.ts +1 -1
  40. package/types/uploader.d.ts +1 -0
  41. package/umd/varlet.js +8 -8
@@ -5,7 +5,8 @@ function useSelectController(options) {
5
5
  multiple: multipleGetter,
6
6
  modelValue: modelValueGetter,
7
7
  optionProviders: optionProvidersGetter,
8
- optionProvidersLength: optionProvidersLengthGetter
8
+ optionProvidersLength: optionProvidersLengthGetter,
9
+ optionIsIndeterminate
9
10
  } = options;
10
11
  const label = ref("");
11
12
  const labels = ref([]);
@@ -33,29 +34,35 @@ function useSelectController(options) {
33
34
  }
34
35
  return (_a = option == null ? void 0 : option.label.value) != null ? _a : "";
35
36
  }
36
- function findValueOrLabel({ value, label: label2 }) {
37
+ function getOptionProviderKey({ value, label: label2 }) {
37
38
  var _a;
38
39
  return (_a = value.value) != null ? _a : label2.value;
39
40
  }
40
41
  function getSelectedValue(option) {
41
42
  const multiple = multipleGetter();
42
43
  const options2 = optionProvidersGetter();
43
- return multiple ? options2.filter(({ selected }) => selected.value).map(findValueOrLabel) : findValueOrLabel(option);
44
+ return multiple ? options2.filter(({ selected }) => selected.value).map(getOptionProviderKey) : getOptionProviderKey(option);
44
45
  }
45
46
  function syncOptions() {
46
47
  const multiple = multipleGetter();
47
48
  const modelValue = modelValueGetter();
48
49
  const options2 = optionProvidersGetter();
49
50
  if (multiple) {
50
- options2.forEach((option) => option.sync(modelValue.includes(findValueOrLabel(option))));
51
+ options2.forEach(
52
+ (option) => option.sync(
53
+ modelValue.includes(getOptionProviderKey(option)),
54
+ optionIsIndeterminate ? optionIsIndeterminate(option) : void 0
55
+ )
56
+ );
51
57
  } else {
52
- options2.forEach((option) => option.sync(modelValue === findValueOrLabel(option)));
58
+ options2.forEach((option) => option.sync(modelValue === getOptionProviderKey(option)));
53
59
  }
54
60
  computeLabel();
55
61
  }
56
62
  return {
57
63
  label,
58
64
  labels,
65
+ getOptionProviderKey,
59
66
  computeLabel,
60
67
  getSelectedValue
61
68
  };
@@ -1,7 +1,7 @@
1
1
  import '../../styles/common.css'
2
+ import '../SnackbarSfc.css'
2
3
  import '../../styles/elevation.css'
3
4
  import '../../loading/loading.css'
4
5
  import '../../icon/icon.css'
5
6
  import '../snackbar.css'
6
7
  import '../coreSfc.css'
7
- import '../SnackbarSfc.css'