@wix/editor-react-components 1.2764.0 → 1.2765.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 (100) hide show
  1. package/dist/site/components/AccordionComponent/manifest.js +1 -1
  2. package/dist/site/components/AudioPlayer/component.js +4 -3
  3. package/dist/site/components/AudioPlayer/manifest.js +1 -1
  4. package/dist/site/components/BoxContainer/component.js +2 -2
  5. package/dist/site/components/Breadcrumbs/component.js +3 -3
  6. package/dist/site/components/Breadcrumbs/manifest.js +1 -1
  7. package/dist/site/components/Button/component.js +1 -1
  8. package/dist/site/components/Button/manifest.js +1 -1
  9. package/dist/site/components/Checkbox/component.js +2 -2
  10. package/dist/site/components/CheckboxGroup/component.js +2 -2
  11. package/dist/site/components/CollapsibleText/component.js +2 -2
  12. package/dist/site/components/CollapsibleText/manifest.js +1 -1
  13. package/dist/site/components/DatePicker/component.js +6 -4
  14. package/dist/site/components/Dropdown/component.js +1 -1
  15. package/dist/site/components/Dropdown/manifest.js +1 -1
  16. package/dist/site/components/GoogleMap/manifest.js +1 -1
  17. package/dist/site/components/HTMLComponent/manifest.js +1 -1
  18. package/dist/site/components/HeadingTextBlock/component.js +2 -2
  19. package/dist/site/components/HipaaIcon/component.js +1 -1
  20. package/dist/site/components/Image3/component.js +1 -1
  21. package/dist/site/components/ImageReveal/component.js +2 -2
  22. package/dist/site/components/LegacyAppWidget/component.js +1 -1
  23. package/dist/site/components/LegacyContainer/component.js +1 -1
  24. package/dist/site/components/LegacyMultiStateBox/component.js +2 -2
  25. package/dist/site/components/Line/component.js +1 -1
  26. package/dist/site/components/LinkBar/manifest.js +1 -1
  27. package/dist/site/components/Lottie/component.js +1 -1
  28. package/dist/site/components/Lottie/manifest.js +1 -1
  29. package/dist/site/components/MarkdownBlock/component.js +1 -1
  30. package/dist/site/components/Menu/component.js +3 -3
  31. package/dist/site/components/Menu/manifest.js +1 -1
  32. package/dist/site/components/MultiStateBox/manifest.js +1 -1
  33. package/dist/site/components/RadioButtons/component.js +2 -2
  34. package/dist/site/components/ShareButtons/component.js +1 -1
  35. package/dist/site/components/ShareButtons/manifest.js +1 -1
  36. package/dist/site/components/Slideshow/component.js +1 -1
  37. package/dist/site/components/Slideshow/manifest.js +1 -1
  38. package/dist/site/components/Tabs/manifest.js +1 -1
  39. package/dist/site/components/TestComp/manifest.js +1 -1
  40. package/dist/site/components/TextBox/component.js +1 -1
  41. package/dist/site/components/TextEffects3d/component.js +1 -1
  42. package/dist/site/components/TextEffectsBauhaus/component.js +1 -1
  43. package/dist/site/components/TextEffectsGlass/component.js +1 -1
  44. package/dist/site/components/TextEffectsGlitch/component.js +1 -1
  45. package/dist/site/components/TextEffectsLetterPress/component.js +1 -1
  46. package/dist/site/components/TextEffectsMatrix/component.js +1 -1
  47. package/dist/site/components/TextEffectsNeonSign/component.js +1 -1
  48. package/dist/site/components/TextEffectsNoisy/component.js +1 -1
  49. package/dist/site/components/TextEffectsOutlineOut/component.js +1 -1
  50. package/dist/site/components/TextEffectsRetro/component.js +1 -1
  51. package/dist/site/components/TextEffectsShook/component.js +1 -1
  52. package/dist/site/components/TextEffectsSticker/component.js +1 -1
  53. package/dist/site/components/TextEffectsStriped/component.js +1 -1
  54. package/dist/site/components/TextInput/TextInput.d.ts +3 -7
  55. package/dist/site/components/TextInput/TextInput.types.d.ts +38 -105
  56. package/dist/site/components/TextInput/component.js +104 -780
  57. package/dist/site/components/TextInput/component.preview.d.ts +1 -4
  58. package/dist/site/components/TextInput/constants.d.ts +17 -65
  59. package/dist/site/components/TextInput/css.css +25 -223
  60. package/dist/site/components/TextInput/manifest.js +181 -367
  61. package/dist/site/components/TimePicker/component.js +6 -5
  62. package/dist/site/components/chunks/AnimatedIcon.js +1 -1
  63. package/dist/site/components/chunks/Button.js +1055 -466
  64. package/dist/site/components/chunks/Button2.js +486 -0
  65. package/dist/site/components/chunks/Group.js +46 -970
  66. package/dist/site/components/chunks/I18nProvider.js +125 -0
  67. package/dist/site/components/chunks/Input.js +369 -0
  68. package/dist/site/components/chunks/Link.js +1 -1
  69. package/dist/site/components/chunks/ResponsiveBox.js +1 -1
  70. package/dist/site/components/chunks/ResponsiveContainer.js +1 -1
  71. package/dist/site/components/chunks/TextEffectsShared.js +1 -1
  72. package/dist/site/components/chunks/Tooltip.js +6745 -351
  73. package/dist/site/components/chunks/VisuallyHidden.js +1 -1
  74. package/dist/site/components/chunks/a11y.js +4 -5
  75. package/dist/site/components/chunks/constants3.js +23 -63
  76. package/dist/site/components/chunks/filterDOMProps.js +18 -139
  77. package/dist/site/components/chunks/index10.js +3 -2020
  78. package/dist/site/components/chunks/index11.js +31184 -232
  79. package/dist/site/components/chunks/index12.js +3 -31191
  80. package/dist/site/components/chunks/index13.js +44 -3
  81. package/dist/site/components/chunks/index3.js +1 -1
  82. package/dist/site/components/chunks/index4.js +1 -1
  83. package/dist/site/components/chunks/index5.js +1 -1
  84. package/dist/site/components/chunks/index7.js +67 -3
  85. package/dist/site/components/chunks/index8.js +2020 -3
  86. package/dist/site/components/chunks/index9.js +232 -60
  87. package/dist/site/components/chunks/manifestSdkMixins.js +4 -4
  88. package/dist/site/components/chunks/parseHtml.js +1 -1
  89. package/dist/site/components/chunks/parseSvg.js +1 -1
  90. package/dist/site/components/chunks/staticService.js +1 -1
  91. package/dist/site/components/chunks/useConsentPolicyProps.js +1 -1
  92. package/dist/site/components/chunks/useLocalizedStringFormatter.js +1 -1
  93. package/package.json +2 -2
  94. package/dist/site/components/TextInput/TextInput.viewer.constants.d.ts +0 -24
  95. package/dist/site/components/TextInput/sdk.d.ts +0 -4
  96. package/dist/site/components/TextInput/sdk.js +0 -91
  97. package/dist/site/components/TextInput/utils.d.ts +0 -9
  98. package/dist/site/components/chunks/DateField.js +0 -6762
  99. package/dist/site/components/chunks/NumberFormatter.js +0 -140
  100. package/dist/site/components/chunks/index14.js +0 -46
