• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/// <reference path='./import.ts' />
17class TextInputStyleModifier extends ModifierWithKey<number> {
18  constructor(value: number) {
19    super(value);
20  }
21  static identity: Symbol = Symbol('textInputStyle');
22  applyPeer(node: KNode, reset: boolean): void {
23    if (reset) {
24      getUINativeModule().textInput.resetStyle(node);
25    } else {
26      getUINativeModule().textInput.setStyle(node, this.value!);
27    }
28  }
29  checkObjectDiff(): boolean {
30    return !isBaseOrResourceEqual(this.stageValue, this.value);
31  }
32}
33class TextInputMaxLengthModifier extends ModifierWithKey<number> {
34  constructor(value: number) {
35    super(value);
36  }
37  static identity: Symbol = Symbol('textInputMaxLength');
38  applyPeer(node: KNode, reset: boolean): void {
39    if (reset) {
40      getUINativeModule().textInput.resetMaxLength(node);
41    } else {
42      getUINativeModule().textInput.setMaxLength(node, this.value!);
43    }
44  }
45  checkObjectDiff(): boolean {
46    return !isBaseOrResourceEqual(this.stageValue, this.value);
47  }
48}
49class TextInputMaxLinesModifier extends ModifierWithKey<number> {
50  constructor(value: number) {
51    super(value);
52  }
53  static identity: Symbol = Symbol('textInputMaxLines');
54  applyPeer(node: KNode, reset: boolean): void {
55    if (reset) {
56      getUINativeModule().textInput.resetMaxLines(node);
57    } else {
58      getUINativeModule().textInput.setMaxLines(node, this.value!);
59    }
60  }
61  checkObjectDiff(): boolean {
62    return !isBaseOrResourceEqual(this.stageValue, this.value);
63  }
64}
65class TextInputShowPasswordIconModifier extends ModifierWithKey<boolean> {
66  constructor(value: boolean) {
67    super(value);
68  }
69  static identity: Symbol = Symbol('textInputShowPasswordIcon');
70  applyPeer(node: KNode, reset: boolean): void {
71    if (reset) {
72      getUINativeModule().textInput.resetShowPasswordIcon(node);
73    } else {
74      getUINativeModule().textInput.setShowPasswordIcon(node, this.value!);
75    }
76  }
77  checkObjectDiff(): boolean {
78    return !isBaseOrResourceEqual(this.stageValue, this.value);
79  }
80}
81class TextInputTextAlignModifier extends ModifierWithKey<number> {
82  constructor(value: number) {
83    super(value);
84  }
85  static identity: Symbol = Symbol('textInputTextAlign');
86  applyPeer(node: KNode, reset: boolean): void {
87    if (reset) {
88      getUINativeModule().textInput.resetTextAlign(node);
89    } else {
90      getUINativeModule().textInput.setTextAlign(node, this.value!);
91    }
92  }
93  checkObjectDiff(): boolean {
94    return !isBaseOrResourceEqual(this.stageValue, this.value);
95  }
96}
97
98class TextInputPlaceholderFontModifier extends ModifierWithKey<Font> {
99  constructor(value: Font) {
100    super(value);
101  }
102  static identity: Symbol = Symbol('textInputPlaceholderFont');
103
104  applyPeer(node: KNode, reset: boolean): void {
105    if (reset) {
106      getUINativeModule().textInput.resetPlaceholderFont(node);
107    } else {
108      getUINativeModule().textInput.setPlaceholderFont(node, this.value.size,
109        this.value.weight, this.value.family, this.value.style);
110    }
111  }
112
113  checkObjectDiff(): boolean {
114    if (!(this.stageValue.weight === this.value.weight &&
115      this.stageValue.style === this.value.style)) {
116      return true;
117    } else {
118      if (((isResource(this.stageValue.size) && isResource(this.value.size) &&
119        isResourceEqual(this.stageValue.size, this.value.size)) ||
120        (!isResource(this.stageValue.size) && !isResource(this.value.size) &&
121          this.stageValue.size === this.value.size)) &&
122        ((isResource(this.stageValue.family) && isResource(this.value.family) &&
123          isResourceEqual(this.stageValue.family, this.value.family)) ||
124          (!isResource(this.stageValue.family) && !isResource(this.value.family) &&
125            this.stageValue.family === this.value.family))) {
126        return false;
127      } else {
128        return true;
129      }
130    }
131  }
132}
133
134class TextInputPlaceholderColorModifier extends ModifierWithKey<ResourceColor> {
135  constructor(value: ResourceColor) {
136    super(value);
137  }
138  static identity: Symbol = Symbol('textInputPlaceholderColor');
139  applyPeer(node: KNode, reset: boolean): void {
140    if (reset) {
141      getUINativeModule().textInput.resetPlaceholderColor(node);
142    } else {
143      getUINativeModule().textInput.setPlaceholderColor(node, this.value!);
144    }
145  }
146  checkObjectDiff(): boolean {
147    return !isBaseOrResourceEqual(this.stageValue, this.value);
148  }
149}
150
151class TextInputPasswordIconModifier extends ModifierWithKey<PasswordIcon> {
152  constructor(value: PasswordIcon) {
153    super(value);
154  }
155  static identity: Symbol = Symbol('textInputPasswordIcon');
156  applyPeer(node: KNode, reset: boolean): void {
157    if (reset) {
158      getUINativeModule().textInput.resetPasswordIcon(node);
159    } else {
160      getUINativeModule().textInput.setPasswordIcon(node, this.value.onIconSrc, this.value.offIconSrc);
161    }
162  }
163  checkObjectDiff(): boolean {
164    return !isBaseOrResourceEqual(this.stageValue.onIconSrc, this.value.onIconSrc) ||
165      !isBaseOrResourceEqual(this.stageValue.offIconSrc, this.value.offIconSrc);
166  }
167}
168
169class TextInputSelectedBackgroundColorModifier extends ModifierWithKey<ResourceColor> {
170  constructor(value: ResourceColor) {
171    super(value);
172  }
173  static identity: Symbol = Symbol('textInputSelectedBackgroundColor');
174  applyPeer(node: KNode, reset: boolean): void {
175    if (reset) {
176      getUINativeModule().textInput.resetSelectedBackgroundColor(node);
177    } else {
178      getUINativeModule().textInput.setSelectedBackgroundColor(node, this.value!);
179    }
180  }
181  checkObjectDiff(): boolean {
182    return !isBaseOrResourceEqual(this.stageValue, this.value);
183  }
184}
185
186class TextInputSelectionMenuHiddenModifier extends ModifierWithKey<boolean> {
187  constructor(value: boolean) {
188    super(value);
189  }
190  static identity: Symbol = Symbol('textInputSelectionMenuHidden');
191  applyPeer(node: KNode, reset: boolean): void {
192    if (reset) {
193      getUINativeModule().textInput.resetSelectionMenuHidden(node);
194    } else {
195      getUINativeModule().textInput.setSelectionMenuHidden(node, this.value!);
196    }
197  }
198  checkObjectDiff(): boolean {
199    return !isBaseOrResourceEqual(this.stageValue, this.value);
200  }
201}
202class TextInputShowUnderlineModifier extends ModifierWithKey<boolean> {
203  constructor(value: boolean) {
204    super(value);
205  }
206  static identity: Symbol = Symbol('textInputShowUnderLine');
207  applyPeer(node: KNode, reset: boolean): void {
208    if (reset) {
209      getUINativeModule().textInput.resetShowUnderline(node);
210    } else {
211      getUINativeModule().textInput.setShowUnderline(node, this.value!);
212    }
213  }
214  checkObjectDiff(): boolean {
215    return !isBaseOrResourceEqual(this.stageValue, this.value);
216  }
217}
218class TextInputShowErrorModifier extends ModifierWithKey<string | undefined> {
219  constructor(value: string | undefined) {
220    super(value);
221  }
222  static identity: Symbol = Symbol('textInputShowError');
223  applyPeer(node: KNode, reset: boolean): void {
224    if (reset) {
225      getUINativeModule().textInput.resetShowError(node);
226    } else {
227      getUINativeModule().textInput.setShowError(node, this.value!);
228    }
229  }
230  checkObjectDiff(): boolean {
231    return !isBaseOrResourceEqual(this.stageValue, this.value);
232  }
233}
234class TextInputTypeModifier extends ModifierWithKey<number> {
235  constructor(value: number) {
236    super(value);
237  }
238  static identity: Symbol = Symbol('textInputType');
239  applyPeer(node: KNode, reset: boolean): void {
240    if (reset) {
241      getUINativeModule().textInput.resetType(node);
242    } else {
243      getUINativeModule().textInput.setType(node, this.value!);
244    }
245  }
246  checkObjectDiff(): boolean {
247    return !isBaseOrResourceEqual(this.stageValue, this.value);
248  }
249}
250
251class TextInputCaretPositionModifier extends ModifierWithKey<number> {
252  constructor(value: number) {
253    super(value);
254  }
255  static identity: Symbol = Symbol('textInputCaretPosition');
256  applyPeer(node: KNode, reset: boolean): void {
257    if (reset) {
258      getUINativeModule().textInput.resetCaretPosition(node);
259    } else {
260      getUINativeModule().textInput.setCaretPosition(node, this.value);
261    }
262  }
263  checkObjectDiff(): boolean {
264    return !isBaseOrResourceEqual(this.stageValue, this.value);
265  }
266}
267
268class TextInputCopyOptionModifier extends ModifierWithKey<number> {
269  constructor(value: number) {
270    super(value);
271  }
272  static identity: Symbol = Symbol('textInputCopyOption');
273  applyPeer(node: KNode, reset: boolean): void {
274    if (reset) {
275      getUINativeModule().textInput.resetCopyOption(node);
276    } else {
277      getUINativeModule().textInput.setCopyOption(node, this.value);
278    }
279  }
280  checkObjectDiff(): boolean {
281    return !isBaseOrResourceEqual(this.stageValue, this.value);
282  }
283}
284
285class TextInputEnableKeyboardOnFocusModifier extends ModifierWithKey<boolean> {
286  constructor(value: boolean) {
287    super(value);
288  }
289  static identity: Symbol = Symbol('textInputEnableKeyboardOnFocus');
290  applyPeer(node: KNode, reset: boolean): void {
291    if (reset) {
292      getUINativeModule().textInput.resetEnableKeyboardOnFocus(node);
293    } else {
294      getUINativeModule().textInput.setEnableKeyboardOnFocus(node, this.value);
295    }
296  }
297  checkObjectDiff(): boolean {
298    return !isBaseOrResourceEqual(this.stageValue, this.value);
299  }
300}
301
302class TextInputCaretStyleModifier extends ModifierWithKey<CaretStyle> {
303  constructor(value: CaretStyle) {
304    super(value);
305  }
306  static identity: Symbol = Symbol('textInputCaretStyle');
307  applyPeer(node: KNode, reset: boolean): void {
308    if (reset) {
309      getUINativeModule().textInput.resetCaretStyle(node);
310    } else {
311      getUINativeModule().textInput.setCaretStyle(node, this.value!.width);
312    }
313  }
314
315  checkObjectDiff(): boolean {
316    if (isObject(this.stageValue) && isObject(this.value)) {
317      return !isBaseOrResourceEqual(this.stageValue.width, this.value.width);
318    } else {
319      return true;
320    }
321  }
322}
323
324class TextInputEnterKeyTypeModifier extends ModifierWithKey<number> {
325  constructor(value: number) {
326    super(value);
327  }
328  static identity: Symbol = Symbol('textInputEnterKeyType');
329  applyPeer(node: KNode, reset: boolean): void {
330    if (reset) {
331      getUINativeModule().textInput.resetEnterKeyType(node);
332    } else {
333      getUINativeModule().textInput.setEnterKeyType(node, this.value);
334    }
335  }
336  checkObjectDiff(): boolean {
337    return !isBaseOrResourceEqual(this.stageValue, this.value);
338  }
339}
340
341class TextInputBarStateModifier extends ModifierWithKey<number> {
342  constructor(value: number) {
343    super(value);
344  }
345  static identity: Symbol = Symbol('textInputBarState');
346  applyPeer(node: KNode, reset: boolean): void {
347    if (reset) {
348      getUINativeModule().textInput.resetBarState(node);
349    } else {
350      getUINativeModule().textInput.setBarState(node, this.value);
351    }
352  }
353  checkObjectDiff(): boolean {
354    return !isBaseOrResourceEqual(this.stageValue, this.value);
355  }
356}
357
358class TextInputCaretColorModifier extends ModifierWithKey<ResourceColor> {
359  constructor(value: ResourceColor) {
360    super(value);
361  }
362  static identity: Symbol = Symbol('textinputCaretColor');
363  applyPeer(node: KNode, reset: boolean): void {
364    if (reset) {
365      getUINativeModule().textInput.resetCaretColor(node);
366    } else {
367      getUINativeModule().textInput.setCaretColor(node, this.value!);
368    }
369  }
370  checkObjectDiff(): boolean {
371    return !isBaseOrResourceEqual(this.stageValue, this.value);
372  }
373}
374class TextInputFontColorModifier extends ModifierWithKey<ResourceColor> {
375  constructor(value: ResourceColor) {
376    super(value);
377  }
378  static identity: Symbol = Symbol('textInputFontColor');
379  applyPeer(node: KNode, reset: boolean): void {
380    if (reset) {
381      getUINativeModule().textInput.resetFontColor(node);
382    } else {
383      getUINativeModule().textInput.setFontColor(node, this.value!);
384    }
385  }
386  checkObjectDiff(): boolean {
387    return !isBaseOrResourceEqual(this.stageValue, this.value);
388  }
389}
390
391
392class TextInputFontSizeModifier extends ModifierWithKey<Length> {
393  constructor(value: Length) {
394    super(value);
395  }
396  static identity: Symbol = Symbol('textInputFontSize');
397
398  applyPeer(node: KNode, reset: boolean): void {
399    if (reset) {
400      getUINativeModule().textInput.resetFontSize(node);
401    } else {
402      getUINativeModule().textInput.setFontSize(node, this.value!);
403    }
404  }
405
406  checkObjectDiff(): boolean {
407    return !isBaseOrResourceEqual(this.stageValue, this.value);
408  }
409}
410class TextInputFontStyleModifier extends ModifierWithKey<number> {
411  constructor(value: number) {
412    super(value);
413  }
414  static identity: Symbol = Symbol('textInputFontStyle');
415  applyPeer(node: KNode, reset: boolean): void {
416    if (reset) {
417      getUINativeModule().textInput.resetFontStyle(node);
418    } else {
419      getUINativeModule().textInput.setFontStyle(node, this.value!);
420    }
421  }
422  checkObjectDiff(): boolean {
423    return !isBaseOrResourceEqual(this.stageValue, this.value);
424  }
425}
426
427class TextInputFontWeightModifier extends ModifierWithKey<number | string> {
428  constructor(value: number | string) {
429    super(value);
430  }
431  static identity: Symbol = Symbol('textInputFontWeight');
432  applyPeer(node: KNode, reset: boolean): void {
433    if (reset) {
434      getUINativeModule().textInput.resetFontWeight(node);
435    } else {
436      getUINativeModule().textInput.setFontWeight(node, this.value!);
437    }
438  }
439  checkObjectDiff(): boolean {
440    return !isBaseOrResourceEqual(this.stageValue, this.value);
441  }
442}
443
444class TextInputFontFamilyModifier extends ModifierWithKey<ResourceStr> {
445  constructor(value: ResourceStr) {
446    super(value);
447  }
448  static identity: Symbol = Symbol('textInputFontFamily');
449  applyPeer(node: KNode, reset: boolean): void {
450    if (reset) {
451      getUINativeModule().textInput.resetFontFamily(node);
452    } else {
453      getUINativeModule().textInput.setFontFamily(node, this.value!);
454    }
455  }
456
457  checkObjectDiff(): boolean {
458    return !isBaseOrResourceEqual(this.stageValue, this.value);
459  }
460}
461class ArkTextInputComponent extends ArkComponent implements CommonMethod<TextInputAttribute> {
462  constructor(nativePtr: KNode) {
463    super(nativePtr);
464  }
465  cancelButton(value: { style?: CancelButtonStyle, icon?: IconOptions }): TextInputAttribute {
466    throw new Error('Method not implemented.');
467  }
468  onGestureJudgeBegin(callback: (gestureInfo: GestureInfo, event: BaseGestureEvent) => GestureJudgeResult): this {
469    throw new Error('Method not implemented.');
470  }
471  selectAll(value: boolean): TextInputAttribute {
472    throw new Error('Method not implemented.');
473  }
474  enableAutoFill(value: boolean): TextInputAttribute {
475    throw new Error('Method not implemented.');
476  }
477  passwordRules(value: string): TextInputAttribute {
478    throw new Error('Method not implemented.');
479  }
480  showCounter(value: boolean): TextInputAttribute {
481    throw new Error('Method not implemented.');
482  }
483
484  type(value: InputType): TextInputAttribute {
485
486    modifierWithKey(this._modifiersWithKeys, TextInputTypeModifier.identity,
487      TextInputTypeModifier, value);
488    return this;
489  }
490
491  placeholderColor(value: ResourceColor): TextInputAttribute {
492    modifierWithKey(this._modifiersWithKeys, TextInputPlaceholderColorModifier.identity,
493      TextInputPlaceholderColorModifier, value);
494    return this;
495  }
496
497  placeholderFont(value?: Font): TextInputAttribute {
498    modifierWithKey(this._modifiersWithKeys, TextInputPlaceholderFontModifier.identity,
499      TextInputPlaceholderFontModifier, value);
500    return this;
501  }
502  enterKeyType(value: EnterKeyType): TextInputAttribute {
503    modifierWithKey(this._modifiersWithKeys, TextInputEnterKeyTypeModifier.identity,
504      TextInputEnterKeyTypeModifier, value);
505    return this;
506  }
507  caretColor(value: ResourceColor): TextInputAttribute {
508    modifierWithKey(this._modifiersWithKeys, TextInputCaretColorModifier.identity,
509      TextInputCaretColorModifier, value);
510    return this;
511  }
512  onEditChanged(callback: (isEditing: boolean) => void): TextInputAttribute {
513    throw new Error('Method not implemented.');
514  }
515  onEditChange(callback: (isEditing: boolean) => void): TextInputAttribute {
516    throw new Error('Method not implemented.');
517  }
518  onSubmit(callback: (enterKey: EnterKeyType) => void): TextInputAttribute {
519    throw new Error('Method not implemented.');
520  }
521  onChange(callback: (value: string) => void): TextInputAttribute {
522    throw new Error('Method not implemented.');
523  }
524  onTextSelectionChange(callback: (selectionStart: number, selectionEnd: number) => void): TextInputAttribute {
525    throw new Error('Method not implemented.');
526  }
527  onContentScroll(callback: (totalOffsetX: number, totalOffsetY: number) => void): TextInputAttribute {
528    throw new Error('Method not implemented.');
529  }
530  maxLength(value: number): TextInputAttribute {
531    modifierWithKey(this._modifiersWithKeys, TextInputMaxLengthModifier.identity,
532      TextInputMaxLengthModifier, value);
533    return this;
534  }
535  fontColor(value: ResourceColor): TextInputAttribute {
536    modifierWithKey(this._modifiersWithKeys, TextInputFontColorModifier.identity,
537      TextInputFontColorModifier, value);
538    return this;
539  }
540
541  fontSize(value: Length): TextInputAttribute {
542    modifierWithKey(this._modifiersWithKeys, TextInputFontSizeModifier.identity,
543      TextInputFontSizeModifier, value);
544    return this;
545  }
546  fontStyle(value: FontStyle): TextInputAttribute {
547    modifierWithKey(this._modifiersWithKeys, TextInputFontStyleModifier.identity,
548      TextInputFontStyleModifier, value);
549    return this;
550  }
551  fontWeight(value: number | FontWeight | string): TextInputAttribute {
552    modifierWithKey(this._modifiersWithKeys, TextInputFontWeightModifier.identity,
553      TextInputFontWeightModifier, value);
554    return this;
555  }
556
557  fontFamily(value: ResourceStr): TextInputAttribute {
558    modifierWithKey(this._modifiersWithKeys, TextInputFontFamilyModifier.identity,
559      TextInputFontFamilyModifier, value);
560    return this;
561  }
562  inputFilter(value: ResourceStr, error?: (value: string) => void): TextInputAttribute {
563    throw new Error('Method not implemented.');
564  }
565  onCopy(callback: (value: string) => void): TextInputAttribute {
566    throw new Error('Method not implemented.');
567  }
568  onCut(callback: (value: string) => void): TextInputAttribute {
569    throw new Error('Method not implemented.');
570  }
571  onPaste(callback: (value: string) => void): TextInputAttribute {
572    throw new Error('Method not implemented.');
573  }
574  copyOption(value: CopyOptions): TextInputAttribute {
575    modifierWithKey(this._modifiersWithKeys, TextInputCopyOptionModifier.identity,
576      TextInputCopyOptionModifier, value);
577    return this;
578  }
579
580  showPasswordIcon(value: boolean): TextInputAttribute {
581    modifierWithKey(this._modifiersWithKeys, TextInputShowPasswordIconModifier.identity,
582      TextInputShowPasswordIconModifier, value);
583    return this;
584  }
585  textAlign(value: TextAlign): TextInputAttribute {
586    modifierWithKey(this._modifiersWithKeys, TextInputTextAlignModifier.identity,
587      TextInputTextAlignModifier, value);
588    return this;
589  }
590  style(value: TextInputStyle | TextContentStyle): TextInputAttribute {
591    modifierWithKey(this._modifiersWithKeys, TextInputStyleModifier.identity,
592      TextInputStyleModifier, value);
593    return this;
594  }
595  caretStyle(value: CaretStyle) {
596    modifierWithKey(this._modifiersWithKeys, TextInputCaretStyleModifier.identity,
597      TextInputCaretStyleModifier, value);
598    return this;
599  }
600
601  selectedBackgroundColor(value: ResourceColor): TextInputAttribute {
602    modifierWithKey(this._modifiersWithKeys, TextInputSelectedBackgroundColorModifier.identity,
603      TextInputSelectedBackgroundColorModifier, value);
604    return this;
605  }
606  caretPosition(value: number): TextInputAttribute {
607    modifierWithKey(this._modifiersWithKeys, TextInputCaretPositionModifier.identity,
608      TextInputCaretPositionModifier, value);
609    return this;
610  }
611  enableKeyboardOnFocus(value: boolean): TextInputAttribute {
612    modifierWithKey(this._modifiersWithKeys, TextInputEnableKeyboardOnFocusModifier.identity,
613      TextInputEnableKeyboardOnFocusModifier, value);
614    return this;
615  }
616
617  passwordIcon(value: PasswordIcon): TextInputAttribute {
618    modifierWithKey(this._modifiersWithKeys, TextInputPasswordIconModifier.identity,
619      TextInputPasswordIconModifier, value);
620    return this;
621  }
622  showError(value: string | undefined): TextInputAttribute {
623    modifierWithKey(this._modifiersWithKeys, TextInputShowErrorModifier.identity,
624      TextInputShowErrorModifier, value);
625    return this;
626  }
627  showUnit(event: () => void): TextInputAttribute {
628    throw new Error('Method not implemented.');
629  }
630  showUnderline(value: boolean): TextInputAttribute {
631    modifierWithKey(this._modifiersWithKeys, TextInputShowUnderlineModifier.identity,
632      TextInputShowUnderlineModifier, value);
633    return this;
634  }
635  selectionMenuHidden(value: boolean): TextInputAttribute {
636    modifierWithKey(this._modifiersWithKeys, TextInputSelectionMenuHiddenModifier.identity, TextInputSelectionMenuHiddenModifier, value);
637    return this;
638  }
639  barState(value: BarState): TextInputAttribute {
640    modifierWithKey(this._modifiersWithKeys, TextInputBarStateModifier.identity, TextInputBarStateModifier, value);
641    return this;
642  }
643  maxLines(value: number): TextInputAttribute {
644    modifierWithKey(this._modifiersWithKeys, TextInputMaxLinesModifier.identity, TextInputMaxLinesModifier, value);
645    return this;
646  }
647  customKeyboard(event: () => void): TextInputAttribute {
648    throw new Error('Method not implemented.');
649  }
650}
651// @ts-ignore
652globalThis.TextInput.attributeModifier = function (modifier) {
653  const elmtId = ViewStackProcessor.GetElmtIdToAccountFor();
654  let nativeNode = getUINativeModule().getFrameNodeById(elmtId);
655  let component = this.createOrGetNode(elmtId, () => {
656    return new ArkTextInputComponent(nativeNode);
657  });
658  applyUIAttributes(modifier, nativeNode, component);
659  component.applyModifierPatch();
660};