@senlinz/import-export 0.1.0-beta.9 → 0.1.1

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 (46) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +196 -61
  3. package/README.zh.md +188 -0
  4. package/dist/index.js +2 -0
  5. package/dist/types/ExcelDefinition.d.ts +116 -0
  6. package/dist/types/index.d.ts +17 -7
  7. package/dist/types/runtime.d.ts +20 -0
  8. package/dist/types/utils.d.ts +8 -7
  9. package/package.json +22 -23
  10. package/dist/components/editable-cell.d.ts +0 -11
  11. package/dist/components/editable-cell.js +0 -2
  12. package/dist/components/import-export-definition.d.ts +0 -11
  13. package/dist/components/import-export-definition.js +0 -2
  14. package/dist/components/import-export-studio.d.ts +0 -11
  15. package/dist/components/import-export-studio.js +0 -2
  16. package/dist/components/import-export-table.d.ts +0 -11
  17. package/dist/components/import-export-table.js +0 -2
  18. package/dist/components/index.d.ts +0 -33
  19. package/dist/components/index.js +0 -2
  20. package/dist/components/p-3b0da608.js +0 -2
  21. package/dist/components/p-c9904f6a.js +0 -2
  22. package/dist/components/p-dd1bf849.js +0 -2
  23. package/dist/components/p-ddbe189c.js +0 -2
  24. package/dist/components/p-f7586df1.js +0 -2
  25. package/dist/tests/dist/editable-cell.d.ts +0 -11
  26. package/dist/tests/dist/imexport-table.d.ts +0 -11
  27. package/dist/tests/dist/import-export-definition.d.ts +0 -11
  28. package/dist/tests/dist/import-export-definiton.d.ts +0 -11
  29. package/dist/tests/dist/import-export-studio.d.ts +0 -11
  30. package/dist/tests/dist/import-export-table.d.ts +0 -11
  31. package/dist/tests/dist/index.d.ts +0 -33
  32. package/dist/tests/dist/table-definition.d.ts +0 -11
  33. package/dist/types/components/editable-cell/editable-cell.d.ts +0 -18
  34. package/dist/types/components/imexport-table/imexport-table.d.ts +0 -19
  35. package/dist/types/components/import-export-definition/import-export-definition.d.ts +0 -7
  36. package/dist/types/components/import-export-definition/import-export-definiton.d.ts +0 -6
  37. package/dist/types/components/import-export-studio/import-export-studio.d.ts +0 -14
  38. package/dist/types/components/import-export-studio/import-export-table.d.ts +0 -5
  39. package/dist/types/components/import-export-table/import-export-table.d.ts +0 -6
  40. package/dist/types/components/table-definition/table-definition.d.ts +0 -0
  41. package/dist/types/components.d.ts +0 -116
  42. package/dist/types/declarations/ExcelDefinition.d.ts +0 -17
  43. package/dist/types/declarations/ExcelDefintion.d.ts +0 -17
  44. package/dist/types/stencil-public-runtime.d.ts +0 -1674
  45. package/dist/types/types/index.d.ts +0 -19
  46. package/dist/types/utils/utils.d.ts +0 -9
