smoothly 0.3.66 → 0.3.68
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/dist/cjs/smoothly-accordion_53.cjs.entry.js +153 -37
- package/dist/collection/components/display/index.js +1 -1
- package/dist/collection/components/input-demo/index.js +1 -1
- package/dist/custom-elements/index.js +153 -37
- package/dist/esm/smoothly-accordion_53.entry.js +153 -37
- package/dist/smoothly/p-62c2f80f.entry.js +1 -0
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/package.json +6 -6
- package/dist/smoothly/p-f3f1338e.entry.js +0 -1
|
@@ -607,6 +607,12 @@ class StateEditor {
|
|
|
607
607
|
padStart(length, padding) {
|
|
608
608
|
return this.pad(length, padding, 0);
|
|
609
609
|
}
|
|
610
|
+
toLower() {
|
|
611
|
+
return this.map(symbol => symbol.toLowerCase());
|
|
612
|
+
}
|
|
613
|
+
toUpper() {
|
|
614
|
+
return this.map(symbol => symbol.toUpperCase());
|
|
615
|
+
}
|
|
610
616
|
map(mapping) {
|
|
611
617
|
let result = this;
|
|
612
618
|
let j = 0;
|
|
@@ -748,12 +754,12 @@ function parse(value, type, ...argument) {
|
|
|
748
754
|
return handler ? handler.fromString(handler.unformat(StateEditor.modify(value)).value) : undefined;
|
|
749
755
|
}
|
|
750
756
|
|
|
751
|
-
class Handler$
|
|
757
|
+
class Handler$h {
|
|
752
758
|
toString(data) {
|
|
753
759
|
return typeof data == "string" ? data : "";
|
|
754
760
|
}
|
|
755
761
|
fromString(value) {
|
|
756
|
-
return typeof value == "string" ? value : undefined;
|
|
762
|
+
return typeof value == "string" && !!value ? value : undefined;
|
|
757
763
|
}
|
|
758
764
|
format(unformatted) {
|
|
759
765
|
return { ...unformatted, type: "tel", autocomplete: "cc-csc", length: [3, 3], pattern: /^\d{3}$/ };
|
|
@@ -765,9 +771,9 @@ class Handler$f {
|
|
|
765
771
|
return state.value.length < 3 && symbol >= "0" && symbol <= "9";
|
|
766
772
|
}
|
|
767
773
|
}
|
|
768
|
-
add("card-csc", () => new Handler$
|
|
774
|
+
add("card-csc", () => new Handler$h());
|
|
769
775
|
|
|
770
|
-
class Handler$
|
|
776
|
+
class Handler$g {
|
|
771
777
|
toString(data) {
|
|
772
778
|
return Array.isArray(data) && data.length == 2 && typeof data[0] == "number" && typeof data[1] == "number"
|
|
773
779
|
? data[0].toString().padStart(2, "0") + data[1].toString().padStart(2, "0")
|
|
@@ -793,14 +799,14 @@ class Handler$e {
|
|
|
793
799
|
return state.value.length < 4 && symbol >= "0" && symbol <= "9";
|
|
794
800
|
}
|
|
795
801
|
}
|
|
796
|
-
add("card-expires", () => new Handler$
|
|
802
|
+
add("card-expires", () => new Handler$g());
|
|
797
803
|
|
|
798
|
-
class Handler$
|
|
804
|
+
class Handler$f {
|
|
799
805
|
toString(data) {
|
|
800
806
|
return typeof data == "string" ? data : "";
|
|
801
807
|
}
|
|
802
808
|
fromString(value) {
|
|
803
|
-
return typeof value == "string" ? value : undefined;
|
|
809
|
+
return typeof value == "string" && !!value ? value : undefined;
|
|
804
810
|
}
|
|
805
811
|
format(unformatted) {
|
|
806
812
|
const issuer = getIssuer(unformatted.value);
|
|
@@ -822,7 +828,7 @@ class Handler$d {
|
|
|
822
828
|
return symbol >= "0" && symbol <= "9" && state.value.length < issuer.length[0];
|
|
823
829
|
}
|
|
824
830
|
}
|
|
825
|
-
add("card-number", () => new Handler$
|
|
831
|
+
add("card-number", () => new Handler$f());
|
|
826
832
|
function getIssuer(value) {
|
|
827
833
|
let result = defaultIssuer;
|
|
828
834
|
for (const key in issuers)
|
|
@@ -7172,7 +7178,7 @@ add("date", (parameters) => {
|
|
|
7172
7178
|
return create();
|
|
7173
7179
|
});
|
|
7174
7180
|
|
|
7175
|
-
class Handler$
|
|
7181
|
+
class Handler$e extends Base {
|
|
7176
7182
|
constructor(separator) {
|
|
7177
7183
|
super(separator);
|
|
7178
7184
|
}
|
|
@@ -7220,11 +7226,11 @@ class Handler$c extends Base {
|
|
|
7220
7226
|
: state.selection.start < 8 && symbol >= "0" && symbol <= "9";
|
|
7221
7227
|
}
|
|
7222
7228
|
}
|
|
7223
|
-
register("dd.mm.YYYY", () => new Handler$
|
|
7224
|
-
register("dd/mm/YYYY", () => new Handler$
|
|
7225
|
-
register("dd-mm-YYYY", () => new Handler$
|
|
7229
|
+
register("dd.mm.YYYY", () => new Handler$e("."));
|
|
7230
|
+
register("dd/mm/YYYY", () => new Handler$e("/"));
|
|
7231
|
+
register("dd-mm-YYYY", () => new Handler$e("-"));
|
|
7226
7232
|
|
|
7227
|
-
class Handler$
|
|
7233
|
+
class Handler$d extends Base {
|
|
7228
7234
|
constructor(separator) {
|
|
7229
7235
|
super(separator);
|
|
7230
7236
|
}
|
|
@@ -7269,9 +7275,9 @@ class Handler$b extends Base {
|
|
|
7269
7275
|
return result;
|
|
7270
7276
|
}
|
|
7271
7277
|
}
|
|
7272
|
-
register("mm/dd/YYYY", () => new Handler$
|
|
7278
|
+
register("mm/dd/YYYY", () => new Handler$d("/"));
|
|
7273
7279
|
|
|
7274
|
-
class Handler$
|
|
7280
|
+
class Handler$c extends Base {
|
|
7275
7281
|
constructor(separator) {
|
|
7276
7282
|
super(separator);
|
|
7277
7283
|
}
|
|
@@ -7320,9 +7326,9 @@ class Handler$a extends Base {
|
|
|
7320
7326
|
: state.selection.start < 8 && symbol >= "0" && symbol <= "9";
|
|
7321
7327
|
}
|
|
7322
7328
|
}
|
|
7323
|
-
register("YYYY-mm-dd", () => new Handler$
|
|
7329
|
+
register("YYYY-mm-dd", () => new Handler$c("-"));
|
|
7324
7330
|
|
|
7325
|
-
class Handler$
|
|
7331
|
+
class Handler$b {
|
|
7326
7332
|
toString(data) {
|
|
7327
7333
|
return typeof data == "string" ? data : "";
|
|
7328
7334
|
}
|
|
@@ -7375,7 +7381,7 @@ class Handler$9 {
|
|
|
7375
7381
|
((symbol >= "0" && symbol <= "9") || symbol == "-" || symbol == ":" || symbol == "." || symbol == " "));
|
|
7376
7382
|
}
|
|
7377
7383
|
}
|
|
7378
|
-
add("date-time", () => new Handler$
|
|
7384
|
+
add("date-time", () => new Handler$b());
|
|
7379
7385
|
function formatDate(unformatted, format) {
|
|
7380
7386
|
let result = unformatted;
|
|
7381
7387
|
switch (format) {
|
|
@@ -7472,7 +7478,7 @@ function daysPerMonth(year, month) {
|
|
|
7472
7478
|
return result;
|
|
7473
7479
|
}
|
|
7474
7480
|
|
|
7475
|
-
class Handler$
|
|
7481
|
+
class Handler$a {
|
|
7476
7482
|
toString(data) {
|
|
7477
7483
|
return Array.isArray(data) && data.length == 2 && typeof data[0] == "number" && typeof data[1] == "number"
|
|
7478
7484
|
? data[0].toString() + " / " + data[1].toString()
|
|
@@ -7528,9 +7534,9 @@ class Handler$8 {
|
|
|
7528
7534
|
return state.value.length < 7 && ((symbol >= "0" && symbol <= "9") || symbol == "/" || symbol == " ");
|
|
7529
7535
|
}
|
|
7530
7536
|
}
|
|
7531
|
-
add("divisor", () => new Handler$
|
|
7537
|
+
add("divisor", () => new Handler$a());
|
|
7532
7538
|
|
|
7533
|
-
class Handler$
|
|
7539
|
+
class Handler$9 {
|
|
7534
7540
|
constructor() {
|
|
7535
7541
|
this.separator = ":";
|
|
7536
7542
|
this.patterns = {
|
|
@@ -7612,9 +7618,96 @@ class Handler$7 {
|
|
|
7612
7618
|
return !!nextValue.match(this.patterns.allowed);
|
|
7613
7619
|
}
|
|
7614
7620
|
}
|
|
7615
|
-
add("duration", () => new Handler$
|
|
7621
|
+
add("duration", () => new Handler$9());
|
|
7616
7622
|
|
|
7617
|
-
class Handler$
|
|
7623
|
+
class Handler$8 {
|
|
7624
|
+
constructor(settings, mode) {
|
|
7625
|
+
this.settings = settings;
|
|
7626
|
+
this.mode = mode;
|
|
7627
|
+
}
|
|
7628
|
+
toString(data) {
|
|
7629
|
+
return typeof data == "string" ? data : "";
|
|
7630
|
+
}
|
|
7631
|
+
fromString(value) {
|
|
7632
|
+
return typeof value == "string" && !!value ? value : undefined;
|
|
7633
|
+
}
|
|
7634
|
+
split(unformatted) {
|
|
7635
|
+
let firstAllowedSymbol;
|
|
7636
|
+
let previousAllowedSymbol = "";
|
|
7637
|
+
return unformatted
|
|
7638
|
+
.map((symbol, index) => {
|
|
7639
|
+
const newSymbol = index !== 0 &&
|
|
7640
|
+
symbol === symbol.toUpperCase() &&
|
|
7641
|
+
isNaN(+symbol) &&
|
|
7642
|
+
previousAllowedSymbol !== " " &&
|
|
7643
|
+
this.isSymbolAllowed(symbol) &&
|
|
7644
|
+
firstAllowedSymbol
|
|
7645
|
+
? " " + symbol
|
|
7646
|
+
: (symbol === "_" || symbol === "-") && previousAllowedSymbol !== " "
|
|
7647
|
+
? " "
|
|
7648
|
+
: (symbol === " " && previousAllowedSymbol === " ") ||
|
|
7649
|
+
!this.isSymbolAllowed(symbol) ||
|
|
7650
|
+
(!firstAllowedSymbol && !this.isSymbolLetter(symbol) && this.mode !== "code")
|
|
7651
|
+
? ""
|
|
7652
|
+
: symbol;
|
|
7653
|
+
!firstAllowedSymbol && (firstAllowedSymbol = this.isSymbolLetter(symbol));
|
|
7654
|
+
this.isSymbolAllowed(symbol) && (previousAllowedSymbol = symbol);
|
|
7655
|
+
return newSymbol;
|
|
7656
|
+
})
|
|
7657
|
+
.toLower()
|
|
7658
|
+
.delete("-")
|
|
7659
|
+
.delete("_");
|
|
7660
|
+
}
|
|
7661
|
+
isSymbolLetter(symbol) {
|
|
7662
|
+
return (symbol >= "a" && symbol <= "z") || (symbol >= "A" && symbol <= "Z");
|
|
7663
|
+
}
|
|
7664
|
+
isSymbolAllowed(symbol) {
|
|
7665
|
+
return this.isSymbolLetter(symbol) || (symbol >= "0" && symbol <= "9") || symbol === " ";
|
|
7666
|
+
}
|
|
7667
|
+
format(unformatted) {
|
|
7668
|
+
const alignedString = this.split(unformatted);
|
|
7669
|
+
let result;
|
|
7670
|
+
switch (this.mode) {
|
|
7671
|
+
case "code":
|
|
7672
|
+
result = alignedString.delete(" ");
|
|
7673
|
+
break;
|
|
7674
|
+
case "pascal":
|
|
7675
|
+
case "camel":
|
|
7676
|
+
let previousSpace;
|
|
7677
|
+
result = alignedString
|
|
7678
|
+
.map((symbol, index) => {
|
|
7679
|
+
const newSymbol = (index === 0 && this.mode === "pascal") || previousSpace ? symbol.toUpperCase() : symbol.toLowerCase();
|
|
7680
|
+
previousSpace = symbol == " ";
|
|
7681
|
+
return newSymbol;
|
|
7682
|
+
})
|
|
7683
|
+
.delete(" ");
|
|
7684
|
+
break;
|
|
7685
|
+
case "snake":
|
|
7686
|
+
case "attribute":
|
|
7687
|
+
result = alignedString.replace(" ", this.mode === "snake" ? "_" : "-");
|
|
7688
|
+
break;
|
|
7689
|
+
default:
|
|
7690
|
+
result = unformatted;
|
|
7691
|
+
}
|
|
7692
|
+
return { ...result, ...this.settings, type: "text", autocomplete: "on" };
|
|
7693
|
+
}
|
|
7694
|
+
unformat(formatted) {
|
|
7695
|
+
return formatted;
|
|
7696
|
+
}
|
|
7697
|
+
allowed(symbol, state) {
|
|
7698
|
+
return (this.isSymbolLetter(symbol) ||
|
|
7699
|
+
(symbol >= "0" && symbol <= "9" && (this.mode == "code" || state.value.length > 0)) ||
|
|
7700
|
+
(symbol == "_" && this.mode == "snake" && state.value.length > 0) ||
|
|
7701
|
+
(symbol == "-" && this.mode == "attribute" && state.value.length > 0));
|
|
7702
|
+
}
|
|
7703
|
+
}
|
|
7704
|
+
add("identifier-code", (settings) => new Handler$8(settings || {}, "code"));
|
|
7705
|
+
add("identifier-pascal", (settings) => new Handler$8(settings || {}, "pascal"));
|
|
7706
|
+
add("identifier-snake", (settings) => new Handler$8(settings || {}, "snake"));
|
|
7707
|
+
add("identifier-camel", (settings) => new Handler$8(settings || {}, "camel"));
|
|
7708
|
+
add("identifier-attribute", (settings) => new Handler$8(settings || {}, "attribute"));
|
|
7709
|
+
|
|
7710
|
+
class Handler$7 {
|
|
7618
7711
|
constructor(country) {
|
|
7619
7712
|
this.country = country;
|
|
7620
7713
|
}
|
|
@@ -7622,7 +7715,7 @@ class Handler$6 {
|
|
|
7622
7715
|
return typeof data == "string" ? data : "";
|
|
7623
7716
|
}
|
|
7624
7717
|
fromString(value) {
|
|
7625
|
-
return typeof value == "string" ? value : undefined;
|
|
7718
|
+
return typeof value == "string" && !!value ? value : undefined;
|
|
7626
7719
|
}
|
|
7627
7720
|
format(unformatted) {
|
|
7628
7721
|
let result = unformatted;
|
|
@@ -7645,14 +7738,39 @@ class Handler$6 {
|
|
|
7645
7738
|
return state.value.length < 13 && symbol >= "0" && symbol <= "9";
|
|
7646
7739
|
}
|
|
7647
7740
|
}
|
|
7648
|
-
add("identity-number", (argument) => new Handler$
|
|
7741
|
+
add("identity-number", (argument) => new Handler$7(argument && argument.length > 0 ? argument[0] : undefined));
|
|
7742
|
+
|
|
7743
|
+
class Handler$6 {
|
|
7744
|
+
toString(data) {
|
|
7745
|
+
return typeof data == "number" ? data.toString() : "";
|
|
7746
|
+
}
|
|
7747
|
+
fromString(value) {
|
|
7748
|
+
const parsed = typeof value == "string" ? Number.parseInt(value) : undefined;
|
|
7749
|
+
return typeof parsed == "number" && !Number.isNaN(parsed) ? parsed : undefined;
|
|
7750
|
+
}
|
|
7751
|
+
format(unformatted) {
|
|
7752
|
+
return {
|
|
7753
|
+
...unformatted,
|
|
7754
|
+
type: "number",
|
|
7755
|
+
length: [3, undefined],
|
|
7756
|
+
pattern: /^[0-9]+$/,
|
|
7757
|
+
};
|
|
7758
|
+
}
|
|
7759
|
+
unformat(formatted) {
|
|
7760
|
+
return formatted;
|
|
7761
|
+
}
|
|
7762
|
+
allowed(symbol, state) {
|
|
7763
|
+
return symbol >= "0" && symbol <= "9";
|
|
7764
|
+
}
|
|
7765
|
+
}
|
|
7766
|
+
add("integer", () => new Handler$6());
|
|
7649
7767
|
|
|
7650
7768
|
class Handler$5 {
|
|
7651
7769
|
toString(data) {
|
|
7652
7770
|
return typeof data == "string" ? data : "";
|
|
7653
7771
|
}
|
|
7654
7772
|
fromString(value) {
|
|
7655
|
-
return typeof value == "string" ? value : undefined;
|
|
7773
|
+
return typeof value == "string" && !!value ? value : undefined;
|
|
7656
7774
|
}
|
|
7657
7775
|
format(unformatted) {
|
|
7658
7776
|
return { ...unformatted, type: "password", autocomplete: "current-password" };
|
|
@@ -7994,7 +8112,7 @@ class Handler$3 {
|
|
|
7994
8112
|
return typeof data == "string" ? data : "";
|
|
7995
8113
|
}
|
|
7996
8114
|
fromString(value) {
|
|
7997
|
-
return typeof value == "string" ? value : undefined;
|
|
8115
|
+
return typeof value == "string" && !!value ? value : undefined;
|
|
7998
8116
|
}
|
|
7999
8117
|
format(unformatted) {
|
|
8000
8118
|
let result = unformatted;
|
|
@@ -8071,7 +8189,7 @@ class Handler$2 {
|
|
|
8071
8189
|
return typeof data == "string" ? data : "";
|
|
8072
8190
|
}
|
|
8073
8191
|
fromString(value) {
|
|
8074
|
-
return typeof value == "string" ? value : undefined;
|
|
8192
|
+
return typeof value == "string" && !!value ? value : undefined;
|
|
8075
8193
|
}
|
|
8076
8194
|
format(unformatted) {
|
|
8077
8195
|
const result = !unformatted.value.includes(" ") && unformatted.value.length >= 4 ? unformatted.insert(3, " ") : unformatted;
|
|
@@ -8104,19 +8222,17 @@ class Handler$1 {
|
|
|
8104
8222
|
return result != undefined && !isNaN(result) ? result : undefined;
|
|
8105
8223
|
}
|
|
8106
8224
|
format(unformatted) {
|
|
8107
|
-
let separator = unformatted.value && unformatted.value.includes(".") ? unformatted.value.indexOf(".") : undefined;
|
|
8108
8225
|
let result = unformatted.value == "NaN" ? unformatted.replace(0, unformatted.value.length, "") : StateEditor.copy(unformatted);
|
|
8226
|
+
const decimals = this.currency && Currency.decimalDigits(this.currency);
|
|
8227
|
+
if (!result.value.includes(".") && decimals && Math.abs(Number.parseFloat(result.value)) > 0)
|
|
8228
|
+
result = result.suffix(".0");
|
|
8229
|
+
let separator = result.value && result.value.includes(".") ? result.value.indexOf(".") : undefined;
|
|
8109
8230
|
if (separator == 0) {
|
|
8110
8231
|
result = result.prepend("0");
|
|
8111
8232
|
separator++;
|
|
8112
8233
|
}
|
|
8113
8234
|
if (separator != undefined) {
|
|
8114
|
-
const adjust = separator +
|
|
8115
|
-
1 +
|
|
8116
|
-
(!this.currency || Currency.decimalDigits(this.currency) == undefined
|
|
8117
|
-
? 2
|
|
8118
|
-
: Currency.decimalDigits(this.currency) ?? 2) -
|
|
8119
|
-
result.value.length;
|
|
8235
|
+
const adjust = separator + 1 + (decimals ?? 2) - result.value.length;
|
|
8120
8236
|
result = adjust < 0 ? result.truncate(result.value.length + adjust) : result.suffix("0".repeat(adjust));
|
|
8121
8237
|
}
|
|
8122
8238
|
else
|
|
@@ -8159,7 +8275,7 @@ class Handler {
|
|
|
8159
8275
|
return typeof data == "string" ? data : "";
|
|
8160
8276
|
}
|
|
8161
8277
|
fromString(value) {
|
|
8162
|
-
return typeof value == "string" ? value : undefined;
|
|
8278
|
+
return typeof value == "string" && !!value ? value : undefined;
|
|
8163
8279
|
}
|
|
8164
8280
|
format(unformatted) {
|
|
8165
8281
|
return { ...unformatted, type: "text", ...this.settings };
|
|
@@ -9209,7 +9325,7 @@ const SmoothlyInputDemo = class {
|
|
|
9209
9325
|
}
|
|
9210
9326
|
render() {
|
|
9211
9327
|
return [
|
|
9212
|
-
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"))),
|
|
9328
|
+
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"))),
|
|
9213
9329
|
h("smoothly-backtotop", null),
|
|
9214
9330
|
];
|
|
9215
9331
|
}
|