@nmorph/nmorph-ui-kit 1.0.89 → 1.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +2 -2
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -208,7 +208,7 @@ const Lt = (t) => {
|
|
|
208
208
|
});
|
|
209
209
|
};
|
|
210
210
|
return { placement: c, placementCoords: d };
|
|
211
|
-
}, $o = "@nmorph/nmorph-ui-kit", Mo = "module", ko = "1.0.
|
|
211
|
+
}, $o = "@nmorph/nmorph-ui-kit", Mo = "module", ko = "1.0.90", zo = "MIT", Ho = {
|
|
212
212
|
node: "18.13.0",
|
|
213
213
|
npm: "8.19.3"
|
|
214
214
|
}, Vo = "./dist/index.d.ts", Bo = "./dist/index.umd.js", Co = "./dist/index.es.js", So = "./dist/style.css", Io = [
|
|
@@ -336,7 +336,7 @@ const Lt = (t) => {
|
|
|
336
336
|
overlay: "#00000095"
|
|
337
337
|
}, Po = {
|
|
338
338
|
darkShade: "#c8c9ca",
|
|
339
|
-
main: "#
|
|
339
|
+
main: "#e5ecec",
|
|
340
340
|
lightShade: "#ffffff",
|
|
341
341
|
text: "#687b9e",
|
|
342
342
|
accent: "#4a90e2",
|
package/dist/index.umd.js
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
text-overflow: ellipsis;
|
|
64
64
|
`,je=()=>`
|
|
65
65
|
outline: 2px solid var(--nmorph-accent-color);
|
|
66
|
-
`,Or=(n,t=!1)=>{const o=e.reactive({}),r=e.reactive({}),l=e.reactive(dn(n)),c=e.ref(!1),i=e.ref(!1),s=()=>{Object.entries(n).forEach(([h,_])=>{r[h]=ft({inputValue:_.value,rules:_.rules}),r[h].validate()}),c.value=Object.entries(r).every(([h,_])=>_.valid)},d=()=>{Object.entries(n).forEach(([h,_])=>{o[h]=ft({inputValue:_.value,rules:_.rules}),o[h].validate()})},m=(h,_)=>Object.keys(_).filter(p=>{const b=h[p]?JSON.stringify(h[p]):null,B=JSON.stringify(_[p]);return b!==B}),k=h=>{m(l,h).forEach(f=>{const p=h[f];o[f]=ft({inputValue:p.value,rules:p.rules}),o[f].validate()}),Object.assign(l,dn(h)),s(),i.value=!0};return e.watch(n,k,{deep:!0}),t&&d(),{fields:o,isFormValid:e.readonly(c),isAnyTouched:e.readonly(i)}},un=n=>{const{initialPlacement:t,relativeElement:o,contentDOMElement:r,yOffset:l=0,xOffset:c=0}=n,i=e.ref(t),s=e.ref({x:"0px",y:"0px"}),d=e.inject("nmorph"),m=e.ref(null);e.watch(()=>d.browser,()=>{f()},{deep:!0}),e.onMounted(()=>{f(),k(),h()}),e.onUnmounted(()=>{_()});const k=()=>{let p=r.value;for(;p;){const b=window.getComputedStyle(p);if(b.overflowY==="auto"||b.overflowY==="scroll"){m.value=p;break}p=p.parentElement}},h=()=>{m.value?m.value.addEventListener("scroll",f,{passive:!0}):window.addEventListener("scroll",f,{passive:!0})},_=()=>{m.value?m.value.removeEventListener("scroll",f):window.removeEventListener("scroll",f)},f=()=>{e.nextTick(()=>{if(!r.value||!o){console.warn("There is no relative element or content DOM element");return}const p=r.value.getBoundingClientRect(),b=p.width,B=p.height,u="value"in o?o.value:o;if(!u){console.warn("Relative element is not an HTMLElement");return}const w=u.getBoundingClientRect(),{x:g,y}=w,x=w.width,$=w.height,E=window.innerWidth,N=window.innerHeight;i.value==="top"&&y-B<0&&(i.value="bottom"),i.value==="bottom"&&y+$+B>N&&(i.value="top"),i.value==="left"&&g-b<0&&(i.value="right"),i.value==="right"&&g+x+b>E&&(i.value="left"),i.value==="top"&&(s.value={x:`${g+c}px`,y:`${y-B+l}px`}),i.value==="bottom"&&(s.value={x:`${g+c}px`,y:`${y+$+l}px`}),i.value==="right"&&(s.value={x:`${g+x+c}px`,y:`${y+l}px`}),i.value==="left"&&(s.value={x:`${g-b+c}px`,y:`${y+l}px`})})};return{placement:i,placementCoords:s}},Fr={name:"@nmorph/nmorph-ui-kit",type:"module",private:!1,version:"1.0.
|
|
66
|
+
`,Or=(n,t=!1)=>{const o=e.reactive({}),r=e.reactive({}),l=e.reactive(dn(n)),c=e.ref(!1),i=e.ref(!1),s=()=>{Object.entries(n).forEach(([h,_])=>{r[h]=ft({inputValue:_.value,rules:_.rules}),r[h].validate()}),c.value=Object.entries(r).every(([h,_])=>_.valid)},d=()=>{Object.entries(n).forEach(([h,_])=>{o[h]=ft({inputValue:_.value,rules:_.rules}),o[h].validate()})},m=(h,_)=>Object.keys(_).filter(p=>{const b=h[p]?JSON.stringify(h[p]):null,B=JSON.stringify(_[p]);return b!==B}),k=h=>{m(l,h).forEach(f=>{const p=h[f];o[f]=ft({inputValue:p.value,rules:p.rules}),o[f].validate()}),Object.assign(l,dn(h)),s(),i.value=!0};return e.watch(n,k,{deep:!0}),t&&d(),{fields:o,isFormValid:e.readonly(c),isAnyTouched:e.readonly(i)}},un=n=>{const{initialPlacement:t,relativeElement:o,contentDOMElement:r,yOffset:l=0,xOffset:c=0}=n,i=e.ref(t),s=e.ref({x:"0px",y:"0px"}),d=e.inject("nmorph"),m=e.ref(null);e.watch(()=>d.browser,()=>{f()},{deep:!0}),e.onMounted(()=>{f(),k(),h()}),e.onUnmounted(()=>{_()});const k=()=>{let p=r.value;for(;p;){const b=window.getComputedStyle(p);if(b.overflowY==="auto"||b.overflowY==="scroll"){m.value=p;break}p=p.parentElement}},h=()=>{m.value?m.value.addEventListener("scroll",f,{passive:!0}):window.addEventListener("scroll",f,{passive:!0})},_=()=>{m.value?m.value.removeEventListener("scroll",f):window.removeEventListener("scroll",f)},f=()=>{e.nextTick(()=>{if(!r.value||!o){console.warn("There is no relative element or content DOM element");return}const p=r.value.getBoundingClientRect(),b=p.width,B=p.height,u="value"in o?o.value:o;if(!u){console.warn("Relative element is not an HTMLElement");return}const w=u.getBoundingClientRect(),{x:g,y}=w,x=w.width,$=w.height,E=window.innerWidth,N=window.innerHeight;i.value==="top"&&y-B<0&&(i.value="bottom"),i.value==="bottom"&&y+$+B>N&&(i.value="top"),i.value==="left"&&g-b<0&&(i.value="right"),i.value==="right"&&g+x+b>E&&(i.value="left"),i.value==="top"&&(s.value={x:`${g+c}px`,y:`${y-B+l}px`}),i.value==="bottom"&&(s.value={x:`${g+c}px`,y:`${y+$+l}px`}),i.value==="right"&&(s.value={x:`${g+x+c}px`,y:`${y+l}px`}),i.value==="left"&&(s.value={x:`${g-b+c}px`,y:`${y+l}px`})})};return{placement:i,placementCoords:s}},Fr={name:"@nmorph/nmorph-ui-kit",type:"module",private:!1,version:"1.0.90",license:"MIT",engines:{node:"18.13.0",npm:"8.19.3"},types:"./dist/index.d.ts",main:"./dist/index.umd.js",module:"./dist/index.es.js",style:"./dist/style.css",sideEffects:["*.css"],files:["dist","tsconfig.base.json",".eslintrc.base.cjs",".stylelintrc.base.cjs",".prettierrc.base.cjs"],exports:{".":{import:{types:"./dist/index.d.ts",default:"./dist/index.es.js"},require:"./dist/index.umd.js"},"./dist/index.d.ts":"./dist/index.d.ts","./dist/style.css":"./dist/style.css","./dist/styles/abstracts/_variables.scss":"./dist/styles/abstracts/_variables.scss","./dist/styles/abstracts/_mixins.scss":"./dist/styles/abstracts/_mixins.scss","./dist/styles/abstracts/_functions.scss":"./dist/styles/abstracts/_functions.scss","./dist/styles/main.scss":"./dist/styles/main.scss"},scripts:{build:"npm run build:types && vite build",watch:"vite build --watch","lint:es:check":"eslint --ext .js,.ts,.vue --ignore-path .gitignore src/","lint:es":"eslint --ext .js,.ts,.vue --ignore-path .gitignore --fix src/","lint:style:check":"stylelint ./src/**/*.{scss,vue}","lint:style":"stylelint ./src/**/*.{scss,vue} --fix","lint:check":"npm run lint:es:check && npm run lint:style:check",lint:"npm run lint:es && npm run lint:style","dev:type":"vue-tsc -p ./tsconfig.vue.json",prepare:"cd .. && husky install ./library/.husky","validate-branch-name":"node .husky/validate-branch-name.cjs","validate-commit-msg":"node .husky/validate-commit-msg.cjs","build:types":"vue-tsc --declaration --emitDeclarationOnly --outDir dist"},dependencies:{"@vue-styled-components/core":"^1.9.0",vue:"^3.5.13","vue-i18n":"^9.9.0"},devDependencies:{"@types/node":"^20.10.8","@types/vue":"^2.0.0","@types/vue-router":"^2.0.0","@typescript-eslint/eslint-plugin":"^6.18.1","@typescript-eslint/parser":"^6.18.1","@vitejs/plugin-vue":"^4.4.0",eslint:"^8.56.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","eslint-plugin-storybook":"^0.6.15","eslint-plugin-vue":"^9.19.2","happy-dom":"^15.11.7",husky:"^8.0.3",prettier:"^3.1.1","rollup-plugin-ignore":"^1.0.10",sass:"^1.69.7",stylelint:"^16.1.0","stylelint-config-idiomatic-order":"^10.0.0","stylelint-config-rational-order":"^0.0.4","stylelint-config-recommended-scss":"^14.0.0","stylelint-config-recommended-vue":"^1.5.0","stylelint-config-standard":"^36.0.0","stylelint-config-standard-scss":"^13.0.0","stylelint-order":"^6.0.4","stylelint-prettier":"^5.0.0","stylelint-scss":"^6.0.0",typescript:"~5.1.6",vite:"^4.5.0","vite-plugin-dts":"^4.3.0","vite-plugin-static-copy":"^0.17.1","vite-svg-loader":"^5.1.0","vue-eslint-parser":"^9.4.0","vue-tsc":"^1.6.5"}},gn={error:{bg:"#000000",text:"red"},success:{bg:"#000000",text:"green"},warn:{bg:"#000000",text:"orange"},info:{bg:"#000000",text:"blue"}},wn=(n,t)=>{console.log(`%c ${t} `,`background: ${gn[n].bg}; color: ${gn[n].text}`)},_n={info:"#d4e5edbb",infoText:"#506c80",success:"#67C23A",successText:"#0b5b1d",error:"#F56C6C",errorText:"#8d3333",warn:"#E6A21C",warnText:"#7a6712",gray:"#c9d2dee6",white:"#ffffff",black:"#000000",overlay:"#00000095"},Pr={darkShade:"#c8c9ca",main:"#e5ecec",lightShade:"#ffffff",text:"#687b9e",accent:"#4a90e2",focusText:"#ffffff",placeholderText:"#c1c9cf"},Rr={darkShade:"#0f1112",main:"#1c1f21",lightShade:"#292d30",text:"#778288",accent:"#006cb6",focusText:"#ffffff",placeholderText:"#575757"},we="nmorph-data-theme",qr={themes:{common:_n,light:Pr,dark:Rr},defaultTheme:"dark",saveCurrentThemeToLS:!0,darkShadeGeneratorCoefficient:-45,lightShadeGeneratorCoefficient:45,other:{baseShadowWidth:"3px",baseShadowBlurCoefficient:"2.3"}},Wr=n=>/^#[0-9A-Fa-f]{6}$/.test(n),Ur=n=>{if(!Wr(n))throw new Error(`Invalid hex color: ${n}`);return n},Yr=(n,t)=>{const o={};return n.forEach(({name:r,color:l})=>{o[r]=l}),t.forEach(({name:r,color:l})=>{o[r]=l}),Object.entries(o).map(([r,l])=>({name:r,color:l}))},kn=(n,t)=>{let o=parseInt(n.substring(1,3),16),r=parseInt(n.substring(3,5),16),l=parseInt(n.substring(5,7),16);o=Math.round(o*(1+t/100)),r=Math.round(r*(1+t/100)),l=Math.round(l*(1+t/100)),o=Math.min(255,Math.max(0,o)),r=Math.min(255,Math.max(0,r)),l=Math.min(255,Math.max(0,l));const c=o.toString(16).padStart(2,"0"),i=r.toString(16).padStart(2,"0"),s=l.toString(16).padStart(2,"0");return`#${c}${i}${s}`},bn=n=>{wn("warn",`NMORPH(v${Fr.version})`);const t={...qr,...n},o=f=>{try{const p=Ur(f),b=kn(p,t.darkShadeGeneratorCoefficient),B=kn(p,t.lightShadeGeneratorCoefficient);return[{name:"--nmorph-dark-shade-color",color:b},{name:"--nmorph-light-shade-color",color:B}]}catch(p){console.error(p.message)}},r=f=>Object.entries(f).map(([p,b])=>({name:`--nmorph-${sn(p)}-color`,color:b})),l=(f,p)=>{const b=w=>w.map(g=>`${g.name}: ${g.color};`).join(" "),B=Object.entries(p).map(([w,g])=>`--${sn(w)}: ${g};`).join(" "),u=[];return Object.entries(f).forEach(([w,g])=>{const y=r(_n);if(w==="common")u.push(b(Yr(y,g)));else{const x=`
|
|
67
67
|
&[${we}='${w}'] {
|
|
68
68
|
${b(g)}
|
|
69
69
|
}
|