@@ -1,2 +0,0 @@
1
- import{p as t,H as e,h as a}from"./p-ddbe189c.js";const o=t(class extends e{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.definition=void 0,this.data=[]}render(){return this.definition?a("div",{class:"import-export-table"},this.data&&a("table",{class:"data-table"},a("thead",null,a("tr",null,this.definition.columns.map((t=>a("th",null,t.name))))),a("tbody",null,this.data.map((t=>a("tr",null,this.definition.columns.map((e=>a("td",null,t[e.key]))))))))):null}static get style(){return".data-table{width:100%;border-collapse:collapse;margin:0;background-color:#fff;border-radius:8px;overflow:hidden;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1)}.data-table th,.data-table td{border-width:0;padding:8px;text-align:left}.data-table th{background-color:#4caf50;color:white;font-weight:bold}.data-table tr:nth-child(even){background-color:#e8f5e9}.data-table tr:hover{background-color:#c8e6c9}"}},[1,"import-export-table",{definition:[16],data:[16]}]);function l(){if("undefined"==typeof customElements)return;["import-export-table"].forEach((t=>{if("import-export-table"===t)customElements.get(t)||customElements.define(t,o)}))}l();export{o as I,l as d};
2
- //# sourceMappingURL=p-c9904f6a.js.map
@@ -1,2 +0,0 @@
1
- import{p as t,H as e,c as i,h as s}from"./p-ddbe189c.js";const n={zh:{tooltip:"双击编辑"},en:{tooltip:"Double click to edit"}},h=t(class extends e{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.valueChange=i(this,"valueChange",7),this.dblHandler=t=>{this.showEditor()},this.showEditor=()=>{this.contentELement.style.display="none",this.inputElement.style.display="block",this.inputElement.focus()},this.hideEditor=()=>{this.contentELement.style.display="block",this.inputElement.style.display="none"},this.keyUpHandler=t=>{if(t instanceof KeyboardEvent&&"Enter"===t.key)return void this.completeInput();const e=t.target;this.inputValue=e.value},this.changeHandler=t=>{t.target instanceof HTMLInputElement&&(this.inputValue=t.target.value),this.completeInput()},this.completeInput=()=>{this.contentELement.innerText=this.inputValue,this.hideEditor(),this.valueChange.emit(this.inputValue)},this.culture="en",this.type="text",this.value=void 0,this.inputValue=void 0}componentWillLoad(){this.value instanceof Date?this.inputValue=this.value.toISOString().slice(0,10):this.inputValue=this.value}render(){return s("div",{key:"8452a378b3ccc0989edd053391e0910ab817242e",class:"editable-cell-container",onDblClick:this.dblHandler,title:n[this.culture].tooltip},s("span",{key:"f7bbd64a45084ddb0d08c7b39b0159a116b31aec",class:"value",ref:t=>this.contentELement=t},this.value),s("input",{key:"2a7c5fc922be2adea3ce116430928c8d60f23102",type:this.type,class:"cell-editor",value:this.inputValue,onKeyUp:this.keyUpHandler,onChange:this.changeHandler,onBlur:this.completeInput,ref:t=>this.inputElement=t}))}static get style(){return".editable-cell-container{position:relative;width:100%;height:100%;display:flex;margin:0;padding:0}.cell-editor{display:none;z-index:1;flex:1 0 0;width:100%;line-height:1;font-size:1rem;background-color:transparent;border-width:0;outline:none;border-bottom:1px solid #ccc}"}},[1,"editable-cell",{culture:[1],type:[1],value:[1],inputValue:[32]}]);function l(){if("undefined"==typeof customElements)return;["editable-cell"].forEach((t=>{if("editable-cell"===t)customElements.get(t)||customElements.define(t,h)}))}l();export{h as E,l as d};
2
- //# sourceMappingURL=p-dd1bf849.js.map
@@ -1,2 +0,0 @@
1
- const e="hydrated",n=!1,t=!1,l=!0,o=!1;var r=Object.defineProperty,s=new WeakMap,i=e=>s.get(e),c=(e,n)=>n in e,u=(e,n)=>(0,console.error)(e,n),a=new Map,f="undefined"!=typeof window?window:{},h=f.document||{head:{}},d=f.HTMLElement||class{},p={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,n,t,l)=>e.addEventListener(n,t,l),rel:(e,n,t,l)=>e.removeEventListener(n,t,l),ce:(e,n)=>new CustomEvent(e,n)},m=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),y=!1,b=[],$=[],v=(e,n)=>t=>{e.push(t),y||(y=!0,n&&4&p.t?S(g):p.raf(g))},w=e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(e){u(e)}e.length=0},g=()=>{w(b),w($),(y=b.length>0)&&p.raf(g)},S=e=>{return Promise.resolve(n).then(e);var n},j=v($,!0),k=e=>{const n=new URL(e,p.l);return n.origin!==f.location.origin?n.href:n.pathname},O=e=>p.l=e,E={},C=e=>"object"===(e=typeof e)||"function"===e;((e,n)=>{for(var t in n)r(e,t,{get:n[t],enumerable:!0})})({},{err:()=>x,map:()=>P,ok:()=>M,unwrap:()=>_,unwrapErr:()=>N});var M=e=>({isOk:!0,isErr:!1,value:e}),x=e=>({isOk:!1,isErr:!0,value:e});function P(e,n){if(e.isOk){const t=n(e.value);return t instanceof Promise?t.then((e=>M(e))):M(t)}if(e.isErr){const n=e.value;return x(n)}throw"should never get here"}var A,H,_=e=>{if(e.isOk)return e.value;throw e.value},N=e=>{if(e.isErr)return e.value;throw e.value},R=(e,n,...t)=>{let l=null,o=null,r=!1,s=!1;const i=[],c=n=>{for(let t=0;t<n.length;t++)l=n[t],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((r="function"!=typeof e&&!C(l))&&(l=String(l)),r&&s?i[i.length-1].o+=l:i.push(r?U(null,l):l),s=r)};if(c(t),n){n.key&&(o=n.key);{const e=n.className||n.class;e&&(n.class="object"!=typeof e?e:Object.keys(e).filter((n=>e[n])).join(" "))}}const u=U(e,null);return u.i=n,i.length>0&&(u.u=i),u.h=o,u},U=(e,n)=>{const t={t:0,p:e,o:n,m:null,u:null,i:null,h:null};return t},W={},D=(e,n,t)=>{const l=e;return{emit:e=>F(l,n,{bubbles:!!(4&t),composed:!!(2&t),cancelable:!!(1&t),detail:e})}},F=(e,n,t)=>{const l=p.ce(n,t);return e.dispatchEvent(l),l},L=new WeakMap,q=e=>{const n=e.$,t=e.$hostElement$,l=n.t,o=(n.v,()=>{}),r=((e,n)=>{var t;const l=V(n),o=a.get(l);if(e=11===e.nodeType?e:h,o)if("string"==typeof o){e=e.head||e;let r,s=L.get(e);if(s||L.set(e,s=new Set),!s.has(l)){{r=h.createElement("style"),r.innerHTML=o;const l=null!=(t=p.S)?t:function(){var e,n,t;return null!=(t=null==(n=null==(e=h.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?t:void 0}();if(null!=l&&r.setAttribute("nonce",l),!(1&n.t))if("HEAD"===e.nodeName){const n=e.querySelectorAll("link[rel=preconnect]"),t=n.length>0?n[n.length-1].nextSibling:document.querySelector("style");e.insertBefore(r,t)}else"host"in e?e.prepend(r):e.append(r);1&n.t&&"HEAD"!==e.nodeName&&e.insertBefore(r,null)}4&n.t&&(r.innerHTML+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),s&&s.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(t.shadowRoot?t.shadowRoot:t.getRootNode(),n);10&l&&2&l&&(t["s-sc"]=r,t.classList.add(r+"-h")),o()},V=(e,n)=>"sc-"+e.v,z=(e,n,t,l,o,r)=>{if(t!==l){let s=c(e,n),i=n.toLowerCase();if("class"===n){const n=e.classList,o=G(t),r=G(l);n.remove(...o.filter((e=>e&&!r.includes(e)))),n.add(...r.filter((e=>e&&!o.includes(e))))}else if("key"===n);else if("ref"===n)l&&l(e);else if(e.__lookupSetter__(n)||"o"!==n[0]||"n"!==n[1]){const i=C(l);if((s||i&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[n]=l;else{const o=null==l?"":l;"list"===n?s=!1:null!=t&&e[n]==o||("function"==typeof e.__lookupSetter__(n)?e[n]=o:e.setAttribute(n,o))}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(n)||e.removeAttribute(n):(!s||4&r||o)&&!i&&(l=!0===l?"":l,e.setAttribute(n,l))}else if(n="-"===n[2]?n.slice(3):c(f,i)?i.slice(2):i[2]+n.slice(3),t||l){const o=n.endsWith(I);n=n.replace(J,""),t&&p.rel(e,n,t,o),l&&p.ael(e,n,l,o)}}},B=/\s/,G=e=>e?e.split(B):[],I="Capture",J=new RegExp(I+"$"),K=(e,n,t)=>{const l=11===n.m.nodeType&&n.m.host?n.m.host:n.m,o=e&&e.i||E,r=n.i||E;for(const e of Q(Object.keys(o)))e in r||z(l,e,o[e],void 0,t,n.t);for(const e of Q(Object.keys(r)))z(l,e,o[e],r[e],t,n.t)};function Q(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var T=!1,X=!1,Y=(e,l,o,r)=>{const s=l.u[o];let i,c,u=0;if(null!==s.o)i=s.m=h.createTextNode(s.o);else{i=s.m=h.createElement(!T&&t&&2&s.t?"slot-fb":s.p),K(null,s,X);if(!!i.getRootNode().querySelector("body")&&n&&null!=A&&i["s-si"]!==A&&i.classList.add(i["s-si"]=A),s.u)for(u=0;u<s.u.length;++u)c=Y(e,s,u),c&&i.appendChild(c)}return i["s-hn"]=H,i},Z=(e,n,t,l,o,r)=>{let s,i=e;for(i.shadowRoot&&i.tagName===H&&(i=i.shadowRoot);o<=r;++o)l[o]&&(s=Y(null,t,o),s&&(l[o].m=s,oe(i,s,n)))},ee=(e,n,t)=>{for(let l=n;l<=t;++l){const n=e[l];if(n){const e=n.m;le(n),e&&e.remove()}}},ne=(e,n,t=!1)=>e.p===n.p&&(!!t||e.h===n.h),te=(e,n,t=!1)=>{const o=n.m=e.m,r=e.u,s=n.u,i=n.o;null===i?(K(e,n,X),null!==r&&null!==s?((e,n,t,l,o=!1)=>{let r,s,i=0,c=0,u=0,a=0,f=n.length-1,h=n[0],d=n[f],p=l.length-1,m=l[0],y=l[p];for(;i<=f&&c<=p;)if(null==h)h=n[++i];else if(null==d)d=n[--f];else if(null==m)m=l[++c];else if(null==y)y=l[--p];else if(ne(h,m,o))te(h,m,o),h=n[++i],m=l[++c];else if(ne(d,y,o))te(d,y,o),d=n[--f],y=l[--p];else if(ne(h,y,o))te(h,y,o),oe(e,h.m,d.m.nextSibling),h=n[++i],y=l[--p];else if(ne(d,m,o))te(d,m,o),oe(e,d.m,h.m),d=n[--f],m=l[++c];else{for(u=-1,a=i;a<=f;++a)if(n[a]&&null!==n[a].h&&n[a].h===m.h){u=a;break}u>=0?(s=n[u],s.p!==m.p?r=Y(n&&n[c],t,u):(te(s,m,o),n[u]=void 0,r=s.m),m=l[++c]):(r=Y(n&&n[c],t,c),m=l[++c]),r&&oe(h.m.parentNode,r,h.m)}i>f?Z(e,null==l[p+1]?null:l[p+1].m,t,l,c,p):c>p&&ee(n,i,f)})(o,r,n,s,t):null!==s?(null!==e.o&&(o.textContent=""),Z(o,null,n,s,0,s.length-1)):!t&&l&&null!==r&&ee(r,0,r.length-1)):e.o!==i&&(o.data=i)},le=e=>{e.i&&e.i.ref&&e.i.ref(null),e.u&&e.u.map(le)},oe=(e,n,t)=>null==e?void 0:e.insertBefore(n,t),re=(e,n,t=!1)=>{const l=e.$hostElement$,o=e.$,r=e.j||U(null,null),s=(i=n)&&i.p===W?n:R(null,null,n);var i;if(H=l.tagName,t&&s.i)for(const e of Object.keys(s.i))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(s.i[e]=l[e]);s.p=null,s.t|=4,e.j=s,s.m=r.m=l.shadowRoot||l,A=l["s-sc"],T=!!(1&o.t),te(r,s,t)},se=(e,n)=>{n&&!e.k&&n["s-p"]&&n["s-p"].push(new Promise((n=>e.k=n)))},ie=(e,n)=>{if(e.t|=16,4&e.t)return void(e.t|=512);se(e,e.O);return j((()=>ce(e,n)))},ce=(e,n)=>{const t=e.$hostElement$,l=(e.$.v,()=>{}),o=t;if(!o)throw new Error(`Can't render component <${t.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let r;return n&&(r=me(o,"componentWillLoad")),l(),ue(r,(()=>fe(e,o,n)))},ue=(e,n)=>ae(e)?e.then(n).catch((e=>{console.error(e),n()})):n(),ae=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,fe=async(e,n,t)=>{var l;const o=e.$hostElement$,r=(e.$.v,()=>{}),s=o["s-rc"];t&&q(e);const i=(e.$.v,()=>{});he(e,n,o,t),s&&(s.map((e=>e())),o["s-rc"]=void 0),i(),r();{const n=null!=(l=o["s-p"])?l:[],t=()=>de(e);0===n.length?t():(Promise.all(n).then(t),e.t|=4,n.length=0)}},he=(e,n,t,l)=>{try{n=n.render(),e.t&=-17,e.t|=2,re(e,n,l)}catch(n){u(n,e.$hostElement$)}return null},de=e=>{e.$.v;const n=e.$hostElement$,t=()=>{},l=e.O;64&e.t?t():(e.t|=64,ye(n),t(),e.C(n),l||pe()),e.k&&(e.k(),e.k=void 0),512&e.t&&S((()=>ie(e,!1))),e.t&=-517},pe=e=>{ye(h.documentElement),S((()=>F(f,"appload",{detail:{namespace:"import-export"}})))},me=(e,n,t)=>{if(e&&e[n])try{return e[n](t)}catch(e){u(e)}},ye=n=>{var t;return n.classList.add(null!=(t=e)?t:"hydrated")},be=(e,n,t,l)=>{const o=i(e),r=o.M.get(n),s=o.t;var c,u;c=t,u=l.P[n][0],t=null==c||C(c)?c:1&u?String(c):c;const a=Number.isNaN(r)&&Number.isNaN(t);t!==r&&!a&&(o.M.set(n,t),2==(18&s)&&ie(o,!1))},$e=(e,n,t)=>{var l,r;const s=e.prototype;if(n.P||o){const t=Object.entries(null!=(l=n.P)?l:{});t.map((([e,[t]])=>{(31&t||32&t)&&Object.defineProperty(s,e,{get(){return n=e,i(this).M.get(n);var n},set(t){be(this,e,t,n)},configurable:!0,enumerable:!0})}));{const l=new Map;s.attributeChangedCallback=function(e,t,o){p.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))o=this[c],delete this[c];else{if(s.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==o)return;if(null==c){const l=i(this),s=null==l?void 0:l.t;if(s&&!(8&s)&&128&s&&o!==t){const l=this,s=null==(r=n.A)?void 0:r[e];null==s||s.forEach((n=>{null!=l[n]&&l[n].call(l,o,t,e)}))}return}}this[c]=(null!==o||"boolean"!=typeof this[c])&&o}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=n.A)?r:{}),...t.filter((([e,n])=>15&n[0])).map((([e,n])=>{const t=n[1]||e;return l.set(t,e),t}))]))}}return e},ve=async(e,n,t,l)=>{let o;if(!(32&n.t)){n.t|=32;{o=e.constructor;const t=e.localName;customElements.whenDefined(t).then((()=>n.t|=128))}if(o&&o.style){let e;"string"==typeof o.style&&(e=o.style);const n=V(t);if(!a.has(n)){const l=(t.v,()=>{});((e,n,t)=>{let l=a.get(e);m&&t?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,a.set(e,l)})(n,e,!!(1&t.t)),l()}}}const r=n.O,s=()=>ie(n,!0);r&&r["s-rc"]?r["s-rc"].push(s):s()},we=(e,n)=>{const t={t:n[0],v:n[1]};return t.P=n[2],Object.assign(e.prototype,{__registerHost(){((e,n)=>{const t={t:0,$hostElement$:e,$:n,M:new Map};t.H=new Promise((e=>t.C=e)),e["s-p"]=[],e["s-rc"]=[],s.set(e,t)})(this,t)},connectedCallback(){i(this),(e=>{if(!(1&p.t)){const n=i(e),t=n.$,l=(t.v,()=>{});if(1&n.t)(null==n?void 0:n._)||(null==n?void 0:n.H)&&n.H.then((()=>{}));else{n.t|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){se(n,n.O=t);break}}t.P&&Object.entries(t.P).map((([n,[t]])=>{if(31&t&&e.hasOwnProperty(n)){const t=e[n];delete e[n],e[n]=t}})),ve(e,n,t)}l()}})(this)},disconnectedCallback(){(async e=>{1&p.t||i(e)})(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw new Error(`Unable to re-use existing shadow root for ${t.v}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else this.attachShadow({mode:"open"})}}),e.is=t.v,$e(e,t)},ge=e=>p.S=e,Se=e=>Object.assign(p,e);export{d as H,ge as a,Se as b,D as c,k as g,R as h,we as p,O as s};
2
- //# sourceMappingURL=p-ddbe189c.js.map
@@ -1,2 +0,0 @@
1
- import{p as e,H as l,h as t}from"./p-ddbe189c.js";import{d as i}from"./p-dd1bf849.js";const a={zh:{excelName:"Excel名称",sheetName:"表名",author:"作者",createTime:"创建时间",key:"键",name:"名称",width:"宽度",note:"备注",dataType:"数据类型",allowedValues:"允许值",noDefinition:"未提供定义"},en:{excelName:"Excel Name",sheetName:"Sheet Name",author:"Author",createTime:"Created Time",key:"Key",name:"Name",width:"Width",note:"Note",dataType:"Data Type",allowedValues:"Allowed Values",noDefinition:"No definition provided"}},n=e(class extends l{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.definition=void 0,this.culture="en",this.cultureResources=void 0}render(){var e,l;const i=null!==(l=null===(e=this.cultureResources)||void 0===e?void 0:e[this.culture])&&void 0!==l?l:a[this.culture];return this.definition?t("div",{class:"table-definition"},t("div",{class:"definition-details"},t("div",{class:"detail-item"},t("span",{class:"label"},i.excelName),t("span",{class:"value"},t("editable-cell",{value:this.definition.name,onValueChange:e=>this.definition.name=e.detail}))),t("div",{class:"detail-item"},t("span",{class:"label"},i.sheetName),t("span",{class:"value"},t("editable-cell",{value:this.definition.sheetName,onValueChange:e=>this.definition.sheetName=e.detail}))),t("div",{class:"detail-item"},t("span",{class:"label"},i.author),t("span",{class:"value"},t("editable-cell",{value:this.definition.author,onValueChange:e=>this.definition.author=e.detail}))),t("div",{class:"detail-item"},t("span",{class:"label"},i.createTime),t("span",{class:"value"},t("editable-cell",{value:this.definition.createTime,type:"datetime-local",onValueChange:e=>this.definition.createTime=e.detail})))),t("table",{class:"definition-table"},t("thead",null,t("tr",null,t("th",null,i.key),t("th",null,i.name),t("th",null,i.width),t("th",null,i.note),t("th",null,i.dataType),t("th",null,i.allowedValues))),t("tbody",null,this.definition.columns.map((e=>{var l,i,a;return t("tr",null,t("td",null,t("editable-cell",{value:e.key,onValueChange:l=>e.key=l.detail})),t("td",null,t("editable-cell",{value:e.name,onValueChange:l=>e.name=l.detail})),t("td",null,t("editable-cell",{value:null===(l=e.width)||void 0===l?void 0:l.toString(),onValueChange:l=>e.width=parseInt(l.detail)})),t("td",null,t("editable-cell",{value:e.note,onValueChange:l=>e.note=l.detail})),t("td",null,e.dataType),t("td",null,t("editable-cell",{value:null!==(a=null===(i=e.allowedValues)||void 0===i?void 0:i.join(", "))&&void 0!==a?a:"",onValueChange:l=>e.allowedValues=l.detail.split(",")})))}))))):t("div",{class:"no-definition"},i.noDefinition)}static get style(){return".table-definition{font-family:Arial, sans-serif;margin:4px;padding:20px;border:1px solid #ccc;border-radius:8px;background-color:#f9f9f9;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1)}.definition-name{font-size:24px;font-weight:bold;margin-bottom:10px;color:#333}.definition-details{display:flex;flex-direction:column;gap:10px;margin-bottom:20px}.detail-item{display:flex;gap:10px;justify-content:space-between}.label{font-weight:bold;padding-right:10px;flex:0 0 150px;text-align:right;color:#333;border-radius:4px;padding:5px}.value{flex:1;text-align:left;padding:5px;background-color:#e8f5e9;border-radius:4px;box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1)}.definition-table{width:100%;border-collapse:collapse;margin-top:20px;background-color:#fff;border-radius:8px;overflow:hidden;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border:none}.definition-table th,.definition-table td{border-width:0;padding:8px;text-align:left}.definition-table th{background-color:#4caf50;color:white;font-weight:bold}.definition-table tr:nth-child(even){background-color:#e8f5e9}.definition-table tr:hover{background-color:#c8e6c9}.no-definition{font-size:18px;color:#888;text-align:center;margin-top:20px}"}},[1,"import-export-definition",{definition:[16],culture:[1],cultureResources:[16]}]);function o(){if("undefined"==typeof customElements)return;["import-export-definition","editable-cell"].forEach((e=>{switch(e){case"import-export-definition":customElements.get(e)||customElements.define(e,n);break;case"editable-cell":customElements.get(e)||i()}}))}o();export{n as I,o as d};
2
- //# sourceMappingURL=p-f7586df1.js.map
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../../dist/types/components";
2
-
3
- interface EditableCell extends Components.EditableCell, HTMLElement {}
4
- export const EditableCell: {
5
- prototype: EditableCell;
6
- new (): EditableCell;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../../dist/types/components";
2
-
3
- interface ImexportTable extends Components.ImexportTable, HTMLElement {}
4
- export const ImexportTable: {
5
- prototype: ImexportTable;
6
- new (): ImexportTable;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../../dist/types/components";
2
-
3
- interface ImportExportDefinition extends Components.ImportExportDefinition, HTMLElement {}
4
- export const ImportExportDefinition: {
5
- prototype: ImportExportDefinition;
6
- new (): ImportExportDefinition;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../../dist/types/components";
2
-
3
- interface ImportExportDefiniton extends Components.ImportExportDefiniton, HTMLElement {}
4
- export const ImportExportDefiniton: {
5
- prototype: ImportExportDefiniton;
6
- new (): ImportExportDefiniton;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../../dist/types/components";
2
-
3
- interface ImportExportStudio extends Components.ImportExportStudio, HTMLElement {}
4
- export const ImportExportStudio: {
5
- prototype: ImportExportStudio;
6
- new (): ImportExportStudio;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../../dist/types/components";
2
-
3
- interface ImportExportTable extends Components.ImportExportTable, HTMLElement {}
4
- export const ImportExportTable: {
5
- prototype: ImportExportTable;
6
- new (): ImportExportTable;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,33 +0,0 @@
1
- /**
2
- * Get the base path to where the assets can be found. Use "setAssetPath(path)"
3
- * if the path needs to be customized.
4
- */
5
- export declare const getAssetPath: (path: string) => string;
6
-
7
- /**
8
- * Used to manually set the base path where assets can be found.
9
- * If the script is used as "module", it's recommended to use "import.meta.url",
10
- * such as "setAssetPath(import.meta.url)". Other options include
11
- * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
12
- * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
13
- * But do note that this configuration depends on how your script is bundled, or lack of
14
- * bundling, and where your assets can be loaded from. Additionally custom bundling
15
- * will have to ensure the static assets are copied to its build directory.
16
- */
17
- export declare const setAssetPath: (path: string) => void;
18
-
19
- /**
20
- * Used to specify a nonce value that corresponds with an application's CSP.
21
- * When set, the nonce will be added to all dynamically created script and style tags at runtime.
22
- * Alternatively, the nonce value can be set on a meta tag in the DOM head
23
- * (<meta name="csp-nonce" content="{ nonce value here }" />) which
24
- * will result in the same behavior.
25
- */
26
- export declare const setNonce: (nonce: string) => void
27
-
28
- export interface SetPlatformOptions {
29
- raf?: (c: FrameRequestCallback) => number;
30
- ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
31
- rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
32
- }
33
- export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../../dist/types/components";
2
-
3
- interface TableDefinition extends Components.TableDefinition, HTMLElement {}
4
- export const TableDefinition: {
5
- prototype: TableDefinition;
6
- new (): TableDefinition;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,18 +0,0 @@
1
- import { EventEmitter } from '../../stencil-public-runtime';
2
- export declare class EditableCellComponent {
3
- culture: 'zh' | 'en';
4
- type: 'text' | 'datetime-local';
5
- value: string | Date;
6
- inputValue: string;
7
- valueChange: EventEmitter<string>;
8
- inputElement: HTMLInputElement;
9
- contentELement: HTMLElement;
10
- componentWillLoad(): void;
11
- dblHandler: (_: MouseEvent) => void;
12
- showEditor: () => void;
13
- hideEditor: () => void;
14
- keyUpHandler: (event: KeyboardEvent) => void;
15
- changeHandler: (e: Event) => void;
16
- completeInput: () => void;
17
- render(): any;
18
- }
@@ -1,19 +0,0 @@
1
- import { EventEmitter } from 'stream';
2
- import { type ExcelDefinition } from '../../declarations/ExcelDefintion';
3
- export declare class ImexportTableComponent {
4
- info: ExcelDefinition;
5
- imported: EventEmitter<any>;
6
- importExcel(options?: {
7
- buffer?: Uint8Array;
8
- }): Promise<void>;
9
- downloadExcelTemplate(): Promise<void>;
10
- exportExcel(data: any[]): Promise<void>;
11
- componentDidLoad(): void;
12
- fileInput: HTMLInputElement;
13
- linkInput: HTMLAnchorElement;
14
- private setDownloadLink;
15
- private download;
16
- private onFileChange;
17
- private exportDataToExcel;
18
- render(): any;
19
- }
@@ -1,7 +0,0 @@
1
- import { ExcelDefinition } from '../../declarations/ExcelDefinition';
2
- export declare class ImportExportDefinitionComponent {
3
- definition: ExcelDefinition;
4
- culture: 'zh' | 'en';
5
- cultureResources?: Record<string, Record<string, string>>;
6
- render(): any;
7
- }
@@ -1,6 +0,0 @@
1
- import { ExcelDefinition } from '../../declarations/ExcelDefintion';
2
- export declare class ImportExportDefinitionComponent {
3
- definition: ExcelDefinition;
4
- culture: 'zh' | 'en';
5
- render(): any;
6
- }
@@ -1,14 +0,0 @@
1
- import { type ExcelDefinition } from '../../declarations/ExcelDefinition';
2
- export declare class ImportExportStudioComponent {
3
- definition: ExcelDefinition;
4
- culture: 'zh' | 'en';
5
- data: any[];
6
- showDefinition: boolean;
7
- showDataSource: boolean;
8
- componentWillLoad(): void;
9
- toggleDefinitionVisibility: () => void;
10
- toggleDataSourceVisibility: () => void;
11
- importExcelHandler: (definition: ExcelDefinition) => Promise<void>;
12
- handleDataSourceChange: (e: Event) => void;
13
- render(): any;
14
- }
@@ -1,5 +0,0 @@
1
- import { type ExcelDefinition } from '../../declarations/ExcelDefintion';
2
- export declare class ImportExportTableComponent {
3
- info: ExcelDefinition;
4
- render(): any;
5
- }
@@ -1,6 +0,0 @@
1
- import { type ExcelDefinition } from '../../declarations/ExcelDefinition';
2
- export declare class ImportExportTableComponent {
3
- definition: ExcelDefinition;
4
- data: any[];
5
- render(): any;
6
- }
@@ -1,116 +0,0 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- /**
4
- * This is an autogenerated file created by the Stencil compiler.
5
- * It contains typing information for all components that exist in this project.
6
- */
7
- import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
- import { ExcelDefinition } from "./declarations/ExcelDefinition";
9
- export { ExcelDefinition } from "./declarations/ExcelDefinition";
10
- export namespace Components {
11
- interface EditableCell {
12
- "culture": 'zh' | 'en';
13
- "type": 'text' | 'datetime-local';
14
- "value": string | Date;
15
- }
16
- interface ImportExportDefinition {
17
- "culture": 'zh' | 'en';
18
- "cultureResources"?: Record<string, Record<string, string>>;
19
- "definition": ExcelDefinition;
20
- }
21
- interface ImportExportStudio {
22
- "culture": 'zh' | 'en';
23
- "data": any[];
24
- "definition": ExcelDefinition;
25
- }
26
- interface ImportExportTable {
27
- "data": any[];
28
- "definition": ExcelDefinition;
29
- }
30
- }
31
- export interface EditableCellCustomEvent<T> extends CustomEvent<T> {
32
- detail: T;
33
- target: HTMLEditableCellElement;
34
- }
35
- declare global {
36
- interface HTMLEditableCellElementEventMap {
37
- "valueChange": string;
38
- }
39
- interface HTMLEditableCellElement extends Components.EditableCell, HTMLStencilElement {
40
- addEventListener<K extends keyof HTMLEditableCellElementEventMap>(type: K, listener: (this: HTMLEditableCellElement, ev: EditableCellCustomEvent<HTMLEditableCellElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
41
- addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
42
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
43
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
44
- removeEventListener<K extends keyof HTMLEditableCellElementEventMap>(type: K, listener: (this: HTMLEditableCellElement, ev: EditableCellCustomEvent<HTMLEditableCellElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
45
- removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
46
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
47
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
48
- }
49
- var HTMLEditableCellElement: {
50
- prototype: HTMLEditableCellElement;
51
- new (): HTMLEditableCellElement;
52
- };
53
- interface HTMLImportExportDefinitionElement extends Components.ImportExportDefinition, HTMLStencilElement {
54
- }
55
- var HTMLImportExportDefinitionElement: {
56
- prototype: HTMLImportExportDefinitionElement;
57
- new (): HTMLImportExportDefinitionElement;
58
- };
59
- interface HTMLImportExportStudioElement extends Components.ImportExportStudio, HTMLStencilElement {
60
- }
61
- var HTMLImportExportStudioElement: {
62
- prototype: HTMLImportExportStudioElement;
63
- new (): HTMLImportExportStudioElement;
64
- };
65
- interface HTMLImportExportTableElement extends Components.ImportExportTable, HTMLStencilElement {
66
- }
67
- var HTMLImportExportTableElement: {
68
- prototype: HTMLImportExportTableElement;
69
- new (): HTMLImportExportTableElement;
70
- };
71
- interface HTMLElementTagNameMap {
72
- "editable-cell": HTMLEditableCellElement;
73
- "import-export-definition": HTMLImportExportDefinitionElement;
74
- "import-export-studio": HTMLImportExportStudioElement;
75
- "import-export-table": HTMLImportExportTableElement;
76
- }
77
- }
78
- declare namespace LocalJSX {
79
- interface EditableCell {
80
- "culture"?: 'zh' | 'en';
81
- "onValueChange"?: (event: EditableCellCustomEvent<string>) => void;
82
- "type"?: 'text' | 'datetime-local';
83
- "value"?: string | Date;
84
- }
85
- interface ImportExportDefinition {
86
- "culture"?: 'zh' | 'en';
87
- "cultureResources"?: Record<string, Record<string, string>>;
88
- "definition"?: ExcelDefinition;
89
- }
90
- interface ImportExportStudio {
91
- "culture"?: 'zh' | 'en';
92
- "data"?: any[];
93
- "definition"?: ExcelDefinition;
94
- }
95
- interface ImportExportTable {
96
- "data"?: any[];
97
- "definition"?: ExcelDefinition;
98
- }
99
- interface IntrinsicElements {
100
- "editable-cell": EditableCell;
101
- "import-export-definition": ImportExportDefinition;
102
- "import-export-studio": ImportExportStudio;
103
- "import-export-table": ImportExportTable;
104
- }
105
- }
106
- export { LocalJSX as JSX };
107
- declare module "@stencil/core" {
108
- export namespace JSX {
109
- interface IntrinsicElements {
110
- "editable-cell": LocalJSX.EditableCell & JSXBase.HTMLAttributes<HTMLEditableCellElement>;
111
- "import-export-definition": LocalJSX.ImportExportDefinition & JSXBase.HTMLAttributes<HTMLImportExportDefinitionElement>;
112
- "import-export-studio": LocalJSX.ImportExportStudio & JSXBase.HTMLAttributes<HTMLImportExportStudioElement>;
113
- "import-export-table": LocalJSX.ImportExportTable & JSXBase.HTMLAttributes<HTMLImportExportTableElement>;
114
- }
115
- }
116
- }
@@ -1,17 +0,0 @@
1
- import { ExcelDataType } from "@senlinz/import-export-wasm";
2
- interface ExcelDefinition {
3
- name: string;
4
- sheetName: string;
5
- columns: ExcelColumnDefinition[];
6
- author?: string;
7
- createTime?: Date | string;
8
- }
9
- interface ExcelColumnDefinition {
10
- key: string;
11
- name: string;
12
- width?: number;
13
- note?: string;
14
- dataType?: ExcelDataType;
15
- allowedValues?: string[];
16
- }
17
- export { ExcelDefinition, ExcelColumnDefinition, ExcelDataType };
@@ -1,17 +0,0 @@
1
- import { ExcelDataType } from "@senlinz/import-export-wasm";
2
- interface ExcelDefinition {
3
- name: string;
4
- sheetName: string;
5
- columns: ExcelColumnDefinition[];
6
- author: string;
7
- createTime: Date | string;
8
- }
9
- interface ExcelColumnDefinition {
10
- key: string;
11
- name: string;
12
- width?: number;
13
- note?: string;
14
- dataType?: ExcelDataType;
15
- allowedValues?: string[];
16
- }
17
- export { ExcelDefinition, ExcelColumnDefinition, ExcelDataType };