smoothly 1.0.0-alpha.150 → 1.0.0-alpha.152

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.
@@ -9113,8 +9113,7 @@ const SmoothlyInput = class {
9113
9113
  let pasted = event.clipboardData ? event.clipboardData.getData("text") : "";
9114
9114
  const backend = event.target;
9115
9115
  pasted = this.expiresAutocompleteFix(backend, pasted);
9116
- for (const letter of pasted)
9117
- this.processKey({ key: letter }, backend);
9116
+ this.processPaste(pasted, backend);
9118
9117
  }
9119
9118
  onInput(event) {
9120
9119
  var _a;
@@ -9146,6 +9145,12 @@ const SmoothlyInput = class {
9146
9145
  : value;
9147
9146
  return value;
9148
9147
  }
9148
+ processPaste(pasted, backend) {
9149
+ if (!this.readonly) {
9150
+ const after = Action.paste(this.formatter, this.state, pasted);
9151
+ this.updateBackend(after, backend);
9152
+ }
9153
+ }
9149
9154
  processKey(event, backend) {
9150
9155
  if (!this.readonly) {
9151
9156
  const after = Action.apply(this.formatter, this.state, event);
@@ -9365,7 +9370,7 @@ const SmoothlyInputDemo = class {
9365
9370
  console.log("smoothlyInput", event.detail);
9366
9371
  }
9367
9372
  render() {
9368
- return (index.h(index.Host, null, index.h("h2", null, "Range"), index.h("smoothly-form", null, index.h("smoothly-input-range", { step: 1 }, index.h("div", { slot: "label" }, "Select number in range"))), index.h("h2", null, "Duration"), index.h("smoothly-form", { looks: "border" }, index.h("smoothly-input", { name: "duration", type: "duration", placeholder: "hh:mm", value: this.duration, onSmoothlyInput: e => {
9373
+ return (index.h(index.Host, null, index.h("h2", null, "Range"), index.h("smoothly-form", null, index.h("smoothly-input-range", { step: 1, name: "range" }, "Select")), index.h("h2", null, "Duration"), index.h("smoothly-form", { looks: "border" }, index.h("smoothly-input", { name: "duration", type: "duration", placeholder: "hh:mm", value: this.duration, onSmoothlyInput: e => {
9369
9374
  const duration = e.detail.duration;
9370
9375
  console.log("event duration", duration);
9371
9376
  this.duration = duration;
@@ -9471,7 +9476,7 @@ const MonthSelector = class {
9471
9476
  };
9472
9477
  MonthSelector.style = styleCss$G;
9473
9478
 
9474
- const styleCss$F = ":host{display:flex;position:relative;flex-wrap:wrap;width:100%;justify-content:space-between}:host .output-container{width:100%;margin:0 1.2em;position:relative;height:2em}:host output{position:absolute;transform:translateX(-50%);font-weight:600;font-size:1.2em;left:var(--left-adjustment, 0)}:host ::slotted(div),:host label{margin-bottom:.5em;font-size:1.5em}input[type=range]{-webkit-appearance:none;width:100%;background:transparent;height:3em}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;height:2em;width:2em;border-radius:50%;background-color:rgb(var(--smoothly-primary-contrast));border:1px rgb(var(--smoothly-primary-contrast)) solid;cursor:pointer;margin-top:.5em;}input[type=range]::-moz-range-thumb{height:2em;width:2em;border-radius:50%;background-color:rgb(var(--smoothly-primary-contrast));border:1px rgb(var(--smoothly-primary-contrast)) solid;cursor:pointer}input[type=range]::-webkit-slider-runnable-track{padding:0 .6em;height:100%;cursor:pointer;background-color:rgb(var(--smoothly-primary-tint));border-radius:20px}input[type=range]::-moz-range-track{width:calc(100% + 1em);height:3em;cursor:pointer;background-color:rgb(var(--smoothly-primary-tint));border-radius:20px}.min,.max{display:inline-block;margin:0.5em .8em}.max{text-align:right}";
9479
+ const styleCss$F = ":host{position:relative;width:100%;justify-content:center;align-items:center;display:flex;padding-top:.8em}:host div{position:relative}:host output{display:block;min-width:3em;text-align:center;margin:0 1em}:host label{position:absolute;display:block;white-space:nowrap;text-align:center;top:-1.5em;font-size:.7em;left:.5em}input[type=range]{-webkit-appearance:none;width:100%;background:transparent;height:2.5em;margin:0}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;height:1.5em;width:.8em;border-radius:20%;background-color:rgb(var(--smoothly-primary-contrast));border:1px #333 solid;cursor:pointer;margin-top:-.5em;}input[type=range]::-moz-range-thumb{height:1.5em;width:.8em;border-radius:20%;background-color:rgb(var(--smoothly-primary-contrast));border:1px rgb(var(--text-color, var(--smoothly-color-contrast))) solid;cursor:pointer}input[type=range]::-webkit-slider-runnable-track{height:.5em;cursor:pointer;background-color:rgb(var(--smoothly-primary-tint));border-radius:20px}input[type=range]::-moz-range-track{width:100%;height:.5em;cursor:pointer;background-color:rgb(var(--smoothly-primary-tint));border-radius:20px}";
9475
9480
 
9476
9481
  const SmoothlyInputRange = class {
9477
9482
  constructor(hostRef) {
@@ -9487,12 +9492,13 @@ const SmoothlyInputRange = class {
9487
9492
  valueChanged() {
9488
9493
  this.smoothlyInput.emit({ [this.name]: this.value });
9489
9494
  }
9490
- inputHandler(e) {
9491
- e.target instanceof HTMLInputElement &&
9492
- (this.value = this.step !== "any" ? e.target.valueAsNumber : Math.round(e.target.valueAsNumber * 100) / 100);
9495
+ inputHandler(event) {
9496
+ event.target instanceof HTMLInputElement &&
9497
+ (this.value =
9498
+ this.step !== "any" ? event.target.valueAsNumber : Math.round(event.target.valueAsNumber * 100) / 100);
9493
9499
  }
9494
9500
  render() {
9495
- return (index.h(index.Host, { style: { "--left-adjustment": `${(this.value / this.max) * 100}%` } }, index.h("slot", { name: "label" }, typeof this.labelText === "string" && index.h("label", { htmlFor: this.name }, this.labelText)), index.h("div", { class: "output-container" }, index.h("output", { htmlFor: this.name }, this.value)), index.h("input", { name: this.name, part: "range", type: "range", min: this.min, max: this.max, step: this.step, onInput: e => this.inputHandler(e), value: this.value }), index.h("p", { class: "min" }, this.min), index.h("p", { class: "max" }, this.max)));
9501
+ return (index.h(index.Host, { style: { "--left-adjustment": `${(this.value / this.max) * 100}%` } }, index.h("div", null, index.h("output", { htmlFor: this.name }, this.value), index.h("label", { htmlFor: this.name }, index.h("slot", null))), index.h("input", { name: this.name, part: "range", type: "range", min: this.min, max: this.max, step: this.step, onInput: event => this.inputHandler(event), value: this.value })));
9496
9502
  }
9497
9503
  static get watchers() { return {
9498
9504
  "value": ["valueChanged"]