@vuu-ui/vuu-ui-controls 3.5.13 → 3.5.15

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.5.13",
2
+ "version": "3.5.15",
3
3
  "description": "VUU UI Controls",
4
4
  "main": "./src/index.js",
5
5
  "author": "heswell",
@@ -10,17 +10,17 @@
10
10
  "type-defs": "node ../../scripts/build-type-defs.mjs"
11
11
  },
12
12
  "devDependencies": {
13
- "@vuu-ui/vuu-data-types": "3.5.13",
14
- "@vuu-ui/vuu-protocol-types": "3.5.13",
15
- "@vuu-ui/vuu-table-types": "3.5.13"
13
+ "@vuu-ui/vuu-data-types": "3.5.15",
14
+ "@vuu-ui/vuu-protocol-types": "3.5.15",
15
+ "@vuu-ui/vuu-table-types": "3.5.15"
16
16
  },
17
17
  "dependencies": {
18
- "@vuu-ui/vuu-context-menu": "3.5.13",
19
- "@vuu-ui/vuu-data-react": "3.5.13",
20
- "@vuu-ui/vuu-layout": "3.5.13",
21
- "@vuu-ui/vuu-popups": "3.5.13",
22
- "@vuu-ui/vuu-table": "3.5.13",
23
- "@vuu-ui/vuu-utils": "3.5.13",
18
+ "@vuu-ui/vuu-context-menu": "3.5.15",
19
+ "@vuu-ui/vuu-data-react": "3.5.15",
20
+ "@vuu-ui/vuu-layout": "3.5.15",
21
+ "@vuu-ui/vuu-popups": "3.5.15",
22
+ "@vuu-ui/vuu-table": "3.5.15",
23
+ "@vuu-ui/vuu-utils": "3.5.15",
24
24
  "@salt-ds/core": "1.54.1",
25
25
  "@salt-ds/icons": "1.16.0",
26
26
  "@salt-ds/styles": "0.2.1",
@@ -148,7 +148,7 @@ class MaskedInput extends EventEmitter {
148
148
  }
149
149
  set value(value) {
150
150
  this.#controlled = true;
151
- const normalisedValue = this.normalise(value);
151
+ const normalisedValue = "" === value ? this.zeroValue : this.normalise(value);
152
152
  if (void 0 !== normalisedValue && normalisedValue !== this.#value) {
153
153
  this.#value = normalisedValue;
154
154
  if (this.isFocused) requestAnimationFrame(()=>{
@@ -278,6 +278,11 @@ class MaskedInput extends EventEmitter {
278
278
  click() {
279
279
  if (this.#input) {
280
280
  this.#isFocused = true;
281
+ if ("" === this.#input.value) {
282
+ this.setValue(this.zeroValue);
283
+ this.selectFirst();
284
+ return;
285
+ }
281
286
  const { start, end } = this.getSelection();
282
287
  if (null === start) this.selectFirst();
283
288
  else 0 === start && end === this.length || this.select(this.getUnitAtCursorPos(start));
@@ -292,8 +297,10 @@ class MaskedInput extends EventEmitter {
292
297
  focus = ()=>{
293
298
  if (this.#input) {
294
299
  this.#isFocused = true;
300
+ if ("" === this.#input.value) this.setValue(this.zeroValue);
301
+ this.selectFirst();
295
302
  requestAnimationFrame(()=>{
296
- this.selectFirst();
303
+ this.restoreSelection();
297
304
  });
298
305
  }
299
306
  };
@@ -53,7 +53,7 @@ export declare class MaskedInput extends EventEmitter<MaskedInputEvents> {
53
53
  * Setting the value this way invokes 'controlled' mode. Value
54
54
  * will be normalised to the configured precision.
55
55
  */
56
- set value(value: TimeValue);
56
+ set value(value: TimeValue | "");
57
57
  clear(unit: TimeUnit): void;
58
58
  /**
59
59
  * Select a unit. If digitIndex > 0, only the digits of the unit