@grayscale-dev/dragon 0.1.6 → 0.1.8

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.
package/README.md CHANGED
@@ -146,12 +146,15 @@ dui-input::part(input) {
146
146
 
147
147
  **Masking**
148
148
 
149
- `regex` enables mask formatting using a supported regex-like pattern.
149
+ `regex` uses the IMask regex engine with full JavaScript `RegExp` syntax.
150
150
 
151
- - Example phone pattern: `^\(\d{3}\)\s\d{3}-\d{4}$`
152
- - As the user types, input is normalized to the mask shape.
153
- - `show-regex-placeholder` shows a generated placeholder such as `(xxx) xxx-xxxx`.
154
- - With `label-position="floating"`, the regex placeholder appears only while focused.
151
+ - Example single digit: `\d`
152
+ - Example unlimited digits: `\d*`
153
+ - Example phone validation shape: `^\(\d{3}\)\s\d{3}-\d{4}$`
154
+ - As the user types, input is constrained by the regex.
155
+ - `regex-placeholder` provides explicit placeholder text for regex mode.
156
+ - If `regex-placeholder` is empty, no regex placeholder is shown.
157
+ - With `label-position="floating"`, regex placeholder appears only while focused.
155
158
 
156
159
  Example:
157
160
 
@@ -160,7 +163,7 @@ Example:
160
163
  label="Phone"
161
164
  label-position="floating"
162
165
  regex="^\(\d{3}\)\s\d{3}-\d{4}$"
163
- show-regex-placeholder
166
+ regex-placeholder="(xxx) xxx-xxxx"
164
167
  ></dui-input>
165
168
  ```
166
169
 
@@ -12,12 +12,11 @@ export declare class DuiInput extends LitElement {
12
12
  label: string;
13
13
  labelPosition: 'floating' | 'above';
14
14
  regex: string;
15
- showRegexPlaceholder: boolean;
16
- showRegexPlaceholer: boolean;
15
+ regexPlaceholder: string;
17
16
  private inputEl?;
18
17
  private internals?;
19
18
  private defaultValue?;
20
- private mask;
19
+ private compiledRegex;
21
20
  private isFocused;
22
21
  constructor();
23
22
  connectedCallback(): void;
@@ -28,7 +27,7 @@ export declare class DuiInput extends LitElement {
28
27
  formResetCallback(): void;
29
28
  formStateRestoreCallback(state: unknown): void;
30
29
  formDisabledCallback(disabled: boolean): void;
31
- private normalizeMaskedValue;
30
+ private normalizeWithRegex;
32
31
  private syncFormValue;
33
32
  private handleInput;
34
33
  private handleChange;