[PR #14] [MERGED] chore(input): implement get/set #220

Closed
opened 2026-03-02 23:45:28 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/14
Author: @msmps
Created: 8/14/2025
Status: Merged
Merged: 8/14/2025
Merged by: @kommander

Base: mainHead: feat/add-setters-20250814212158


📝 Commits (1)

  • 32d1aae chore(input): implement get/set

📊 Changes

3 files changed (+127 additions, -108 deletions)

View changed files

📝 src/examples/input-demo.ts (+9 -9)
📝 src/examples/input-select-layout-demo.ts (+1 -1)
📝 src/renderables/Input.ts (+117 -98)

📄 Description

Description

New setters:

  • backgroundColor - Sets the background color with automatic color parsing
  • textColor - Sets the text color with automatic color parsing
  • focusedBackgroundColor - Sets the focused background color
  • focusedTextColor - Sets the focused text color
  • placeholderColor - Sets the placeholder text color
  • cursorColor - Sets the cursor color
  • maxLength - Sets the max length
  • placeholder - Sets the placeholder text

Converted to get/set:

  • value - getValue()/setValue() → get/set value
  • cursorPosition - getCursorPosition()/setCursorPosition() → get/set cursorPosition

Removed unused getters (for now):

  • placeholder - getPlaceholder()
  • maxLength - getMaxLength()

Implementation Details:

  • All private fields were renamed with underscore prefix (e.g., _backgroundColor)
  • All setters call this.needsUpdate() to trigger re-rendering when properties change
  • Color setters use parseColor() to handle different color input formats
  • All references throughout the class were updated to use the new private field names

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/14 **Author:** [@msmps](https://github.com/msmps) **Created:** 8/14/2025 **Status:** ✅ Merged **Merged:** 8/14/2025 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `feat/add-setters-20250814212158` --- ### 📝 Commits (1) - [`32d1aae`](https://github.com/anomalyco/opentui/commit/32d1aae64e43f7d9905c63b7d9793bfba6f5ccd2) chore(input): implement get/set ### 📊 Changes **3 files changed** (+127 additions, -108 deletions) <details> <summary>View changed files</summary> 📝 `src/examples/input-demo.ts` (+9 -9) 📝 `src/examples/input-select-layout-demo.ts` (+1 -1) 📝 `src/renderables/Input.ts` (+117 -98) </details> ### 📄 Description ## Description ### New setters: - `backgroundColor` - Sets the background color with automatic color parsing - `textColor` - Sets the text color with automatic color parsing - `focusedBackgroundColor` - Sets the focused background color - `focusedTextColor` - Sets the focused text color - `placeholderColor` - Sets the placeholder text color - `cursorColor` - Sets the cursor color - `maxLength` - Sets the max length - `placeholder` - Sets the placeholder text ### Converted to get/set: - `value` - getValue()/setValue() → get/set value - `cursorPosition` - getCursorPosition()/setCursorPosition() → get/set cursorPosition ### Removed unused **getters** (_for now_): - `placeholder` - getPlaceholder() - `maxLength` - getMaxLength() ### Implementation Details: - All private fields were renamed with underscore prefix (e.g., `_backgroundColor`) - All setters call `this.needsUpdate()` to trigger re-rendering when properties change - Color setters use `parseColor()` to handle different color input formats - All references throughout the class were updated to use the new private field names --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:45:28 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#220
No description provided.