@nmorph/nmorph-ui-kit 1.0.69 → 1.0.70
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 +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -194,7 +194,7 @@ const z2 = (t) => {
|
|
|
194
194
|
});
|
|
195
195
|
};
|
|
196
196
|
return { placement: u, placementCoords: c };
|
|
197
|
-
}, dn = "@nmorph/nmorph-ui-kit", hn = "module", pn = "1.0.
|
|
197
|
+
}, dn = "@nmorph/nmorph-ui-kit", hn = "module", pn = "1.0.70", vn = "MIT", mn = {
|
|
198
198
|
node: "18.13.0",
|
|
199
199
|
npm: "8.19.3"
|
|
200
200
|
}, fn = "./dist/index.d.ts", _n = "./dist/index.umd.js", gn = "./dist/index.es.js", wn = "./dist/style.css", xn = [
|
package/dist/index.umd.js
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
`,Gt=()=>`
|
|
50
50
|
cursor: not-allowed;
|
|
51
51
|
opacity: 0.6;
|
|
52
|
-
`,$2=(n,t=!1)=>{const o=e.reactive({}),r=e.reactive({}),l=e.reactive(qt(n)),c=e.ref(!1),i=e.ref(!1),s=()=>{Object.entries(n).forEach(([w,u])=>{r[w]=at({inputValue:u.value,rules:u.rules}),r[w].validate()}),c.value=Object.entries(r).every(([w,u])=>u.valid)},d=()=>{Object.entries(n).forEach(([w,u])=>{o[w]=at({inputValue:u.value,rules:u.rules}),o[w].validate()})},m=(w,u)=>Object.keys(u).filter(p=>{const f=w[p]?JSON.stringify(w[p]):null,B=JSON.stringify(u[p]);return f!==B}),k=w=>{m(l,w).forEach(_=>{const p=w[_];o[_]=at({inputValue:p.value,rules:p.rules}),o[_].validate()}),Object.assign(l,qt(w)),s(),i.value=!0};return e.watch(n,k,{deep:!0}),t&&d(),{fields:o,isFormValid:e.readonly(c),isAnyTouched:e.readonly(i)}},Kt=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,()=>{_()},{deep:!0}),e.onMounted(()=>{_(),k(),w()}),e.onUnmounted(()=>{u()});const k=()=>{let p=r.value;for(;p;){const f=window.getComputedStyle(p);if(f.overflowY==="auto"||f.overflowY==="scroll"){m.value=p;break}p=p.parentElement}},w=()=>{m.value?m.value.addEventListener("scroll",_,{passive:!0}):window.addEventListener("scroll",_,{passive:!0})},u=()=>{m.value?m.value.removeEventListener("scroll",_):window.removeEventListener("scroll",_)},_=()=>{e.nextTick(()=>{if(!r.value||!o){console.warn("There is no relative element or content DOM element");return}const p=r.value.getBoundingClientRect(),f=p.width,B=p.height,h="value"in o?o.value:o;if(!h){console.warn("Relative element is not an HTMLElement");return}const g=h.getBoundingClientRect(),{x:y,y:x}=g,$=g.width,V=g.height,N=window.innerWidth,b=window.innerHeight;i.value==="top"&&x-B<0&&(i.value="bottom"),i.value==="bottom"&&x+V+B>b&&(i.value="top"),i.value==="left"&&y-f<0&&(i.value="right"),i.value==="right"&&y+$+f>N&&(i.value="left"),i.value==="top"&&(s.value={x:`${y+c}px`,y:`${x-B+l}px`}),i.value==="bottom"&&(s.value={x:`${y+c}px`,y:`${x+V+l}px`}),i.value==="right"&&(s.value={x:`${y+$+c}px`,y:`${x+l}px`}),i.value==="left"&&(s.value={x:`${y-f+c}px`,y:`${x+l}px`})})};return{placement:i,placementCoords:s}},x2={name:"@nmorph/nmorph-ui-kit",type:"module",private:!1,version:"1.0.
|
|
52
|
+
`,$2=(n,t=!1)=>{const o=e.reactive({}),r=e.reactive({}),l=e.reactive(qt(n)),c=e.ref(!1),i=e.ref(!1),s=()=>{Object.entries(n).forEach(([w,u])=>{r[w]=at({inputValue:u.value,rules:u.rules}),r[w].validate()}),c.value=Object.entries(r).every(([w,u])=>u.valid)},d=()=>{Object.entries(n).forEach(([w,u])=>{o[w]=at({inputValue:u.value,rules:u.rules}),o[w].validate()})},m=(w,u)=>Object.keys(u).filter(p=>{const f=w[p]?JSON.stringify(w[p]):null,B=JSON.stringify(u[p]);return f!==B}),k=w=>{m(l,w).forEach(_=>{const p=w[_];o[_]=at({inputValue:p.value,rules:p.rules}),o[_].validate()}),Object.assign(l,qt(w)),s(),i.value=!0};return e.watch(n,k,{deep:!0}),t&&d(),{fields:o,isFormValid:e.readonly(c),isAnyTouched:e.readonly(i)}},Kt=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,()=>{_()},{deep:!0}),e.onMounted(()=>{_(),k(),w()}),e.onUnmounted(()=>{u()});const k=()=>{let p=r.value;for(;p;){const f=window.getComputedStyle(p);if(f.overflowY==="auto"||f.overflowY==="scroll"){m.value=p;break}p=p.parentElement}},w=()=>{m.value?m.value.addEventListener("scroll",_,{passive:!0}):window.addEventListener("scroll",_,{passive:!0})},u=()=>{m.value?m.value.removeEventListener("scroll",_):window.removeEventListener("scroll",_)},_=()=>{e.nextTick(()=>{if(!r.value||!o){console.warn("There is no relative element or content DOM element");return}const p=r.value.getBoundingClientRect(),f=p.width,B=p.height,h="value"in o?o.value:o;if(!h){console.warn("Relative element is not an HTMLElement");return}const g=h.getBoundingClientRect(),{x:y,y:x}=g,$=g.width,V=g.height,N=window.innerWidth,b=window.innerHeight;i.value==="top"&&x-B<0&&(i.value="bottom"),i.value==="bottom"&&x+V+B>b&&(i.value="top"),i.value==="left"&&y-f<0&&(i.value="right"),i.value==="right"&&y+$+f>N&&(i.value="left"),i.value==="top"&&(s.value={x:`${y+c}px`,y:`${x-B+l}px`}),i.value==="bottom"&&(s.value={x:`${y+c}px`,y:`${x+V+l}px`}),i.value==="right"&&(s.value={x:`${y+$+c}px`,y:`${x+l}px`}),i.value==="left"&&(s.value={x:`${y-f+c}px`,y:`${x+l}px`})})};return{placement:i,placementCoords:s}},x2={name:"@nmorph/nmorph-ui-kit",type:"module",private:!1,version:"1.0.70",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"}},Qt={error:{bg:"#000000",text:"red"},success:{bg:"#000000",text:"green"},warn:{bg:"#000000",text:"orange"},info:{bg:"#000000",text:"blue"}},Xt=(n,t)=>{console.log(`%c ${t} `,`background: ${Qt[n].bg}; color: ${Qt[n].text}`)},Zt=[{name:"--nmorph-info-color",color:"#d4e5edbb"},{name:"--nmorph-info-text-color",color:"#506c80"},{name:"--nmorph-success-color",color:"#67C23A"},{name:"--nmorph-success-text-color",color:"#0b5b1d"},{name:"--nmorph-error-color",color:"#F56C6C"},{name:"--nmorph-error-text-color",color:"#8d3333"},{name:"--nmorph-warn-color",color:"#E6A21C"},{name:"--nmorph-warn-text-color",color:"#7a6712"},{name:"--nmorph-white-color",color:"#ffffff"},{name:"--nmorph-gray-color",color:"#c9d2dee6"},{name:"--nmorph-black-color",color:"#000000"},{name:"--nmorph-overlay-color",color:"#00000095"}],v2={darkShade:"#c8c9ca",main:"#eaf2f9",lightShade:"#ffffff",text:"#687b9e",accent:"#4a90e2",focusText:"#ffffff",placeholderText:"#c1c9cf"},M2={darkShade:"#0f1112",main:"#1c1f21",lightShade:"#292d30",text:"#778288",accent:"#006cb6",focusText:"#ffffff",placeholderText:"#575757"},se="nmorph-data-theme",z2={themes:{common:Zt,light:v2,dark:M2},defaultTheme:"dark",saveCurrentThemeToLS:!0,darkShadeGeneratorCoefficient:-45,lightShadeGeneratorCoefficient:45,other:{baseShadowWidth:"2px",baseShadowBlurCoefficient:"3"}},C2=n=>/^#[0-9A-Fa-f]{6}$/.test(n),H2=n=>{if(!C2(n))throw new Error(`Invalid hex color: ${n}`);return n},I2=(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}))},Jt=(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}`},en=n=>{Xt("warn",`NMORPH(v${x2.version})`);const t={...z2,...n},o=_=>{try{const p=H2(_),f=Jt(p,t.darkShadeGeneratorCoefficient),B=Jt(p,t.lightShadeGeneratorCoefficient);return[{name:"--nmorph-dark-shade-color",color:f},{name:"--nmorph-light-shade-color",color:B}]}catch(p){console.error(p.message)}},r=_=>Object.entries(_).map(([p,f])=>({name:`--nmorph-${Rt(p)}-color`,color:f})),l=(_,p)=>{const f=g=>g.map(y=>`${y.name}: ${y.color};`).join(" "),B=Object.entries(p).map(([g,y])=>`--${Rt(g)}: ${y};`).join(" "),h=[];return Object.entries(_).forEach(([g,y])=>{if(g==="common")h.push(f(I2(Zt,y)));else{const x=`
|
|
53
53
|
&[${se}='${g}'] {
|
|
54
54
|
${f(y)}
|
|
55
55
|
}
|