@@ -1,69 +1,241 @@
1
- import { g as getDefaultExportFromCjs } from "./_commonjsHelpers.js";
2
- var classnames = { exports: {} };
3
- /*!
4
- Copyright (c) 2018 Jed Watson.
5
- Licensed under the MIT License (MIT), see
6
- http://jedwatson.github.io/classnames
7
- */
8
- var hasRequiredClassnames;
9
- function requireClassnames() {
10
- if (hasRequiredClassnames) return classnames.exports;
11
- hasRequiredClassnames = 1;
12
- (function(module) {
13
- (function() {
14
- var hasOwn = {}.hasOwnProperty;
15
- function classNames() {
16
- var classes = "";
17
- for (var i = 0; i < arguments.length; i++) {
18
- var arg = arguments[i];
19
- if (arg) {
20
- classes = appendClass(classes, parseValue(arg));
21
- }
22
- }
23
- return classes;
1
+ var cjs$2 = {};
2
+ var cjs$1;
3
+ var hasRequiredCjs$2;
4
+ function requireCjs$2() {
5
+ if (hasRequiredCjs$2) return cjs$1;
6
+ hasRequiredCjs$2 = 1;
7
+ var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
8
+ var NEWLINE_REGEX = /\n/g;
9
+ var WHITESPACE_REGEX = /^\s*/;
10
+ var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
11
+ var COLON_REGEX = /^:\s*/;
12
+ var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
13
+ var SEMICOLON_REGEX = /^[;\s]*/;
14
+ var TRIM_REGEX = /^\s+|\s+$/g;
15
+ var NEWLINE = "\n";
16
+ var FORWARD_SLASH = "/";
17
+ var ASTERISK = "*";
18
+ var EMPTY_STRING = "";
19
+ var TYPE_COMMENT = "comment";
20
+ var TYPE_DECLARATION = "declaration";
21
+ function index(style, options) {
22
+ if (typeof style !== "string") {
23
+ throw new TypeError("First argument must be a string");
24
+ }
25
+ if (!style) return [];
26
+ options = options || {};
27
+ var lineno = 1;
28
+ var column = 1;
29
+ function updatePosition(str) {
30
+ var lines = str.match(NEWLINE_REGEX);
31
+ if (lines) lineno += lines.length;
32
+ var i = str.lastIndexOf(NEWLINE);
33
+ column = ~i ? str.length - i : column + str.length;
34
+ }
35
+ function position() {
36
+ var start = { line: lineno, column };
37
+ return function(node) {
38
+ node.position = new Position(start);
39
+ whitespace();
40
+ return node;
41
+ };
42
+ }
43
+ function Position(start) {
44
+ this.start = start;
45
+ this.end = { line: lineno, column };
46
+ this.source = options.source;
47
+ }
48
+ Position.prototype.content = style;
49
+ function error(msg) {
50
+ var err = new Error(
51
+ options.source + ":" + lineno + ":" + column + ": " + msg
52
+ );
53
+ err.reason = msg;
54
+ err.filename = options.source;
55
+ err.line = lineno;
56
+ err.column = column;
57
+ err.source = style;
58
+ if (options.silent) ;
59
+ else {
60
+ throw err;
24
61
  }
25
- function parseValue(arg) {
26
- if (typeof arg === "string" || typeof arg === "number") {
27
- return arg;
28
- }
29
- if (typeof arg !== "object") {
30
- return "";
31
- }
32
- if (Array.isArray(arg)) {
33
- return classNames.apply(null, arg);
34
- }
35
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
36
- return arg.toString();
62
+ }
63
+ function match(re) {
64
+ var m = re.exec(style);
65
+ if (!m) return;
66
+ var str = m[0];
67
+ updatePosition(str);
68
+ style = style.slice(str.length);
69
+ return m;
70
+ }
71
+ function whitespace() {
72
+ match(WHITESPACE_REGEX);
73
+ }
74
+ function comments(rules) {
75
+ var c;
76
+ rules = rules || [];
77
+ while (c = comment()) {
78
+ if (c !== false) {
79
+ rules.push(c);
37
80
  }
38
- var classes = "";
39
- for (var key in arg) {
40
- if (hasOwn.call(arg, key) && arg[key]) {
41
- classes = appendClass(classes, key);
42
- }
43
- }
44
- return classes;
45
81
  }
46
- function appendClass(value, newClass) {
47
- if (!newClass) {
48
- return value;
49
- }
50
- if (value) {
51
- return value + " " + newClass;
82
+ return rules;
83
+ }
84
+ function comment() {
85
+ var pos = position();
86
+ if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
87
+ var i = 2;
88
+ while (EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))) {
89
+ ++i;
90
+ }
91
+ i += 2;
92
+ if (EMPTY_STRING === style.charAt(i - 1)) {
93
+ return error("End of comment missing");
94
+ }
95
+ var str = style.slice(2, i - 2);
96
+ column += 2;
97
+ updatePosition(str);
98
+ style = style.slice(i);
99
+ column += 2;
100
+ return pos({
101
+ type: TYPE_COMMENT,
102
+ comment: str
103
+ });
104
+ }
105
+ function declaration() {
106
+ var pos = position();
107
+ var prop = match(PROPERTY_REGEX);
108
+ if (!prop) return;
109
+ comment();
110
+ if (!match(COLON_REGEX)) return error("property missing ':'");
111
+ var val = match(VALUE_REGEX);
112
+ var ret = pos({
113
+ type: TYPE_DECLARATION,
114
+ property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
115
+ value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING
116
+ });
117
+ match(SEMICOLON_REGEX);
118
+ return ret;
119
+ }
120
+ function declarations() {
121
+ var decls = [];
122
+ comments(decls);
123
+ var decl;
124
+ while (decl = declaration()) {
125
+ if (decl !== false) {
126
+ decls.push(decl);
127
+ comments(decls);
52
128
  }
53
- return value + newClass;
54
129
  }
55
- if (module.exports) {
56
- classNames.default = classNames;
57
- module.exports = classNames;
58
- } else {
59
- window.classNames = classNames;
130
+ return decls;
131
+ }
132
+ whitespace();
133
+ return declarations();
134
+ }
135
+ function trim(str) {
136
+ return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
137
+ }
138
+ cjs$1 = index;
139
+ return cjs$1;
140
+ }
141
+ var hasRequiredCjs$1;
142
+ function requireCjs$1() {
143
+ if (hasRequiredCjs$1) return cjs$2;
144
+ hasRequiredCjs$1 = 1;
145
+ var __importDefault = cjs$2 && cjs$2.__importDefault || function(mod) {
146
+ return mod && mod.__esModule ? mod : { "default": mod };
147
+ };
148
+ Object.defineProperty(cjs$2, "__esModule", { value: true });
149
+ cjs$2.default = StyleToObject;
150
+ const inline_style_parser_1 = __importDefault(requireCjs$2());
151
+ function StyleToObject(style, iterator) {
152
+ let styleObject = null;
153
+ if (!style || typeof style !== "string") {
154
+ return styleObject;
155
+ }
156
+ const declarations = (0, inline_style_parser_1.default)(style);
157
+ const hasIterator = typeof iterator === "function";
158
+ declarations.forEach((declaration) => {
159
+ if (declaration.type !== "declaration") {
160
+ return;
161
+ }
162
+ const { property, value } = declaration;
163
+ if (hasIterator) {
164
+ iterator(property, value, declaration);
165
+ } else if (value) {
166
+ styleObject = styleObject || {};
167
+ styleObject[property] = value;
168
+ }
169
+ });
170
+ return styleObject;
171
+ }
172
+ return cjs$2;
173
+ }
174
+ var utilities = {};
175
+ var hasRequiredUtilities;
176
+ function requireUtilities() {
177
+ if (hasRequiredUtilities) return utilities;
178
+ hasRequiredUtilities = 1;
179
+ Object.defineProperty(utilities, "__esModule", { value: true });
180
+ utilities.camelCase = void 0;
181
+ var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/;
182
+ var HYPHEN_REGEX = /-([a-z])/g;
183
+ var NO_HYPHEN_REGEX = /^[^-]+$/;
184
+ var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;
185
+ var MS_VENDOR_PREFIX_REGEX = /^-(ms)-/;
186
+ var skipCamelCase = function(property) {
187
+ return !property || NO_HYPHEN_REGEX.test(property) || CUSTOM_PROPERTY_REGEX.test(property);
188
+ };
189
+ var capitalize = function(match, character) {
190
+ return character.toUpperCase();
191
+ };
192
+ var trimHyphen = function(match, prefix) {
193
+ return "".concat(prefix, "-");
194
+ };
195
+ var camelCase = function(property, options) {
196
+ if (options === void 0) {
197
+ options = {};
198
+ }
199
+ if (skipCamelCase(property)) {
200
+ return property;
201
+ }
202
+ property = property.toLowerCase();
203
+ if (options.reactCompat) {
204
+ property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen);
205
+ } else {
206
+ property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);
207
+ }
208
+ return property.replace(HYPHEN_REGEX, capitalize);
209
+ };
210
+ utilities.camelCase = camelCase;
211
+ return utilities;
212
+ }
213
+ var cjs;
214
+ var hasRequiredCjs;
215
+ function requireCjs() {
216
+ if (hasRequiredCjs) return cjs;
217
+ hasRequiredCjs = 1;
218
+ var __importDefault = cjs && cjs.__importDefault || function(mod) {
219
+ return mod && mod.__esModule ? mod : { "default": mod };
220
+ };
221
+ var style_to_object_1 = __importDefault(requireCjs$1());
222
+ var utilities_1 = requireUtilities();
223
+ function StyleToJS(style, options) {
224
+ var output = {};
225
+ if (!style || typeof style !== "string") {
226
+ return output;
227
+ }
228
+ (0, style_to_object_1.default)(style, function(property, value) {
229
+ if (property && value) {
230
+ output[(0, utilities_1.camelCase)(property, options)] = value;
60
231
  }
61
- })();
62
- })(classnames);
63
- return classnames.exports;
232
+ });
233
+ return output;
234
+ }
235
+ StyleToJS.default = StyleToJS;
236
+ cjs = StyleToJS;
237
+ return cjs;
64
238
  }
65
- var classnamesExports = requireClassnames();
66
- const cn = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
67
239
  export {
68
- cn as c
240
+ requireCjs as r
69
241
  };
@@ -116,10 +116,10 @@ function manifestMediaProgress(names = {}) {
116
116
  }
117
117
  export {
118
118
  manifestChangeable as a,
119
- manifestInputable as b,
120
- manifestMouseHover as c,
121
- manifestClickable as d,
122
- manifestPlayable as e,
119
+ manifestMouseHover as b,
120
+ manifestClickable as c,
121
+ manifestPlayable as d,
122
+ manifestInputable as e,
123
123
  manifestMediaProgress as f,
124
124
  manifestFocusable as m
125
125
  };
@@ -1,4 +1,4 @@
1
- import { p as parseDocument } from "./index10.js";
1
+ import { p as parseDocument } from "./index8.js";
2
2
  import { l as libExports } from "./index5.js";
3
3
  import { s as sanitizeHTML } from "./sanitizeHTML.js";
4
4
  function parseHtml(html, options) {
@@ -1,4 +1,4 @@
1
- import { p as parseDocument } from "./index10.js";
1
+ import { p as parseDocument } from "./index8.js";
2
2
  import { l as libExports } from "./index5.js";
3
3
  function parseSvg(svg) {
4
4
  const doc = parseDocument(svg, {
@@ -1,4 +1,4 @@
1
- import { d as defineService } from "./index8.js";
1
+ import { d as defineService } from "./index10.js";
2
2
  const defineStaticService = defineService;
3
3
  export {
4
4
  defineStaticService as d
@@ -3,7 +3,7 @@ import * as React from "react";
3
3
  import React__default, { useState, useEffect, useMemo } from "react";
4
4
  import { c as clsx } from "./clsx.js";
5
5
  import { a as getDataAttributes } from "./dataUtils.js";
6
- import { a as activateBySpaceOrEnterButton, f as getTabIndexAttribute } from "./a11y.js";
6
+ import { a as activateBySpaceOrEnterButton, e as getTabIndexAttribute } from "./a11y.js";
7
7
  import * as __rspack_external_react_dom_7136dc57 from "react-dom";
8
8
  import __rspack_external_react_dom_7136dc57__default from "react-dom";
9
9
  import { g as getDefaultExportFromCjs } from "./_commonjsHelpers.js";
@@ -1,4 +1,4 @@
1
- import { k as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./filterDOMProps.js";
1
+ import { a as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider.js";
2
2
  import { useMemo } from "react";
3
3
  const $a747a10fe70a57da$var$localeSymbol = Symbol.for("react-aria.i18n.locale");
4
4
  const $a747a10fe70a57da$var$stringsSymbol = Symbol.for("react-aria.i18n.strings");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2764.0",
3
+ "version": "1.2765.0",
4
4
  "description": "React components for the Wix Editor",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -222,5 +222,5 @@
222
222
  "registry": "https://registry.npmjs.org/",
223
223
  "access": "public"
224
224
  },
225
- "falconPackageHash": "747aaa276fdfaf2e6b7c5522e38882889d1ea22f944fe61b79f0598d"
225
+ "falconPackageHash": "c25990b763cf96e89598ea50ee34be468566f5aee11e5b9d80fe7882"
226
226
  }
@@ -1,24 +0,0 @@
1
- export declare const TranslationKeys: {
2
- readonly NAMESPACE: "Text_Input";
3
- readonly PHONE_FORMAT_LENGTH_VALIDATION_ERROR: "text_input_phone_format_length_validation_error";
4
- readonly PHONE_FORMAT_LENGTH_VALIDATION_ERROR_DEFAULT: "Please enter a phone number with {digits} digits";
5
- readonly PHONE_FORMAT_DEFAULT_VALIDATION_ERROR: "text_input_phone_format_default_validation_error";
6
- readonly PHONE_FORMAT_DEFAULT_VALIDATION_ERROR_DEFAULT: "Please enter between 4 to 17 digits. You can include hyphens (-) or start with a (+), e.g., 555-123-4567 or +(222)987654321";
7
- readonly PHONE_FORMAT_COMPLEX_PHONE_DEFAULT_VALIDATION_ERROR: "text_input_phone_format_complex_phone_default_validation_error";
8
- readonly PHONE_FORMAT_COMPLEX_PHONE_DEFAULT_VALIDATION_ERROR_DEFAULT: "Please enter between 4 to 17 digits. You can include dividers (-), e.g., 555-123-4567.";
9
- readonly INLINE_ERROR_MESSAGE_DEFAULT_ERROR_MESSAGE: "Text_Input_On_Stage_Error_Text_Label";
10
- };
11
- export declare const textTypeToName: {
12
- readonly email: "email";
13
- readonly url: "url";
14
- readonly tel: "phone";
15
- readonly text: undefined;
16
- readonly password: undefined;
17
- readonly number: undefined;
18
- readonly search: undefined;
19
- };
20
- type SPFields = 'textPadding' | 'labelMargin' | 'labelPadding' | 'inputHeight';
21
- type StyleFields = SPFields | 'textAlignment';
22
- export declare const migratedSPFields: Array<SPFields>;
23
- export declare const migratedFields: Array<StyleFields>;
24
- export {};
@@ -1,4 +0,0 @@
1
- import { CorvidSDKFactory } from '../../../types/vendored/editor-elements-types-corvid';
2
- export declare const createTextInputSdk: CorvidSDKFactory;
3
- declare const _default: CorvidSDKFactory<object, object, object>;
4
- export default _default;
@@ -1,91 +0,0 @@
1
- import { c as composeSDKFactories } from "../chunks/composeSDKFactories.js";
2
- import { c as createA11ySdk } from "../chunks/a11ySdk.js";
3
- import { S as SdkStateDefinition } from "../chunks/index7.js";
4
- const createValueSdkFactory = ({ valueProperty }) => (api) => {
5
- const { props, getService } = api;
6
- const sdkService = getService(SdkStateDefinition);
7
- const sdkState = sdkService.for(props.wix.wixPath);
8
- return {
9
- get value() {
10
- return sdkState.get(valueProperty);
11
- },
12
- set value(_value) {
13
- sdkState.set(valueProperty, _value);
14
- }
15
- };
16
- };
17
- const createValiditySdkFactory = ({ validityIndicationProperty }) => (api) => {
18
- const { props, getService } = api;
19
- const sdkService = getService(SdkStateDefinition);
20
- const sdkState = sdkService.for(props.wix.wixPath);
21
- return {
22
- get validityIndication() {
23
- return sdkState.get(validityIndicationProperty);
24
- },
25
- updateValidityIndication() {
26
- sdkState.set(validityIndicationProperty, true);
27
- },
28
- resetValidityIndication() {
29
- sdkState.set(validityIndicationProperty, false);
30
- }
31
- };
32
- };
33
- const createTextInputSdk = (api) => {
34
- const { props, setProps } = api;
35
- return {
36
- get max() {
37
- return props.max;
38
- },
39
- set max(value) {
40
- if (value === void 0 || value === null) {
41
- setProps({ max: null });
42
- }
43
- setProps({ max: value });
44
- },
45
- get min() {
46
- return props.min;
47
- },
48
- set min(value) {
49
- if (value === void 0 || value === null) {
50
- setProps({ min: null });
51
- }
52
- setProps({ min: value });
53
- },
54
- get inputType() {
55
- return props.inputType;
56
- },
57
- set inputType(value) {
58
- setProps({ inputType: value });
59
- },
60
- get prefix() {
61
- return props.prefix || "";
62
- },
63
- set prefix(value) {
64
- const prefix = value || "";
65
- setProps({ prefix });
66
- },
67
- get numberSpinnerHidden() {
68
- return typeof props.numberSpinnerHidden !== "undefined" ? props.numberSpinnerHidden : false;
69
- },
70
- hideNumberSpinner() {
71
- setProps({ numberSpinnerHidden: true });
72
- return Promise.resolve();
73
- },
74
- showNumberSpinner() {
75
- setProps({ numberSpinnerHidden: false });
76
- return Promise.resolve();
77
- }
78
- };
79
- };
80
- const sdk = composeSDKFactories([
81
- createTextInputSdk,
82
- createA11ySdk({ a11yProperty: "a11y" }),
83
- createValueSdkFactory({ valueProperty: "value" }),
84
- createValiditySdkFactory({
85
- validityIndicationProperty: "shouldShowValidityIndication"
86
- })
87
- ]);
88
- export {
89
- createTextInputSdk,
90
- sdk as default
91
- };
@@ -1,9 +0,0 @@
1
- import { HtmlValidationMessageOverrideObject } from '../../../common/sdk/inputUtils/inputValidationTypes';
2
- import { ITextInputProps } from './TextInput.types';
3
- export declare const formatPhoneNumber: (unformattedValue: string, phoneFormat: string) => string;
4
- export declare const getUnformattedNumber: (val: string, phoneFormat: string, didDeleteChars: boolean) => string;
5
- export declare const hasNonNumericChar: (str: string) => boolean;
6
- export declare const translateHtmlValidationMessage: (message: HtmlValidationMessageOverrideObject, { translations, phoneFormat, }: {
7
- translations: ITextInputProps["translations"];
8
- phoneFormat?: string;
9
- }) => string;