smoothly 0.3.65 → 0.3.67

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.
@@ -20337,6 +20337,12 @@ class StateEditor {
20337
20337
  padStart(length, padding) {
20338
20338
  return this.pad(length, padding, 0);
20339
20339
  }
20340
+ toLower() {
20341
+ return this.map(symbol => symbol.toLowerCase());
20342
+ }
20343
+ toUpper() {
20344
+ return this.map(symbol => symbol.toUpperCase());
20345
+ }
20340
20346
  map(mapping) {
20341
20347
  let result = this;
20342
20348
  let j = 0;
@@ -20478,12 +20484,12 @@ function parse(value, type, ...argument) {
20478
20484
  return handler ? handler.fromString(handler.unformat(StateEditor.modify(value)).value) : undefined;
20479
20485
  }
20480
20486
 
20481
- class Handler$f {
20487
+ class Handler$h {
20482
20488
  toString(data) {
20483
20489
  return typeof data == "string" ? data : "";
20484
20490
  }
20485
20491
  fromString(value) {
20486
- return typeof value == "string" ? value : undefined;
20492
+ return typeof value == "string" && !!value ? value : undefined;
20487
20493
  }
20488
20494
  format(unformatted) {
20489
20495
  return { ...unformatted, type: "tel", autocomplete: "cc-csc", length: [3, 3], pattern: /^\d{3}$/ };
@@ -20495,9 +20501,9 @@ class Handler$f {
20495
20501
  return state.value.length < 3 && symbol >= "0" && symbol <= "9";
20496
20502
  }
20497
20503
  }
20498
- add("card-csc", () => new Handler$f());
20504
+ add("card-csc", () => new Handler$h());
20499
20505
 
20500
- class Handler$e {
20506
+ class Handler$g {
20501
20507
  toString(data) {
20502
20508
  return Array.isArray(data) && data.length == 2 && typeof data[0] == "number" && typeof data[1] == "number"
20503
20509
  ? data[0].toString().padStart(2, "0") + data[1].toString().padStart(2, "0")
@@ -20523,14 +20529,14 @@ class Handler$e {
20523
20529
  return state.value.length < 4 && symbol >= "0" && symbol <= "9";
20524
20530
  }
20525
20531
  }
20526
- add("card-expires", () => new Handler$e());
20532
+ add("card-expires", () => new Handler$g());
20527
20533
 
20528
- class Handler$d {
20534
+ class Handler$f {
20529
20535
  toString(data) {
20530
20536
  return typeof data == "string" ? data : "";
20531
20537
  }
20532
20538
  fromString(value) {
20533
- return typeof value == "string" ? value : undefined;
20539
+ return typeof value == "string" && !!value ? value : undefined;
20534
20540
  }
20535
20541
  format(unformatted) {
20536
20542
  const issuer = getIssuer(unformatted.value);
@@ -20552,7 +20558,7 @@ class Handler$d {
20552
20558
  return symbol >= "0" && symbol <= "9" && state.value.length < issuer.length[0];
20553
20559
  }
20554
20560
  }
20555
- add("card-number", () => new Handler$d());
20561
+ add("card-number", () => new Handler$f());
20556
20562
  function getIssuer(value) {
20557
20563
  let result = defaultIssuer;
20558
20564
  for (const key in issuers)
@@ -26902,7 +26908,7 @@ add("date", (parameters) => {
26902
26908
  return create();
26903
26909
  });
26904
26910
 
26905
- class Handler$c extends Base {
26911
+ class Handler$e extends Base {
26906
26912
  constructor(separator) {
26907
26913
  super(separator);
26908
26914
  }
@@ -26950,11 +26956,11 @@ class Handler$c extends Base {
26950
26956
  : state.selection.start < 8 && symbol >= "0" && symbol <= "9";
26951
26957
  }
26952
26958
  }
26953
- register("dd.mm.YYYY", () => new Handler$c("."));
26954
- register("dd/mm/YYYY", () => new Handler$c("/"));
26955
- register("dd-mm-YYYY", () => new Handler$c("-"));
26959
+ register("dd.mm.YYYY", () => new Handler$e("."));
26960
+ register("dd/mm/YYYY", () => new Handler$e("/"));
26961
+ register("dd-mm-YYYY", () => new Handler$e("-"));
26956
26962
 
26957
- class Handler$b extends Base {
26963
+ class Handler$d extends Base {
26958
26964
  constructor(separator) {
26959
26965
  super(separator);
26960
26966
  }
@@ -26999,9 +27005,9 @@ class Handler$b extends Base {
26999
27005
  return result;
27000
27006
  }
27001
27007
  }
27002
- register("mm/dd/YYYY", () => new Handler$b("/"));
27008
+ register("mm/dd/YYYY", () => new Handler$d("/"));
27003
27009
 
27004
- class Handler$a extends Base {
27010
+ class Handler$c extends Base {
27005
27011
  constructor(separator) {
27006
27012
  super(separator);
27007
27013
  }
@@ -27050,9 +27056,9 @@ class Handler$a extends Base {
27050
27056
  : state.selection.start < 8 && symbol >= "0" && symbol <= "9";
27051
27057
  }
27052
27058
  }
27053
- register("YYYY-mm-dd", () => new Handler$a("-"));
27059
+ register("YYYY-mm-dd", () => new Handler$c("-"));
27054
27060
 
27055
- class Handler$9 {
27061
+ class Handler$b {
27056
27062
  toString(data) {
27057
27063
  return typeof data == "string" ? data : "";
27058
27064
  }
@@ -27105,7 +27111,7 @@ class Handler$9 {
27105
27111
  ((symbol >= "0" && symbol <= "9") || symbol == "-" || symbol == ":" || symbol == "." || symbol == " "));
27106
27112
  }
27107
27113
  }
27108
- add("date-time", () => new Handler$9());
27114
+ add("date-time", () => new Handler$b());
27109
27115
  function formatDate(unformatted, format) {
27110
27116
  let result = unformatted;
27111
27117
  switch (format) {
@@ -27202,7 +27208,7 @@ function daysPerMonth(year, month) {
27202
27208
  return result;
27203
27209
  }
27204
27210
 
27205
- class Handler$8 {
27211
+ class Handler$a {
27206
27212
  toString(data) {
27207
27213
  return Array.isArray(data) && data.length == 2 && typeof data[0] == "number" && typeof data[1] == "number"
27208
27214
  ? data[0].toString() + " / " + data[1].toString()
@@ -27258,9 +27264,9 @@ class Handler$8 {
27258
27264
  return state.value.length < 7 && ((symbol >= "0" && symbol <= "9") || symbol == "/" || symbol == " ");
27259
27265
  }
27260
27266
  }
27261
- add("divisor", () => new Handler$8());
27267
+ add("divisor", () => new Handler$a());
27262
27268
 
27263
- class Handler$7 {
27269
+ class Handler$9 {
27264
27270
  constructor() {
27265
27271
  this.separator = ":";
27266
27272
  this.patterns = {
@@ -27342,9 +27348,96 @@ class Handler$7 {
27342
27348
  return !!nextValue.match(this.patterns.allowed);
27343
27349
  }
27344
27350
  }
27345
- add("duration", () => new Handler$7());
27351
+ add("duration", () => new Handler$9());
27346
27352
 
27347
- class Handler$6 {
27353
+ class Handler$8 {
27354
+ constructor(settings, mode) {
27355
+ this.settings = settings;
27356
+ this.mode = mode;
27357
+ }
27358
+ toString(data) {
27359
+ return typeof data == "string" ? data : "";
27360
+ }
27361
+ fromString(value) {
27362
+ return typeof value == "string" && !!value ? value : undefined;
27363
+ }
27364
+ split(unformatted) {
27365
+ let firstAllowedSymbol;
27366
+ let previousAllowedSymbol = "";
27367
+ return unformatted
27368
+ .map((symbol, index) => {
27369
+ const newSymbol = index !== 0 &&
27370
+ symbol === symbol.toUpperCase() &&
27371
+ isNaN(+symbol) &&
27372
+ previousAllowedSymbol !== " " &&
27373
+ this.isSymbolAllowed(symbol) &&
27374
+ firstAllowedSymbol
27375
+ ? " " + symbol
27376
+ : (symbol === "_" || symbol === "-") && previousAllowedSymbol !== " "
27377
+ ? " "
27378
+ : (symbol === " " && previousAllowedSymbol === " ") ||
27379
+ !this.isSymbolAllowed(symbol) ||
27380
+ (!firstAllowedSymbol && !this.isSymbolLetter(symbol) && this.mode !== "code")
27381
+ ? ""
27382
+ : symbol;
27383
+ !firstAllowedSymbol && (firstAllowedSymbol = this.isSymbolLetter(symbol));
27384
+ this.isSymbolAllowed(symbol) && (previousAllowedSymbol = symbol);
27385
+ return newSymbol;
27386
+ })
27387
+ .toLower()
27388
+ .delete("-")
27389
+ .delete("_");
27390
+ }
27391
+ isSymbolLetter(symbol) {
27392
+ return (symbol >= "a" && symbol <= "z") || (symbol >= "A" && symbol <= "Z");
27393
+ }
27394
+ isSymbolAllowed(symbol) {
27395
+ return this.isSymbolLetter(symbol) || (symbol >= "0" && symbol <= "9") || symbol === " ";
27396
+ }
27397
+ format(unformatted) {
27398
+ const alignedString = this.split(unformatted);
27399
+ let result;
27400
+ switch (this.mode) {
27401
+ case "code":
27402
+ result = alignedString.delete(" ");
27403
+ break;
27404
+ case "pascal":
27405
+ case "camel":
27406
+ let previousSpace;
27407
+ result = alignedString
27408
+ .map((symbol, index) => {
27409
+ const newSymbol = (index === 0 && this.mode === "pascal") || previousSpace ? symbol.toUpperCase() : symbol.toLowerCase();
27410
+ previousSpace = symbol == " ";
27411
+ return newSymbol;
27412
+ })
27413
+ .delete(" ");
27414
+ break;
27415
+ case "snake":
27416
+ case "attribute":
27417
+ result = alignedString.replace(" ", this.mode === "snake" ? "_" : "-");
27418
+ break;
27419
+ default:
27420
+ result = unformatted;
27421
+ }
27422
+ return { ...result, ...this.settings, type: "text", autocomplete: "on" };
27423
+ }
27424
+ unformat(formatted) {
27425
+ return formatted;
27426
+ }
27427
+ allowed(symbol, state) {
27428
+ return (this.isSymbolLetter(symbol) ||
27429
+ (symbol >= "0" && symbol <= "9" && (this.mode == "code" || state.value.length > 0)) ||
27430
+ (symbol == "_" && this.mode == "snake" && state.value.length > 0) ||
27431
+ (symbol == "-" && this.mode == "attribute" && state.value.length > 0));
27432
+ }
27433
+ }
27434
+ add("identifier-code", (settings) => new Handler$8(settings || {}, "code"));
27435
+ add("identifier-pascal", (settings) => new Handler$8(settings || {}, "pascal"));
27436
+ add("identifier-snake", (settings) => new Handler$8(settings || {}, "snake"));
27437
+ add("identifier-camel", (settings) => new Handler$8(settings || {}, "camel"));
27438
+ add("identifier-attribute", (settings) => new Handler$8(settings || {}, "attribute"));
27439
+
27440
+ class Handler$7 {
27348
27441
  constructor(country) {
27349
27442
  this.country = country;
27350
27443
  }
@@ -27352,7 +27445,7 @@ class Handler$6 {
27352
27445
  return typeof data == "string" ? data : "";
27353
27446
  }
27354
27447
  fromString(value) {
27355
- return typeof value == "string" ? value : undefined;
27448
+ return typeof value == "string" && !!value ? value : undefined;
27356
27449
  }
27357
27450
  format(unformatted) {
27358
27451
  let result = unformatted;
@@ -27375,14 +27468,39 @@ class Handler$6 {
27375
27468
  return state.value.length < 13 && symbol >= "0" && symbol <= "9";
27376
27469
  }
27377
27470
  }
27378
- add("identity-number", (argument) => new Handler$6(argument && argument.length > 0 ? argument[0] : undefined));
27471
+ add("identity-number", (argument) => new Handler$7(argument && argument.length > 0 ? argument[0] : undefined));
27472
+
27473
+ class Handler$6 {
27474
+ toString(data) {
27475
+ return typeof data == "number" ? data.toString() : "";
27476
+ }
27477
+ fromString(value) {
27478
+ const parsed = typeof value == "string" ? Number.parseInt(value) : undefined;
27479
+ return typeof parsed == "number" && !Number.isNaN(parsed) ? parsed : undefined;
27480
+ }
27481
+ format(unformatted) {
27482
+ return {
27483
+ ...unformatted,
27484
+ type: "number",
27485
+ length: [3, undefined],
27486
+ pattern: /^[0-9]+$/,
27487
+ };
27488
+ }
27489
+ unformat(formatted) {
27490
+ return formatted;
27491
+ }
27492
+ allowed(symbol, state) {
27493
+ return symbol >= "0" && symbol <= "9";
27494
+ }
27495
+ }
27496
+ add("integer", () => new Handler$6());
27379
27497
 
27380
27498
  class Handler$5 {
27381
27499
  toString(data) {
27382
27500
  return typeof data == "string" ? data : "";
27383
27501
  }
27384
27502
  fromString(value) {
27385
- return typeof value == "string" ? value : undefined;
27503
+ return typeof value == "string" && !!value ? value : undefined;
27386
27504
  }
27387
27505
  format(unformatted) {
27388
27506
  return { ...unformatted, type: "password", autocomplete: "current-password" };
@@ -27724,7 +27842,7 @@ class Handler$3 {
27724
27842
  return typeof data == "string" ? data : "";
27725
27843
  }
27726
27844
  fromString(value) {
27727
- return typeof value == "string" ? value : undefined;
27845
+ return typeof value == "string" && !!value ? value : undefined;
27728
27846
  }
27729
27847
  format(unformatted) {
27730
27848
  let result = unformatted;
@@ -27801,7 +27919,7 @@ class Handler$2 {
27801
27919
  return typeof data == "string" ? data : "";
27802
27920
  }
27803
27921
  fromString(value) {
27804
- return typeof value == "string" ? value : undefined;
27922
+ return typeof value == "string" && !!value ? value : undefined;
27805
27923
  }
27806
27924
  format(unformatted) {
27807
27925
  const result = !unformatted.value.includes(" ") && unformatted.value.length >= 4 ? unformatted.insert(3, " ") : unformatted;
@@ -27834,19 +27952,17 @@ class Handler$1 {
27834
27952
  return result != undefined && !isNaN(result) ? result : undefined;
27835
27953
  }
27836
27954
  format(unformatted) {
27837
- let separator = unformatted.value && unformatted.value.includes(".") ? unformatted.value.indexOf(".") : undefined;
27838
27955
  let result = unformatted.value == "NaN" ? unformatted.replace(0, unformatted.value.length, "") : StateEditor.copy(unformatted);
27956
+ const decimals = this.currency && Currency.decimalDigits(this.currency);
27957
+ if (!result.value.includes(".") && decimals && Math.abs(Number.parseFloat(result.value)) > 0)
27958
+ result = result.suffix(".0");
27959
+ let separator = result.value && result.value.includes(".") ? result.value.indexOf(".") : undefined;
27839
27960
  if (separator == 0) {
27840
27961
  result = result.prepend("0");
27841
27962
  separator++;
27842
27963
  }
27843
27964
  if (separator != undefined) {
27844
- const adjust = separator +
27845
- 1 +
27846
- (!this.currency || Currency.decimalDigits(this.currency) == undefined
27847
- ? 2
27848
- : Currency.decimalDigits(this.currency) ?? 2) -
27849
- result.value.length;
27965
+ const adjust = separator + 1 + (decimals ?? 2) - result.value.length;
27850
27966
  result = adjust < 0 ? result.truncate(result.value.length + adjust) : result.suffix("0".repeat(adjust));
27851
27967
  }
27852
27968
  else
@@ -27889,7 +28005,7 @@ class Handler {
27889
28005
  return typeof data == "string" ? data : "";
27890
28006
  }
27891
28007
  fromString(value) {
27892
- return typeof value == "string" ? value : undefined;
28008
+ return typeof value == "string" && !!value ? value : undefined;
27893
28009
  }
27894
28010
  format(unformatted) {
27895
28011
  return { ...unformatted, type: "text", ...this.settings };
@@ -28101,6 +28217,8 @@ const SmoothlyGoogleFont$1 = class extends HTMLElement {
28101
28217
  }
28102
28218
  };
28103
28219
 
28220
+ const alertCircle = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><title>ionicons-v5-a</title><path d="M256,48C141.31,48,48,141.31,48,256s93.31,208,208,208,208-93.31,208-208S370.69,48,256,48Zm0,319.91a20,20,0,1,1,20-20A20,20,0,0,1,256,367.91Zm21.72-201.15-5.74,122a16,16,0,0,1-32,0l-5.74-121.94v-.05a21.74,21.74,0,1,1,43.44,0Z"/></svg>`;
28221
+
28104
28222
  const styleCss$B = "[size].sc-smoothly-icon-h{background:none}.sc-smoothly-icon-h{display:block;transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0)}[hidden].sc-smoothly-icon-h{display:none}[size=tiny].sc-smoothly-icon-h{width:1.2em;height:1.2em}[size=small].sc-smoothly-icon-h{width:1.4em;height:1.4em}[size=medium].sc-smoothly-icon-h{width:1.8em;height:1.8em}[size=large].sc-smoothly-icon-h{width:2.8em;height:2.8em}[size=xlarge].sc-smoothly-icon-h{width:4em;height:4em}";
28105
28223
 
28106
28224
  const SmoothlyIcon$1 = class extends HTMLElement {
@@ -28115,7 +28233,9 @@ const SmoothlyIcon$1 = class extends HTMLElement {
28115
28233
  this.document = undefined;
28116
28234
  }
28117
28235
  async loadDocument() {
28118
- if (this.name)
28236
+ if (this.name == "alert-circle")
28237
+ this.document = alertCircle;
28238
+ else if (this.name)
28119
28239
  try {
28120
28240
  this.document = await Icon.load(this.name);
28121
28241
  }
@@ -28957,7 +29077,7 @@ const SmoothlyInputDemo$1 = class extends HTMLElement {
28957
29077
  }
28958
29078
  render() {
28959
29079
  return [
28960
- h("form", { action: "done", style: { position: "relative" } }, h("header", null, h("h5", null, "Form")), h("main", null, h("fieldset", null, h("h2", null, "Smoothly Input"), h("h3", null, "Card"), h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"), h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input-date", null), h("smoothly-input", { type: "date", name: "date" }, "Date"), h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), h("h3", null, "Contact"), h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), h("smoothly-input", { type: "password", name: "password" }, "Password"), h("smoothly-input", { type: "email", name: "email" }, "Email"), h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), h("smoothly-input-date", { name: "some-date" }, "Calendar"), h("smoothly-input-date", { name: "some-date", color: "tertiary" }, "Calendar (chosen color)"), h("smoothly-input-date", { name: "some-date", flexible: true }, "Calendar (no min-width)")), h("fieldset", null, h("h2", null, "Smoothly Radio"), h("h3", null, "Deselectable Radio List with button"), h("smoothly-radio-button", { deselectable: true, decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "primary", iconColor: "medium" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, iconColor: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, iconColor: "danger" }, h("span", null, "Option 3")), h("smoothly-radio-button-item", { value: { some: "some", yes: "thing" }, disabled: true }, h("span", null, "Option 4 (Disabled)"))), h("h3", null, "Radio List with button"), h("smoothly-radio-button", { decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "warning" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } }, h("span", null, "Option 3"))), h("h3", null, "Radio List ", h("b", null, "without button")), h("smoothly-radio-button", null, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, selected: true, color: "light" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, color: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, color: "light" }, h("span", null, "Option 3"))), h("smoothly-radio", { name: "option", value: "1" }, "option 1"), h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), h("smoothly-radio", { name: "option", value: "3" }, "option 3")), h("fieldset", null, h("h2", null, "Smoothly Accordion"), h("smoothly-accordion", null, h("smoothly-accordion-item", { name: "A", open: true }, h("smoothly-radio", { name: "a", value: "1" }, "a 1"), h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), h("smoothly-radio", { name: "a", value: "3" }, "a 3")), h("smoothly-accordion-item", { name: "B" }, h("smoothly-radio", { name: "b", value: "1" }, "b 1"), h("smoothly-radio", { name: "b", value: "2" }, "b 2"), h("smoothly-radio", { name: "b", value: "3" }, "b 3")))), h("fieldset", null, h("h2", null, "Smoothly checkbox"), h("smoothly-checkbox", { selectAll: true, intermediate: true }), h("smoothly-checkbox", null), h("smoothly-checkbox", { disabled: true })), h("fieldset", null, h("h2", null, "Smoothly addresses"), h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))), h("footer", null, h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-submit", { disabled: true, expand: "block", onClick: e => console.log(e), onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
29080
+ h("form", { action: "done", style: { position: "relative" } }, h("header", null, h("h5", null, "Form")), h("main", null, h("fieldset", null, h("h2", null, "Smoothly Input"), h("h3", null, "Card"), h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"), h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"), h("smoothly-input-date", null), h("smoothly-input", { type: "date", name: "date" }, "Date"), h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"), h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"), h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"), h("smoothly-input", { type: "card-number", name: "card" }, "Card #"), h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"), h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"), h("h3", null, "Contact"), h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"), h("smoothly-input", { type: "text", name: "testing" }, "Texttest"), h("smoothly-input", { type: "integer", name: "integer" }, "Integer"), h("smoothly-input", { type: "identifier-code", name: "identifier-code" }, "Identifier"), h("smoothly-input", { type: "password", name: "password" }, "Password"), h("smoothly-input", { type: "email", name: "email" }, "Email"), h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"), h("smoothly-input", { type: "percent", name: "percent" }, "Percent"), h("smoothly-input", { type: "phone", name: "phone" }, "Phone"), h("smoothly-input-date", { name: "some-date" }, "Calendar"), h("smoothly-input-date", { name: "some-date", color: "tertiary" }, "Calendar (chosen color)"), h("smoothly-input-date", { name: "some-date", flexible: true }, "Calendar (no min-width)")), h("fieldset", null, h("h2", null, "Smoothly Radio"), h("h3", null, "Deselectable Radio List with button"), h("smoothly-radio-button", { deselectable: true, decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "primary", iconColor: "medium" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, iconColor: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, iconColor: "danger" }, h("span", null, "Option 3")), h("smoothly-radio-button-item", { value: { some: "some", yes: "thing" }, disabled: true }, h("span", null, "Option 4 (Disabled)"))), h("h3", null, "Radio List with button"), h("smoothly-radio-button", { decoration: "button" }, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, color: "warning" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } }, h("span", null, "Option 3"))), h("h3", null, "Radio List ", h("b", null, "without button")), h("smoothly-radio-button", null, h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" }, selected: true, color: "light" }, h("span", null, "Option 1"), h("span", { slot: "expansion" }, "Some description.")), h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" }, color: "light" }, h("span", null, "Option 2"), h("span", { slot: "expansion" }, "Some other description.")), h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" }, color: "light" }, h("span", null, "Option 3"))), h("smoothly-radio", { name: "option", value: "1" }, "option 1"), h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"), h("smoothly-radio", { name: "option", value: "3" }, "option 3")), h("fieldset", null, h("h2", null, "Smoothly Accordion"), h("smoothly-accordion", null, h("smoothly-accordion-item", { name: "A", open: true }, h("smoothly-radio", { name: "a", value: "1" }, "a 1"), h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"), h("smoothly-radio", { name: "a", value: "3" }, "a 3")), h("smoothly-accordion-item", { name: "B" }, h("smoothly-radio", { name: "b", value: "1" }, "b 1"), h("smoothly-radio", { name: "b", value: "2" }, "b 2"), h("smoothly-radio", { name: "b", value: "3" }, "b 3")))), h("fieldset", null, h("h2", null, "Smoothly checkbox"), h("smoothly-checkbox", { selectAll: true, intermediate: true }), h("smoothly-checkbox", null), h("smoothly-checkbox", { disabled: true })), h("fieldset", null, h("h2", null, "Smoothly addresses"), h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }), h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }), h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))), h("footer", null, h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-submit", { disabled: true, expand: "block", onClick: e => console.log(e), onSubmit: (e) => alert(e), color: "success" }, "Submit"), h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
28961
29081
  h("smoothly-backtotop", null),
28962
29082
  ];
28963
29083
  }