smoothly 0.1.93 → 0.1.94

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.
@@ -41,6 +41,9 @@ let SmoothlyInput = class {
41
41
  if (value != before)
42
42
  this.smoothlyChanged.emit({ name: this.name, value });
43
43
  }
44
+ onCurrency() {
45
+ this.state = Object.assign(Object.assign({}, this.state), { value: this.newState({ value: this.formatter.toString(this.value), selection: this.state.selection }).value });
46
+ }
44
47
  componentWillLoad() {
45
48
  const value = this.formatter.toString(this.value) || "";
46
49
  const start = value.length;
@@ -181,7 +184,8 @@ let SmoothlyInput = class {
181
184
  return (h(Host, { class: { "has-value": ((_a = this.state) === null || _a === void 0 ? void 0 : _a.value) != undefined && ((_b = this.state) === null || _b === void 0 ? void 0 : _b.value) != "" } }, h("input", { name: this.name, type: (_c = this.state) === null || _c === void 0 ? void 0 : _c.type, placeholder: this.placeholder, required: this.required, autocomplete: this.autocomplete ? (_d = this.state) === null || _d === void 0 ? void 0 : _d.autocomplete : "off", disabled: this.disabled, pattern: ((_e = this.state) === null || _e === void 0 ? void 0 : _e.pattern) && ((_f = this.state) === null || _f === void 0 ? void 0 : _f.pattern.source), value: (_g = this.state) === null || _g === void 0 ? void 0 : _g.value, onInput: (e) => this.onInput(e), onFocus: e => this.onFocus(e), onClick: e => this.onClick(e), onBlur: e => this.onBlur(e), onKeyDown: e => this.onKeyDown(e), ref: (el) => (this.inputElement = el), onPaste: e => this.onPaste(e) }), h("smoothly-icon", { name: "alert-circle", color: "danger", fill: "clear", size: "small" }), h("label", { htmlFor: this.name }, h("slot", null))));
182
185
  }
183
186
  static get watchers() { return {
184
- "value": ["valueWatcher"]
187
+ "value": ["valueWatcher"],
188
+ "currency": ["onCurrency"]
185
189
  }; }
186
190
  };
187
191
  function getLocale() {
@@ -24,6 +24,7 @@ export declare class SmoothlyInput {
24
24
  value: any;
25
25
  }>;
26
26
  valueWatcher(value: any, before: any): void;
27
+ onCurrency(): void;
27
28
  componentWillLoad(): void;
28
29
  componentDidRender(): void;
29
30
  getFormData(name: string): Promise<Record<string, any>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smoothly",
3
- "version": "0.1.93",
3
+ "version": "0.1.94",
4
4
  "description": "Web component library written in Stencil.",
5
5
  "author": "PayFunc",
6
6
  "license": "MIT",