@telia-ace/widget-ui 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/index.mjs +17 -14
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -353,7 +353,7 @@
|
|
|
353
353
|
justify-content: center;
|
|
354
354
|
grid-auto-rows: max-content;
|
|
355
355
|
${Te}
|
|
356
|
-
`,be=i.forwardRef(({htmlParseInstruction:e=null,className:t,html:n,...o},r)=>{const a=R(),[l,f]=i.useState();return i.useEffect(()=>{const c=Ve(a,n),u={...c,...e,transform:{...c.transform,...e==null?void 0:e.transform}},d=Be(n,u);f(d)},[n,e]),s.jsx("div",{className:b.appendClassNames(t,"humany-html"),...S(o),ref:r,children:l})}),Qe=({faIcon:e,title:t,className:n="",role:o="presentation",...r})=>s.jsx("i",{className:b.appendClassNames(n,`fa fa-${e}`),title:t,role:o,...S(r)}),dn=i.forwardRef(({className:e="",autoFocus:t=!1,onFocusChange:n=()=>{},onEnter:o=()=>{},onEscape:r=()=>{},selectAllOnFocus:a,onChange:l=()=>{},disabled:f=!1,type:c,...u},d)=>{const[h,m]=i.useState(t),p=i.useRef();i.useImperativeHandle(d,()=>p.current),i.useEffect(()=>{var y;t&&((y=p==null?void 0:p.current)==null||y.focus())},[t,d,p]);const x=(y,k)=>{m(y),n&&n(y),a&&y&&k.target.select()},g={...S(u),disabled:f,autoFocus:t,type:c,onKeyDown:y=>{y.key==="Enter"&&h&&o(y),y.key==="Escape"&&h&&r(y)},onFocus:y=>x(!0,y),onBlur:y=>x(!1,y),onChange:y=>l(y.target.value||""),className:b.appendClassNames(e,"humany-input"),"data-type":c};return c!=="textarea"?s.jsx("input",{...g,ref:p}):s.jsx("textarea",{...g,ref:p})}),Je=i.forwardRef(({className:e,items:t,renderItem:n,renderLi:o=!1,...r},a)=>s.jsx("ul",{role:"none",className:b.appendClassNames(e,"humany-list"),"data-item-count":t.length,...S(r),ref:a,children:t.map((
|
|
356
|
+
`,be=i.forwardRef(({htmlParseInstruction:e=null,className:t,html:n,...o},r)=>{const a=R(),[l,f]=i.useState();return i.useEffect(()=>{const c=Ve(a,n),u={...c,...e,transform:{...c.transform,...e==null?void 0:e.transform}},d=Be(n,u);f(d)},[n,e]),s.jsx("div",{className:b.appendClassNames(t,"humany-html"),...S(o),ref:r,children:l})}),Qe=({faIcon:e,title:t,className:n="",role:o="presentation",...r})=>s.jsx("i",{className:b.appendClassNames(n,`fa fa-${e}`),title:t,role:o,...S(r)}),dn=i.forwardRef(({className:e="",autoFocus:t=!1,onFocusChange:n=()=>{},onEnter:o=()=>{},onEscape:r=()=>{},selectAllOnFocus:a,onChange:l=()=>{},disabled:f=!1,type:c,...u},d)=>{const[h,m]=i.useState(t),p=i.useRef();i.useImperativeHandle(d,()=>p.current),i.useEffect(()=>{var y;t&&((y=p==null?void 0:p.current)==null||y.focus())},[t,d,p]);const x=(y,k)=>{m(y),n&&n(y),a&&y&&k.target.select()},g={...S(u),disabled:f,autoFocus:t,type:c,onKeyDown:y=>{y.key==="Enter"&&h&&o(y),y.key==="Escape"&&h&&r(y)},onFocus:y=>x(!0,y),onBlur:y=>x(!1,y),onChange:y=>l(y.target.value||""),className:b.appendClassNames(e,"humany-input"),"data-type":c};return c!=="textarea"?s.jsx("input",{...g,ref:p}):s.jsx("textarea",{...g,ref:p})}),Je=i.forwardRef(({className:e,items:t,renderItem:n,renderLi:o=!1,...r},a)=>{const l=t.length===1&&t[0].expanded;return s.jsx("ul",{role:l?"none":void 0,className:b.appendClassNames(e,"humany-list"),"data-item-count":t.length,...S(r),ref:a,children:t.map((f,c,u)=>o?s.jsx("li",{className:"humany-list-item",children:n(f,c,u)},f.id||c):n(f,c,u))})}),et=i.forwardRef(({text:e,html:t,header:n,className:o,htmlParseInstruction:r,symbol:a,...l},f)=>{var u;const c=(u=window.humany)==null?void 0:u.deflectionHeaderTag;return s.jsxs("div",{className:b.appendClassNames(o,"humany-paragraph"),...S(l),ref:f,children:[n?s.jsxs(O,{variant:c&&c.match(/h1|h2|h3|h4|h5|h6/)?c:"h1",children:[a?s.jsx(F,{symbol:a}):null,n]}):null,t?s.jsx(be,{html:t,htmlParseInstruction:r}):null,e?s.jsx(te,{children:e}):null]})}),tt=i.forwardRef(({header:e,customHeader:t,text:n,html:o,className:r,children:a,symbol:l,items:f,renderItem:c,renderLi:u,ulProps:d,...h},m)=>s.jsxs("div",{className:b.appendClassNames(r,"humany-item-list"),"data-item-count":f.length,...S(h),ref:m,children:[t||(e||n||o?s.jsx(et,{symbol:l,header:e,text:n,html:o}):null),f.length?s.jsx(Je,{items:f,renderItem:c,renderLi:u,...d}):null,a]})),fn=({className:e="",tree:t,renderItem:n,rootItem:o,renderUnselected:r=!0,renderEmpty:a=!0,ulProps:l,liProps:f})=>{const c=h=>!u(h),u=h=>!h||h.length<1?!0:!h.some(m=>!!m.selected),d=(h,m)=>s.jsx(tt,{className:b.appendClassNames(`humany-item-tree-level-${m}`),items:h,ulProps:l,renderItem:p=>{const{id:x,selected:g,items:y,matches:k}=p,$=g&&u(y);return!a&&!k?null:i.createElement("li",{...S(f),key:x,className:"humany-item-tree-item"},n&&n(p,m,$),y&&(r||$)&&d(y,m+1))}});return s.jsxs("div",{className:b.appendClassNames(e,"humany-item-tree"),children:[o&&o(!c(t||[])),t&&d(t,1)]})},nt=i.forwardRef(({className:e,onClick:t=()=>{},name:n="",to:o="",params:r={},children:a,...l},f)=>{const c=pe(),u=R();if(!c)return null;let d="";const h={onClick:t,className:b.appendClassNames(e,"humany-route-link"),to:d,innerRef:f,...l,ref:null};if(n){if(!(c.routes||[]).find(g=>g.name===n))return process.env.NODE_ENV!=="production"&&b.Logger.warn(`Unable to create route. No route named "${n}" exist.`),s.jsx(ie.Link,{...h,onClick:g=>{t(g),g.preventDefault(),process.env.NODE_ENV!=="production"&&b.Logger.warn(`Unable to navigate. No route named "${n}" exist.`)},children:a});const x=Object.keys(r).reduce((g,y)=>{const k=r[y];if(Array.isArray(k)){if(k.length===0)return g;g[y]=k.map($=>typeof $=="string"?encodeURIComponent($):$).join(",")}else g[y]=typeof k=="string"?encodeURIComponent(k):k;return g},{});try{d=c.generate(n,x||{})}catch{return s.jsx(ie.Link,{...h,ref:h.innerRef,children:a})}d&&c.settings.mode&&c.settings.mode===re.HistoryMode.browser&&d[0]!=="/"&&(d=`/${d}`)}else if(o&&c.history)d=c.history.createHref({hash:"",pathname:o,search:"",state:void 0});else return process.env.NODE_ENV!=="production"&&b.Logger.warn('Unable to generate path for route link. Either specify route name or use the "to" prop.'),null;if(c.settings&&c.settings.mode===re.HistoryMode.scopedHash){const m=u.get("$widget").name;d=re.getSpecificWidgetPath(d,m)}return h.as?s.jsx(hn,{...h,as:h.as,children:a}):s.jsx(ie.Link,{...h,to:d,children:a})}),hn=C.span``,oe=i.forwardRef(({className:e,disabled:t=!1,tabIndex:n=0,onClick:o=()=>{},onKeyDown:r=()=>{},title:a,as:l,href:f,children:c,target:u,routeName:d,params:h,...m},p)=>{const x={title:a,role:d==="index"||d==="contact-method"?"button":void 0,"aria-expanded":d==="index"?"false":void 0,disabled:t,as:l,tabIndex:n,className:b.appendClassNames(e,"humany-link",[!!t,"humany-disabled"]),onClick:g=>{if(g.persist(),t){g.preventDefault();return}o(g)},onKeyDown:g=>{if(g.persist(),t){g.key!=="Tab"&&g.preventDefault();return}r(g)}};return m["data-client-name"]==="custom.link"&&(x.role="link"),d?s.jsx(mn,{name:d,params:h,...x,...S(m),ref:p,children:c}):s.jsx(pn,{href:f,target:u,...x,...S(m),ref:p,children:c})}),mn=C(nt)`
|
|
357
357
|
${e=>e.disabled?`
|
|
358
358
|
pointer-events: none;
|
|
359
359
|
opacity: .7;
|
package/index.mjs
CHANGED
|
@@ -1914,19 +1914,22 @@ const Ut = 300, T1 = ({
|
|
|
1914
1914
|
);
|
|
1915
1915
|
}
|
|
1916
1916
|
), an = H(
|
|
1917
|
-
({ className: e, items: t, renderItem: n, renderLi: o = !1, ...r }, s) =>
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1917
|
+
({ className: e, items: t, renderItem: n, renderLi: o = !1, ...r }, s) => {
|
|
1918
|
+
const c = t.length === 1 && t[0].expanded;
|
|
1919
|
+
return /* @__PURE__ */ i(
|
|
1920
|
+
"ul",
|
|
1921
|
+
{
|
|
1922
|
+
role: c ? "none" : void 0,
|
|
1923
|
+
className: $(e, "humany-list"),
|
|
1924
|
+
"data-item-count": t.length,
|
|
1925
|
+
...D(r),
|
|
1926
|
+
ref: s,
|
|
1927
|
+
children: t.map(
|
|
1928
|
+
(d, a, l) => o ? /* @__PURE__ */ i("li", { className: "humany-list-item", children: n(d, a, l) }, d.id || a) : n(d, a, l)
|
|
1929
|
+
)
|
|
1930
|
+
}
|
|
1931
|
+
);
|
|
1932
|
+
}
|
|
1930
1933
|
), cn = H(
|
|
1931
1934
|
({ text: e, html: t, header: n, className: o, htmlParseInstruction: r, symbol: s, ...c }, d) => {
|
|
1932
1935
|
var l;
|
|
@@ -2120,7 +2123,7 @@ const Ut = 300, T1 = ({
|
|
|
2120
2123
|
}, m) => {
|
|
2121
2124
|
const p = {
|
|
2122
2125
|
title: s,
|
|
2123
|
-
role: u === "index" ? "button" : void 0,
|
|
2126
|
+
role: u === "index" || u === "contact-method" ? "button" : void 0,
|
|
2124
2127
|
"aria-expanded": u === "index" ? "false" : void 0,
|
|
2125
2128
|
disabled: t,
|
|
2126
2129
|
as: c,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/widget-ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@telia-ace/widget-core": "^1.3.
|
|
14
|
-
"@telia-ace/widget-routing": "^1.3.
|
|
15
|
-
"@telia-ace/widget-utilities": "^1.3.
|
|
13
|
+
"@telia-ace/widget-core": "^1.3.1",
|
|
14
|
+
"@telia-ace/widget-routing": "^1.3.1",
|
|
15
|
+
"@telia-ace/widget-utilities": "^1.3.1",
|
|
16
16
|
"@webprovisions/platform": "^1.1.4",
|
|
17
17
|
"htmr": "1.0.2"
|
|
18
18
|
},
|