smoothly 0.2.10 → 0.3.0
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/{Notice-a540b9fb.js → index-2a011313.js} +380 -4
- package/dist/cjs/index.cjs.js +9 -372
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{smoothly-accordion_51.cjs.entry.js → smoothly-accordion_50.cjs.entry.js} +127 -135
- package/dist/cjs/smoothly-svg.cjs.entry.js +41 -0
- package/dist/cjs/smoothly.cjs.js +1 -1
- package/dist/collection/components/App.js +9 -4
- package/dist/collection/components/app-demo/index.js +20 -10
- package/dist/collection/components/display-demo/index.js +16 -12
- package/dist/collection/components/input-date/index.js +18 -1
- package/dist/collection/components/input-demo/index.js +3 -1
- package/dist/collection/components/menu-options/index.js +31 -10
- package/dist/collection/components/option/index.js +81 -6
- package/dist/collection/components/option/style.css +31 -35
- package/dist/collection/components/picker/index.js +26 -21
- package/dist/collection/components/room/index.js +7 -3
- package/dist/collection/components/select-demo/index.js +4 -4
- package/dist/collection/components/skeleton/index.js +1 -1
- package/dist/collection/components/submit/Data.js +12 -0
- package/dist/collection/components/submit/index.js +10 -4
- package/dist/collection/index.js +1 -1
- package/dist/collection/model/{OptionType.js → Option.js} +0 -0
- package/dist/custom-elements/index.js +75 -43
- package/dist/esm/{Notice-4d3fbaaf.js → index-1d438ba2.js} +380 -5
- package/dist/esm/index.js +2 -372
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{smoothly-accordion_51.entry.js → smoothly-accordion_50.entry.js} +127 -134
- package/dist/esm/smoothly-svg.entry.js +37 -0
- package/dist/esm/smoothly.js +1 -1
- package/dist/smoothly/index.esm.js +1 -1
- package/dist/smoothly/p-71443887.entry.js +1 -0
- package/dist/smoothly/p-76e88859.js +1 -0
- package/dist/smoothly/p-8aefcb54.entry.js +1 -0
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/App.d.ts +1 -0
- package/dist/types/components/input-date/index.d.ts +1 -0
- package/dist/types/components/menu-options/index.d.ts +10 -6
- package/dist/types/components/option/index.d.ts +7 -0
- package/dist/types/components/picker/index.d.ts +11 -10
- package/dist/types/components/room/index.d.ts +1 -1
- package/dist/types/components/submit/Data.d.ts +7 -0
- package/dist/types/components/submit/index.d.ts +2 -3
- package/dist/types/components.d.ts +26 -14
- package/dist/types/index.d.ts +2 -2
- package/dist/types/model/Option.d.ts +7 -0
- package/dist/types/model/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/smoothly/p-d8a81a07.js +0 -1
- package/dist/smoothly/p-fbcf1356.entry.js +0 -1
- package/dist/types/model/OptionType.d.ts +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,f as t,h as n}from"./p-191ee4b8.js";const r=e=>!("isConnected"in e)||e.isConnected,i=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys())e.set(t,e.get(t).filter(r))})(...t)}),2e3)}})();let o;const f=(e,t)=>{var n;return"to"in e?{path:e.path,to:e.to}:{path:e.path,id:e.id,jsx:null!==(n=e.render)&&void 0!==n?n:t}},a=(e,t=o)=>({href:e,onClick:n=>{n.metaKey||n.ctrlKey||2!=n.which&&1!=n.button&&(n.preventDefault(),t.push(e))}}),l=(e,t)=>{if("string"==typeof t){if(t===e)return{}}else if("function"==typeof t){const n=t(e);if(n)return!0===n?{}:{...n}}else{const n=t.exec(e);if(n)return t.lastIndex=0,{...n}}},s=e=>e.pathname.toLowerCase(),d=(()=>{const n=window,r=new URL(n.location.href),f=(void 0,s),{state:a,onChange:d,dispose:u}=((n,r)=>{const o=((e,t=((e,t)=>e!==t))=>{let n=new Map(Object.entries(null!=e?e:{}));const r={dispose:[],get:[],set:[],reset:[]},i=()=>{n=new Map(Object.entries(null!=e?e:{})),r.reset.forEach((e=>e()))},o=e=>(r.get.forEach((t=>t(e))),n.get(e)),f=(e,i)=>{const o=n.get(e);t(i,o,e)&&(n.set(e,i),r.set.forEach((t=>t(e,i,o))))},a="undefined"==typeof Proxy?{}:new Proxy(e,{get:(e,t)=>o(t),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>n.has(t),set:(e,t,n)=>(f(t,n),!0)}),l=(e,t)=>(r[e].push(t),()=>{((e,t)=>{const n=e.indexOf(t);n>=0&&(e[n]=e[e.length-1],e.length--)})(r[e],t)});return{state:a,get:o,set:f,on:l,onChange:(t,n)=>{const r=l("set",((e,r)=>{e===t&&n(r)})),i=l("reset",(()=>n(e[t])));return()=>{r(),i()}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(l("set",t.set)),t.get&&e.push(l("get",t.get)),t.reset&&e.push(l("reset",t.reset)),t.dispose&&e.push(l("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{r.dispose.forEach((e=>e())),i()},reset:i,forceUpdate:e=>{const t=n.get(e);r.set.forEach((n=>n(e,t,t)))}}})(n,r);return o.use((()=>{if("function"!=typeof e)return{};const n=new Map;return{dispose:()=>n.clear(),get:t=>{const r=e();r&&((e,t,n)=>{const r=e.get(t);r?r.includes(n)||r.push(n):e.set(t,[n])})(n,t,r)},set:e=>{const r=n.get(e);r&&n.set(e,r.filter(t)),i(n)},reset:()=>{n.forEach((e=>e.forEach(t))),i(n)}}})()),o})({url:r,activePath:f(r)},((e,t,n)=>"url"===n?e.href!==t.href:e!==t)),c=e=>{history.pushState(null,null,e);const t=new URL(e,document.baseURI);a.url=t,a.activePath=f(t)},b=e=>{const{activePath:t}=a;for(let n of e){const r=l(t,n.path);if(r){if(null!=n.to){const r="string"==typeof n.to?n.to:n.to(t);return c(r),b(e)}return{params:r,route:n}}}},g=()=>{const e=new URL(n.location.href);a.url=e,a.activePath=f(e)},v=o={Switch:(e,t)=>{const n=b(t);if(n)return"function"==typeof n.route.jsx?n.route.jsx(n.params):n.route.jsx},get url(){return a.url},get activePath(){return a.activePath},push:c,onChange:d,dispose:()=>{o=void 0,n.removeEventListener("popstate",g),u()}};return g(),n.addEventListener("popstate",g),v})();function u(e){const t=b(e);t?d.push(t):window.location.href=e}const c=(e,t,r)=>{var i;const o=Object.entries(t[0]).reduce(((e,t)=>(e[t[0]]=null,e)),{}),l=s(o);function s(e){let t;return r.forEach([e],(e=>t=e)),null!=t?t:l}function u(e){return r.map([o],(t=>Object.assign(Object.assign({},t),e)))[0]}const c=t.map((e=>Object.assign(Object.assign({},s(e)),{node:e})));return n("smoothly-app",null,n("header",null,n("h1",null,n("a",Object.assign({},a(null!==(i=b(""))&&void 0!==i?i:"/")),e.label)),n("nav",null,n("ul",null,r.map([...c.filter((e=>{var t;return"nav-start"==(null===(t=e.vattrs)||void 0===t?void 0:t.slot)})),...c.filter((e=>{var t,n,r;return(null===(t=e.vattrs)||void 0===t?void 0:t.label)&&(null===(n=e.vattrs)||void 0===n?void 0:n.path)&&"string"==typeof(null===(r=e.vattrs)||void 0===r?void 0:r.path)})),...c.filter((e=>{var t;return"nav-end"==(null===(t=e.vattrs)||void 0===t?void 0:t.slot)}))].map((e=>e.node)),(e=>{var t,n,r,i,o,f,a,s,c;(null===(t=e.vattrs)||void 0===t?void 0:t.label)&&(null===(n=e.vattrs)||void 0===n?void 0:n.path)&&(e=Object.assign(Object.assign({},l),{vtag:"a",vattrs:{href:null===(r=e.vattrs)||void 0===r?void 0:r.path},vchildren:[(null===(i=e.vattrs)||void 0===i?void 0:i.icon)?u({vtag:"smoothly-icon",vattrs:{toolTip:null===(o=e.vattrs)||void 0===o?void 0:o.label,name:null===(f=e.vattrs)||void 0===f?void 0:f.icon,size:"medium"}}):u({vtext:null===(a=e.vattrs)||void 0===a?void 0:a.label})]}));const g=b(null===(s=e.vattrs)||void 0===s?void 0:s.href);return"a"!=e.vtag?e:Object.assign(Object.assign({},e),g?{vattrs:Object.assign(Object.assign({},e.vattrs),{class:[null===(c=e.vattrs)||void 0===c?void 0:c.class,d.activePath==g?"active":""].join(" ")||void 0,href:g})}:{vattrs:Object.assign(Object.assign({},e.vattrs),{target:"new"})})})).map((e=>{var t,r;const i=s(e);return"a"!=i.vtag||(null===(t=i.vattrs)||void 0===t?void 0:t.target)?e:n("a",Object.assign({},i.vattrs,a(null===(r=i.vattrs)||void 0===r?void 0:r.href)),i.vchildren)})).map((e=>n("li",null,e))))),c.filter((e=>{var t;return"header"==(null===(t=e.vattrs)||void 0===t?void 0:t.slot)})).map((e=>e.node))),n("main",null,n(d.Switch,null,c.filter((e=>{var t;return null!=(null===(t=e.vattrs)||void 0===t?void 0:t.path)})).map((e=>{var t,r,i,o,a;const l="string"==typeof(null===(t=e.vattrs)||void 0===t?void 0:t.path)?b(null===(r=e.vattrs)||void 0===r?void 0:r.path):null===(i=e.vattrs)||void 0===i?void 0:i.path;return(null===(o=e.vattrs)||void 0===o?void 0:o.to)?n(f,{path:l,to:null===(a=e.vattrs)||void 0===a?void 0:a.to}):n(f,{path:l},e.node)})))))};function b(e){const t=new URL(e,document.baseURI);return""==e?new URL(document.baseURI).pathname:t.toString().startsWith(document.baseURI)?t.pathname:void 0}class g{constructor(e,t,n){switch(this.stateValue=e,this.messageValue=t,this.task=n,this.listeners=[],e){case"delayed":this.timer=window.setTimeout((()=>this.execute()),5e3);break;case"executing":this.execute();break;case"success":case"warning":case"failed":this.startCloseTimer()}}get state(){return this.stateValue}set state(e){this.stateValue!=e&&(this.stateValue=e,this.emit())}get message(){return this.messageValue}set message(e){this.messageValue!=e&&(this.messageValue=e,this.emit())}listen(e){this.listeners.push(e)}unlisten(e){this.listeners.filter((t=>t!=e))}emit(){this.listeners.forEach((e=>e(this)))}execute(){this.clearTimer(),this.task?(this.state="executing",this.task(this).then((e=>{this.messageValue=e[1],this.state=e[0]?"success":"failed",this.startCloseTimer()}))):this.state="failed"}startCloseTimer(){this.timer=window.setTimeout((()=>this.close()),15e3)}close(){this.clearTimer(),this.state="closed"}clearTimer(){this.timer&&(window.clearTimeout(this.timer),this.timer=void 0)}static delay(e,t){return new g("delayed",e,t)}static execute(e,t){return new g("executing",e,t)}static succeded(e){return new g("success",e)}static failed(e){return new g("failed",e)}static warn(e){return new g("warning",e)}}var v,h;!function(e){e.is=function(e){const t="string"==typeof e&&e.match(/[0-9a-fA-F]/g)||void 0;return"string"==typeof e&&e.length>3&&"#"==e[0]&&(3==(null==t?void 0:t.length)||6==(null==t?void 0:t.length))}}(v||(v={})),function(e){e.is=function(e){const t="string"==typeof e&&e.length>11?e.substring(4,e.length-1).split(","):[];return"string"==typeof e&&e.length>11&&"hsl("==e.substr(0,4)&&")"==e.substr(e.length-1,1)&&3==t.length&&t.every(((e,t)=>{var n,r;let i=!1;if(0==t)i=!Number.isNaN(e)&&(null===(n=e.match(/[0-9]/g))||void 0===n?void 0:n.length)==e.length&&Number(e)>=0&&Number(e)<=360;else{const t=e.substr(0,e.length-1);i="%"==e[e.length-1]&&!Number.isNaN(t)&&(null===(r=t.match(/[0-9]/g))||void 0===r?void 0:r.length)==t.length&&Number(t)>=0&&Number(t)<=100}return i}))}}(h||(h={}));const p={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var m,y,w,k,j;function O(e,t){return e.reduce(((e,n)=>"object"==typeof t&&null!=t&&"string"==typeof t[n]?Object.assign(Object.assign({},e),{[n]:t[n]}):e),{})}!function(e){e.types=()=>Object.keys(p),e.is=function(t){return"string"==typeof t&&e.types().includes(t.toLowerCase())}}(m||(m={})),function(e){e.is=function(e){const t="string"==typeof e&&e.length>9?e.substring(4,e.length-1).split(","):[];return"string"==typeof e&&e.length>9&&"rgb("==e.substr(0,4)&&")"==e.substr(e.length-1,1)&&3==t.length&&t.every((e=>{var t;return!Number.isNaN(e)&&(null===(t=e.match(/[0-9]/g))||void 0===t?void 0:t.length)==e.length&&Number(e)>=0&&Number(e)<=255}))}}(y||(y={})),function(e){function t(e){let n="0,0,0";return 7==e.length?n=`${parseInt(e.substr(1,2),16)},${parseInt(e.substr(3,2),16)},${parseInt(e.substr(5,2),16)}`:4==e.length&&(n=t(`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`)),n}function n(e){return e.substring(4,e.length-1)}function r(e){let t,n,r,o,f,a,l="";const s=e.substring(4,e.length-1).split(",").map(((e,t)=>Number(0==t?e:e.substr(0,e.length-1))));if(3==s.length){if(t=s[0]/360,n=s[1]/100,r=s[2]/100,0==n)o=f=a=r;else{const e=r<.5?r*(1+n):r+n-r*n,l=2*r-e;o=i(l,e,t+1/3),f=i(l,e,t),a=i(l,e,t-1/3)}l=`${Math.round(255*o)},${Math.round(255*f)},${Math.round(255*a)}`}return l}function i(e,t,n){let r=e;return n<0&&(n+=1),n>1&&(n-=1),n<1/6?r=e+6*(t-e)*n:n<.5?r=t:n<2/3&&(r=e+(t-e)*(2/3-n)*6),r}e.is=function(e){const t="string"==typeof e?e.split(","):[];return 3==t.length&&t.every((e=>{var t;return!Number.isNaN(e)&&(null===(t=e.match(/[0-9]/g))||void 0===t?void 0:t.length)==e.length&&Number(e)>=0&&Number(e)<=255}))},e.from=function(i){let o;const f="string"==typeof i?i.replace(/ /g,"").toLowerCase():void 0;return f?e.is(f)?o=f:v.is(f)?o=t(f):y.is(f)?o=n(f):m.is(f)?o=t(p[f]):h.is(f)&&(o=r(f)):o=void 0,o},e.fromHex=t,e.fromRgb=n,e.fromHsl=r}(w||(w={})),function(e){function t(e){return"string"==typeof e&&(w.is(e)||v.is(e)||h.is(e)||m.is(e)||y.is(e))}e.is=t,e.from=function(e){return t(e)?e:void 0},e.Names=p,e.Name=m,e.CommaRgb=w,e.Rgb=y,e.Hex=v,e.Hsl=h}(k||(k={})),function(e){e.types=e,e.from=function(e){let t={};return"object"==typeof e&&e&&(t={text:O(["background","color"],e.text),border:O(["background","color","style","radius","width"],e.border),gap:"string"==typeof e.gap?e.gap:void 0,dangerColor:"string"==typeof e.dangerColor?e.dangerColor:"string"==typeof e.danger_color?e.danger_color:void 0,fontFamily:"string"==typeof e.fontFamily?e.fontFamily:"string"==typeof e.font_family?e.font_family:void 0,background:"string"==typeof e.background?e.background:void 0},Object.keys(t).forEach((e=>{var n;(null==t[e]||"object"==typeof t[e]&&t[e]&&0==Object.keys(null!==(n=t[e])&&void 0!==n?n:{}).length)&&delete t[e]}))),t},e.Color=k}(j||(j={}));export{c as A,j as C,g as N,u as r}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i,H as h}from"./p-191ee4b8.js";const e=class{constructor(i){t(this,i),this.defaultSizes={large:{height:"50rem",width:"50rem"},medium:{height:"30rem",width:"30rem"},small:{height:"10rem",width:"10rem"},tiny:{height:"5rem",width:"5rem"}}}render(){const t=this.size?"object"==typeof this.size?this.size.height:this.defaultSizes[this.size].height:"10rem",e=this.size?"object"==typeof this.size?this.size.width:this.defaultSizes[this.size].width:"10rem";return i(h,{style:{"min-height":t,"min-width":e,"--size-height":t,"--size-width":e,"--color":this.color}},i("object",{height:t,width:e,type:"image/svg+xml",data:this.url}))}};e.style=".sc-smoothly-svg-h{display:block;min-width:var(--size-width);min-height:var(--size-height);background-color:rgb(var(--color))}object.sc-smoothly-svg{min-width:var(--size-width);min-height:var(--size-height);background-color:rgb(var(--color))}";export{e as smoothly_svg}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-191ee4b8.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-8e4e941e",[[2,"smoothly-google-font",{value:[1]}]]],["p-9bc77fba",[[4,"smoothly-radio-group",{orientation:[513]}]]],["p-7a5eda51",[[0,"smoothly-reorder"]]],["p-d5d4832d",[[6,"smoothly-trigger-sink",{context:[16],destination:[1],filter:[1]},[[0,"trigger","TriggerListener"]]]]],["p-919ae3e8",[[6,"smoothly-trigger-source",{listen:[1]}]]],["p-
|
|
1
|
+
import{p as e,b as o}from"./p-191ee4b8.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-8e4e941e",[[2,"smoothly-google-font",{value:[1]}]]],["p-9bc77fba",[[4,"smoothly-radio-group",{orientation:[513]}]]],["p-7a5eda51",[[0,"smoothly-reorder"]]],["p-8aefcb54",[[2,"smoothly-svg",{url:[513],size:[513],color:[1]}]]],["p-d5d4832d",[[6,"smoothly-trigger-sink",{context:[16],destination:[1],filter:[1]},[[0,"trigger","TriggerListener"]]]]],["p-919ae3e8",[[6,"smoothly-trigger-source",{listen:[1]}]]],["p-71443887",[[0,"smoothly-app-demo",{baseUrl:[1,"base-url"]}],[0,"smoothly-input-demo"],[2,"smoothly-select-demo",null,[[0,"selectionChanged","handleSelectionChanged"]]],[2,"smoothly-table-demo"],[0,"smoothly-display-demo"],[4,"smoothly-app",{color:[1]}],[0,"smoothly-dialog-demo"],[2,"smoothly-icon-demo"],[6,"smoothly-button",{color:[513],expand:[513],fill:[513],disabled:[516],type:[513],link:[1],download:[4]}],[4,"smoothly-room",{label:[1],icon:[1],path:[1],to:[1]}],[2,"smoothly-input-date-range",{value:[1025],start:[1025],end:[1025],max:[1025],min:[1025],open:[1028],showLabel:[516,"show-label"]},[[0,"startChanged","onStartChanged"],[0,"endChanged","onEndChanged"],[0,"dateRangeSet","onDateRangeSet"]]],[1,"smoothly-picker",{disabled:[516],readonly:[516],maxMenuHeight:[1,"max-menu-height"],maxHeight:[1,"max-height"],emptyMenuLabel:[1025,"empty-menu-label"],multiple:[516],mutable:[4],optionStyle:[8,"option-style"],options:[1040],labelSetting:[513,"label-setting"],label:[513],selections:[1040],selectNoneName:[1025,"select-none-name"],selectAllName:[1025,"select-all-name"],selectionName:[1025,"selection-name"],newOptionLabel:[1025,"new-option-label"],valueValidator:[16],isOpen:[32],empty:[32]},[[0,"optionSelect","optionSelectHandler"],[0,"optionUnselect","optionSelectHandler"],[0,"optionAdd","optionAddHandler"],[0,"menuEmpty","emptyHandler"]]],[6,"smoothly-notifier",{notices:[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]],[6,"smoothly-dialog",{color:[513],open:[1540],closable:[516],header:[513]},[[0,"trigger","TriggerListener"]]],[2,"smoothly-backtotop",{opacity:[1],bottom:[1],right:[1],visible:[32]}],[2,"smoothly-checkbox",{selectAll:[4,"select-all"],size:[1],intermediate:[1540],selected:[1540],disabled:[1540],t:[32]}],[6,"smoothly-submit",{processing:[1540],color:[513],expand:[513],fill:[513],disabled:[516],prevent:[4],submit:[64]},[[0,"click","handleSubmit"]]],[6,"smoothly-table-expandable-cell",{align:[1],open:[1540]},[[0,"click","onClick"]]],[6,"smoothly-table-expandable-row",{align:[1],open:[1540]},[[0,"click","onClick"]]],[0,"smoothly-urlencoded",{data:[1]}],[6,"smoothly-accordion",{value:[1025]},[[0,"smoothlyOpen","handleOpenClose"],[0,"smoothlyClose","handleOpenClose"],[0,"smoothlyAccordionItemDidLoad","onAccordionItemDidLoad"],[0,"smoothlyAccordionItemDidUnload","onAccordionItemDidUnload"]]],[6,"smoothly-accordion-item",{name:[1],brand:[1],open:[1540]}],[2,"smoothly-display",{type:[1],value:[8],currency:[1],country:[1],format:[16]}],[2,"smoothly-display-amount",{amount:[8],currency:[1]}],[2,"smoothly-frame",{url:[1],name:[1],origin:[1],send:[64]}],[6,"smoothly-popup",{visible:[1540],direction:[1537],cssVariables:[32]}],[6,"smoothly-radio",{name:[1],value:[1],checked:[1540],tabIndex:[2,"tab-index"]}],[6,"smoothly-select",{identifier:[1],background:[513],value:[1025]}],[2,"smoothly-skeleton",{widths:[16],width:[1025],color:[1],period:[2],distance:[1],align:[513]}],[6,"smoothly-table",null,[[0,"expansionLoad","handleEvents"],[0,"expansionOpen","handleEvents"]]],[6,"smoothly-table-cell"],[6,"smoothly-table-header",{name:[1]}],[6,"smoothly-table-row",null,[[0,"expansionLoad","onExpansionLoad"],[0,"expansionOpen","onExpansionOpen"]]],[6,"smoothly-input-date",{name:[513],value:[1025],open:[1028],max:[1025],min:[1025],disabled:[1028]},[[0,"dateSet","dateSetHandler"]]],[1,"smoothly-menu-options",{toggle:[4],emptyMenuLabel:[1025,"empty-menu-label"],newOptionLabel:[1,"new-option-label"],maxMenuHeight:[1,"max-menu-height"],order:[4],optionStyle:[8,"option-style"],options:[1040],resetHighlightOnOptionsChange:[1028,"reset-highlight-on-options-change"],mutable:[4],filteredOptions:[32],highlightIndex:[32],keyword:[32],moveHighlight:[64],setHighlight:[64],getHighlighted:[64],filterOptions:[64]},[[0,"optionHover","optionHoverHandler"]]],[2,"smoothly-notification",{notice:[16],tick:[32]},[[0,"trigger","onTrigger"]]],[2,"smoothly-display-date-time",{datetime:[1]}],[2,"smoothly-spinner",{active:[516],size:[513]}],[6,"smoothly-tab",{label:[1],open:[1540]},[[0,"click","onClick"]]],[6,"smoothly-tab-switch",{selectedElement:[32]},[[0,"expansionOpen","openChanged"]]],[0,"smoothly-tuple",{tuple:[16]}],[1,"smoothly-option",{aliases:[513],dataHighlight:[1540,"data-highlight"],name:[1537],value:[1537],divider:[1540],checkbox:[4],new:[4],toggle:[4],checked:[1028]}],[2,"smoothly-calendar",{month:[1025],value:[1025],start:[1025],end:[1025],max:[1025],min:[1025],doubleInput:[516,"double-input"],firstSelected:[32]}],[6,"smoothly-input",{name:[513],value:[1032],type:[513],required:[1540],minLength:[1026,"min-length"],showLabel:[516,"show-label"],maxLength:[1026,"max-length"],autocomplete:[1028],pattern:[1040],placeholder:[1025],disabled:[1028],readonly:[1028],currency:[513],initialValue:[32],getFormData:[64],setKeepFocusOnReRender:[64],setSelectionRange:[64]}],[2,"smoothly-input-month",{value:[1025]}],[6,"smoothly-quiet",{color:[1]}],[6,"smoothly-selector",{opened:[32],selectedElement:[32],missing:[32],filter:[32]},[[0,"click","onClick"],[0,"itemSelected","onItemSelected"],[0,"keydown","onKeyDown"]]],[6,"smoothly-item",{value:[8],selected:[1540],filter:[64]},[[0,"click","onClick"]]],[6,"smoothly-trigger",{color:[513],expand:[513],fill:[513],disabled:[516],type:[513],name:[1],value:[8]},[[0,"click","onClick"]]],[2,"smoothly-icon",{color:[513],fill:[513],name:[1],size:[513],toolTip:[1,"tool-tip"],document:[32]}]]]],e)));
|
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Option } from "../../model";
|
|
3
3
|
export declare class SmoothlyMenuOptions {
|
|
4
4
|
private firstOptionsElement;
|
|
5
|
+
private optionElements;
|
|
5
6
|
element: HTMLElement;
|
|
6
|
-
filteredOptions:
|
|
7
|
+
filteredOptions: (Option & {
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
})[];
|
|
7
10
|
highlightIndex: number;
|
|
8
11
|
keyword?: string;
|
|
12
|
+
toggle: boolean;
|
|
9
13
|
emptyMenuLabel: string;
|
|
10
14
|
newOptionLabel: string;
|
|
11
15
|
maxMenuHeight: "inherit";
|
|
12
16
|
order: boolean;
|
|
13
17
|
optionStyle: any;
|
|
14
|
-
options:
|
|
18
|
+
options: Option[];
|
|
15
19
|
resetHighlightOnOptionsChange: boolean;
|
|
16
20
|
mutable: boolean;
|
|
17
21
|
menuEmpty: EventEmitter<boolean>;
|
|
18
|
-
optionsChangeHandler(
|
|
22
|
+
optionsChangeHandler(): void;
|
|
19
23
|
optionHoverHandler(event: CustomEvent<{
|
|
20
24
|
value: any;
|
|
21
25
|
name: string;
|
|
22
26
|
}>): void;
|
|
23
27
|
moveHighlight(step: number): Promise<void>;
|
|
24
28
|
setHighlight(newIndex: number | string, scrollToHighlight?: boolean): Promise<void>;
|
|
25
|
-
getHighlighted(): Promise<
|
|
29
|
+
getHighlighted(): Promise<Option | undefined>;
|
|
26
30
|
filterOptions(keyword: string, excludeValues?: string[]): Promise<void>;
|
|
27
31
|
sortOptions(keyword: string): void;
|
|
28
|
-
getPriorityScore(option:
|
|
32
|
+
getPriorityScore(option: Option, keywordLowercase: string): number;
|
|
29
33
|
scrollTo(optionIndex: number): void;
|
|
30
34
|
render(): any;
|
|
31
35
|
}
|
|
@@ -6,7 +6,10 @@ export declare class SmoothlyOption {
|
|
|
6
6
|
name: string;
|
|
7
7
|
value: string;
|
|
8
8
|
divider?: boolean;
|
|
9
|
+
checkbox: boolean;
|
|
9
10
|
new?: boolean;
|
|
11
|
+
toggle: boolean;
|
|
12
|
+
checked: boolean;
|
|
10
13
|
optionHover: EventEmitter<{
|
|
11
14
|
value: any;
|
|
12
15
|
name: string;
|
|
@@ -15,6 +18,10 @@ export declare class SmoothlyOption {
|
|
|
15
18
|
value: any;
|
|
16
19
|
name: string;
|
|
17
20
|
}>;
|
|
21
|
+
optionUnselect: EventEmitter<{
|
|
22
|
+
value: any;
|
|
23
|
+
name: string;
|
|
24
|
+
}>;
|
|
18
25
|
optionAdd: EventEmitter<{
|
|
19
26
|
name: string;
|
|
20
27
|
value: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
|
-
import { Notice,
|
|
2
|
+
import { Notice, Option } from "../../model";
|
|
3
3
|
export declare class SmoothlyPicker {
|
|
4
4
|
private inputElement;
|
|
5
5
|
private keepFocusOnReRender;
|
|
@@ -9,35 +9,37 @@ export declare class SmoothlyPicker {
|
|
|
9
9
|
empty: boolean;
|
|
10
10
|
disabled: boolean;
|
|
11
11
|
readonly: boolean;
|
|
12
|
-
maxMenuHeight:
|
|
12
|
+
maxMenuHeight: string;
|
|
13
13
|
maxHeight: string;
|
|
14
14
|
emptyMenuLabel: string;
|
|
15
15
|
multiple: boolean;
|
|
16
16
|
mutable: boolean;
|
|
17
17
|
optionStyle: any;
|
|
18
|
-
options:
|
|
18
|
+
options: (Option & {
|
|
19
|
+
checked?: boolean;
|
|
20
|
+
})[];
|
|
19
21
|
labelSetting: "hide" | "default";
|
|
20
22
|
label: string;
|
|
21
|
-
selections:
|
|
23
|
+
selections: Option[];
|
|
22
24
|
selectNoneName: string;
|
|
23
25
|
selectAllName: string;
|
|
24
26
|
selectionName: string;
|
|
25
27
|
newOptionLabel: string;
|
|
26
28
|
valueValidator: (value: any) => [boolean, Notice | undefined];
|
|
27
|
-
menuClose: EventEmitter<
|
|
29
|
+
menuClose: EventEmitter<Option[]>;
|
|
28
30
|
notice: EventEmitter<Notice>;
|
|
29
31
|
isOpenChangeHandler(): void;
|
|
30
32
|
componentDidRender(): void;
|
|
31
|
-
optionSelectHandler(event: CustomEvent<
|
|
33
|
+
optionSelectHandler(event: CustomEvent<Option>): void;
|
|
32
34
|
optionAddHandler(event: CustomEvent<{
|
|
33
35
|
name: string;
|
|
34
36
|
value: string;
|
|
35
37
|
}>): void;
|
|
36
38
|
emptyHandler(event: CustomEvent<boolean>): void;
|
|
37
|
-
toggle(option:
|
|
39
|
+
toggle(option: Option): void;
|
|
38
40
|
toggleAll(): void;
|
|
39
|
-
unselect(selection:
|
|
40
|
-
select(selection:
|
|
41
|
+
unselect(selection: Option): void;
|
|
42
|
+
select(selection: Option): void;
|
|
41
43
|
toggleHighlighted(): void;
|
|
42
44
|
highlightDefault(): void;
|
|
43
45
|
filterOptions(): void;
|
|
@@ -45,6 +47,5 @@ export declare class SmoothlyPicker {
|
|
|
45
47
|
onKeyDown(event: KeyboardEvent): void;
|
|
46
48
|
onClick(): void;
|
|
47
49
|
onBlur(): void;
|
|
48
|
-
getCheckHtml(checked: boolean): HTMLElement;
|
|
49
50
|
render(): any;
|
|
50
51
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
2
|
import { Color, Expand, Fill } from "../../model";
|
|
3
|
+
import { Data } from "./Data";
|
|
3
4
|
export declare class SmoothlySubmit {
|
|
4
5
|
private button?;
|
|
5
6
|
get form(): HTMLFormElement | undefined;
|
|
@@ -9,9 +10,7 @@ export declare class SmoothlySubmit {
|
|
|
9
10
|
fill?: Fill;
|
|
10
11
|
disabled: boolean;
|
|
11
12
|
prevent?: boolean;
|
|
12
|
-
submitEvent: EventEmitter<
|
|
13
|
-
[key: string]: string;
|
|
14
|
-
}>;
|
|
13
|
+
submitEvent: EventEmitter<Data>;
|
|
15
14
|
handleSubmit(event: UIEvent): Promise<void>;
|
|
16
15
|
submit(): Promise<boolean>;
|
|
17
16
|
render(): any[];
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
-
import { Color, Expand, Fill, Message, Notice,
|
|
8
|
+
import { Color, Expand, Fill, Message, Notice, Option, Trigger } from "./model";
|
|
9
9
|
import { CountryCode, Currency, Date, DateRange, DateTime } from "isoly";
|
|
10
10
|
import { Direction, Type } from "tidily";
|
|
11
11
|
import { GoogleFont } from "./model/GoogleFont";
|
|
12
|
+
import { Data } from "./components/submit/Data";
|
|
12
13
|
export namespace Components {
|
|
13
14
|
interface SmoothlyAccordion {
|
|
14
15
|
"value"?: string;
|
|
@@ -118,6 +119,7 @@ export namespace Components {
|
|
|
118
119
|
"disabled": boolean;
|
|
119
120
|
"max": Date;
|
|
120
121
|
"min": Date;
|
|
122
|
+
"name": string;
|
|
121
123
|
"open": boolean;
|
|
122
124
|
"value"?: Date;
|
|
123
125
|
}
|
|
@@ -143,16 +145,17 @@ export namespace Components {
|
|
|
143
145
|
interface SmoothlyMenuOptions {
|
|
144
146
|
"emptyMenuLabel": string;
|
|
145
147
|
"filterOptions": (keyword: string, excludeValues?: string[]) => Promise<void>;
|
|
146
|
-
"getHighlighted": () => Promise<
|
|
148
|
+
"getHighlighted": () => Promise<Option | undefined>;
|
|
147
149
|
"maxMenuHeight": "inherit";
|
|
148
150
|
"moveHighlight": (step: number) => Promise<void>;
|
|
149
151
|
"mutable": boolean;
|
|
150
152
|
"newOptionLabel": string;
|
|
151
153
|
"optionStyle": any;
|
|
152
|
-
"options":
|
|
154
|
+
"options": Option[];
|
|
153
155
|
"order": boolean;
|
|
154
156
|
"resetHighlightOnOptionsChange": boolean;
|
|
155
157
|
"setHighlight": (newIndex: number | string, scrollToHighlight?: boolean) => Promise<void>;
|
|
158
|
+
"toggle": boolean;
|
|
156
159
|
}
|
|
157
160
|
interface SmoothlyNotification {
|
|
158
161
|
"notice": Notice;
|
|
@@ -161,10 +164,13 @@ export namespace Components {
|
|
|
161
164
|
}
|
|
162
165
|
interface SmoothlyOption {
|
|
163
166
|
"aliases": string;
|
|
167
|
+
"checkbox": boolean;
|
|
168
|
+
"checked": boolean;
|
|
164
169
|
"dataHighlight": boolean;
|
|
165
170
|
"divider"?: boolean;
|
|
166
171
|
"name": string;
|
|
167
172
|
"new"?: boolean;
|
|
173
|
+
"toggle": boolean;
|
|
168
174
|
"value": string;
|
|
169
175
|
}
|
|
170
176
|
interface SmoothlyPicker {
|
|
@@ -173,17 +179,17 @@ export namespace Components {
|
|
|
173
179
|
"label": string;
|
|
174
180
|
"labelSetting": "hide" | "default";
|
|
175
181
|
"maxHeight": string;
|
|
176
|
-
"maxMenuHeight":
|
|
182
|
+
"maxMenuHeight": string;
|
|
177
183
|
"multiple": boolean;
|
|
178
184
|
"mutable": boolean;
|
|
179
185
|
"newOptionLabel": string;
|
|
180
186
|
"optionStyle": any;
|
|
181
|
-
"options":
|
|
187
|
+
"options": (Option & { checked?: boolean })[];
|
|
182
188
|
"readonly": boolean;
|
|
183
189
|
"selectAllName": string;
|
|
184
190
|
"selectNoneName": string;
|
|
185
191
|
"selectionName": string;
|
|
186
|
-
"selections":
|
|
192
|
+
"selections": Option[];
|
|
187
193
|
"valueValidator": (value: any) => [boolean, Notice | undefined];
|
|
188
194
|
}
|
|
189
195
|
interface SmoothlyPopup {
|
|
@@ -207,7 +213,7 @@ export namespace Components {
|
|
|
207
213
|
interface SmoothlyRoom {
|
|
208
214
|
"icon"?: string;
|
|
209
215
|
"label"?: string;
|
|
210
|
-
"path": string;
|
|
216
|
+
"path": string | RegExp;
|
|
211
217
|
"to"?: string;
|
|
212
218
|
}
|
|
213
219
|
interface SmoothlySelect {
|
|
@@ -915,6 +921,7 @@ declare namespace LocalJSX {
|
|
|
915
921
|
"disabled"?: boolean;
|
|
916
922
|
"max"?: Date;
|
|
917
923
|
"min"?: Date;
|
|
924
|
+
"name"?: string;
|
|
918
925
|
"onValueChanged"?: (event: SmoothlyInputDateCustomEvent<Date>) => void;
|
|
919
926
|
"open"?: boolean;
|
|
920
927
|
"value"?: Date;
|
|
@@ -948,9 +955,10 @@ declare namespace LocalJSX {
|
|
|
948
955
|
"newOptionLabel"?: string;
|
|
949
956
|
"onMenuEmpty"?: (event: SmoothlyMenuOptionsCustomEvent<boolean>) => void;
|
|
950
957
|
"optionStyle"?: any;
|
|
951
|
-
"options"?:
|
|
958
|
+
"options"?: Option[];
|
|
952
959
|
"order"?: boolean;
|
|
953
960
|
"resetHighlightOnOptionsChange"?: boolean;
|
|
961
|
+
"toggle"?: boolean;
|
|
954
962
|
}
|
|
955
963
|
interface SmoothlyNotification {
|
|
956
964
|
"notice"?: Notice;
|
|
@@ -960,6 +968,8 @@ declare namespace LocalJSX {
|
|
|
960
968
|
}
|
|
961
969
|
interface SmoothlyOption {
|
|
962
970
|
"aliases"?: string;
|
|
971
|
+
"checkbox"?: boolean;
|
|
972
|
+
"checked"?: boolean;
|
|
963
973
|
"dataHighlight"?: boolean;
|
|
964
974
|
"divider"?: boolean;
|
|
965
975
|
"name"?: string;
|
|
@@ -967,6 +977,8 @@ declare namespace LocalJSX {
|
|
|
967
977
|
"onOptionAdd"?: (event: SmoothlyOptionCustomEvent<{ name: string; value: string }>) => void;
|
|
968
978
|
"onOptionHover"?: (event: SmoothlyOptionCustomEvent<{ value: any; name: string }>) => void;
|
|
969
979
|
"onOptionSelect"?: (event: SmoothlyOptionCustomEvent<{ value: any; name: string }>) => void;
|
|
980
|
+
"onOptionUnselect"?: (event: SmoothlyOptionCustomEvent<{ value: any; name: string }>) => void;
|
|
981
|
+
"toggle"?: boolean;
|
|
970
982
|
"value"?: string;
|
|
971
983
|
}
|
|
972
984
|
interface SmoothlyPicker {
|
|
@@ -975,19 +987,19 @@ declare namespace LocalJSX {
|
|
|
975
987
|
"label"?: string;
|
|
976
988
|
"labelSetting"?: "hide" | "default";
|
|
977
989
|
"maxHeight"?: string;
|
|
978
|
-
"maxMenuHeight"?:
|
|
990
|
+
"maxMenuHeight"?: string;
|
|
979
991
|
"multiple"?: boolean;
|
|
980
992
|
"mutable"?: boolean;
|
|
981
993
|
"newOptionLabel"?: string;
|
|
982
|
-
"onMenuClose"?: (event: SmoothlyPickerCustomEvent<
|
|
994
|
+
"onMenuClose"?: (event: SmoothlyPickerCustomEvent<Option[]>) => void;
|
|
983
995
|
"onNotice"?: (event: SmoothlyPickerCustomEvent<Notice>) => void;
|
|
984
996
|
"optionStyle"?: any;
|
|
985
|
-
"options"?:
|
|
997
|
+
"options"?: (Option & { checked?: boolean })[];
|
|
986
998
|
"readonly"?: boolean;
|
|
987
999
|
"selectAllName"?: string;
|
|
988
1000
|
"selectNoneName"?: string;
|
|
989
1001
|
"selectionName"?: string;
|
|
990
|
-
"selections"?:
|
|
1002
|
+
"selections"?: Option[];
|
|
991
1003
|
"valueValidator"?: (value: any) => [boolean, Notice | undefined];
|
|
992
1004
|
}
|
|
993
1005
|
interface SmoothlyPopup {
|
|
@@ -1014,7 +1026,7 @@ declare namespace LocalJSX {
|
|
|
1014
1026
|
interface SmoothlyRoom {
|
|
1015
1027
|
"icon"?: string;
|
|
1016
1028
|
"label"?: string;
|
|
1017
|
-
"path"?: string;
|
|
1029
|
+
"path"?: string | RegExp;
|
|
1018
1030
|
"to"?: string;
|
|
1019
1031
|
}
|
|
1020
1032
|
interface SmoothlySelect {
|
|
@@ -1045,7 +1057,7 @@ declare namespace LocalJSX {
|
|
|
1045
1057
|
"disabled"?: boolean;
|
|
1046
1058
|
"expand"?: Expand;
|
|
1047
1059
|
"fill"?: Fill;
|
|
1048
|
-
"onSubmit"?: (event: SmoothlySubmitCustomEvent<
|
|
1060
|
+
"onSubmit"?: (event: SmoothlySubmitCustomEvent<Data>) => void;
|
|
1049
1061
|
"prevent"?: boolean;
|
|
1050
1062
|
"processing"?: boolean;
|
|
1051
1063
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Components, JSX } from "./components";
|
|
2
|
-
export { App } from "./components/App";
|
|
3
|
-
export { Autocomplete, ClientIdentifier, Color, Expand, Fill, GoogleFont, Message, Notice, Trigger,
|
|
2
|
+
export { App, redirect } from "./components/App";
|
|
3
|
+
export { Autocomplete, ClientIdentifier, Color, Expand, Fill, GoogleFont, Message, Notice, Trigger, Option, } from "./model";
|
|
4
4
|
export { Cosmetic } from "./utilities";
|
|
@@ -6,5 +6,5 @@ export { Fill } from "./Fill";
|
|
|
6
6
|
export { GoogleFont } from "./GoogleFont";
|
|
7
7
|
export { Message } from "./Message";
|
|
8
8
|
export { Notice } from "./Notice";
|
|
9
|
-
export {
|
|
9
|
+
export { Option } from "./Option";
|
|
10
10
|
export { Trigger } from "./Trigger";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,f as e,h as n}from"./p-191ee4b8.js";const i=t=>!("isConnected"in t)||t.isConnected,s=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(i))})(...e)}),2e3)}})();let o;const r=(t,e)=>{var n;return"to"in t?{path:t.path,to:t.to}:{path:t.path,id:t.id,jsx:null!==(n=t.render)&&void 0!==n?n:e}},l=(t,e=o)=>({href:t,onClick:n=>{n.metaKey||n.ctrlKey||2!=n.which&&1!=n.button&&(n.preventDefault(),e.push(t))}}),u=(t,e)=>{if("string"==typeof e){if(e===t)return{}}else if("function"==typeof e){const n=e(t);if(n)return!0===n?{}:{...n}}else{const n=e.exec(t);if(n)return e.lastIndex=0,{...n}}},c=t=>t.pathname.toLowerCase(),a=(()=>{const n=window,i=new URL(n.location.href),r=(void 0,c),{state:l,onChange:a,dispose:d}=((n,i)=>{const o=((t,e=((t,e)=>t!==e))=>{let n=new Map(Object.entries(null!=t?t:{}));const i={dispose:[],get:[],set:[],reset:[]},s=()=>{n=new Map(Object.entries(null!=t?t:{})),i.reset.forEach((t=>t()))},o=t=>(i.get.forEach((e=>e(t))),n.get(t)),r=(t,s)=>{const o=n.get(t);e(s,o,t)&&(n.set(t,s),i.set.forEach((e=>e(t,s,o))))},l="undefined"==typeof Proxy?{}:new Proxy(t,{get:(t,e)=>o(e),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>n.has(e),set:(t,e,n)=>(r(e,n),!0)}),u=(t,e)=>(i[t].push(e),()=>{((t,e)=>{const n=t.indexOf(e);n>=0&&(t[n]=t[t.length-1],t.length--)})(i[t],e)});return{state:l,get:o,set:r,on:u,onChange:(e,n)=>{const i=u("set",((t,i)=>{t===e&&n(i)})),s=u("reset",(()=>n(t[e])));return()=>{i(),s()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(u("set",e.set)),e.get&&t.push(u("get",e.get)),e.reset&&t.push(u("reset",e.reset)),e.dispose&&t.push(u("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{i.dispose.forEach((t=>t())),s()},reset:s,forceUpdate:t=>{const e=n.get(t);i.set.forEach((n=>n(t,e,e)))}}})(n,i);return o.use((()=>{if("function"!=typeof t)return{};const n=new Map;return{dispose:()=>n.clear(),get:e=>{const i=t();i&&((t,e,n)=>{const i=t.get(e);i?i.includes(n)||i.push(n):t.set(e,[n])})(n,e,i)},set:t=>{const i=n.get(t);i&&n.set(t,i.filter(e)),s(n)},reset:()=>{n.forEach((t=>t.forEach(e))),s(n)}}})()),o})({url:i,activePath:r(i)},((t,e,n)=>"url"===n?t.href!==e.href:t!==e)),v=t=>{history.pushState(null,null,t);const e=new URL(t,document.baseURI);l.url=e,l.activePath=r(e)},h=t=>{const{activePath:e}=l;for(let n of t){const i=u(e,n.path);if(i){if(null!=n.to){const i="string"==typeof n.to?n.to:n.to(e);return v(i),h(t)}return{params:i,route:n}}}},f=()=>{const t=new URL(n.location.href);l.url=t,l.activePath=r(t)},p=o={Switch:(t,e)=>{const n=h(e);if(n)return"function"==typeof n.route.jsx?n.route.jsx(n.params):n.route.jsx},get url(){return l.url},get activePath(){return l.activePath},push:v,onChange:a,dispose:()=>{o=void 0,n.removeEventListener("popstate",f),d()}};return f(),n.addEventListener("popstate",f),p})(),d=(t,e,i)=>{var s;const o=Object.entries(e[0]).reduce(((t,e)=>(t[e[0]]=null,t)),{}),u=c(o);function c(t){let e;return i.forEach([t],(t=>e=t)),null!=e?e:u}function d(t){return i.map([o],(e=>Object.assign(Object.assign({},e),t)))[0]}const h=e.map((t=>Object.assign(Object.assign({},c(t)),{node:t})));return n("smoothly-app",null,n("header",null,n("h1",null,n("a",Object.assign({},l(null!==(s=v(""))&&void 0!==s?s:"/")),t.label)),n("nav",null,n("ul",null,i.map([...h.filter((t=>{var e;return"nav-start"==(null===(e=t.vattrs)||void 0===e?void 0:e.slot)})),...h.filter((t=>{var e,n;return(null===(e=t.vattrs)||void 0===e?void 0:e.label)&&(null===(n=t.vattrs)||void 0===n?void 0:n.path)})),...h.filter((t=>{var e;return"nav-end"==(null===(e=t.vattrs)||void 0===e?void 0:e.slot)}))].map((t=>t.node)),(t=>{var e,n,i,s,o,r,l,c,h;(null===(e=t.vattrs)||void 0===e?void 0:e.label)&&(null===(n=t.vattrs)||void 0===n?void 0:n.path)&&(t=Object.assign(Object.assign({},u),{vtag:"a",vattrs:{href:null===(i=t.vattrs)||void 0===i?void 0:i.path},vchildren:[(null===(s=t.vattrs)||void 0===s?void 0:s.icon)?d({vtag:"smoothly-icon",vattrs:{toolTip:null===(o=t.vattrs)||void 0===o?void 0:o.label,name:null===(r=t.vattrs)||void 0===r?void 0:r.icon,size:"medium"}}):d({vtext:null===(l=t.vattrs)||void 0===l?void 0:l.label})]}));const f=v(null===(c=t.vattrs)||void 0===c?void 0:c.href);return"a"!=t.vtag?t:Object.assign(Object.assign({},t),f?{vattrs:Object.assign(Object.assign({},t.vattrs),{class:[null===(h=t.vattrs)||void 0===h?void 0:h.class,a.activePath==f?"active":""].join(" ")||void 0,href:f})}:{vattrs:Object.assign(Object.assign({},t.vattrs),{target:"new"})})})).map((t=>{var e,i;const s=c(t);return"a"!=s.vtag||(null===(e=s.vattrs)||void 0===e?void 0:e.target)?t:n("a",Object.assign({},s.vattrs,l(null===(i=s.vattrs)||void 0===i?void 0:i.href)),s.vchildren)})).map((t=>n("li",null,t))))),h.filter((t=>{var e;return"header"==(null===(e=t.vattrs)||void 0===e?void 0:e.slot)})).map((t=>t.node))),n("main",null,n(a.Switch,null,h.filter((t=>{var e;return null!=(null===(e=t.vattrs)||void 0===e?void 0:e.path)})).map((t=>{var e,i,s,o,l,u,c,a;return(null===(e=t.vattrs)||void 0===e?void 0:e.to)?n(r,{path:null!==(s=v(null===(i=t.vattrs)||void 0===i?void 0:i.path))&&void 0!==s?s:null===(o=t.vattrs)||void 0===o?void 0:o.path,to:null===(l=t.vattrs)||void 0===l?void 0:l.to}):n(r,{path:null!==(c=v(null===(u=t.vattrs)||void 0===u?void 0:u.path))&&void 0!==c?c:null===(a=t.vattrs)||void 0===a?void 0:a.path},t.node)})))))};function v(t){const e=new URL(t,document.baseURI);return""==t?new URL(document.baseURI).pathname:e.toString().startsWith(document.baseURI)?e.pathname:void 0}class h{constructor(t,e,n){switch(this.stateValue=t,this.messageValue=e,this.task=n,this.listeners=[],t){case"delayed":this.timer=window.setTimeout((()=>this.execute()),5e3);break;case"executing":this.execute();break;case"success":case"warning":case"failed":this.startCloseTimer()}}get state(){return this.stateValue}set state(t){this.stateValue!=t&&(this.stateValue=t,this.emit())}get message(){return this.messageValue}set message(t){this.messageValue!=t&&(this.messageValue=t,this.emit())}listen(t){this.listeners.push(t)}unlisten(t){this.listeners.filter((e=>e!=t))}emit(){this.listeners.forEach((t=>t(this)))}execute(){this.clearTimer(),this.task?(this.state="executing",this.task(this).then((t=>{this.messageValue=t[1],this.state=t[0]?"success":"failed",this.startCloseTimer()}))):this.state="failed"}startCloseTimer(){this.timer=window.setTimeout((()=>this.close()),15e3)}close(){this.clearTimer(),this.state="closed"}clearTimer(){this.timer&&(window.clearTimeout(this.timer),this.timer=void 0)}static delay(t,e){return new h("delayed",t,e)}static execute(t,e){return new h("executing",t,e)}static succeded(t){return new h("success",t)}static failed(t){return new h("failed",t)}static warn(t){return new h("warning",t)}}export{d as A,h as N}
|