@wix/editor-react-components 1.2354.0 → 1.2356.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.
@@ -65,13 +65,19 @@ const defaultValues = {
65
65
  readOnly: false,
66
66
  disabled: false
67
67
  };
68
+ const VALIDATION_MESSAGES = {
69
+ valueMissing: "This field is required",
70
+ tooShort: (minLength) => `Please use at least ${minLength} characters`,
71
+ tooLong: (maxLength) => `Please use no more than ${maxLength} characters`
72
+ };
68
73
  const TestIds = {
69
74
  root: "textbox-root",
70
75
  input: "textbox-input",
71
76
  label: "textbox-label",
72
77
  requiredIndicator: "textbox-required-indicator",
73
78
  tooltipButton: "textbox-tooltip-button",
74
- description: "textbox-description"
79
+ description: "textbox-description",
80
+ errorMessage: "textbox-error-message"
75
81
  };
76
82
  const selectors = {
77
83
  root: "textbox",
@@ -83,11 +89,13 @@ const semanticClassNames = {
83
89
  input: "textbox__input",
84
90
  label: "textbox__label",
85
91
  requiredIndicator: "textbox__required-indicator",
86
- description: "textbox__description"
92
+ description: "textbox__description",
93
+ errorMessage: "textbox__error-message"
87
94
  };
88
95
  export {
89
96
  DesignStates as D,
90
97
  TestIds as T,
98
+ VALIDATION_MESSAGES as V,
91
99
  semanticClassNames as a,
92
100
  DisplayNames as b,
93
101
  defaultValues as d,
@@ -48,8 +48,17 @@ function manifestValidation({
48
48
  parameters: [
49
49
  { dataType: valueDataType },
50
50
  // value
51
- { dataType: DATA.DATA_TYPE.text }
52
- // cause: 'mount' | 'change' | 'blur'
51
+ {
52
+ // cause: 'mount' | 'change' | 'blur'
53
+ dataType: DATA.DATA_TYPE.textEnum,
54
+ [DATA.DATA_TYPE.textEnum]: {
55
+ options: [
56
+ { value: "mount" },
57
+ { value: "change" },
58
+ { value: "blur" }
59
+ ]
60
+ }
61
+ }
53
62
  ]
54
63
  }
55
64
  },