@htmlbricks/hb-form-composer 0.18.14 → 0.18.15
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/package.json +4 -4
- package/release/manifest.json +1 -1
- package/release/release.js +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@htmlbricks/hb-form-composer",
|
|
3
3
|
"displayName": "Svelte-Bootstrap form-composer",
|
|
4
4
|
"description": "Svelte-Bootstrap form-composer",
|
|
5
|
-
"version": "0.18.
|
|
5
|
+
"version": "0.18.15",
|
|
6
6
|
"main": "release/release.js",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"webcomponents"
|
|
76
76
|
],
|
|
77
77
|
"contributors": [],
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "bc93365aaf0629daf34fe1a80ef7ae791c8a11c7",
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@htmlbricks/hb-form": "^0.18.
|
|
81
|
-
"@htmlbricks/hb-table": "^0.18.
|
|
80
|
+
"@htmlbricks/hb-form": "^0.18.15",
|
|
81
|
+
"@htmlbricks/hb-table": "^0.18.15",
|
|
82
82
|
"style-to-object": "^0.3.0"
|
|
83
83
|
}
|
|
84
84
|
}
|
package/release/manifest.json
CHANGED
package/release/release.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var release=function(){"use strict";function e(){}function t(e){return e()}function o(){return Object.create(null)}function n(e){e.forEach(t)}function l(e){return"function"==typeof e}function a(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function i(e,t){e.appendChild(t)}function r(e,t,o){e.insertBefore(t,o||null)}function d(e){e.parentNode.removeChild(e)}function c(e){return document.createElement(e)}function s(e){return document.createTextNode(e)}function u(){return s(" ")}function p(){return s("")}function b(e,t,o,n){return e.addEventListener(t,o,n),()=>e.removeEventListener(t,o,n)}function f(e,t,o){null==o?e.removeAttribute(t):e.getAttribute(t)!==o&&e.setAttribute(t,o)}function h(e,t,o){t in e?e[t]="boolean"==typeof e[t]&&""===o||o:f(e,t,o)}function m(e,t,o,n){null===o?e.style.removeProperty(t):e.style.setProperty(t,o,n?"important":"")}function y(e){const t={};for(const o of e)t[o.name]=o.value;return t}let g;function v(e){g=e}function L(){if(!g)throw new Error("Function called outside component initialization");return g}function x(){const e=L();return(t,o,{cancelable:n=!1}={})=>{const l=e.$$.callbacks[t];if(l){const a=function(e,t,{bubbles:o=!1,cancelable:n=!1}={}){const l=document.createEvent("CustomEvent");return l.initCustomEvent(e,o,n,t),l}(t,o,{cancelable:n});return l.slice().forEach((t=>{t.call(e,a)})),!a.defaultPrevented}return!0}}const V=[],$=[],w=[],O=[],k=Promise.resolve();let E=!1;function _(e){w.push(e)}const T=new Set;let C=0;function N(){const e=g;do{for(;C<V.length;){const e=V[C];C++,v(e),S(e.$$)}for(v(null),V.length=0,C=0;$.length;)$.pop()();for(let e=0;e<w.length;e+=1){const t=w[e];T.has(t)||(T.add(t),t())}w.length=0}while(V.length);for(;O.length;)O.pop()();E=!1,T.clear(),v(e)}function S(e){if(null!==e.fragment){e.update(),n(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(_)}}const M=new Set;function q(e,t){e&&e.i&&(M.delete(e),e.i(t))}function P(e,t){e.d(1),t.delete(e.key)}function A(e,t){-1===e.$$.dirty[0]&&(V.push(e),E||(E=!0,k.then(N)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function D(a,i,r,c,s,u,p,b=[-1]){const f=g;v(a);const h=a.$$={fragment:null,ctx:null,props:u,update:e,not_equal:s,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(f?f.$$.context:[])),callbacks:o(),dirty:b,skip_bound:!1,root:i.target||f.$$.root};p&&p(h.root);let m=!1;if(h.ctx=r?r(a,i.props||{},((e,t,...o)=>{const n=o.length?o[0]:t;return h.ctx&&s(h.ctx[e],h.ctx[e]=n)&&(!h.skip_bound&&h.bound[e]&&h.bound[e](n),m&&A(a,e)),t})):[],h.update(),m=!0,n(h.before_update),h.fragment=!!c&&c(h.ctx),i.target){if(i.hydrate){const e=function(e){return Array.from(e.childNodes)}(i.target);h.fragment&&h.fragment.l(e),e.forEach(d)}else h.fragment&&h.fragment.c();i.intro&&q(a.$$.fragment),function(e,o,a,i){const{fragment:r,on_mount:d,on_destroy:c,after_update:s}=e.$$;r&&r.m(o,a),i||_((()=>{const o=d.map(t).filter(l);c?c.push(...o):n(o),e.$$.on_mount=[]})),s.forEach(_)}(a,i.target,i.anchor,i.customElement),N()}v(f)}let J;"function"==typeof HTMLElement&&(J=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(t).filter(l);for(const e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,o){this[e]=o}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){!function(e,t){const o=e.$$;null!==o.fragment&&(n(o.on_destroy),o.fragment&&o.fragment.d(t),o.on_destroy=o.fragment=null,o.ctx=[])}(this,1),this.$destroy=e}$on(e,t){const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(t),()=>{const e=o.indexOf(t);-1!==e&&o.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}});var j="0.18.14",I=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,R=/\n/g,z=/^\s*/,B=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,H=/^:\s*/,F=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,W=/^[;\s]*/,K=/^\s+|\s+$/g,G="";function Q(e){return e?e.replace(K,G):G}var U=function(e,t){var o,n=null;if(!e||"string"!=typeof e)return n;for(var l,a,i=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var o=1,n=1;function l(e){var t=e.match(R);t&&(o+=t.length);var l=e.lastIndexOf("\n");n=~l?e.length-l:n+e.length}function a(){var e={line:o,column:n};return function(t){return t.position=new i(e),c(),t}}function i(e){this.start=e,this.end={line:o,column:n},this.source=t.source}function r(l){var a=new Error(t.source+":"+o+":"+n+": "+l);if(a.reason=l,a.filename=t.source,a.line=o,a.column=n,a.source=e,!t.silent)throw a}function d(t){var o=t.exec(e);if(o){var n=o[0];return l(n),e=e.slice(n.length),o}}function c(){d(z)}function s(e){var t;for(e=e||[];t=u();)!1!==t&&e.push(t);return e}function u(){var t=a();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var o=2;G!=e.charAt(o)&&("*"!=e.charAt(o)||"/"!=e.charAt(o+1));)++o;if(o+=2,G===e.charAt(o-1))return r("End of comment missing");var i=e.slice(2,o-2);return n+=2,l(i),e=e.slice(o),n+=2,t({type:"comment",comment:i})}}function p(){var e=a(),t=d(B);if(t){if(u(),!d(H))return r("property missing ':'");var o=d(F),n=e({type:"declaration",property:Q(t[0].replace(I,G)),value:o?Q(o[0].replace(I,G)):G});return d(W),n}}return i.prototype.content=e,c(),function(){var e,t=[];for(s(t);e=p();)!1!==e&&(t.push(e),s(t));return t}()}(e),r="function"==typeof t,d=0,c=i.length;d<c;d++)l=(o=i[d]).property,a=o.value,r?t(l,a,o):a&&(n||(n={}),n[l]=a);return n};var X,Y=(function(e,t){t.__esModule=!0,t.LanguageTranslator=t.addComponent=t.getChildStyleToPass=void 0,t.getChildStyleToPass=function(e,t){var o,n,l="";if(e&&(null==t?void 0:t.length)&&(null===(o=Object.keys(e))||void 0===o?void 0:o.length)&&(null===(n=null==t?void 0:t.filter((function(t){return Object.keys(e).includes(t.name)})))||void 0===n?void 0:n.length))for(var a=function(o){(null==t?void 0:t.filter((function(t){return t.name===o&&t.defaultValue!==e[o]})))&&(l+="".concat(o,":").concat(e[o],";"))},i=0,r=Object.keys(e);i<r.length;i++)a(r[i]);return l},t.addComponent=function(e){var t,o=(null===(t=null==e?void 0:e.repoName.split("/"))||void 0===t?void 0:t[1])||(null==e?void 0:e.repoName);if(!o)throw new Error("wrong componentPath "+(null==e?void 0:e.repoName));if(!(null==e?void 0:e.version))throw new Error("wrong version "+(null==e?void 0:e.version));var n=(null==e?void 0:e.iifePath)||"release/release.js";if(!document.getElementById(o+"-script"))try{var l=document.createElement("script");l.id=o+"-script",l.src="https://cdn.jsdelivr.net/npm/".concat(e.repoName,"@").concat(e.version,"/").concat(n),(null==e?void 0:e.local)&&location.href.includes("localhost")&&(l.src="".concat(e.local)),document.head.appendChild(l)}catch(e){console.warn(e)}};var o=function(){function e(e){if(!(null==e?void 0:e.dictionary))throw new Error("no dictionary provided");this.dictionary=e.dictionary,this.setLang(null==e?void 0:e.lang)}return e.prototype.setLang=function(t){t||(t=e.getDefaultLang()),this.lang=t},e.prototype.translateWord=function(t,o){return e.getDictionaryWord(t,this.dictionary,o||this.lang)},e.prototype.translateDate=function(t,o,n){return e.formatDate(t,o,n||this.lang)},e.getDefaultLang=function(){var e,t,o,n,l,a="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(o=null===(t=null===(e=navigator.languages[0])||void 0===e?void 0:e.split("-")[0])||void 0===t?void 0:t.toLowerCase())||void 0===o?void 0:o.length)&&(a=null===(l=null===(n=navigator.languages[0])||void 0===n?void 0:n.split("-")[0])||void 0===l?void 0:l.toLowerCase()),a},e.getDictionaryWord=function(t,o,n){var l;if(!t)throw new Error("no wordKey provided");if(!o)throw new Error("no dictionary provided");if(n&&(null===(l=o[n])||void 0===l?void 0:l[t]))return o[n][t];var a="",i=e.getDefaultLang();if(!n||i!==n){var r=null==o?void 0:o[i];(null==r?void 0:r[t])&&(a=r[t])}return a},e.formatDate=function(t,o,n){if(!t)throw new Error("no date provided");if("function"!=typeof t.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(n||e.getDefaultLang(),o).format(t)},e}();t.LanguageTranslator=o}(X={exports:{}},X.exports),X.exports),Z={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"}],parts:[{name:"invalid-feedback",description:""},{name:"main_button",description:""},{name:"button_container",description:""}]},ee={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"}],parts:[]};function te(e,t,o){const n=e.slice();return n[22]=t[o],n}function oe(e){let t;return{c(){t=s("empty")},m(e,o){r(e,t,o)},d(e){e&&d(t)}}}function ne(e){let t,o,l,a,s,p,m,y,g;return{c(){t=c("hb-form"),o=c("span"),o.innerHTML='<button type="button" class="btn btn-info">add Property</button>',l=u(),a=c("span"),s=c("button"),s.textContent="done",f(o,"slot","submit_button"),f(s,"type","button"),f(s,"class","btn btn-primary"),f(a,"slot","other_buttons"),h(t,"class","mainform"),h(t,"style",e[3]),h(t,"id",p="schema"+e[22].counter),h(t,"schema",m=e[22].schema)},m(n,d){r(n,t,d),i(t,o),i(t,l),i(t,a),i(a,s),y||(g=[b(s,"click",e[15]),b(t,"submit",e[16])],y=!0)},p(e,o){8&o&&h(t,"style",e[3]),4&o&&p!==(p="schema"+e[22].counter)&&h(t,"id",p),4&o&&m!==(m=e[22].schema)&&h(t,"schema",m)},d(e){e&&d(t),y=!1,n(g)}}}function le(e,t){let o,n,l=t[22].counter===t[2].length-1&&ne(t);return{key:e,first:null,c(){o=p(),l&&l.c(),n=p(),this.first=o},m(e,t){r(e,o,t),l&&l.m(e,t),r(e,n,t)},p(e,o){(t=e)[22].counter===t[2].length-1?l?l.p(t,o):(l=ne(t),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(e){e&&d(o),l&&l.d(e),e&&d(n)}}}function ae(e){let t,o,n;function l(e,t){return e[1]?.length?re:ie}let a=l(e),i=a(e);return{c(){t=c("h2"),t.textContent="output",o=u(),i.c(),n=p(),m(t,"margin","60px"),m(t,"text-align","center"),m(t,"color","blue")},m(e,l){r(e,t,l),r(e,o,l),i.m(e,l),r(e,n,l)},p(e,t){a===(a=l(e))&&i?i.p(e,t):(i.d(1),i=a(e),i&&(i.c(),i.m(n.parentNode,n)))},d(e){e&&d(t),e&&d(o),i.d(e),e&&d(n)}}}function ie(t){let o;return{c(){o=s("...no output")},m(e,t){r(e,o,t)},p:e,d(e){e&&d(o)}}}function re(e){let t,o;return{c(){t=c("hb-form"),h(t,"hide_submit","yes"),h(t,"schema",o=JSON.stringify(e[1])),h(t,"style",e[3])},m(e,o){r(e,t,o)},p(e,n){2&n&&o!==(o=JSON.stringify(e[1]))&&h(t,"schema",o),8&n&&h(t,"style",e[3])},d(e){e&&d(t)}}}function de(t){let o,n,l,a,i,f,m,y,g,v,L,x,V,$=[],w=new Map,O=!t[1]?.length&&oe(),k=t[2];const E=e=>e[22].counter;for(let e=0;e<k.length;e+=1){let o=te(t,k,e),n=E(o);w.set(n,$[e]=le(n,o))}let _=t[0]&&ae(t);return{c(){o=s("TO BE DONE\n"),n=c("br"),l=u(),a=c("br"),i=u(),f=c("hb-table"),y=u(),O&&O.c(),g=u();for(let e=0;e<$.length;e+=1)$[e].c();v=u(),_&&_.c(),L=p(),this.c=e,h(f,"id","table_specs"),h(f,"style",t[4]),h(f,"disablepagination","yes"),h(f,"actions",JSON.stringify(t[6])),h(f,"headers",JSON.stringify(t[7])),h(f,"rows",m=JSON.stringify(t[5]))},m(e,d){r(e,o,d),r(e,n,d),r(e,l,d),r(e,a,d),r(e,i,d),r(e,f,d),r(e,y,d),O&&O.m(e,d),r(e,g,d);for(let t=0;t<$.length;t+=1)$[t].m(e,d);r(e,v,d),_&&_.m(e,d),r(e,L,d),x||(V=b(f,"tableaction",t[14]),x=!0)},p(e,[t]){16&t&&h(f,"style",e[4]),32&t&&m!==(m=JSON.stringify(e[5]))&&h(f,"rows",m),e[1]?.length?O&&(O.d(1),O=null):O||(O=oe(),O.c(),O.m(g.parentNode,g)),1292&t&&(k=e[2],$=function(e,t,o,n,l,a,i,r,d,c,s,u){let p=e.length,b=a.length,f=p;const h={};for(;f--;)h[e[f].key]=f;const m=[],y=new Map,g=new Map;for(f=b;f--;){const e=u(l,a,f),r=o(e);let d=i.get(r);d?n&&d.p(e,t):(d=c(r,e),d.c()),y.set(r,m[f]=d),r in h&&g.set(r,Math.abs(f-h[r]))}const v=new Set,L=new Set;function x(e){q(e,1),e.m(r,s),i.set(e.key,e),s=e.first,b--}for(;p&&b;){const t=m[b-1],o=e[p-1],n=t.key,l=o.key;t===o?(s=t.first,p--,b--):y.has(l)?!i.has(n)||v.has(n)?x(t):L.has(l)?p--:g.get(n)>g.get(l)?(L.add(n),x(t)):(v.add(l),p--):(d(o,i),p--)}for(;p--;){const t=e[p];y.has(t.key)||d(t,i)}for(;b;)x(m[b-1]);return m}($,t,E,1,e,k,w,v.parentNode,P,le,v,te)),e[0]?_?_.p(e,t):(_=ae(e),_.c(),_.m(L.parentNode,L)):_&&(_.d(1),_=null)},i:e,o:e,d(e){e&&d(o),e&&d(n),e&&d(l),e&&d(a),e&&d(i),e&&d(f),e&&d(y),O&&O.d(e),e&&d(g);for(let t=0;t<$.length;t+=1)$[t].d(e);e&&d(v),_&&_.d(e),e&&d(L),x=!1,V()}}}function ce(e,t,o){const n=L(),l=x();let{id:a}=t,{style:i}=t,{debug:r}=t,d=[];const c=[{id:"first-row",type:"row",params:{columns:[{type:"checkbox",placeholder:"Required...",id:"required",label:"Is Required?"},{type:"text",placeholder:"Label...",id:"label",required:!0,label:"Property Label",validationTip:"This field cannot be empty."},{type:"select",placeholder:"Select something here...",id:"type",required:!0,label:"Selection of something",validationTip:"This field cannot be empty.",params:{options:[{label:"",value:""},{label:"text",value:"text"},{label:"textarea",value:"textarea"},{label:"email",value:"email"},{label:"number",value:"number"},{label:"select",value:"select"},{label:"radio",value:"radio"},{label:"checkbox",value:"checkbox"},{label:"file",value:"file"},{label:"date",value:"date"},{label:"datetime",value:"datetime"},{label:"color",value:"color"}]}}]}},{id:"dep-row",type:"row",params:{columns:[{type:"checkbox",placeholder:"Conditional...",id:"conditional",label:"Is Conditional?"},{type:"text",placeholder:"Conditional property...",id:"depName",label:"Conditional property",dependencies:[{id:"conditional"}]},{type:"text",placeholder:"Conditional values (separated by comma)...",id:"depValues",label:"Conditional values",dependencies:[{id:"conditional"}]}]}},{id:"length-row",type:"row",params:{columns:[{type:"number",placeholder:"Min Length...",id:"minLength",label:"Min Length",dependencies:[{id:"type",values:["text","textarea"]}]},{type:"number",placeholder:"Max Length...",id:"maxLength",label:"Max Length",dependencies:[{id:"type",values:["text","textarea"]}]}]}},{id:"size-row",type:"row",params:{columns:[{type:"number",placeholder:"Min...",id:"min",label:"Min",dependencies:[{id:"type",values:["number"]}]},{type:"number",placeholder:"Max...",id:"max",label:"Max",dependencies:[{id:"type",values:["number"]}]}]}},{type:"text",placeholder:"Option Label...",id:"optionLabel1",label:"Option Label",dependencies:[{id:"type",values:["select","radio"]}]},{type:"text",placeholder:"Option Value",id:"optionValue1",label:"Option Value",dependencies:[{id:"type",values:["select","radio"]}]},{type:"text",placeholder:"Option Label...",id:"optionLabel2",label:"Option Label",dependencies:[{id:"optionLabel1"},{id:"optionValue1"}]},{type:"text",placeholder:"Option Value",id:"optionValue2",label:"Option Value",dependencies:[{id:"optionLabel1"},{id:"optionValue1"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel3",label:"Option Label",dependencies:[{id:"optionLabel2"},{id:"optionValue2"}]},{type:"text",placeholder:"Option Value",id:"optionValue3",label:"Option Value",dependencies:[{id:"optionLabel2"},{id:"optionValue2"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel4",label:"Option Label",dependencies:[{id:"optionLabel3"},{id:"optionValue3"}]},{type:"text",placeholder:"Option Value",id:"optionValue4",label:"Option Value",dependencies:[{id:"optionLabel3"},{id:"optionValue3"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel5",label:"Option Label",dependencies:[{id:"optionLabel4"},{id:"optionValue4"}]},{type:"text",placeholder:"Option Value",id:"optionValue5",label:"Option Value",dependencies:[{id:"optionLabel4"},{id:"optionValue4"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel6",label:"Option Label",dependencies:[{id:"optionLabel5"},{id:"optionValue5"}]},{type:"text",placeholder:"Option Value",id:"optionValue6",label:"Option Value",dependencies:[{id:"optionLabel5"},{id:"optionValue5"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel7",label:"Option Label",dependencies:[{id:"optionLabel6"},{id:"optionValue6"}]},{type:"text",placeholder:"Option Value",id:"optionValue7",label:"Option Value",dependencies:[{id:"optionLabel6"},{id:"optionValue6"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel8",label:"Option Label",dependencies:[{id:"optionLabel7"},{id:"optionValue7"}]},{type:"text",placeholder:"Option Value",id:"optionValue8",label:"Option Value",dependencies:[{id:"optionLabel7"},{id:"optionValue7"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel9",label:"Option Label",dependencies:[{id:"optionLabel8"},{id:"optionValue8"}]},{type:"text",placeholder:"Option Value",id:"optionValue9",label:"Option Value",dependencies:[{id:"optionLabel8"},{id:"optionValue8"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel10",label:"Option Label",dependencies:[{id:"optionLabel9"},{id:"optionValue9"}]},{type:"text",placeholder:"Option Value",id:"optionValue10",label:"Option Value",dependencies:[{id:"optionLabel9"},{id:"optionValue9"}]}];let s,u,p,b="",f="";let h;function m(e){let t;console.log("addSchema",e);let n={};e.depName&&(t={id:e.depName},e.depValues&&(t.values=e.depValues.replace(", ",",").replace(" ,",",").split(",")));const l=t?[t]:void 0;if("text"!==e.type&&"textarea"!==e.type||(e.minLength&&(n.minLength=e.minLength),e.maxLength&&(n.maxLength=e.maxLength)),"number"===e.type&&(e.min&&(n.min=e.min),e.max&&(n.max=e.max)),"select"===e.type||"radio"===e.type){const t=[];e.optionLabel1&&t.push({label:e.optionLabel1,value:e.optionValue1}),e.optionLabel2&&t.push({label:e.optionLabel2,value:e.optionValue2}),e.optionLabel3&&t.push({label:e.optionLabel3,value:e.optionValue3}),e.optionLabel4&&t.push({label:e.optionLabel4,value:e.optionValue4}),e.optionLabel5&&t.push({label:e.optionLabel5,value:e.optionValue5}),e.optionLabel6&&t.push({label:e.optionLabel6,value:e.optionValue6}),e.optionLabel7&&t.push({label:e.optionLabel7,value:e.optionValue7}),e.optionLabel8&&t.push({label:e.optionLabel8,value:e.optionValue8}),e.optionLabel9&&t.push({label:e.optionLabel9,value:e.optionValue9}),e.optionLabel10&&t.push({label:e.optionLabel10,value:e.optionValue10}),n.options=t}const a={id:e.label,type:e.type,label:e.label,required:e.required,placeholder:e.placeholder,dependencies:l,params:n};d.find((t=>t.label===e.label))?o(1,d=d.map((t=>t.label===e.label?a:t))):o(1,d=[...d,a]),o(2,s=[...s,{counter:s.length,schema:JSON.stringify(c)}]),console.info("schema4selectorS",s)}function y(e){console.log(e,d),o(1,d=d.filter((t=>t.label!==e))),o(2,s=s.filter((e=>e.counter!==s.length-1)))}function g(){!function(e,t){l(e,t),n.dispatchEvent&&n.dispatchEvent(new CustomEvent(e,{detail:t}))}("done",{schema:d,id:a})}!function(e){L().$$.on_mount.push(e)}((()=>{Y.addComponent({repoName:"@htmlbricks/hb-form",version:j}),Y.addComponent({repoName:"@htmlbricks/hb-table",version:j}),p=n.shadowRoot.getElementById("schema"),console.log("formComponent",p)}));return e.$$set=e=>{"id"in e&&o(11,a=e.id),"style"in e&&o(12,i=e.style),"debug"in e&&o(0,r=e.debug)},e.$$.update=()=>{if(14343&e.$$.dirty){a||o(11,a=""),i&&(o(13,u=U(i)),o(3,b=Y.getChildStyleToPass(u,null==Z?void 0:Z.vars)),o(4,f=Y.getChildStyleToPass(u,null==ee?void 0:ee.vars))),"string"!=typeof r||"true"!==r&&"yes"!==r&&""!==r?!0!==r&&o(0,r=!1):o(0,r=!0),s||o(2,s=[{counter:0,schema:JSON.stringify(c)}]);const e=[];for(const t of d){let o,n;t.params&&(n=JSON.stringify(t.params)),t.dependencies&&(o=JSON.stringify(t.dependencies)),e.push({_id:t.label,label:t.label,type:t.type,params:n,required:t.required,dependencies:o})}o(5,h=e)}},[r,d,s,b,f,h,[{name:"delete",type:"icon",iconOrText:"x-octagon-fill"}],[{label:"Label",key:"label"},{label:"type",key:"type"},{label:"params",key:"params",nosort:!0},{label:"dependencies",key:"dependencies"},{label:"required",key:"required"}],m,y,g,a,i,u,e=>{y(e.detail.itemId)},()=>g(),e=>{m(e.detail)}]}class se extends J{constructor(e){super(),this.shadowRoot.innerHTML='<style>@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host{font-family:"Roboto", sans-serif}.mainform{margin-top:40px;display:block}.btn{display:inline-block;font-weight:400;line-height:1.5;color:#212529;text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;user-select:none;background-color:transparent;border:1px solid transparent;padding:0.375rem 0.75rem;font-size:1rem;border-radius:0.25rem;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out}@media(prefers-reduced-motion: reduce){.btn{transition:none}}.btn:hover{color:#212529}.btn:focus{outline:0;box-shadow:0 0 0 0.25rem rgba(13, 110, 253, 0.25)}.btn:disabled{pointer-events:none;opacity:0.65}.btn-primary{color:#fff;background-color:var(--bs-primary,#07689f);border-color:var(--bs-primary,#07689f)}.btn-primary:hover{color:#fff;background-color:#0b5ed7;border-color:#0a58ca}.btn-primary:focus{color:#fff;background-color:#0b5ed7;border-color:#0a58ca;box-shadow:0 0 0 0.25rem rgba(49, 132, 253, 0.5)}.btn-primary:active{color:#fff;background-color:#0a58ca;border-color:#0a53be}.btn-primary:active:focus{box-shadow:0 0 0 0.25rem rgba(49, 132, 253, 0.5)}.btn-primary:disabled{color:#fff;background-color:var(--bs-primary,#07689f);border-color:var(--bs-primary,#07689f)}.btn-info{color:#000;background-color:var(--bs-info,#a2d5f2);border-color:var(--bs-info,#a2d5f2)}.btn-info:hover{color:#000;background-color:#31d2f2;border-color:#25cff2}.btn-info:focus{color:#000;background-color:#31d2f2;border-color:#25cff2;box-shadow:0 0 0 0.25rem rgba(11, 172, 204, 0.5)}.btn-info:active{color:#000;background-color:#3dd5f3;border-color:#25cff2}.btn-info:active:focus{box-shadow:0 0 0 0.25rem rgba(11, 172, 204, 0.5)}.btn-info:disabled{color:#000;background-color:var(--bs-info,#a2d5f2);border-color:var(--bs-info,#a2d5f2)}</style>',D(this,{target:this.shadowRoot,props:y(this.attributes),customElement:!0},ce,de,a,{id:11,style:12,debug:0},null),e&&(e.target&&r(e.target,this,e.anchor),e.props&&(this.$set(e.props),N()))}static get observedAttributes(){return["id","style","debug"]}get id(){return this.$$.ctx[11]}set id(e){this.$$set({id:e}),N()}get style(){return this.$$.ctx[12]}set style(e){this.$$set({style:e}),N()}get debug(){return this.$$.ctx[0]}set debug(e){this.$$set({debug:e}),N()}}return customElements.define("hb-form-composer",se),se}();
|
|
1
|
+
var release=function(){"use strict";function e(){}function t(e){return e()}function o(){return Object.create(null)}function n(e){e.forEach(t)}function l(e){return"function"==typeof e}function a(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function i(e,t){e.appendChild(t)}function r(e,t,o){e.insertBefore(t,o||null)}function d(e){e.parentNode.removeChild(e)}function c(e){return document.createElement(e)}function s(e){return document.createTextNode(e)}function u(){return s(" ")}function p(){return s("")}function b(e,t,o,n){return e.addEventListener(t,o,n),()=>e.removeEventListener(t,o,n)}function f(e,t,o){null==o?e.removeAttribute(t):e.getAttribute(t)!==o&&e.setAttribute(t,o)}function h(e,t,o){t in e?e[t]="boolean"==typeof e[t]&&""===o||o:f(e,t,o)}function m(e,t,o,n){null===o?e.style.removeProperty(t):e.style.setProperty(t,o,n?"important":"")}function y(e){const t={};for(const o of e)t[o.name]=o.value;return t}let g;function v(e){g=e}function L(){if(!g)throw new Error("Function called outside component initialization");return g}function x(){const e=L();return(t,o,{cancelable:n=!1}={})=>{const l=e.$$.callbacks[t];if(l){const a=function(e,t,{bubbles:o=!1,cancelable:n=!1}={}){const l=document.createEvent("CustomEvent");return l.initCustomEvent(e,o,n,t),l}(t,o,{cancelable:n});return l.slice().forEach((t=>{t.call(e,a)})),!a.defaultPrevented}return!0}}const V=[],$=[],w=[],O=[],k=Promise.resolve();let E=!1;function _(e){w.push(e)}const T=new Set;let C=0;function N(){const e=g;do{for(;C<V.length;){const e=V[C];C++,v(e),S(e.$$)}for(v(null),V.length=0,C=0;$.length;)$.pop()();for(let e=0;e<w.length;e+=1){const t=w[e];T.has(t)||(T.add(t),t())}w.length=0}while(V.length);for(;O.length;)O.pop()();E=!1,T.clear(),v(e)}function S(e){if(null!==e.fragment){e.update(),n(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(_)}}const M=new Set;function q(e,t){e&&e.i&&(M.delete(e),e.i(t))}function P(e,t){e.d(1),t.delete(e.key)}function A(e,t){-1===e.$$.dirty[0]&&(V.push(e),E||(E=!0,k.then(N)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function D(a,i,r,c,s,u,p,b=[-1]){const f=g;v(a);const h=a.$$={fragment:null,ctx:null,props:u,update:e,not_equal:s,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(f?f.$$.context:[])),callbacks:o(),dirty:b,skip_bound:!1,root:i.target||f.$$.root};p&&p(h.root);let m=!1;if(h.ctx=r?r(a,i.props||{},((e,t,...o)=>{const n=o.length?o[0]:t;return h.ctx&&s(h.ctx[e],h.ctx[e]=n)&&(!h.skip_bound&&h.bound[e]&&h.bound[e](n),m&&A(a,e)),t})):[],h.update(),m=!0,n(h.before_update),h.fragment=!!c&&c(h.ctx),i.target){if(i.hydrate){const e=function(e){return Array.from(e.childNodes)}(i.target);h.fragment&&h.fragment.l(e),e.forEach(d)}else h.fragment&&h.fragment.c();i.intro&&q(a.$$.fragment),function(e,o,a,i){const{fragment:r,on_mount:d,on_destroy:c,after_update:s}=e.$$;r&&r.m(o,a),i||_((()=>{const o=d.map(t).filter(l);c?c.push(...o):n(o),e.$$.on_mount=[]})),s.forEach(_)}(a,i.target,i.anchor,i.customElement),N()}v(f)}let J;"function"==typeof HTMLElement&&(J=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(t).filter(l);for(const e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,o){this[e]=o}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){!function(e,t){const o=e.$$;null!==o.fragment&&(n(o.on_destroy),o.fragment&&o.fragment.d(t),o.on_destroy=o.fragment=null,o.ctx=[])}(this,1),this.$destroy=e}$on(e,t){const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(t),()=>{const e=o.indexOf(t);-1!==e&&o.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}});var j="0.18.15",I=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,R=/\n/g,z=/^\s*/,B=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,H=/^:\s*/,F=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,W=/^[;\s]*/,K=/^\s+|\s+$/g,G="";function Q(e){return e?e.replace(K,G):G}var U=function(e,t){var o,n=null;if(!e||"string"!=typeof e)return n;for(var l,a,i=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var o=1,n=1;function l(e){var t=e.match(R);t&&(o+=t.length);var l=e.lastIndexOf("\n");n=~l?e.length-l:n+e.length}function a(){var e={line:o,column:n};return function(t){return t.position=new i(e),c(),t}}function i(e){this.start=e,this.end={line:o,column:n},this.source=t.source}function r(l){var a=new Error(t.source+":"+o+":"+n+": "+l);if(a.reason=l,a.filename=t.source,a.line=o,a.column=n,a.source=e,!t.silent)throw a}function d(t){var o=t.exec(e);if(o){var n=o[0];return l(n),e=e.slice(n.length),o}}function c(){d(z)}function s(e){var t;for(e=e||[];t=u();)!1!==t&&e.push(t);return e}function u(){var t=a();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var o=2;G!=e.charAt(o)&&("*"!=e.charAt(o)||"/"!=e.charAt(o+1));)++o;if(o+=2,G===e.charAt(o-1))return r("End of comment missing");var i=e.slice(2,o-2);return n+=2,l(i),e=e.slice(o),n+=2,t({type:"comment",comment:i})}}function p(){var e=a(),t=d(B);if(t){if(u(),!d(H))return r("property missing ':'");var o=d(F),n=e({type:"declaration",property:Q(t[0].replace(I,G)),value:o?Q(o[0].replace(I,G)):G});return d(W),n}}return i.prototype.content=e,c(),function(){var e,t=[];for(s(t);e=p();)!1!==e&&(t.push(e),s(t));return t}()}(e),r="function"==typeof t,d=0,c=i.length;d<c;d++)l=(o=i[d]).property,a=o.value,r?t(l,a,o):a&&(n||(n={}),n[l]=a);return n};var X,Y=(function(e,t){t.__esModule=!0,t.LanguageTranslator=t.addComponent=t.getChildStyleToPass=void 0,t.getChildStyleToPass=function(e,t){var o,n,l="";if(e&&(null==t?void 0:t.length)&&(null===(o=Object.keys(e))||void 0===o?void 0:o.length)&&(null===(n=null==t?void 0:t.filter((function(t){return Object.keys(e).includes(t.name)})))||void 0===n?void 0:n.length))for(var a=function(o){(null==t?void 0:t.filter((function(t){return t.name===o&&t.defaultValue!==e[o]})))&&(l+="".concat(o,":").concat(e[o],";"))},i=0,r=Object.keys(e);i<r.length;i++)a(r[i]);return l},t.addComponent=function(e){var t,o=(null===(t=null==e?void 0:e.repoName.split("/"))||void 0===t?void 0:t[1])||(null==e?void 0:e.repoName);if(!o)throw new Error("wrong componentPath "+(null==e?void 0:e.repoName));if(!(null==e?void 0:e.version))throw new Error("wrong version "+(null==e?void 0:e.version));var n=(null==e?void 0:e.iifePath)||"release/release.js";if(!document.getElementById(o+"-script"))try{var l=document.createElement("script");l.id=o+"-script",l.src="https://cdn.jsdelivr.net/npm/".concat(e.repoName,"@").concat(e.version,"/").concat(n),(null==e?void 0:e.local)&&location.href.includes("localhost")&&(l.src="".concat(e.local)),document.head.appendChild(l)}catch(e){console.warn(e)}};var o=function(){function e(e){if(!(null==e?void 0:e.dictionary))throw new Error("no dictionary provided");this.dictionary=e.dictionary,this.setLang(null==e?void 0:e.lang)}return e.prototype.setLang=function(t){t||(t=e.getDefaultLang()),this.lang=t},e.prototype.translateWord=function(t,o){return e.getDictionaryWord(t,this.dictionary,o||this.lang)},e.prototype.translateDate=function(t,o,n){return e.formatDate(t,o,n||this.lang)},e.getDefaultLang=function(){var e,t,o,n,l,a="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(o=null===(t=null===(e=navigator.languages[0])||void 0===e?void 0:e.split("-")[0])||void 0===t?void 0:t.toLowerCase())||void 0===o?void 0:o.length)&&(a=null===(l=null===(n=navigator.languages[0])||void 0===n?void 0:n.split("-")[0])||void 0===l?void 0:l.toLowerCase()),a},e.getDictionaryWord=function(t,o,n){var l;if(!t)throw new Error("no wordKey provided");if(!o)throw new Error("no dictionary provided");if(n&&(null===(l=o[n])||void 0===l?void 0:l[t]))return o[n][t];var a="",i=e.getDefaultLang();if(!n||i!==n){var r=null==o?void 0:o[i];(null==r?void 0:r[t])&&(a=r[t])}return a},e.formatDate=function(t,o,n){if(!t)throw new Error("no date provided");if("function"!=typeof t.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(n||e.getDefaultLang(),o).format(t)},e}();t.LanguageTranslator=o}(X={exports:{}},X.exports),X.exports),Z={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"}],parts:[{name:"invalid-feedback",description:""},{name:"main_button",description:""},{name:"button_container",description:""}]},ee={vars:[{name:"--bs-primary",valueType:"color",theme:"bootstrap",defaultValue:"#07689f"},{name:"--bs-secondary",valueType:"color",theme:"bootstrap",defaultValue:"#c9d6df"},{name:"--bs-success",valueType:"color",theme:"bootstrap",defaultValue:"#11d3bc"},{name:"--bs-info",valueType:"color",theme:"bootstrap",defaultValue:"#a2d5f2"},{name:"--bs-warning",valueType:"color",theme:"bootstrap",defaultValue:"#ffc107"},{name:"--bs-danger",valueType:"color",theme:"bootstrap",defaultValue:"#f67280"}],parts:[]};function te(e,t,o){const n=e.slice();return n[22]=t[o],n}function oe(e){let t;return{c(){t=s("empty")},m(e,o){r(e,t,o)},d(e){e&&d(t)}}}function ne(e){let t,o,l,a,s,p,m,y,g;return{c(){t=c("hb-form"),o=c("span"),o.innerHTML='<button type="button" class="btn btn-info">add Property</button>',l=u(),a=c("span"),s=c("button"),s.textContent="done",f(o,"slot","submit_button"),f(s,"type","button"),f(s,"class","btn btn-primary"),f(a,"slot","other_buttons"),h(t,"class","mainform"),h(t,"style",e[3]),h(t,"id",p="schema"+e[22].counter),h(t,"schema",m=e[22].schema)},m(n,d){r(n,t,d),i(t,o),i(t,l),i(t,a),i(a,s),y||(g=[b(s,"click",e[15]),b(t,"submit",e[16])],y=!0)},p(e,o){8&o&&h(t,"style",e[3]),4&o&&p!==(p="schema"+e[22].counter)&&h(t,"id",p),4&o&&m!==(m=e[22].schema)&&h(t,"schema",m)},d(e){e&&d(t),y=!1,n(g)}}}function le(e,t){let o,n,l=t[22].counter===t[2].length-1&&ne(t);return{key:e,first:null,c(){o=p(),l&&l.c(),n=p(),this.first=o},m(e,t){r(e,o,t),l&&l.m(e,t),r(e,n,t)},p(e,o){(t=e)[22].counter===t[2].length-1?l?l.p(t,o):(l=ne(t),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(e){e&&d(o),l&&l.d(e),e&&d(n)}}}function ae(e){let t,o,n;function l(e,t){return e[1]?.length?re:ie}let a=l(e),i=a(e);return{c(){t=c("h2"),t.textContent="output",o=u(),i.c(),n=p(),m(t,"margin","60px"),m(t,"text-align","center"),m(t,"color","blue")},m(e,l){r(e,t,l),r(e,o,l),i.m(e,l),r(e,n,l)},p(e,t){a===(a=l(e))&&i?i.p(e,t):(i.d(1),i=a(e),i&&(i.c(),i.m(n.parentNode,n)))},d(e){e&&d(t),e&&d(o),i.d(e),e&&d(n)}}}function ie(t){let o;return{c(){o=s("...no output")},m(e,t){r(e,o,t)},p:e,d(e){e&&d(o)}}}function re(e){let t,o;return{c(){t=c("hb-form"),h(t,"hide_submit","yes"),h(t,"schema",o=JSON.stringify(e[1])),h(t,"style",e[3])},m(e,o){r(e,t,o)},p(e,n){2&n&&o!==(o=JSON.stringify(e[1]))&&h(t,"schema",o),8&n&&h(t,"style",e[3])},d(e){e&&d(t)}}}function de(t){let o,n,l,a,i,f,m,y,g,v,L,x,V,$=[],w=new Map,O=!t[1]?.length&&oe(),k=t[2];const E=e=>e[22].counter;for(let e=0;e<k.length;e+=1){let o=te(t,k,e),n=E(o);w.set(n,$[e]=le(n,o))}let _=t[0]&&ae(t);return{c(){o=s("TO BE DONE\n"),n=c("br"),l=u(),a=c("br"),i=u(),f=c("hb-table"),y=u(),O&&O.c(),g=u();for(let e=0;e<$.length;e+=1)$[e].c();v=u(),_&&_.c(),L=p(),this.c=e,h(f,"id","table_specs"),h(f,"style",t[4]),h(f,"disablepagination","yes"),h(f,"actions",JSON.stringify(t[6])),h(f,"headers",JSON.stringify(t[7])),h(f,"rows",m=JSON.stringify(t[5]))},m(e,d){r(e,o,d),r(e,n,d),r(e,l,d),r(e,a,d),r(e,i,d),r(e,f,d),r(e,y,d),O&&O.m(e,d),r(e,g,d);for(let t=0;t<$.length;t+=1)$[t].m(e,d);r(e,v,d),_&&_.m(e,d),r(e,L,d),x||(V=b(f,"tableaction",t[14]),x=!0)},p(e,[t]){16&t&&h(f,"style",e[4]),32&t&&m!==(m=JSON.stringify(e[5]))&&h(f,"rows",m),e[1]?.length?O&&(O.d(1),O=null):O||(O=oe(),O.c(),O.m(g.parentNode,g)),1292&t&&(k=e[2],$=function(e,t,o,n,l,a,i,r,d,c,s,u){let p=e.length,b=a.length,f=p;const h={};for(;f--;)h[e[f].key]=f;const m=[],y=new Map,g=new Map;for(f=b;f--;){const e=u(l,a,f),r=o(e);let d=i.get(r);d?n&&d.p(e,t):(d=c(r,e),d.c()),y.set(r,m[f]=d),r in h&&g.set(r,Math.abs(f-h[r]))}const v=new Set,L=new Set;function x(e){q(e,1),e.m(r,s),i.set(e.key,e),s=e.first,b--}for(;p&&b;){const t=m[b-1],o=e[p-1],n=t.key,l=o.key;t===o?(s=t.first,p--,b--):y.has(l)?!i.has(n)||v.has(n)?x(t):L.has(l)?p--:g.get(n)>g.get(l)?(L.add(n),x(t)):(v.add(l),p--):(d(o,i),p--)}for(;p--;){const t=e[p];y.has(t.key)||d(t,i)}for(;b;)x(m[b-1]);return m}($,t,E,1,e,k,w,v.parentNode,P,le,v,te)),e[0]?_?_.p(e,t):(_=ae(e),_.c(),_.m(L.parentNode,L)):_&&(_.d(1),_=null)},i:e,o:e,d(e){e&&d(o),e&&d(n),e&&d(l),e&&d(a),e&&d(i),e&&d(f),e&&d(y),O&&O.d(e),e&&d(g);for(let t=0;t<$.length;t+=1)$[t].d(e);e&&d(v),_&&_.d(e),e&&d(L),x=!1,V()}}}function ce(e,t,o){const n=L(),l=x();let{id:a}=t,{style:i}=t,{debug:r}=t,d=[];const c=[{id:"first-row",type:"row",params:{columns:[{type:"checkbox",placeholder:"Required...",id:"required",label:"Is Required?"},{type:"text",placeholder:"Label...",id:"label",required:!0,label:"Property Label",validationTip:"This field cannot be empty."},{type:"select",placeholder:"Select something here...",id:"type",required:!0,label:"Selection of something",validationTip:"This field cannot be empty.",params:{options:[{label:"",value:""},{label:"text",value:"text"},{label:"textarea",value:"textarea"},{label:"email",value:"email"},{label:"number",value:"number"},{label:"select",value:"select"},{label:"radio",value:"radio"},{label:"checkbox",value:"checkbox"},{label:"file",value:"file"},{label:"date",value:"date"},{label:"datetime",value:"datetime"},{label:"color",value:"color"}]}}]}},{id:"dep-row",type:"row",params:{columns:[{type:"checkbox",placeholder:"Conditional...",id:"conditional",label:"Is Conditional?"},{type:"text",placeholder:"Conditional property...",id:"depName",label:"Conditional property",dependencies:[{id:"conditional"}]},{type:"text",placeholder:"Conditional values (separated by comma)...",id:"depValues",label:"Conditional values",dependencies:[{id:"conditional"}]}]}},{id:"length-row",type:"row",params:{columns:[{type:"number",placeholder:"Min Length...",id:"minLength",label:"Min Length",dependencies:[{id:"type",values:["text","textarea"]}]},{type:"number",placeholder:"Max Length...",id:"maxLength",label:"Max Length",dependencies:[{id:"type",values:["text","textarea"]}]}]}},{id:"size-row",type:"row",params:{columns:[{type:"number",placeholder:"Min...",id:"min",label:"Min",dependencies:[{id:"type",values:["number"]}]},{type:"number",placeholder:"Max...",id:"max",label:"Max",dependencies:[{id:"type",values:["number"]}]}]}},{type:"text",placeholder:"Option Label...",id:"optionLabel1",label:"Option Label",dependencies:[{id:"type",values:["select","radio"]}]},{type:"text",placeholder:"Option Value",id:"optionValue1",label:"Option Value",dependencies:[{id:"type",values:["select","radio"]}]},{type:"text",placeholder:"Option Label...",id:"optionLabel2",label:"Option Label",dependencies:[{id:"optionLabel1"},{id:"optionValue1"}]},{type:"text",placeholder:"Option Value",id:"optionValue2",label:"Option Value",dependencies:[{id:"optionLabel1"},{id:"optionValue1"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel3",label:"Option Label",dependencies:[{id:"optionLabel2"},{id:"optionValue2"}]},{type:"text",placeholder:"Option Value",id:"optionValue3",label:"Option Value",dependencies:[{id:"optionLabel2"},{id:"optionValue2"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel4",label:"Option Label",dependencies:[{id:"optionLabel3"},{id:"optionValue3"}]},{type:"text",placeholder:"Option Value",id:"optionValue4",label:"Option Value",dependencies:[{id:"optionLabel3"},{id:"optionValue3"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel5",label:"Option Label",dependencies:[{id:"optionLabel4"},{id:"optionValue4"}]},{type:"text",placeholder:"Option Value",id:"optionValue5",label:"Option Value",dependencies:[{id:"optionLabel4"},{id:"optionValue4"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel6",label:"Option Label",dependencies:[{id:"optionLabel5"},{id:"optionValue5"}]},{type:"text",placeholder:"Option Value",id:"optionValue6",label:"Option Value",dependencies:[{id:"optionLabel5"},{id:"optionValue5"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel7",label:"Option Label",dependencies:[{id:"optionLabel6"},{id:"optionValue6"}]},{type:"text",placeholder:"Option Value",id:"optionValue7",label:"Option Value",dependencies:[{id:"optionLabel6"},{id:"optionValue6"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel8",label:"Option Label",dependencies:[{id:"optionLabel7"},{id:"optionValue7"}]},{type:"text",placeholder:"Option Value",id:"optionValue8",label:"Option Value",dependencies:[{id:"optionLabel7"},{id:"optionValue7"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel9",label:"Option Label",dependencies:[{id:"optionLabel8"},{id:"optionValue8"}]},{type:"text",placeholder:"Option Value",id:"optionValue9",label:"Option Value",dependencies:[{id:"optionLabel8"},{id:"optionValue8"}]},{type:"text",placeholder:"Option Label...",id:"optionLabel10",label:"Option Label",dependencies:[{id:"optionLabel9"},{id:"optionValue9"}]},{type:"text",placeholder:"Option Value",id:"optionValue10",label:"Option Value",dependencies:[{id:"optionLabel9"},{id:"optionValue9"}]}];let s,u,p,b="",f="";let h;function m(e){let t;console.log("addSchema",e);let n={};e.depName&&(t={id:e.depName},e.depValues&&(t.values=e.depValues.replace(", ",",").replace(" ,",",").split(",")));const l=t?[t]:void 0;if("text"!==e.type&&"textarea"!==e.type||(e.minLength&&(n.minLength=e.minLength),e.maxLength&&(n.maxLength=e.maxLength)),"number"===e.type&&(e.min&&(n.min=e.min),e.max&&(n.max=e.max)),"select"===e.type||"radio"===e.type){const t=[];e.optionLabel1&&t.push({label:e.optionLabel1,value:e.optionValue1}),e.optionLabel2&&t.push({label:e.optionLabel2,value:e.optionValue2}),e.optionLabel3&&t.push({label:e.optionLabel3,value:e.optionValue3}),e.optionLabel4&&t.push({label:e.optionLabel4,value:e.optionValue4}),e.optionLabel5&&t.push({label:e.optionLabel5,value:e.optionValue5}),e.optionLabel6&&t.push({label:e.optionLabel6,value:e.optionValue6}),e.optionLabel7&&t.push({label:e.optionLabel7,value:e.optionValue7}),e.optionLabel8&&t.push({label:e.optionLabel8,value:e.optionValue8}),e.optionLabel9&&t.push({label:e.optionLabel9,value:e.optionValue9}),e.optionLabel10&&t.push({label:e.optionLabel10,value:e.optionValue10}),n.options=t}const a={id:e.label,type:e.type,label:e.label,required:e.required,placeholder:e.placeholder,dependencies:l,params:n};d.find((t=>t.label===e.label))?o(1,d=d.map((t=>t.label===e.label?a:t))):o(1,d=[...d,a]),o(2,s=[...s,{counter:s.length,schema:JSON.stringify(c)}]),console.info("schema4selectorS",s)}function y(e){console.log(e,d),o(1,d=d.filter((t=>t.label!==e))),o(2,s=s.filter((e=>e.counter!==s.length-1)))}function g(){!function(e,t){l(e,t),n.dispatchEvent&&n.dispatchEvent(new CustomEvent(e,{detail:t}))}("done",{schema:d,id:a})}!function(e){L().$$.on_mount.push(e)}((()=>{Y.addComponent({repoName:"@htmlbricks/hb-form",version:j}),Y.addComponent({repoName:"@htmlbricks/hb-table",version:j}),p=n.shadowRoot.getElementById("schema"),console.log("formComponent",p)}));return e.$$set=e=>{"id"in e&&o(11,a=e.id),"style"in e&&o(12,i=e.style),"debug"in e&&o(0,r=e.debug)},e.$$.update=()=>{if(14343&e.$$.dirty){a||o(11,a=""),i&&(o(13,u=U(i)),o(3,b=Y.getChildStyleToPass(u,null==Z?void 0:Z.vars)),o(4,f=Y.getChildStyleToPass(u,null==ee?void 0:ee.vars))),"string"!=typeof r||"true"!==r&&"yes"!==r&&""!==r?!0!==r&&o(0,r=!1):o(0,r=!0),s||o(2,s=[{counter:0,schema:JSON.stringify(c)}]);const e=[];for(const t of d){let o,n;t.params&&(n=JSON.stringify(t.params)),t.dependencies&&(o=JSON.stringify(t.dependencies)),e.push({_id:t.label,label:t.label,type:t.type,params:n,required:t.required,dependencies:o})}o(5,h=e)}},[r,d,s,b,f,h,[{name:"delete",type:"icon",iconOrText:"x-octagon-fill"}],[{label:"Label",key:"label"},{label:"type",key:"type"},{label:"params",key:"params",nosort:!0},{label:"dependencies",key:"dependencies"},{label:"required",key:"required"}],m,y,g,a,i,u,e=>{y(e.detail.itemId)},()=>g(),e=>{m(e.detail)}]}class se extends J{constructor(e){super(),this.shadowRoot.innerHTML='<style>@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host{font-family:"Roboto", sans-serif}.mainform{margin-top:40px;display:block}.btn{display:inline-block;font-weight:400;line-height:1.5;color:#212529;text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;user-select:none;background-color:transparent;border:1px solid transparent;padding:0.375rem 0.75rem;font-size:1rem;border-radius:0.25rem;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out}@media(prefers-reduced-motion: reduce){.btn{transition:none}}.btn:hover{color:#212529}.btn:focus{outline:0;box-shadow:0 0 0 0.25rem rgba(13, 110, 253, 0.25)}.btn:disabled{pointer-events:none;opacity:0.65}.btn-primary{color:#fff;background-color:var(--bs-primary,#07689f);border-color:var(--bs-primary,#07689f)}.btn-primary:hover{color:#fff;background-color:#0b5ed7;border-color:#0a58ca}.btn-primary:focus{color:#fff;background-color:#0b5ed7;border-color:#0a58ca;box-shadow:0 0 0 0.25rem rgba(49, 132, 253, 0.5)}.btn-primary:active{color:#fff;background-color:#0a58ca;border-color:#0a53be}.btn-primary:active:focus{box-shadow:0 0 0 0.25rem rgba(49, 132, 253, 0.5)}.btn-primary:disabled{color:#fff;background-color:var(--bs-primary,#07689f);border-color:var(--bs-primary,#07689f)}.btn-info{color:#000;background-color:var(--bs-info,#a2d5f2);border-color:var(--bs-info,#a2d5f2)}.btn-info:hover{color:#000;background-color:#31d2f2;border-color:#25cff2}.btn-info:focus{color:#000;background-color:#31d2f2;border-color:#25cff2;box-shadow:0 0 0 0.25rem rgba(11, 172, 204, 0.5)}.btn-info:active{color:#000;background-color:#3dd5f3;border-color:#25cff2}.btn-info:active:focus{box-shadow:0 0 0 0.25rem rgba(11, 172, 204, 0.5)}.btn-info:disabled{color:#000;background-color:var(--bs-info,#a2d5f2);border-color:var(--bs-info,#a2d5f2)}</style>',D(this,{target:this.shadowRoot,props:y(this.attributes),customElement:!0},ce,de,a,{id:11,style:12,debug:0},null),e&&(e.target&&r(e.target,this,e.anchor),e.props&&(this.$set(e.props),N()))}static get observedAttributes(){return["id","style","debug"]}get id(){return this.$$.ctx[11]}set id(e){this.$$set({id:e}),N()}get style(){return this.$$.ctx[12]}set style(e){this.$$set({style:e}),N()}get debug(){return this.$$.ctx[0]}set debug(e){this.$$set({debug:e}),N()}}return customElements.define("hb-form-composer",se),se}();
|
|
2
2
|
//# sourceMappingURL=release.js.map
|