smoothly 0.2.10 → 0.2.11

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.
Files changed (37) hide show
  1. package/dist/cjs/{Notice-a540b9fb.js → index-2a011313.js} +380 -4
  2. package/dist/cjs/index.cjs.js +9 -372
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{smoothly-accordion_51.cjs.entry.js → smoothly-accordion_50.cjs.entry.js} +90 -108
  5. package/dist/cjs/smoothly-svg.cjs.entry.js +41 -0
  6. package/dist/cjs/smoothly.cjs.js +1 -1
  7. package/dist/collection/components/App.js +9 -4
  8. package/dist/collection/components/app-demo/index.js +10 -0
  9. package/dist/collection/components/display-demo/index.js +16 -12
  10. package/dist/collection/components/input-date/index.js +18 -1
  11. package/dist/collection/components/input-demo/index.js +3 -1
  12. package/dist/collection/components/room/index.js +7 -3
  13. package/dist/collection/components/submit/Data.js +12 -0
  14. package/dist/collection/components/submit/index.js +10 -4
  15. package/dist/collection/index.js +1 -1
  16. package/dist/custom-elements/index.js +33 -11
  17. package/dist/esm/{Notice-4d3fbaaf.js → index-1d438ba2.js} +380 -5
  18. package/dist/esm/index.js +2 -372
  19. package/dist/esm/loader.js +1 -1
  20. package/dist/esm/{smoothly-accordion_51.entry.js → smoothly-accordion_50.entry.js} +90 -107
  21. package/dist/esm/smoothly-svg.entry.js +37 -0
  22. package/dist/esm/smoothly.js +1 -1
  23. package/dist/smoothly/index.esm.js +1 -1
  24. package/dist/smoothly/p-76e88859.js +1 -0
  25. package/dist/smoothly/p-8aefcb54.entry.js +1 -0
  26. package/dist/smoothly/p-956089d5.entry.js +1 -0
  27. package/dist/smoothly/smoothly.esm.js +1 -1
  28. package/dist/types/components/App.d.ts +1 -0
  29. package/dist/types/components/input-date/index.d.ts +1 -0
  30. package/dist/types/components/room/index.d.ts +1 -1
  31. package/dist/types/components/submit/Data.d.ts +7 -0
  32. package/dist/types/components/submit/index.d.ts +2 -3
  33. package/dist/types/components.d.ts +6 -3
  34. package/dist/types/index.d.ts +1 -1
  35. package/package.json +1 -1
  36. package/dist/smoothly/p-d8a81a07.js +0 -1
  37. package/dist/smoothly/p-fbcf1356.entry.js +0 -1
@@ -322,6 +322,10 @@ const DEFAULT_PARSE_URL = (url) => {
322
322
  };
323
323
 
324
324
  const Router = createRouter();
