@htmlbricks/hb-form-composer 0.19.14 → 0.19.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.19.
|
|
5
|
+
"version": "0.19.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": "7f2261e3331a19985acf04db7113cd586069e070",
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@htmlbricks/hb-form": "^0.19.
|
|
81
|
-
"@htmlbricks/hb-table": "^0.19.
|
|
80
|
+
"@htmlbricks/hb-form": "^0.19.15",
|
|
81
|
+
"@htmlbricks/hb-table": "^0.19.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 r(e,t){e.appendChild(t)}function i(e,t,o){e.insertBefore(t,o||null)}function s(e){e.parentNode&&e.parentNode.removeChild(e)}function c(e){return document.createElement(e)}function p(e){return document.createTextNode(e)}function d(){return p(" ")}function u(){return p("")}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 m(e,t,o){t in e?e[t]="boolean"==typeof e[t]&&""===o||o:f(e,t,o)}function h(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 $=[],w=[],V=[],O=[],k=Promise.resolve();let C=!1;function E(e){V.push(e)}const _=new Set;let T=0;function N(){if(0!==T)return;const e=g;do{try{for(;T<$.length;){const e=$[T];T++,v(e),S(e.$$)}}catch(e){throw $.length=0,T=0,e}for(v(null),$.length=0,T=0;w.length;)w.pop()();for(let e=0;e<V.length;e+=1){const t=V[e];_.has(t)||(_.add(t),t())}V.length=0}while($.length);for(;O.length;)O.pop()();C=!1,_.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(E)}}const j=new Set;function M(e,t){e&&e.i&&(j.delete(e),e.i(t))}function D(e,t){e.d(1),t.delete(e.key)}function P(e,t){-1===e.$$.dirty[0]&&($.push(e),C||(C=!0,k.then(N)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function q(a,r,i,c,p,d,u,b=[-1]){const f=g;v(a);const m=a.$$={fragment:null,ctx:[],props:d,update:e,not_equal:p,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(r.context||(f?f.$$.context:[])),callbacks:o(),dirty:b,skip_bound:!1,root:r.target||f.$$.root};u&&u(m.root);let h=!1;if(m.ctx=i?i(a,r.props||{},((e,t,...o)=>{const n=o.length?o[0]:t;return m.ctx&&p(m.ctx[e],m.ctx[e]=n)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](n),h&&P(a,e)),t})):[],m.update(),h=!0,n(m.before_update),m.fragment=!!c&&c(m.ctx),r.target){if(r.hydrate){const e=function(e){return Array.from(e.childNodes)}(r.target);m.fragment&&m.fragment.l(e),e.forEach(s)}else m.fragment&&m.fragment.c();r.intro&&M(a.$$.fragment),function(e,o,a,r){const{fragment:i,after_update:s}=e.$$;i&&i.m(o,a),r||E((()=>{const o=e.$$.on_mount.map(t).filter(l);e.$$.on_destroy?e.$$.on_destroy.push(...o):n(o),e.$$.on_mount=[]})),s.forEach(E)}(a,r.target,r.anchor,r.customElement),N()}v(f)}let A;"function"==typeof HTMLElement&&(A=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(t,o){if(!l(o))return e;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(o),()=>{const e=n.indexOf(o);-1!==e&&n.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 I={name:"@htmlbricks/hb-form-composer",displayName:"Svelte-Bootstrap form-composer",description:"Svelte-Bootstrap form-composer",version:"0.19.12",main:"release/release.js",publishConfig:{access:"public"},author:"Dario Caruso <dev@dariocaruso.info> (https://dariocaruso.info)",authorUrl:"https://dariocaruso.info",license:"MIT","license-docs":"CC BY 4.0","license-translations":"CC BY 4.0","license-images":"CC BY-NC 4.0",engines:{node:">=16.0.0"},scripts:{start:"sirv dist",dev:"rm -rf ./dist && rollup -c -w",build:"rm -rf ./dist && rollup -c","generate-manifest":"npm run generate-schemes && monorepo-wc-packages-manifester --dir $PWD","generate-component-schema":"ts-json-schema-generator --type 'Component' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent.type.d.json","generate-events-schema":"ts-json-schema-generator --type 'Events' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent_events.type.d.json","generate-schemes":"npm run generate-events-schema && npm run generate-component-schema",copydest:"rm -rf release && mkdir -p release && mkdir -p release && cp dist/* ./release/","build-extra":"tsc --moduleResolution node --module es2020 --esModuleInterop true --outDir dist --sourceMap --skipLibCheck extra/*","build:release":"PRODUCTION=true npm run build && npm run build-extra && npm run generate-manifest && npm run copydest",prepublish:"npm run build:release"},devDependencies:{"@rollup/plugin-alias":"^3.1.2","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^4.0.0","@rollup/plugin-typescript":"^8.2.1","@tsconfig/svelte":"^1.0.10","@types/node":"^16.7.1","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0",eslint:"^7.25.0","eslint-plugin-jsdoc":"^33.0.0","eslint-plugin-svelte3":"^3.2.0","monorepo-wc-packages-manifester":"^0.0.3","node-sass":"^6.0.1",postcss:"^8.2.13","postcss-load-config":"^3.0.1",prettier:"^2.8.4",rollup:"^2.46.0","rollup-plugin-copy":"^3.4.0","rollup-plugin-css-only":"^3.1.0","rollup-plugin-livereload":"^2.0.0","rollup-plugin-svelte":"^7.1.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-ts-paths":"^1.0.5","rollup-plugin-typescript2":"^0.31.1",sass:"^1.32.12","sirv-cli":"^1.0.11",svelte:"^3.46.2","svelte-check":"^1.5.2","svelte-preprocess":"^4.7.2","ts-json-schema-generator":"^0.98.0","ts-node":"^9.1.1",tslib:"^2.2.0",ttypescript:"^1.5.12",typescript:"^4.2.4","typescript-transform-paths":"^2.2.3","wc-js-utils":"^0.0.1"},keywords:["svelte","svelte-webcomponents","webcomponents"],contributors:[],gitHead:"6c500c692eb2381e7833259ca87779a15bd58c5e",dependencies:{"@htmlbricks/hb-form":"^0.19.12","@htmlbricks/hb-table":"^0.19.12","style-to-object":"^0.3.0"}},J=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,B=/\n/g,R=/^\s*/,H=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,z=/^:\s*/,W=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,F=/^[;\s]*/,Y=/^\s+|\s+$/g,U="\n",K="/",G="*",Q="",X="comment",Z="declaration",ee=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(B);t&&(o+=t.length);var l=e.lastIndexOf(U);n=~l?e.length-l:n+e.length}function a(){var e={line:o,column:n};return function(t){return t.position=new r(e),c(),t}}function r(e){this.start=e,this.end={line:o,column:n},this.source=t.source}function i(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 s(t){var o=t.exec(e);if(o){var n=o[0];return l(n),e=e.slice(n.length),o}}function c(){s(R)}function p(e){var t;for(e=e||[];t=d();)!1!==t&&e.push(t);return e}function d(){var t=a();if(K==e.charAt(0)&&G==e.charAt(1)){for(var o=2;Q!=e.charAt(o)&&(G!=e.charAt(o)||K!=e.charAt(o+1));)++o;if(o+=2,Q===e.charAt(o-1))return i("End of comment missing");var r=e.slice(2,o-2);return n+=2,l(r),e=e.slice(o),n+=2,t({type:X,comment:r})}}function u(){var e=a(),t=s(H);if(t){if(d(),!s(z))return i("property missing ':'");var o=s(W),n=e({type:Z,property:te(t[0].replace(J,Q)),value:o?te(o[0].replace(J,Q)):Q});return s(F),n}}return r.prototype.content=e,c(),function(){var e,t=[];for(p(t);e=u();)!1!==e&&(t.push(e),p(t));return t}()};function te(e){return e?e.replace(Y,Q):Q}var oe=function(e,t){var o,n=null;if(!e||"string"!=typeof e)return n;for(var l,a,r=ee(e),i="function"==typeof t,s=0,c=r.length;s<c;s++)l=(o=r[s]).property,a=o.value,i?t(l,a,o):a&&(n||(n={}),n[l]=a);return n};var ne,le=(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],";"))},r=0,i=Object.keys(e);r<i.length;r++)a(i[r]);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="",r=e.getDefaultLang();if(!n||r!==n){var i=null==o?void 0:o[r];(null==i?void 0:i[t])&&(a=i[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}(ne={exports:{}},ne.exports),ne.exports),ae={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:""}]},re={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 ie(e,t,o){const n=e.slice();return n[22]=t[o],n}function se(e){let t;return{c(){t=p("empty")},m(e,o){i(e,t,o)},d(e){e&&s(t)}}}function ce(e){let t,o,l,a,u,h,y,g,v,L,x;return{c(){t=c("hb-form"),o=c("span"),o.innerHTML='<button type="button" class="btn btn-info">add Property</button>',l=d(),a=c("span"),u=c("button"),h=p("done"),f(o,"slot","submit_button"),u.disabled=y=e[2].length<2,f(u,"type","button"),f(u,"class","btn btn-primary"),f(a,"slot","other_buttons"),m(t,"class","mainform"),m(t,"style",e[3]),m(t,"id",g="schema"+e[22].counter),m(t,"schema",v=e[22].schema)},m(n,s){i(n,t,s),r(t,o),r(t,l),r(t,a),r(a,u),r(u,h),L||(x=[b(u,"click",e[15]),b(t,"submit",e[16])],L=!0)},p(e,o){4&o&&y!==(y=e[2].length<2)&&(u.disabled=y),8&o&&m(t,"style",e[3]),4&o&&g!==(g="schema"+e[22].counter)&&m(t,"id",g),4&o&&v!==(v=e[22].schema)&&m(t,"schema",v)},d(e){e&&s(t),L=!1,n(x)}}}function pe(e,t){let o,n,l=t[22].counter===t[2].length-1&&ce(t);return{key:e,first:null,c(){o=u(),l&&l.c(),n=u(),this.first=o},m(e,t){i(e,o,t),l&&l.m(e,t),i(e,n,t)},p(e,o){(t=e)[22].counter===t[2].length-1?l?l.p(t,o):(l=ce(t),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(e){e&&s(o),l&&l.d(e),e&&s(n)}}}function de(e){let t,o,n;function l(e,t){return e[1]?.length?be:ue}let a=l(e),r=a(e);return{c(){t=c("h2"),t.textContent="output",o=d(),r.c(),n=u(),h(t,"margin","60px"),h(t,"text-align","center"),h(t,"color","blue")},m(e,l){i(e,t,l),i(e,o,l),r.m(e,l),i(e,n,l)},p(e,t){a===(a=l(e))&&r?r.p(e,t):(r.d(1),r=a(e),r&&(r.c(),r.m(n.parentNode,n)))},d(e){e&&s(t),e&&s(o),r.d(e),e&&s(n)}}}function ue(t){let o;return{c(){o=p("...no output")},m(e,t){i(e,o,t)},p:e,d(e){e&&s(o)}}}function be(e){let t,o;return{c(){t=c("hb-form"),m(t,"hide_submit","yes"),m(t,"schema",o=JSON.stringify(e[1])),m(t,"style",e[3])},m(e,o){i(e,t,o)},p(e,n){2&n&&o!==(o=JSON.stringify(e[1]))&&m(t,"schema",o),8&n&&m(t,"style",e[3])},d(e){e&&s(t)}}}function fe(t){let o,n,l,a,r,f,h,y,g,v,L,x,$,w=[],V=new Map,O=!t[1]?.length&&se(),k=t[2];const C=e=>e[22].counter;for(let e=0;e<k.length;e+=1){let o=ie(t,k,e),n=C(o);V.set(n,w[e]=pe(n,o))}let E=t[0]&&de(t);return{c(){o=p("TO BE DONE\n"),n=c("br"),l=d(),a=c("br"),r=d(),f=c("hb-table"),y=d(),O&&O.c(),g=d();for(let e=0;e<w.length;e+=1)w[e].c();v=d(),E&&E.c(),L=u(),this.c=e,m(f,"id","table_specs"),m(f,"style",t[4]),m(f,"disablepagination","yes"),m(f,"actions",JSON.stringify(t[6])),m(f,"headers",JSON.stringify(t[7])),m(f,"rows",h=JSON.stringify(t[5]))},m(e,s){i(e,o,s),i(e,n,s),i(e,l,s),i(e,a,s),i(e,r,s),i(e,f,s),i(e,y,s),O&&O.m(e,s),i(e,g,s);for(let t=0;t<w.length;t+=1)w[t].m(e,s);i(e,v,s),E&&E.m(e,s),i(e,L,s),x||($=b(f,"tableaction",t[14]),x=!0)},p(e,[t]){16&t&&m(f,"style",e[4]),32&t&&h!==(h=JSON.stringify(e[5]))&&m(f,"rows",h),e[1]?.length?O&&(O.d(1),O=null):O||(O=se(),O.c(),O.m(g.parentNode,g)),1292&t&&(k=e[2],w=function(e,t,o,n,l,a,r,i,s,c,p,d){let u=e.length,b=a.length,f=u;const m={};for(;f--;)m[e[f].key]=f;const h=[],y=new Map,g=new Map;for(f=b;f--;){const e=d(l,a,f),i=o(e);let s=r.get(i);s?n&&s.p(e,t):(s=c(i,e),s.c()),y.set(i,h[f]=s),i in m&&g.set(i,Math.abs(f-m[i]))}const v=new Set,L=new Set;function x(e){M(e,1),e.m(i,p),r.set(e.key,e),p=e.first,b--}for(;u&&b;){const t=h[b-1],o=e[u-1],n=t.key,l=o.key;t===o?(p=t.first,u--,b--):y.has(l)?!r.has(n)||v.has(n)?x(t):L.has(l)?u--:g.get(n)>g.get(l)?(L.add(n),x(t)):(v.add(l),u--):(s(o,r),u--)}for(;u--;){const t=e[u];y.has(t.key)||s(t,r)}for(;b;)x(h[b-1]);return h}(w,t,C,1,e,k,V,v.parentNode,D,pe,v,ie)),e[0]?E?E.p(e,t):(E=de(e),E.c(),E.m(L.parentNode,L)):E&&(E.d(1),E=null)},i:e,o:e,d(e){e&&s(o),e&&s(n),e&&s(l),e&&s(a),e&&s(r),e&&s(f),e&&s(y),O&&O.d(e),e&&s(g);for(let t=0;t<w.length;t+=1)w[t].d(e);e&&s(v),E&&E.d(e),e&&s(L),x=!1,$()}}}function me(e,t,o){const n=L(),l=x();let{id:a}=t,{style:r}=t,{debug:i}=t,s=[];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"},{label:"range",value:"range"}]}}]}},{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:"size-row",type:"row",params:{columns:[{type:"number",placeholder:"Min...",id:"min",label:"Min",dependencies:[{id:"type",values:["number","date","datetime","text","textarea","range"]}]},{type:"number",placeholder:"Max...",id:"max",label:"Max",dependencies:[{id:"type",values:["number","date","datetime","text","textarea","range"]}]}]}},{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 p,d,u,b="",f="";let m;function h(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&&"number"!==e.type&&"datetime"!==e.type&&"date"!==e.type&&"range"!==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};s.find((t=>t.label===e.label))?o(1,s=s.map((t=>t.label===e.label?a:t))):o(1,s=[...s,a]),o(2,p=[...p,{counter:p.length,schema:JSON.stringify(c)}]),console.info("schema4selectorS",p)}function y(e){console.log(e,s),o(1,s=s.filter((t=>t.label!==e))),o(2,p=p.filter((e=>e.counter!==p.length-1)))}function g(){!function(e,t){l(e,t),n.dispatchEvent&&n.dispatchEvent(new CustomEvent(e,{detail:t}))}("done",{schema:s,id:a})}!function(e){L().$$.on_mount.push(e)}((()=>{le.addComponent({repoName:"@htmlbricks/hb-form",version:I.version}),le.addComponent({repoName:"@htmlbricks/hb-table",version:I.version}),u=n.shadowRoot.getElementById("schema"),console.log("formComponent",u)}));return e.$$set=e=>{"id"in e&&o(11,a=e.id),"style"in e&&o(12,r=e.style),"debug"in e&&o(0,i=e.debug)},e.$$.update=()=>{if(14343&e.$$.dirty){a||o(11,a=""),r&&(o(13,d=oe(r)),o(3,b=le.getChildStyleToPass(d,null==ae?void 0:ae.vars)),o(4,f=le.getChildStyleToPass(d,null==re?void 0:re.vars))),"string"!=typeof i||"true"!==i&&"yes"!==i&&""!==i?!0!==i&&o(0,i=!1):o(0,i=!0),p||o(2,p=[{counter:0,schema:JSON.stringify(c)}]);const e=[];for(const t of s){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,m=e)}},[i,s,p,b,f,m,[{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"}],h,y,g,a,r,d,e=>{y(e.detail.itemId)},()=>g(),e=>{h(e.detail)}]}class he extends A{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>',q(this,{target:this.shadowRoot,props:y(this.attributes),customElement:!0},me,fe,a,{id:11,style:12,debug:0},null),e&&(e.target&&i(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",he),he}();
|
|
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 r(e,t){e.appendChild(t)}function i(e,t,o){e.insertBefore(t,o||null)}function s(e){e.parentNode&&e.parentNode.removeChild(e)}function c(e){return document.createElement(e)}function p(e){return document.createTextNode(e)}function d(){return p(" ")}function u(){return p("")}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 m(e,t,o){t in e?e[t]="boolean"==typeof e[t]&&""===o||o:f(e,t,o)}function h(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 $=[],w=[],V=[],O=[],k=Promise.resolve();let C=!1;function E(e){V.push(e)}const _=new Set;let T=0;function N(){if(0!==T)return;const e=g;do{try{for(;T<$.length;){const e=$[T];T++,v(e),S(e.$$)}}catch(e){throw $.length=0,T=0,e}for(v(null),$.length=0,T=0;w.length;)w.pop()();for(let e=0;e<V.length;e+=1){const t=V[e];_.has(t)||(_.add(t),t())}V.length=0}while($.length);for(;O.length;)O.pop()();C=!1,_.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(E)}}const j=new Set;function M(e,t){e&&e.i&&(j.delete(e),e.i(t))}function D(e,t){e.d(1),t.delete(e.key)}function P(e,t){-1===e.$$.dirty[0]&&($.push(e),C||(C=!0,k.then(N)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function q(a,r,i,c,p,d,u,b=[-1]){const f=g;v(a);const m=a.$$={fragment:null,ctx:[],props:d,update:e,not_equal:p,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(r.context||(f?f.$$.context:[])),callbacks:o(),dirty:b,skip_bound:!1,root:r.target||f.$$.root};u&&u(m.root);let h=!1;if(m.ctx=i?i(a,r.props||{},((e,t,...o)=>{const n=o.length?o[0]:t;return m.ctx&&p(m.ctx[e],m.ctx[e]=n)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](n),h&&P(a,e)),t})):[],m.update(),h=!0,n(m.before_update),m.fragment=!!c&&c(m.ctx),r.target){if(r.hydrate){const e=function(e){return Array.from(e.childNodes)}(r.target);m.fragment&&m.fragment.l(e),e.forEach(s)}else m.fragment&&m.fragment.c();r.intro&&M(a.$$.fragment),function(e,o,a,r){const{fragment:i,after_update:s}=e.$$;i&&i.m(o,a),r||E((()=>{const o=e.$$.on_mount.map(t).filter(l);e.$$.on_destroy?e.$$.on_destroy.push(...o):n(o),e.$$.on_mount=[]})),s.forEach(E)}(a,r.target,r.anchor,r.customElement),N()}v(f)}let A;"function"==typeof HTMLElement&&(A=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(t,o){if(!l(o))return e;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(o),()=>{const e=n.indexOf(o);-1!==e&&n.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 I={name:"@htmlbricks/hb-form-composer",displayName:"Svelte-Bootstrap form-composer",description:"Svelte-Bootstrap form-composer",version:"0.19.15",main:"release/release.js",publishConfig:{access:"public"},author:"Dario Caruso <dev@dariocaruso.info> (https://dariocaruso.info)",authorUrl:"https://dariocaruso.info",license:"MIT","license-docs":"CC BY 4.0","license-translations":"CC BY 4.0","license-images":"CC BY-NC 4.0",engines:{node:">=16.0.0"},scripts:{start:"sirv dist",dev:"rm -rf ./dist && rollup -c -w",build:"rm -rf ./dist && rollup -c","generate-manifest":"npm run generate-schemes && monorepo-wc-packages-manifester --dir $PWD","generate-component-schema":"ts-json-schema-generator --type 'Component' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent.type.d.json","generate-events-schema":"ts-json-schema-generator --type 'Events' --path 'app/types/webcomponent.type.d.ts' > dist/webcomponent_events.type.d.json","generate-schemes":"npm run generate-events-schema && npm run generate-component-schema",copydest:"rm -rf release && mkdir -p release && mkdir -p release && cp dist/* ./release/","build-extra":"tsc --moduleResolution node --module es2020 --esModuleInterop true --outDir dist --sourceMap --skipLibCheck extra/*","build:release":"PRODUCTION=true npm run build && npm run build-extra && npm run generate-manifest && npm run copydest",prepublish:"npm run build:release"},devDependencies:{"@rollup/plugin-alias":"^3.1.2","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^4.0.0","@rollup/plugin-typescript":"^8.2.1","@tsconfig/svelte":"^1.0.10","@types/node":"^16.7.1","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0",eslint:"^7.25.0","eslint-plugin-jsdoc":"^33.0.0","eslint-plugin-svelte3":"^3.2.0","monorepo-wc-packages-manifester":"^0.0.3","node-sass":"^6.0.1",postcss:"^8.2.13","postcss-load-config":"^3.0.1",prettier:"^2.8.4",rollup:"^2.46.0","rollup-plugin-copy":"^3.4.0","rollup-plugin-css-only":"^3.1.0","rollup-plugin-livereload":"^2.0.0","rollup-plugin-svelte":"^7.1.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-ts-paths":"^1.0.5","rollup-plugin-typescript2":"^0.31.1",sass:"^1.32.12","sirv-cli":"^1.0.11",svelte:"^3.46.2","svelte-check":"^1.5.2","svelte-preprocess":"^4.7.2","ts-json-schema-generator":"^0.98.0","ts-node":"^9.1.1",tslib:"^2.2.0",ttypescript:"^1.5.12",typescript:"^4.2.4","typescript-transform-paths":"^2.2.3","wc-js-utils":"^0.0.1"},keywords:["svelte","svelte-webcomponents","webcomponents"],contributors:[],gitHead:"7f2261e3331a19985acf04db7113cd586069e070",dependencies:{"@htmlbricks/hb-form":"^0.19.15","@htmlbricks/hb-table":"^0.19.15","style-to-object":"^0.3.0"}},J=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,B=/\n/g,R=/^\s*/,H=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,z=/^:\s*/,W=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,F=/^[;\s]*/,Y=/^\s+|\s+$/g,U="\n",K="/",G="*",Q="",X="comment",Z="declaration",ee=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(B);t&&(o+=t.length);var l=e.lastIndexOf(U);n=~l?e.length-l:n+e.length}function a(){var e={line:o,column:n};return function(t){return t.position=new r(e),c(),t}}function r(e){this.start=e,this.end={line:o,column:n},this.source=t.source}function i(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 s(t){var o=t.exec(e);if(o){var n=o[0];return l(n),e=e.slice(n.length),o}}function c(){s(R)}function p(e){var t;for(e=e||[];t=d();)!1!==t&&e.push(t);return e}function d(){var t=a();if(K==e.charAt(0)&&G==e.charAt(1)){for(var o=2;Q!=e.charAt(o)&&(G!=e.charAt(o)||K!=e.charAt(o+1));)++o;if(o+=2,Q===e.charAt(o-1))return i("End of comment missing");var r=e.slice(2,o-2);return n+=2,l(r),e=e.slice(o),n+=2,t({type:X,comment:r})}}function u(){var e=a(),t=s(H);if(t){if(d(),!s(z))return i("property missing ':'");var o=s(W),n=e({type:Z,property:te(t[0].replace(J,Q)),value:o?te(o[0].replace(J,Q)):Q});return s(F),n}}return r.prototype.content=e,c(),function(){var e,t=[];for(p(t);e=u();)!1!==e&&(t.push(e),p(t));return t}()};function te(e){return e?e.replace(Y,Q):Q}var oe=function(e,t){var o,n=null;if(!e||"string"!=typeof e)return n;for(var l,a,r=ee(e),i="function"==typeof t,s=0,c=r.length;s<c;s++)l=(o=r[s]).property,a=o.value,i?t(l,a,o):a&&(n||(n={}),n[l]=a);return n};var ne,le=(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],";"))},r=0,i=Object.keys(e);r<i.length;r++)a(i[r]);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="",r=e.getDefaultLang();if(!n||r!==n){var i=null==o?void 0:o[r];(null==i?void 0:i[t])&&(a=i[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}(ne={exports:{}},ne.exports),ne.exports),ae={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:""}]},re={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 ie(e,t,o){const n=e.slice();return n[22]=t[o],n}function se(e){let t;return{c(){t=p("empty")},m(e,o){i(e,t,o)},d(e){e&&s(t)}}}function ce(e){let t,o,l,a,u,h,y,g,v,L,x;return{c(){t=c("hb-form"),o=c("span"),o.innerHTML='<button type="button" class="btn btn-info">add Property</button>',l=d(),a=c("span"),u=c("button"),h=p("done"),f(o,"slot","submit_button"),u.disabled=y=e[2].length<2,f(u,"type","button"),f(u,"class","btn btn-primary"),f(a,"slot","other_buttons"),m(t,"class","mainform"),m(t,"style",e[3]),m(t,"id",g="schema"+e[22].counter),m(t,"schema",v=e[22].schema)},m(n,s){i(n,t,s),r(t,o),r(t,l),r(t,a),r(a,u),r(u,h),L||(x=[b(u,"click",e[15]),b(t,"submit",e[16])],L=!0)},p(e,o){4&o&&y!==(y=e[2].length<2)&&(u.disabled=y),8&o&&m(t,"style",e[3]),4&o&&g!==(g="schema"+e[22].counter)&&m(t,"id",g),4&o&&v!==(v=e[22].schema)&&m(t,"schema",v)},d(e){e&&s(t),L=!1,n(x)}}}function pe(e,t){let o,n,l=t[22].counter===t[2].length-1&&ce(t);return{key:e,first:null,c(){o=u(),l&&l.c(),n=u(),this.first=o},m(e,t){i(e,o,t),l&&l.m(e,t),i(e,n,t)},p(e,o){(t=e)[22].counter===t[2].length-1?l?l.p(t,o):(l=ce(t),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(e){e&&s(o),l&&l.d(e),e&&s(n)}}}function de(e){let t,o,n;function l(e,t){return e[1]?.length?be:ue}let a=l(e),r=a(e);return{c(){t=c("h2"),t.textContent="output",o=d(),r.c(),n=u(),h(t,"margin","60px"),h(t,"text-align","center"),h(t,"color","blue")},m(e,l){i(e,t,l),i(e,o,l),r.m(e,l),i(e,n,l)},p(e,t){a===(a=l(e))&&r?r.p(e,t):(r.d(1),r=a(e),r&&(r.c(),r.m(n.parentNode,n)))},d(e){e&&s(t),e&&s(o),r.d(e),e&&s(n)}}}function ue(t){let o;return{c(){o=p("...no output")},m(e,t){i(e,o,t)},p:e,d(e){e&&s(o)}}}function be(e){let t,o;return{c(){t=c("hb-form"),m(t,"hide_submit","yes"),m(t,"schema",o=JSON.stringify(e[1])),m(t,"style",e[3])},m(e,o){i(e,t,o)},p(e,n){2&n&&o!==(o=JSON.stringify(e[1]))&&m(t,"schema",o),8&n&&m(t,"style",e[3])},d(e){e&&s(t)}}}function fe(t){let o,n,l,a,r,f,h,y,g,v,L,x,$,w=[],V=new Map,O=!t[1]?.length&&se(),k=t[2];const C=e=>e[22].counter;for(let e=0;e<k.length;e+=1){let o=ie(t,k,e),n=C(o);V.set(n,w[e]=pe(n,o))}let E=t[0]&&de(t);return{c(){o=p("TO BE DONE\n"),n=c("br"),l=d(),a=c("br"),r=d(),f=c("hb-table"),y=d(),O&&O.c(),g=d();for(let e=0;e<w.length;e+=1)w[e].c();v=d(),E&&E.c(),L=u(),this.c=e,m(f,"id","table_specs"),m(f,"style",t[4]),m(f,"disablepagination","yes"),m(f,"actions",JSON.stringify(t[6])),m(f,"headers",JSON.stringify(t[7])),m(f,"rows",h=JSON.stringify(t[5]))},m(e,s){i(e,o,s),i(e,n,s),i(e,l,s),i(e,a,s),i(e,r,s),i(e,f,s),i(e,y,s),O&&O.m(e,s),i(e,g,s);for(let t=0;t<w.length;t+=1)w[t].m(e,s);i(e,v,s),E&&E.m(e,s),i(e,L,s),x||($=b(f,"tableaction",t[14]),x=!0)},p(e,[t]){16&t&&m(f,"style",e[4]),32&t&&h!==(h=JSON.stringify(e[5]))&&m(f,"rows",h),e[1]?.length?O&&(O.d(1),O=null):O||(O=se(),O.c(),O.m(g.parentNode,g)),1292&t&&(k=e[2],w=function(e,t,o,n,l,a,r,i,s,c,p,d){let u=e.length,b=a.length,f=u;const m={};for(;f--;)m[e[f].key]=f;const h=[],y=new Map,g=new Map;for(f=b;f--;){const e=d(l,a,f),i=o(e);let s=r.get(i);s?n&&s.p(e,t):(s=c(i,e),s.c()),y.set(i,h[f]=s),i in m&&g.set(i,Math.abs(f-m[i]))}const v=new Set,L=new Set;function x(e){M(e,1),e.m(i,p),r.set(e.key,e),p=e.first,b--}for(;u&&b;){const t=h[b-1],o=e[u-1],n=t.key,l=o.key;t===o?(p=t.first,u--,b--):y.has(l)?!r.has(n)||v.has(n)?x(t):L.has(l)?u--:g.get(n)>g.get(l)?(L.add(n),x(t)):(v.add(l),u--):(s(o,r),u--)}for(;u--;){const t=e[u];y.has(t.key)||s(t,r)}for(;b;)x(h[b-1]);return h}(w,t,C,1,e,k,V,v.parentNode,D,pe,v,ie)),e[0]?E?E.p(e,t):(E=de(e),E.c(),E.m(L.parentNode,L)):E&&(E.d(1),E=null)},i:e,o:e,d(e){e&&s(o),e&&s(n),e&&s(l),e&&s(a),e&&s(r),e&&s(f),e&&s(y),O&&O.d(e),e&&s(g);for(let t=0;t<w.length;t+=1)w[t].d(e);e&&s(v),E&&E.d(e),e&&s(L),x=!1,$()}}}function me(e,t,o){const n=L(),l=x();let{id:a}=t,{style:r}=t,{debug:i}=t,s=[];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"},{label:"range",value:"range"}]}}]}},{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:"size-row",type:"row",params:{columns:[{type:"number",placeholder:"Min...",id:"min",label:"Min",dependencies:[{id:"type",values:["number","date","datetime","text","textarea","range"]}]},{type:"number",placeholder:"Max...",id:"max",label:"Max",dependencies:[{id:"type",values:["number","date","datetime","text","textarea","range"]}]}]}},{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 p,d,u,b="",f="";let m;function h(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&&"number"!==e.type&&"datetime"!==e.type&&"date"!==e.type&&"range"!==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};s.find((t=>t.label===e.label))?o(1,s=s.map((t=>t.label===e.label?a:t))):o(1,s=[...s,a]),o(2,p=[...p,{counter:p.length,schema:JSON.stringify(c)}]),console.info("schema4selectorS",p)}function y(e){console.log(e,s),o(1,s=s.filter((t=>t.label!==e))),o(2,p=p.filter((e=>e.counter!==p.length-1)))}function g(){!function(e,t){l(e,t),n.dispatchEvent&&n.dispatchEvent(new CustomEvent(e,{detail:t}))}("done",{schema:s,id:a})}!function(e){L().$$.on_mount.push(e)}((()=>{le.addComponent({repoName:"@htmlbricks/hb-form",version:I.version}),le.addComponent({repoName:"@htmlbricks/hb-table",version:I.version}),u=n.shadowRoot.getElementById("schema"),console.log("formComponent",u)}));return e.$$set=e=>{"id"in e&&o(11,a=e.id),"style"in e&&o(12,r=e.style),"debug"in e&&o(0,i=e.debug)},e.$$.update=()=>{if(14343&e.$$.dirty){a||o(11,a=""),r&&(o(13,d=oe(r)),o(3,b=le.getChildStyleToPass(d,null==ae?void 0:ae.vars)),o(4,f=le.getChildStyleToPass(d,null==re?void 0:re.vars))),"string"!=typeof i||"true"!==i&&"yes"!==i&&""!==i?!0!==i&&o(0,i=!1):o(0,i=!0),p||o(2,p=[{counter:0,schema:JSON.stringify(c)}]);const e=[];for(const t of s){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,m=e)}},[i,s,p,b,f,m,[{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"}],h,y,g,a,r,d,e=>{y(e.detail.itemId)},()=>g(),e=>{h(e.detail)}]}class he extends A{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>',q(this,{target:this.shadowRoot,props:y(this.attributes),customElement:!0},me,fe,a,{id:11,style:12,debug:0},null),e&&(e.target&&i(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",he),he}();
|
|
2
2
|
//# sourceMappingURL=release.js.map
|