@telia-ace/knowledge-widget-components-guide-category-dropdown 1.1.2-rc.1 → 1.1.2-rc.10
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.
|
@@ -6,130 +6,130 @@ import { initialRouteFallback as V } from "@telia-ace/knowledge-widget-component
|
|
|
6
6
|
import { css as x } from "@emotion/react";
|
|
7
7
|
import m from "@emotion/styled";
|
|
8
8
|
const X = m.div`
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
${B}
|
|
10
|
+
${M}
|
|
11
11
|
overflow: hidden;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
min-height: 50px;
|
|
13
|
+
${(e) => e["data-toggler-in-focus"] && e.isTabbing && x`
|
|
14
|
+
&& {
|
|
15
|
+
${O(e)}
|
|
16
|
+
}
|
|
17
|
+
`};
|
|
18
18
|
`, Y = m.button`
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
background: none;
|
|
20
|
+
border: 0;
|
|
21
|
+
outline: 0;
|
|
22
|
+
display: block;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
padding: 0;
|
|
25
|
+
font-size: ${(e) => {
|
|
26
26
|
var t;
|
|
27
27
|
return (t = e.theme.fonts) == null ? void 0 : t.normal;
|
|
28
28
|
}};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
text-align: end;
|
|
30
|
+
flex: 1 0 auto;
|
|
31
|
+
svg {
|
|
32
|
+
path,
|
|
33
|
+
line {
|
|
34
|
+
stroke: ${(e) => {
|
|
35
35
|
var t;
|
|
36
36
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
37
37
|
}};
|
|
38
|
-
}
|
|
39
38
|
}
|
|
39
|
+
}
|
|
40
40
|
`, L = (e) => {
|
|
41
41
|
var t, g, u, r, n, p, s, h;
|
|
42
42
|
return x`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
43
|
+
font-size: ${(t = e.theme.fonts) == null ? void 0 : t.normal};
|
|
44
|
+
text-align: left;
|
|
45
|
+
text-align: left;
|
|
46
|
+
text-decoration: none;
|
|
47
|
+
font-weight: 300;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
padding: ${(g = e.theme.sizes) == null ? void 0 : g.small};
|
|
51
|
+
padding-left: ${(u = e.theme.sizes) == null ? void 0 : u.large};
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
${e.selected ? x`
|
|
55
|
+
border-left: 2px solid ${(r = e.theme.colors) == null ? void 0 : r.primary};
|
|
56
|
+
color: ${(n = e.theme.colors) == null ? void 0 : n.primary};
|
|
57
|
+
` : x`
|
|
58
|
+
color: ${(p = e.theme.colors) == null ? void 0 : p.text};
|
|
59
|
+
`};
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
span {
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
text-overflow: ellipsis;
|
|
64
|
+
}
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
i {
|
|
67
|
+
margin-right: ${(s = e.theme.sizes) == null ? void 0 : s.normal};
|
|
68
|
+
font-size: ${(h = e.theme.fonts) == null ? void 0 : h.medium};
|
|
69
|
+
min-height: 1em;
|
|
70
|
+
min-width: 1em;
|
|
71
|
+
}
|
|
72
72
|
`;
|
|
73
73
|
}, Z = m.div`
|
|
74
|
-
|
|
74
|
+
${L}
|
|
75
75
|
`, _ = m(G)`
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
76
|
+
${L}
|
|
77
|
+
&:focus {
|
|
78
|
+
outline: none;
|
|
79
|
+
}
|
|
80
|
+
&:focus-visible {
|
|
81
|
+
span {
|
|
82
|
+
${R};
|
|
84
83
|
}
|
|
84
|
+
}
|
|
85
85
|
`, ee = m.div`
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
display: flex;
|
|
87
|
+
justify-content: space-between;
|
|
88
|
+
padding-right: ${(e) => {
|
|
89
89
|
var t;
|
|
90
90
|
return (t = e.theme.sizes) == null ? void 0 : t.large;
|
|
91
91
|
}};
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
min-height: 52px;
|
|
93
|
+
white-space: nowrap;
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
&& {
|
|
96
|
+
font-weight: normal;
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
.humany-guide-category-dropdown-item {
|
|
103
|
-
font-weight: normal;
|
|
98
|
+
a {
|
|
99
|
+
font-weight: normal;
|
|
104
100
|
}
|
|
101
|
+
}
|
|
102
|
+
.humany-guide-category-dropdown-item {
|
|
103
|
+
font-weight: normal;
|
|
104
|
+
}
|
|
105
105
|
`, te = m(A)`
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
${E}
|
|
107
|
+
display: flex;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
margin-right: ${(e) => {
|
|
111
111
|
var t;
|
|
112
112
|
return (t = e.theme.sizes) == null ? void 0 : t.medium;
|
|
113
113
|
}};
|
|
114
|
-
|
|
114
|
+
margin-left: ${(e) => {
|
|
115
115
|
var t;
|
|
116
116
|
return (t = e.theme.sizes) == null ? void 0 : t.large;
|
|
117
117
|
}};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
margin-bottom: 22px;
|
|
119
|
+
border-left: ${(e) => e.theme.border};
|
|
120
|
+
li {
|
|
121
|
+
margin: 0 0 ${(e) => {
|
|
122
122
|
var t;
|
|
123
123
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
124
124
|
}} -2px;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
}
|
|
126
|
+
li:last-child {
|
|
127
|
+
margin: 0 0 0 -2px;
|
|
128
|
+
}
|
|
129
|
+
flex-basis: 100%;
|
|
130
|
+
border-width: 2px;
|
|
131
131
|
`, oe = m($)`
|
|
132
|
-
|
|
132
|
+
margin: 0 0 0 ${(e) => {
|
|
133
133
|
var t;
|
|
134
134
|
return (t = e.theme.sizes) == null ? void 0 : t.small;
|
|
135
135
|
}};
|
|
@@ -148,7 +148,10 @@ const X = m.div`
|
|
|
148
148
|
e,
|
|
149
149
|
")"
|
|
150
150
|
] });
|
|
151
|
-
}, ne = ({
|
|
151
|
+
}, ne = ({
|
|
152
|
+
item: e,
|
|
153
|
+
guideCategory: t
|
|
154
|
+
}) => {
|
|
152
155
|
const {
|
|
153
156
|
route: g = "browse",
|
|
154
157
|
categoryAriaLabel: u = "",
|
|
@@ -158,12 +161,14 @@ const X = m.div`
|
|
|
158
161
|
return /* @__PURE__ */ o("li", { ref: s, children: /* @__PURE__ */ c(
|
|
159
162
|
a.Link,
|
|
160
163
|
{
|
|
161
|
-
...V(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
...V(
|
|
165
|
+
e,
|
|
166
|
+
g,
|
|
167
|
+
n,
|
|
168
|
+
"category"
|
|
166
169
|
),
|
|
170
|
+
"aria-pressed": d,
|
|
171
|
+
"aria-label": (d ? r : u).replace("{{category}}", b),
|
|
167
172
|
className: "humany-guide-category-dropdown-link",
|
|
168
173
|
"aria-current": d,
|
|
169
174
|
selected: d,
|
|
@@ -1,105 +1,105 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),s=require("@telia-ace/knowledge-widget-ui"),b=require("@telia-ace/widget-utilities"),$=require("react"),I=require("@telia-ace/knowledge-widget-component-utilities"),w=require("@emotion/react"),g=require("@emotion/styled"),B=g.div`
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
${s.loadingOpacity}
|
|
3
|
+
${s.contentBox}
|
|
4
4
|
overflow: hidden;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
min-height: 50px;
|
|
6
|
+
${e=>e["data-toggler-in-focus"]&&e.isTabbing&&w.css`
|
|
7
|
+
&& {
|
|
8
|
+
${s.borderTabStyle(e)}
|
|
9
|
+
}
|
|
10
|
+
`};
|
|
11
11
|
`,L=g.button`
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
12
|
+
background: none;
|
|
13
|
+
border: 0;
|
|
14
|
+
outline: 0;
|
|
15
|
+
display: block;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
padding: 0;
|
|
18
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
|
|
19
|
+
text-align: end;
|
|
20
|
+
flex: 1 0 auto;
|
|
21
|
+
svg {
|
|
22
|
+
path,
|
|
23
|
+
line {
|
|
24
|
+
stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
26
25
|
}
|
|
26
|
+
}
|
|
27
27
|
`,k=e=>{var t,m,u,i,n,y,l,h;return w.css`
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
28
|
+
font-size: ${(t=e.theme.fonts)==null?void 0:t.normal};
|
|
29
|
+
text-align: left;
|
|
30
|
+
text-align: left;
|
|
31
|
+
text-decoration: none;
|
|
32
|
+
font-weight: 300;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
padding: ${(m=e.theme.sizes)==null?void 0:m.small};
|
|
36
|
+
padding-left: ${(u=e.theme.sizes)==null?void 0:u.large};
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
${e.selected?w.css`
|
|
40
|
+
border-left: 2px solid ${(i=e.theme.colors)==null?void 0:i.primary};
|
|
41
|
+
color: ${(n=e.theme.colors)==null?void 0:n.primary};
|
|
42
|
+
`:w.css`
|
|
43
|
+
color: ${(y=e.theme.colors)==null?void 0:y.text};
|
|
44
|
+
`};
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
span {
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
text-overflow: ellipsis;
|
|
49
|
+
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
i {
|
|
52
|
+
margin-right: ${(l=e.theme.sizes)==null?void 0:l.normal};
|
|
53
|
+
font-size: ${(h=e.theme.fonts)==null?void 0:h.medium};
|
|
54
|
+
min-height: 1em;
|
|
55
|
+
min-width: 1em;
|
|
56
|
+
}
|
|
57
57
|
`},q=g.div`
|
|
58
|
-
|
|
58
|
+
${k}
|
|
59
59
|
`,F=g(s.Link)`
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
60
|
+
${k}
|
|
61
|
+
&:focus {
|
|
62
|
+
outline: none;
|
|
63
|
+
}
|
|
64
|
+
&:focus-visible {
|
|
65
|
+
span {
|
|
66
|
+
${s.linkTabStyle};
|
|
68
67
|
}
|
|
68
|
+
}
|
|
69
69
|
`,D=g.div`
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: space-between;
|
|
72
|
+
padding-right: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.large}};
|
|
73
|
+
min-height: 52px;
|
|
74
|
+
white-space: nowrap;
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
&& {
|
|
77
|
+
font-weight: normal;
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
.humany-guide-category-dropdown-item {
|
|
84
|
-
font-weight: normal;
|
|
79
|
+
a {
|
|
80
|
+
font-weight: normal;
|
|
85
81
|
}
|
|
82
|
+
}
|
|
83
|
+
.humany-guide-category-dropdown-item {
|
|
84
|
+
font-weight: normal;
|
|
85
|
+
}
|
|
86
86
|
`,M=g(s.List)`
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
87
|
+
${s.list}
|
|
88
|
+
display: flex;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
margin-right: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.medium}};
|
|
92
|
+
margin-left: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.large}};
|
|
93
|
+
margin-bottom: 22px;
|
|
94
|
+
border-left: ${e=>e.theme.border};
|
|
95
|
+
li {
|
|
96
|
+
margin: 0 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}} -2px;
|
|
97
|
+
}
|
|
98
|
+
li:last-child {
|
|
99
|
+
margin: 0 0 0 -2px;
|
|
100
|
+
}
|
|
101
|
+
flex-basis: 100%;
|
|
102
|
+
border-width: 2px;
|
|
103
103
|
`,O=g(s.Text)`
|
|
104
|
-
|
|
104
|
+
margin: 0 0 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}};
|
|
105
105
|
`,a={Wrapper:B,Toggler:L,List:M,Item:q,Link:F,TopItem:D,MatchCount:O},C=({matches:e})=>{const{showMatchCount:t=!1}=s.useProperties();return!t||typeof e>"u"?null:o.jsxs(a.MatchCount,{children:["(",e,")"]})},P=({item:e,guideCategory:t})=>{const{route:m="browse",categoryAriaLabel:u="",activeCategoryAriaLabel:i="",fallbackOnInitialRoute:n=!1}=s.useProperties(),[y,l]=s.useHover(),{id:h,title:f,symbol:r,activeSymbol:d}=e,c=t===h;return o.jsx("li",{ref:l,children:o.jsxs(a.Link,{...I.initialRouteFallback(e,m,n,"category"),"aria-pressed":c,"aria-label":(c?i:u).replace("{{category}}",f),className:"humany-guide-category-dropdown-link","aria-current":c,selected:c,children:[(c||y)&&d?o.jsx(s.SymbolBadge,{symbol:d}):r&&o.jsx(s.SymbolBadge,{symbol:r}),o.jsx(s.Text,{children:f}),o.jsx(C,{...e})]})})},R=({className:e,...t})=>{const m=s.useRouteData(),[u,i]=$.useState(!1),{parent:n,route:y="browse",categories:l=[],loading:h=!1}=s.useProperties(),f=s.useContainer(),[r,d]=$.useState(!1),{params:c}=m,v=s.useIsTabbing(),{guideCategory:j,tag:T,phrase:z,sorting:N}=c;if($.useEffect(()=>{r&&d(!1)},[j]),h||!n||!l.length)return s.createEmptyComponent(f,{...t,className:b.appendClassNames(e,"humany-guide-category-dropdown")});const p=l.find(x=>x.id===j)||n,S=p.activeSymbol||p.symbol;return o.jsx(a.Wrapper,{...t,"data-loading":!1,"data-toggler-in-focus":u,"aria-expanded":r,isTabbing:v,className:b.appendClassNames(e,"humany-guide-category-dropdown"),children:r?o.jsxs(o.Fragment,{children:[o.jsxs(a.TopItem,{className:"humany-guide-category-dropdown-top-item",children:[o.jsxs(a.Link,{className:"humany-guide-category-dropdown-link",routeName:y,params:b.createParams({tag:T,phrase:z,sorting:N,guideCategory:n.id,uriName:b.formatUrl(n.title)}),selected:!1,children:[n.symbol?o.jsx(s.SymbolBadge,{symbol:n.symbol}):null,o.jsx(s.Text,{children:n.title}),o.jsx(C,{...n})]}),o.jsx(a.Toggler,{onBlur:()=>i(!1),onFocus:()=>i(!0),className:"humany-guide-category-dropdown-toggler",onClick:()=>{d(!r)},"aria-expanded":"true","aria-label":n.title,children:o.jsx(s.SymbolBadge,{size:18,symbol:{type:"Svg",content:"caret-up"}})})]}),o.jsx(a.List,{className:"humany-guide-category-dropdown-open",items:l,renderItem:x=>o.jsx(P,{item:x,guideCategory:j},x.id)})]}):o.jsxs(a.TopItem,{className:"humany-guide-category-dropdown-top-item",children:[o.jsxs(a.Item,{className:"humany-guide-category-dropdown-item",onClick:()=>{d(!r)},selected:!1,children:[S?o.jsx(s.SymbolBadge,{symbol:S}):null,o.jsx(s.Text,{children:p.title}),o.jsx(C,{...p})]}),o.jsx(a.Toggler,{onBlur:()=>i(!1),onFocus:()=>i(!0),className:"humany-guide-category-dropdown-toggler",onClick:()=>{d(!r)},"aria-expanded":"false","aria-label":p.title,children:o.jsx(s.SymbolBadge,{size:18,symbol:{type:"Svg",content:"caret-down"}})})]})})};exports.default=R;
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const g=require("@telia-ace/knowledge-data-client"),l=require("@telia-ace/knowledge-widget-core"),v=require("@telia-ace/knowledge-widget-ui"),D=(e,a,n)=>!n||n.length<1?a:h(e,a,null,n),h=(e,a,n,o)=>{if(e.find(s=>s.id===o)||!o)return n||a;for(let s=0;s<e.length;s+=1){const t=e[s];if(t.items){const r=h(t.items,a,t,o);if(r)return r}}},P=e=>e.matches&&e.matches>0,q=e=>{const{events:a}=e.get("$widget"),[n,o]=l.createEventSubscriber(a);return v.createReactComponent(e,"guide-category-dropdown",Promise.resolve().then(()=>require("./guide-category-dropdown-
|
|
1
|
+
"use strict";const g=require("@telia-ace/knowledge-data-client"),l=require("@telia-ace/knowledge-widget-core"),v=require("@telia-ace/knowledge-widget-ui"),D=(e,a,n)=>!n||n.length<1?a:h(e,a,null,n),h=(e,a,n,o)=>{if(e.find(s=>s.id===o)||!o)return n||a;for(let s=0;s<e.length;s+=1){const t=e[s];if(t.items){const r=h(t.items,a,t,o);if(r)return r}}},P=e=>e.matches&&e.matches>0,q=e=>{const{events:a}=e.get("$widget"),[n,o]=l.createEventSubscriber(a);return v.createReactComponent(e,"guide-category-dropdown",Promise.resolve().then(()=>require("./guide-category-dropdown-61b15156.js")),i=>{const s=t=>{i.writeProperties({loading:!0}),i.actions.dispatch("fetch",{params:t}).then(()=>{i.writeProperties({loading:!1})})};i.actions.create("fetch",({parent:t,categories:r})=>{i.writeProperties({parent:t,categories:r,loading:!1})}),e.getAsync("router").then(t=>{const{params:r}=t.getRouteData();s(r)}),n("router:changed",(t,{current:r})=>{s(r.routeData.params)})}).then(()=>l.extendComponent(e,"guide-category-dropdown",i=>{i.actions.watch("guide-category-dropdown.fetch",(s,t)=>{const{matchFilters:r={search:!1,tag:!1},rootCategoryHeader:f}=i.properties(),{params:{phrase:p,guideCategory:w,tag:m}}=s;return g.DataClient.getInstance(e).then(b=>b.fetch(g.DataType.GuideCategories,{searchPhrase:r.search?p:void 0,tagId:r.tag?m:void 0}).then(({categories:d,matches:C})=>{var u;const c=D(d,{matches:C,id:"0",title:f,items:d},w);return t({parent:c,categories:(u=c==null?void 0:c.items)==null?void 0:u.filter(P)})}))})})).then(()=>{o()})};module.exports=q;
|
package/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ const y = (e, n, a) => !a || a.length < 1 ? n : h(e, n, null, a), h = (e, n, a,
|
|
|
17
17
|
return P(
|
|
18
18
|
e,
|
|
19
19
|
"guide-category-dropdown",
|
|
20
|
-
import("./guide-category-dropdown-
|
|
20
|
+
import("./guide-category-dropdown-1d1ef79b.mjs"),
|
|
21
21
|
(i) => {
|
|
22
22
|
const s = (t) => {
|
|
23
23
|
i.writeProperties({ loading: !0 }), i.actions.dispatch("fetch", { params: t }).then(() => {
|
|
@@ -37,39 +37,46 @@ const y = (e, n, a) => !a || a.length < 1 ? n : h(e, n, null, a), h = (e, n, a,
|
|
|
37
37
|
s(r.routeData.params);
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
).then(() => D(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
40
|
+
).then(() => D(
|
|
41
|
+
e,
|
|
42
|
+
"guide-category-dropdown",
|
|
43
|
+
(i) => {
|
|
44
|
+
i.actions.watch(
|
|
45
|
+
"guide-category-dropdown.fetch",
|
|
46
|
+
(s, t) => {
|
|
47
|
+
const {
|
|
48
|
+
matchFilters: r = {
|
|
49
|
+
search: !1,
|
|
50
|
+
tag: !1
|
|
51
|
+
},
|
|
52
|
+
rootCategoryHeader: u
|
|
53
|
+
} = i.properties(), {
|
|
54
|
+
params: { phrase: l, guideCategory: g, tag: p }
|
|
55
|
+
} = s;
|
|
56
|
+
return b.getInstance(e).then((m) => m.fetch(v.GuideCategories, {
|
|
57
|
+
searchPhrase: r.search ? l : void 0,
|
|
58
|
+
tagId: r.tag ? p : void 0
|
|
59
|
+
}).then(({ categories: d, matches: w }) => {
|
|
60
|
+
var f;
|
|
61
|
+
const c = y(
|
|
62
|
+
d,
|
|
63
|
+
{
|
|
64
|
+
matches: w,
|
|
65
|
+
id: "0",
|
|
66
|
+
title: u,
|
|
67
|
+
items: d
|
|
68
|
+
},
|
|
69
|
+
g
|
|
70
|
+
);
|
|
71
|
+
return t({
|
|
72
|
+
parent: c,
|
|
73
|
+
categories: (f = c == null ? void 0 : c.items) == null ? void 0 : f.filter(R)
|
|
74
|
+
});
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
)).then(() => {
|
|
73
80
|
o();
|
|
74
81
|
});
|
|
75
82
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-guide-category-dropdown",
|
|
3
|
-
"version": "1.1.2-rc.
|
|
3
|
+
"version": "1.1.2-rc.10",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@telia-ace/knowledge-widget-core": "^1.1.2-rc.
|
|
14
|
-
"@telia-ace/knowledge-widget-component-utilities": "^1.1.2-rc.
|
|
15
|
-
"@telia-ace/knowledge-widget-ui": "^1.1.2-rc.
|
|
16
|
-
"@telia-ace/widget-utilities": "^1.1.2-rc.
|
|
17
|
-
"@telia-ace/knowledge-data-client": "^1.1.2-rc.
|
|
13
|
+
"@telia-ace/knowledge-widget-core": "^1.1.2-rc.10",
|
|
14
|
+
"@telia-ace/knowledge-widget-component-utilities": "^1.1.2-rc.10",
|
|
15
|
+
"@telia-ace/knowledge-widget-ui": "^1.1.2-rc.10",
|
|
16
|
+
"@telia-ace/widget-utilities": "^1.1.2-rc.10",
|
|
17
|
+
"@telia-ace/knowledge-data-client": "^1.1.2-rc.10",
|
|
18
18
|
"@webprovisions/platform": "^1.1.4"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|