vue-devui 1.0.0-rc.10 → 1.0.0-rc.11

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 (94) hide show
  1. package/README.md +149 -149
  2. package/auto-complete/index.es.js +22 -14
  3. package/auto-complete/index.umd.js +8 -8
  4. package/auto-complete/style.css +1 -1
  5. package/badge/index.es.js +5 -1
  6. package/badge/index.umd.js +1 -1
  7. package/badge/style.css +1 -1
  8. package/button/index.es.js +1 -1
  9. package/button/index.umd.js +1 -1
  10. package/button/style.css +1 -1
  11. package/card/index.es.js +5 -1
  12. package/card/index.umd.js +1 -1
  13. package/card/style.css +1 -1
  14. package/checkbox/index.es.js +21 -13
  15. package/checkbox/index.umd.js +7 -7
  16. package/checkbox/style.css +1 -1
  17. package/collapse/index.es.js +1 -1
  18. package/collapse/index.umd.js +1 -1
  19. package/collapse/style.css +1 -1
  20. package/date-picker/index.es.js +22 -14
  21. package/date-picker/index.umd.js +9 -9
  22. package/date-picker/style.css +1 -1
  23. package/editable-select/style.css +1 -1
  24. package/form/index.es.js +21 -13
  25. package/form/index.umd.js +11 -11
  26. package/icon/index.es.js +1 -1
  27. package/icon/index.umd.js +1 -1
  28. package/icon/style.css +1 -1
  29. package/image-preview/style.css +1 -1
  30. package/input/index.es.js +22 -14
  31. package/input/index.umd.js +7 -7
  32. package/input/style.css +1 -1
  33. package/input-number/style.css +1 -1
  34. package/modal/index.es.js +1 -1
  35. package/modal/index.umd.js +1 -1
  36. package/modal/style.css +1 -1
  37. package/notification/index.es.js +1 -1
  38. package/notification/index.umd.js +1 -1
  39. package/notification/style.css +1 -1
  40. package/nuxt/components/TABLE_TOKEN.js +3 -0
  41. package/nuxt/components/TimeSelect.js +3 -0
  42. package/nuxt/components/tableProps.js +3 -0
  43. package/package.json +2 -1
  44. package/pagination/style.css +1 -1
  45. package/panel/style.css +1 -1
  46. package/radio/index.es.js +21 -13
  47. package/radio/index.umd.js +7 -7
  48. package/radio/style.css +1 -1
  49. package/rate/style.css +1 -1
  50. package/result/index.es.js +1 -1
  51. package/result/index.umd.js +1 -1
  52. package/result/style.css +1 -1
  53. package/search/index.es.js +23 -14
  54. package/search/index.umd.js +7 -7
  55. package/search/style.css +1 -1
  56. package/select/index.es.js +45 -18
  57. package/select/index.umd.js +11 -11
  58. package/select/style.css +1 -1
  59. package/slider/index.es.js +116 -143
  60. package/slider/index.umd.js +1 -1
  61. package/slider/style.css +1 -1
  62. package/statistic/index.es.js +34 -16
  63. package/statistic/index.umd.js +1 -1
  64. package/statistic/style.css +1 -1
  65. package/status/style.css +1 -1
  66. package/style.css +1 -1
  67. package/switch/index.es.js +21 -13
  68. package/switch/index.umd.js +9 -9
  69. package/switch/style.css +1 -1
  70. package/table/index.es.js +212 -177
  71. package/table/index.umd.js +15 -15
  72. package/table/style.css +1 -1
  73. package/tabs/index.es.js +3 -1
  74. package/tabs/index.umd.js +1 -1
  75. package/tabs/style.css +1 -1
  76. package/textarea/index.es.js +21 -13
  77. package/textarea/index.umd.js +9 -9
  78. package/textarea/style.css +1 -1
  79. package/time-select/index.d.ts +7 -0
  80. package/time-select/index.es.js +9460 -0
  81. package/time-select/index.umd.js +27 -0
  82. package/time-select/package.json +7 -0
  83. package/time-select/style.css +1 -0
  84. package/timeline/index.es.js +1 -1
  85. package/timeline/index.umd.js +1 -1
  86. package/timeline/style.css +1 -1
  87. package/tree/index.es.js +1073 -63
  88. package/tree/index.umd.js +17 -17
  89. package/tree/style.css +1 -1
  90. package/upload/index.es.js +49 -11
  91. package/upload/index.umd.js +1 -1
  92. package/upload/style.css +1 -1
  93. package/vue-devui.es.js +1756 -493
  94. package/vue-devui.umd.js +21 -21
@@ -7516,6 +7516,16 @@ Schema.register = function register(type4, validator) {
7516
7516
  Schema.warning = warning;
7517
7517
  Schema.messages = messages;
7518
7518
  Schema.validators = validators;
7519
+ function getFieldValue(obj, path) {
7520
+ return {
7521
+ get value() {
7522
+ return lodash.exports.get(obj, path);
7523
+ },
7524
+ set value(val) {
7525
+ lodash.exports.set(obj, path, val);
7526
+ }
7527
+ };
7528
+ }
7519
7529
  function useFormItem(messageType, _rules, validateState) {
7520
7530
  const formContext = inject(FORM_TOKEN);
7521
7531
  const ns2 = useNamespace("form");
@@ -7554,17 +7564,12 @@ function useFormItemValidate(props, _rules) {
7554
7564
  const computedField = computed(() => {
7555
7565
  return typeof props.field === "string" ? props.field : "";
7556
7566
  });
7557
- const fieldValue = computed({
7558
- get: () => {
7559
- const formData = formContext.data;
7560
- if (!formData || !props.field) {
7561
- return;
7562
- }
7563
- return formData[props.field];
7564
- },
7565
- set: (val) => {
7566
- formContext.data[props.field] = val;
7567
+ const fieldValue = computed(() => {
7568
+ const formData = formContext.data;
7569
+ if (!formData || !props.field) {
7570
+ return;
7567
7571
  }
7572
+ return getFieldValue(formData, props.field).value;
7568
7573
  });
7569
7574
  const getRuleByTrigger = (triggerVal) => {
7570
7575
  return _rules.value.filter((rule) => {
@@ -7633,13 +7638,16 @@ function useFormItemValidate(props, _rules) {
7633
7638
  if (!formContext.data || !props.field) {
7634
7639
  return;
7635
7640
  }
7636
- isResetting = true;
7637
- fieldValue.value = initFieldValue;
7641
+ const currentValue = getFieldValue(formContext.data, props.field);
7642
+ if (!lodash.exports.isEqual(currentValue.value, initFieldValue)) {
7643
+ isResetting = true;
7644
+ }
7645
+ currentValue.value = initFieldValue;
7638
7646
  await nextTick();
7639
7647
  clearValidate();
7640
7648
  };
7641
7649
  onMounted(() => {
7642
- initFieldValue = lodash.exports.cloneDeep(formContext.data[props.field]);
7650
+ initFieldValue = lodash.exports.clone(fieldValue.value);
7643
7651
  });
7644
7652
  return { validateState, validateMessage, validate, resetField, clearValidate };
7645
7653
  }