325
+ function redirect(url) {
326
+ const destination = resolve(url);
327
+ destination ? Router.push(destination) : (window.location.href = url);
328
+ }
325
329
  const App = (attributes, nodes, utils) => {
326
330
  var _a;
327
331
  const emptyNode = Object.entries(nodes[0]).reduce((r, entry) => {
@@ -337,7 +341,7 @@ const App = (attributes, nodes, utils) => {
337
341
  function childToNode(child) {
338
342
  return utils.map([emptyNode], c => (Object.assign(Object.assign({}, c), child)))[0];
339
343
  }
340
- const children = nodes.map((node, index) => (Object.assign(Object.assign({}, nodeToChild(node)), { node })));
344
+ const children = nodes.map(node => (Object.assign(Object.assign({}, nodeToChild(node)), { node })));
341
345
  return (index.h("smoothly-app", null,
342
346
  index.h("header", null,
343
347
  index.h("h1", null,
@@ -346,7 +350,7 @@ const App = (attributes, nodes, utils) => {
346
350
  index.h("ul", null, utils
347
351
  .map([
348
352
  ...children.filter(child => { var _a; return ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.slot) == "nav-start"; }),
349
- ...children.filter(child => { var _a, _b; return ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.label) && ((_b = child.vattrs) === null || _b === void 0 ? void 0 : _b.path); }),
353
+ ...children.filter(child => { var _a, _b, _c; return ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.label) && ((_b = child.vattrs) === null || _b === void 0 ? void 0 : _b.path) && typeof ((_c = child.vattrs) === null || _c === void 0 ? void 0 : _c.path) == "string"; }),
350
354
  ...children.filter(child => { var _a; return ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.slot) == "nav-end"; }),
351
355
  ].map(child => child.node), child => {
352
356
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
@@ -380,8 +384,9 @@ const App = (attributes, nodes, utils) => {
380
384
  index.h(Router.Switch, null, children
381
385
  .filter(child => { var _a; return ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.path) != undefined; })
382
386
  .map(child => {
383
- var _a, _b, _c, _d, _e, _f, _g, _h;
384
- return ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.to) ? (index.h(Route, { path: (_c = resolve((_b = child.vattrs) === null || _b === void 0 ? void 0 : _b.path)) !== null && _c !== void 0 ? _c : (_d = child.vattrs) === null || _d === void 0 ? void 0 : _d.path, to: (_e = child.vattrs) === null || _e === void 0 ? void 0 : _e.to })) : (index.h(Route, { path: (_g = resolve((_f = child.vattrs) === null || _f === void 0 ? void 0 : _f.path)) !== null && _g !== void 0 ? _g : (_h = child.vattrs) === null || _h === void 0 ? void 0 : _h.path }, child.node));
387
+ var _a, _b, _c, _d, _e;
388
+ const path = typeof ((_a = child.vattrs) === null || _a === void 0 ? void 0 : _a.path) == "string" ? resolve((_b = child.vattrs) === null || _b === void 0 ? void 0 : _b.path) : (_c = child.vattrs) === null || _c === void 0 ? void 0 : _c.path;
389
+ return ((_d = child.vattrs) === null || _d === void 0 ? void 0 : _d.to) ? (index.h(Route, { path: path, to: (_e = child.vattrs) === null || _e === void 0 ? void 0 : _e.to })) : (index.h(Route, { path: path }, child.node));
385
390
  })))));
386
391
  };
387
392
  function resolve(url) {
@@ -483,5 +488,376 @@ class Notice {
483
488
  }
484
489
  }
485
490
 
491
+ var Hex;
492
+ (function (Hex) {
493
+ function is(value) {
494
+ const matchArray = (typeof value == "string" && value.match(/[0-9a-fA-F]/g)) || undefined;
495
+ return (typeof value == "string" &&
496
+ value.length > 3 &&
497
+ value[0] == "#" &&
498
+ ((matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 3 || (matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 6));
499
+ }
500
+ Hex.is = is;
501
+ })(Hex || (Hex = {}));
502
+
503
+ var Hsl;
504
+ (function (Hsl) {
505
+ function is(value) {
506
+ const values = typeof value == "string" && value.length > 11 ? value.substring(4, value.length - 1).split(",") : [];
507
+ return (typeof value == "string" &&
508
+ value.length > 11 &&
509
+ value.substr(0, 4) == "hsl(" &&
510
+ value.substr(value.length - 1, 1) == ")" &&
511
+ values.length == 3 &&
512
+ values.every((single, index) => {
513
+ var _a, _b;
514
+ let result = false;
515
+ if (index == 0)
516
+ result =
517
+ !Number.isNaN(single) &&
518
+ ((_a = single.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == single.length &&
519
+ Number(single) >= 0 &&
520
+ Number(single) <= 360;
521
+ else {
522
+ const number = single.substr(0, single.length - 1);
523
+ result =
524
+ single[single.length - 1] == "%" &&
525
+ !Number.isNaN(number) &&
526
+ ((_b = number.match(/[0-9]/g)) === null || _b === void 0 ? void 0 : _b.length) == number.length &&
527
+ Number(number) >= 0 &&
528
+ Number(number) <= 100;
529
+ }
530
+ return result;
531
+ }));
532
+ }
533
+ Hsl.is = is;
534
+ })(Hsl || (Hsl = {}));
535
+
536
+ const Names = {
537
+ aliceblue: "#f0f8ff",
538
+ antiquewhite: "#faebd7",
539
+ aqua: "#00ffff",
540
+ aquamarine: "#7fffd4",
541
+ azure: "#f0ffff",
542
+ beige: "#f5f5dc",
543
+ bisque: "#ffe4c4",
544
+ black: "#000000",
545
+ blanchedalmond: "#ffebcd",
546
+ blue: "#0000ff",
547
+ blueviolet: "#8a2be2",
548
+ brown: "#a52a2a",
549
+ burlywood: "#deb887",
550
+ cadetblue: "#5f9ea0",
551
+ chartreuse: "#7fff00",
552
+ chocolate: "#d2691e",
553
+ coral: "#ff7f50",
554
+ cornflowerblue: "#6495ed",
555
+ cornsilk: "#fff8dc",
556
+ crimson: "#dc143c",
557
+ cyan: "#00ffff",
558
+ darkblue: "#00008b",
559
+ darkcyan: "#008b8b",
560
+ darkgoldenrod: "#b8860b",
561
+ darkgray: "#a9a9a9",
562
+ darkgreen: "#006400",
563
+ darkgrey: "#a9a9a9",
564
+ darkkhaki: "#bdb76b",
565
+ darkmagenta: "#8b008b",
566
+ darkolivegreen: "#556b2f",
567
+ darkorange: "#ff8c00",
568
+ darkorchid: "#9932cc",
569
+ darkred: "#8b0000",
570
+ darksalmon: "#e9967a",
571
+ darkseagreen: "#8fbc8f",
572
+ darkslateblue: "#483d8b",
573
+ darkslategray: "#2f4f4f",
574
+ darkslategrey: "#2f4f4f",
575
+ darkturquoise: "#00ced1",
576
+ darkviolet: "#9400d3",
577
+ deeppink: "#ff1493",
578
+ deepskyblue: "#00bfff",
579
+ dimgray: "#696969",
580
+ dimgrey: "#696969",
581
+ dodgerblue: "#1e90ff",
582
+ firebrick: "#b22222",
583
+ floralwhite: "#fffaf0",
584
+ forestgreen: "#228b22",
585
+ fuchsia: "#ff00ff",
586
+ gainsboro: "#dcdcdc",
587
+ ghostwhite: "#f8f8ff",
588
+ goldenrod: "#daa520",
589
+ gold: "#ffd700",
590
+ gray: "#808080",
591
+ green: "#008000",
592
+ greenyellow: "#adff2f",
593
+ grey: "#808080",
594
+ honeydew: "#f0fff0",
595
+ hotpink: "#ff69b4",
596
+ indianred: "#cd5c5c",
597
+ indigo: "#4b0082",
598
+ ivory: "#fffff0",
599
+ khaki: "#f0e68c",
600
+ lavenderblush: "#fff0f5",
601
+ lavender: "#e6e6fa",
602
+ lawngreen: "#7cfc00",
603
+ lemonchiffon: "#fffacd",
604
+ lightblue: "#add8e6",
605
+ lightcoral: "#f08080",
606
+ lightcyan: "#e0ffff",
607
+ lightgoldenrodyellow: "#fafad2",
608
+ lightgray: "#d3d3d3",
609
+ lightgreen: "#90ee90",
610
+ lightgrey: "#d3d3d3",
611
+ lightpink: "#ffb6c1",
612
+ lightsalmon: "#ffa07a",
613
+ lightseagreen: "#20b2aa",
614
+ lightskyblue: "#87cefa",
615
+ lightslategray: "#778899",
616
+ lightslategrey: "#778899",
617
+ lightsteelblue: "#b0c4de",
618
+ lightyellow: "#ffffe0",
619
+ lime: "#00ff00",
620
+ limegreen: "#32cd32",
621
+ linen: "#faf0e6",
622
+ magenta: "#ff00ff",
623
+ maroon: "#800000",
624
+ mediumaquamarine: "#66cdaa",
625
+ mediumblue: "#0000cd",
626
+ mediumorchid: "#ba55d3",
627
+ mediumpurple: "#9370db",
628
+ mediumseagreen: "#3cb371",
629
+ mediumslateblue: "#7b68ee",
630
+ mediumspringgreen: "#00fa9a",
631
+ mediumturquoise: "#48d1cc",
632
+ mediumvioletred: "#c71585",
633
+ midnightblue: "#191970",
634
+ mintcream: "#f5fffa",
635
+ mistyrose: "#ffe4e1",
636
+ moccasin: "#ffe4b5",
637
+ navajowhite: "#ffdead",
638
+ navy: "#000080",
639
+ oldlace: "#fdf5e6",
640
+ olive: "#808000",
641
+ olivedrab: "#6b8e23",
642
+ orange: "#ffa500",
643
+ orangered: "#ff4500",
644
+ orchid: "#da70d6",
645
+ palegoldenrod: "#eee8aa",
646
+ palegreen: "#98fb98",
647
+ paleturquoise: "#afeeee",
648
+ palevioletred: "#db7093",
649
+ papayawhip: "#ffefd5",
650
+ peachpuff: "#ffdab9",
651
+ peru: "#cd853f",
652
+ pink: "#ffc0cb",
653
+ plum: "#dda0dd",
654
+ powderblue: "#b0e0e6",
655
+ purple: "#800080",
656
+ rebeccapurple: "#663399",
657
+ red: "#ff0000",
658
+ rosybrown: "#bc8f8f",
659
+ royalblue: "#4169e1",
660
+ saddlebrown: "#8b4513",
661
+ salmon: "#fa8072",
662
+ sandybrown: "#f4a460",
663
+ seagreen: "#2e8b57",
664
+ seashell: "#fff5ee",
665
+ sienna: "#a0522d",
666
+ silver: "#c0c0c0",
667
+ skyblue: "#87ceeb",
668
+ slateblue: "#6a5acd",
669
+ slategray: "#708090",
670
+ slategrey: "#708090",
671
+ snow: "#fffafa",
672
+ springgreen: "#00ff7f",
673
+ steelblue: "#4682b4",
674
+ tan: "#d2b48c",
675
+ teal: "#008080",
676
+ thistle: "#d8bfd8",
677
+ tomato: "#ff6347",
678
+ turquoise: "#40e0d0",
679
+ violet: "#ee82ee",
680
+ wheat: "#f5deb3",
681
+ white: "#ffffff",
682
+ whitesmoke: "#f5f5f5",
683
+ yellow: "#ffff00",
684
+ yellowgreen: "#9acd32",
685
+ };
686
+ var Name;
687
+ (function (Name) {
688
+ Name.types = () => Object.keys(Names);
689
+ function is(value) {
690
+ return typeof value == "string" && Name.types().includes(value.toLowerCase());
691
+ }
692
+ Name.is = is;
693
+ })(Name || (Name = {}));
694
+
695
+ var Rgb;
696
+ (function (Rgb) {
697
+ function is(value) {
698
+ const values = typeof value == "string" && value.length > 9 ? value.substring(4, value.length - 1).split(",") : [];
699
+ return (typeof value == "string" &&
700
+ value.length > 9 &&
701
+ value.substr(0, 4) == "rgb(" &&
702
+ value.substr(value.length - 1, 1) == ")" &&
703
+ values.length == 3 &&
704
+ values.every((value) => {
705
+ var _a;
706
+ return !Number.isNaN(value) &&
707
+ ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
708
+ Number(value) >= 0 &&
709
+ Number(value) <= 255;
710
+ }));
711
+ }
712
+ Rgb.is = is;
713
+ })(Rgb || (Rgb = {}));
714
+
715
+ var CommaRgb;
716
+ (function (CommaRgb) {
717
+ function is(value) {
718
+ const values = typeof value == "string" ? value.split(",") : [];
719
+ return (values.length == 3 &&
720
+ values.every((value) => {
721
+ var _a;
722
+ return !Number.isNaN(value) &&
723
+ ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
724
+ Number(value) >= 0 &&
725
+ Number(value) <= 255;
726
+ }));
727
+ }
728
+ CommaRgb.is = is;
729
+ function from(color) {
730
+ let result;
731
+ const colorWithoutSpace = typeof color == "string" ? color.replace(/ /g, "").toLowerCase() : undefined;
732
+ if (!colorWithoutSpace)
733
+ result = undefined;
734
+ else if (CommaRgb.is(colorWithoutSpace))
735
+ result = colorWithoutSpace;
736
+ else if (Hex.is(colorWithoutSpace))
737
+ result = fromHex(colorWithoutSpace);
738
+ else if (Rgb.is(colorWithoutSpace))
739
+ result = fromRgb(colorWithoutSpace);
740
+ else if (Name.is(colorWithoutSpace))
741
+ result = fromHex(Names[colorWithoutSpace]);
742
+ else if (Hsl.is(colorWithoutSpace))
743
+ result = fromHsl(colorWithoutSpace);
744
+ return result;
745
+ }
746
+ CommaRgb.from = from;
747
+ function fromHex(hex) {
748
+ let result = "0,0,0";
749
+ if (hex.length == 7)
750
+ result = `${parseInt(hex.substr(1, 2), 16)},${parseInt(hex.substr(3, 2), 16)},${parseInt(hex.substr(5, 2), 16)}`;
751
+ else if (hex.length == 4)
752
+ result = fromHex(`#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`);
753
+ return result;
754
+ }
755
+ CommaRgb.fromHex = fromHex;
756
+ function fromRgb(rgb) {
757
+ return rgb.substring(4, rgb.length - 1);
758
+ }
759
+ CommaRgb.fromRgb = fromRgb;
760
+ function fromHsl(hsl) {
761
+ let result = "";
762
+ let h, s, l;
763
+ let r, g, b;
764
+ const HSL = hsl
765
+ .substring(4, hsl.length - 1)
766
+ .split(",")
767
+ .map((value, index) => Number(index == 0 ? value : value.substr(0, value.length - 1)));
768
+ if (HSL.length == 3) {
769
+ h = HSL[0] / 360;
770
+ s = HSL[1] / 100;
771
+ l = HSL[2] / 100;
772
+ if (s == 0)
773
+ r = g = b = l;
774
+ else {
775
+ const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
776
+ const p = 2 * l - q;
777
+ r = hue2rgb(p, q, h + 1 / 3);
778
+ g = hue2rgb(p, q, h);
779
+ b = hue2rgb(p, q, h - 1 / 3);
780
+ }
781
+ result = `${Math.round(255 * r)},${Math.round(255 * g)},${Math.round(255 * b)}`;
782
+ }
783
+ return result;
784
+ }
785
+ CommaRgb.fromHsl = fromHsl;
786
+ function hue2rgb(p, q, t) {
787
+ let result = p;
788
+ if (t < 0)
789
+ t += 1;
790
+ if (t > 1)
791
+ t -= 1;
792
+ if (t < 1 / 6)
793
+ result = p + (q - p) * 6 * t;
794
+ else if (t < 1 / 2)
795
+ result = q;
796
+ else if (t < 2 / 3)
797
+ result = p + (q - p) * (2 / 3 - t) * 6;
798
+ return result;
799
+ }
800
+ })(CommaRgb || (CommaRgb = {}));
801
+
802
+ var Color;
803
+ (function (Color) {
804
+ function is(value) {
805
+ return (typeof value == "string" &&
806
+ (CommaRgb.is(value) || Hex.is(value) || Hsl.is(value) || Name.is(value) || Rgb.is(value)));
807
+ }
808
+ Color.is = is;
809
+ function from(value) {
810
+ return is(value) ? value : undefined;
811
+ }
812
+ Color.from = from;
813
+ Color.Names = Names;
814
+ Color.Name = Name;
815
+ Color.CommaRgb = CommaRgb;
816
+ Color.Rgb = Rgb;
817
+ Color.Hex = Hex;
818
+ Color.Hsl = Hsl;
819
+ })(Color || (Color = {}));
820
+
821
+ function reduce(types, value) {
822
+ return types.reduce((r, c) => typeof value == "object" && value != null && typeof value[c] == "string"
823
+ ? Object.assign(Object.assign({}, r), { [c]: value[c] }) : r, {});
824
+ }
825
+ exports.Cosmetic = void 0;
826
+ (function (Cosmetic) {
827
+ Cosmetic.types = Cosmetic;
828
+ function from(value) {
829
+ let result = {};
830
+ if (typeof value == "object" && value) {
831
+ result = {
832
+ text: reduce(["background", "color"], value.text),
833
+ border: reduce(["background", "color", "style", "radius", "width"], value.border),
834
+ gap: typeof value.gap == "string" ? value.gap : undefined,
835
+ dangerColor: typeof value.dangerColor == "string"
836
+ ? value.dangerColor
837
+ : typeof value.danger_color == "string"
838
+ ? value.danger_color
839
+ : undefined,
840
+ fontFamily: typeof value.fontFamily == "string"
841
+ ? value.fontFamily
842
+ : typeof value.font_family == "string"
843
+ ? value.font_family
844
+ : undefined,
845
+ background: typeof value.background == "string" ? value.background : undefined,
846
+ };
847
+ Object.keys(result).forEach((key) => {
848
+ var _a;
849
+ if (result[key] == undefined ||
850
+ (typeof result[key] == "object" && result[key] && Object.keys((_a = result[key]) !== null && _a !== void 0 ? _a : {}).length == 0)) {
851
+ delete result[key];
852
+ }
853
+ });
854
+ }
855
+ return result;
856
+ }
857
+ Cosmetic.from = from;
858
+ Cosmetic.Color = Color;
859
+ })(exports.Cosmetic || (exports.Cosmetic = {}));
860
+
486
861
  exports.App = App;
487
862
  exports.Notice = Notice;
863
+ exports.redirect = redirect;