dev-process-kit 0.2.0 → 0.3.0-beta.0
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/README.md +178 -60
- package/dist/boards.js +1 -0
- package/dist/chunks/shared-B0QTGEwR.js +1844 -0
- package/dist/chunks/shared-BQqlFaPv.js +4928 -0
- package/dist/chunks/shared-BR7trWLo.js +3586 -0
- package/dist/chunks/shared-BpfuvyBP.js +1636 -0
- package/dist/chunks/shared-C1rWkW_W.js +705 -0
- package/dist/chunks/shared-C6hVLci2.js +574 -0
- package/dist/chunks/shared-CtoQ05tb.js +1 -0
- package/dist/chunks/{shared-DJruxrrR.js → shared-DW3QUBTw.js} +25 -56
- package/dist/chunks/shared-DXoggfKr.js +31 -0
- package/dist/chunks/shared-DbgUhOLb.js +686 -0
- package/dist/chunks/shared-Dj_D4ypT.js +2165 -0
- package/dist/chunks/shared-DuB4veji.js +904 -0
- package/dist/chunks/shared-TrlnHjrJ.js +1 -0
- package/dist/chunks/shared-bW1cft1H.js +2530 -0
- package/dist/chunks/shared-jVZVFFNq.js +602 -0
- package/dist/chunks/shared-xpAS9Ri4.js +6208 -0
- package/dist/chunks/shared-ztEUikTm.js +1 -0
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/views/delegation-poker.js +1 -0
- package/dist/views/plain.js +1 -0
- package/dist/views/prototype.js +1 -0
- package/dist/views/slides.js +1 -0
- package/dist/views/task-board.js +1 -0
- package/dist/views/usm.js +1 -0
- package/package.json +8 -10
- package/dist/chunks/shared-Ae8HmujL.js +0 -49
- package/dist/chunks/shared-B5lBiq5s.js +0 -1
- package/dist/chunks/shared-BCmqTEeQ.js +0 -1051
- package/dist/chunks/shared-BkM7jfZs.js +0 -1104
- package/dist/chunks/shared-Bo8OdTee.js +0 -4206
- package/dist/chunks/shared-C-7mxPbV.js +0 -301
- package/dist/chunks/shared-C-Os1zsf.js +0 -572
- package/dist/chunks/shared-C02b6b2m.js +0 -1
- package/dist/chunks/shared-DLdJfSN-.js +0 -1
- package/dist/chunks/shared-DYKbMmHn.js +0 -610
- package/dist/chunks/shared-DbBoZvUP.js +0 -1609
- package/dist/chunks/shared-DbnPOaXf.js +0 -4210
- package/dist/chunks/shared-DnJBtKmH.js +0 -3769
- package/dist/chunks/shared-v63w_5VP.js +0 -2774
- package/dist/templates/delegation-poker.js +0 -1
- package/dist/templates/event-storming.js +0 -1
- package/dist/templates/example-mapping.js +0 -1
- package/dist/templates/plain.js +0 -1
- package/dist/templates/prototype.js +0 -1
- package/dist/templates/slides.js +0 -1
- package/dist/templates/task-board.js +0 -1
- package/dist/templates/usm.js +0 -1
- package/dist/templates/whiteboard.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as _}from"./shared-Dj_D4ypT.js";import{a5 as N,au as R,av as f,aw as c,aa as v,ac as p,aM as G,ax as Y,ay as I,az as U,S as u,C as k,h as V,aH as x,ai as d,as as l,by as J,aY as W,b4 as Q,y as X,ah as Z,V as w}from"./shared-BQqlFaPv.js";const m=N({en:{wholeDeck:"Whole deck",slideGroup:"Slide",outline:"Slides",previous:"Previous slide",next:"Next slide",position:(t,e)=>`Slide ${t} of ${e}`,commentOnSlide:"Comment on this slide",commentPlaceholder:"A question, or what should change (passed to the agent)",addComment:"Add comment",deleteComment:"Delete this comment",submitHint:"\u2318 / Ctrl + Enter",fullscreen:"Full screen",fullscreenHint:"\u2190 \u2192 to move \xB7 Esc to leave",noSlidesBefore:"There are no slides yet. Add them to ",noSlidesAfter:" in the base data."},ja:{wholeDeck:"\u30C7\u30C3\u30AD\u5168\u4F53",slideGroup:"\u30B9\u30E9\u30A4\u30C9",outline:"\u30B9\u30E9\u30A4\u30C9",previous:"\u524D\u306E\u30B9\u30E9\u30A4\u30C9",next:"\u6B21\u306E\u30B9\u30E9\u30A4\u30C9",position:(t,e)=>`${e} \u679A\u4E2D ${t} \u679A\u76EE`,commentOnSlide:"\u3053\u306E\u30B9\u30E9\u30A4\u30C9\u306B\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"\u8CEA\u554F\u3084\u3001\u5909\u3048\u3066\u307B\u3057\u3044\u3053\u3068\uFF08Agent \u306B\u6E21\u308B\uFF09",addComment:"\u30B3\u30E1\u30F3\u30C8\u3092\u8FFD\u52A0",deleteComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u524A\u9664",submitHint:"\u2318 / Ctrl + Enter",fullscreen:"\u5168\u753B\u9762\u8868\u793A",fullscreenHint:"\u2190 \u2192 \u3067\u79FB\u52D5 \xB7 Esc \u3067\u623B\u308B",noSlidesBefore:"\u30B9\u30E9\u30A4\u30C9\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002base data \u306E ",noSlidesAfter:" \u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}),y=["title","section","content"],ee=f({id:G,layout:c(U(y),"content"),title:Y(p(),I(1)),subtitle:c(p(),""),points:c(v(p()),[])}),$=f({title:c(p(),""),slides:c(v(ee),[])}),S=t=>{const e=R($,t),i=new Set;for(const s of e.slides){if(i.has(s.id))throw new Error(`duplicate slide id: ${s.id}`);i.add(s.id)}return{title:e.title,slides:e.slides}},C=()=>({title:"",slides:[]}),r=(t,e)=>e===void 0?-1:t.slides.findIndex(i=>i.id===e),q=(t,e)=>t.slides[r(t,e)],T=t=>t.title===""?"Slides":t.title,h=(t,e)=>`${e+1}. ${t.title}`,E=(t,e,i)=>{switch(i.type){case"slide":{const s=r(e,i.id),n=e.slides[s];return n===void 0?i.id:h(n,s)}case"page":return t.wholeDeck;default:return i.id}},z=(t,e,i)=>({title:e.type,targetLabel:E(t,i,e.target),tone:"meta"}),A=t=>`${t.type} ${u(t.target)} ${JSON.stringify(t.payload)}`,D=(t,e)=>e.slides.map((i,s)=>({value:u({type:"slide",id:i.id}),label:h(i,s),group:t.slideGroup})),M=(t,e,i)=>{const s=r(e,i.slide),n=e.slides[s];return n===void 0?null:{value:u({type:"slide",id:n.id}),label:h(n,s),group:t.slideGroup}},H=(t,e)=>{const i=t.slides[r(t,e.slide)]??t.slides[0],s={...e};return i?s.slide=i.id:delete s.slide,s},F=(t,e)=>{const i=r(t,e.slide),s=i===-1?0:i,n=t.slides[s];return n===void 0?null:{slide:n,index:s,total:t.slides.length,previous:t.slides[s-1],next:t.slides[s+1]}},te=(t,e)=>t.filter(i=>i.type===k&&i.target.type==="slide"&&i.target.id===e).map(i=>({id:i.id,body:V(i)})).filter(i=>i.body!==""),L=(t,e)=>{switch(e.type){case"slide":return q(t,e.id)!==void 0;case"page":return!0;default:return!1}},O=t=>{const e=m(t);return{kind:"view",name:"slides",label:"Slides",addable:!1,parseBase:S,emptyBase:C,actions:{},apply:()=>null,hasTarget:L,describe:(i,s)=>z(e,i,s),serialize:A,resolveNavigation:H,navigationFor:(i,s)=>s.type==="slide"?{slide:s.id}:null,commentTargets:i=>D(e,i),currentTarget:(i,s)=>M(e,i,s),title:T}},ie={ArrowRight:"next",PageDown:"next",ArrowLeft:"previous",PageUp:"previous",Home:"first",End:"last"},P=t=>t.altKey===!0||t.ctrlKey===!0||t.metaKey===!0||t.shiftKey===!0?null:ie[t.key]??null,j=(t,e,i)=>{const s=t.slides.length-1;if(s<0)return;const n=Math.max(r(t,e),0),o={next:Math.min(n+1,s),previous:Math.max(n-1,0),first:0,last:s}[i];return t.slides[o]?.id},se=(t,e)=>{const{state:i,navigation:s}=t,n=s.slide;return l`
|
|
2
2
|
<nav class="outline" aria-label=${e.outline}>
|
|
3
3
|
<div class="outline-head">
|
|
4
4
|
<span class="dpk-label">${e.outline}</span>
|
|
5
5
|
<span class="dpk-label">${i.slides.length}</span>
|
|
6
6
|
</div>
|
|
7
|
-
<ol class="outline-list">
|
|
7
|
+
<ol class="dpk-navlist outline-list">
|
|
8
8
|
${x(i.slides,o=>o.id,(o,a)=>{const g=o.id===n,b=t.commentCount({type:"slide",id:o.id});return l`
|
|
9
9
|
<li class="outline-row" data-current=${String(g)} data-layout=${o.layout}>
|
|
10
10
|
<a href=${t.hashFor({slide:o.id})} aria-current=${g?"page":d}>
|
|
@@ -16,12 +16,12 @@ import{a0 as _,ae as N,af as f,ag as c,ah as k,ai as p,aG as G,ak as R,al as Y,a
|
|
|
16
16
|
`})}
|
|
17
17
|
</ol>
|
|
18
18
|
</nav>
|
|
19
|
-
`},
|
|
20
|
-
<p class="deck-empty">${e.noSlidesBefore}<code>slides</code>${e.noSlidesAfter}</p>
|
|
19
|
+
`},ne=(t,e,i)=>{const s=F(t.state,t.navigation);if(s===null)return l`<div class="deck">
|
|
20
|
+
<p class="dpk-empty deck-empty">${e.noSlidesBefore}<code>slides</code>${e.noSlidesAfter}</p>
|
|
21
21
|
</div>`;const{slide:n,index:o,total:a}=s;return l`
|
|
22
22
|
<div class="deck">
|
|
23
|
-
<div class="stage">${
|
|
24
|
-
<div class="deck-bar">
|
|
23
|
+
<div class="stage">${ae(n,o)}</div>
|
|
24
|
+
<div class="dpk-toolbar deck-bar">
|
|
25
25
|
<div class="deck-move">
|
|
26
26
|
<button
|
|
27
27
|
class="dpk-icon-btn deck-prev"
|
|
@@ -44,7 +44,7 @@ import{a0 as _,ae as N,af as f,ag as c,ah as k,ai as p,aG as G,ak as R,al as Y,a
|
|
|
44
44
|
?disabled=${s.next===void 0}
|
|
45
45
|
@click=${()=>i.onStep("next")}
|
|
46
46
|
>
|
|
47
|
-
${
|
|
47
|
+
${W()}
|
|
48
48
|
</button>
|
|
49
49
|
</div>
|
|
50
50
|
<div class="deck-progress" aria-hidden="true">
|
|
@@ -56,13 +56,13 @@ import{a0 as _,ae as N,af as f,ag as c,ah as k,ai as p,aG as G,ak as R,al as Y,a
|
|
|
56
56
|
title=${e.fullscreenHint}
|
|
57
57
|
@click=${i.onFullscreen}
|
|
58
58
|
>
|
|
59
|
-
${
|
|
59
|
+
${Q()} ${e.fullscreen}
|
|
60
60
|
</button>`:d}
|
|
61
61
|
</div>
|
|
62
|
-
${
|
|
63
|
-
${
|
|
62
|
+
${oe(e,n,te(t.comments,n.id),i)}
|
|
63
|
+
${le(t.state,n.id)}
|
|
64
64
|
</div>
|
|
65
|
-
`},
|
|
65
|
+
`},ae=(t,e)=>l`
|
|
66
66
|
<article
|
|
67
67
|
class="slide"
|
|
68
68
|
data-layout=${t.layout}
|
|
@@ -80,7 +80,7 @@ import{a0 as _,ae as N,af as f,ag as c,ah as k,ai as p,aG as G,ak as R,al as Y,a
|
|
|
80
80
|
</div>
|
|
81
81
|
<span class="slide-number" aria-hidden="true">${e+1}</span>
|
|
82
82
|
</article>
|
|
83
|
-
`,
|
|
83
|
+
`,oe=(t,e,i,s)=>{const n=s.draftFor(e.id),o=n.trim()!=="";return l`
|
|
84
84
|
<section class="slide-comments" aria-label=${t.commentOnSlide}>
|
|
85
85
|
${i.length===0?d:l`<ul class="slide-comment-list">
|
|
86
86
|
${x(i,a=>a.id,a=>l`<li>
|
|
@@ -92,7 +92,7 @@ import{a0 as _,ae as N,af as f,ag as c,ah as k,ai as p,aG as G,ak as R,al as Y,a
|
|
|
92
92
|
title=${t.deleteComment}
|
|
93
93
|
@click=${()=>s.onDeleteComment(a.id)}
|
|
94
94
|
>
|
|
95
|
-
${
|
|
95
|
+
${X()}
|
|
96
96
|
</button>
|
|
97
97
|
</li>`)}
|
|
98
98
|
</ul>`}
|
|
@@ -118,9 +118,9 @@ import{a0 as _,ae as N,af as f,ag as c,ah as k,ai as p,aG as G,ak as R,al as Y,a
|
|
|
118
118
|
</div>
|
|
119
119
|
</div>
|
|
120
120
|
</section>
|
|
121
|
-
`},
|
|
121
|
+
`},le=(t,e)=>{const i=t.slides.filter(s=>s.id!==e);return i.length===0?d:l`<div class="parked" aria-hidden="true">
|
|
122
122
|
${i.map(s=>l`<slot name=${`preview:${s.id}`}></slot>`)}
|
|
123
|
-
</div>`},
|
|
123
|
+
</div>`},de=Z`
|
|
124
124
|
/* ------------------------------------------------------------ outline */
|
|
125
125
|
|
|
126
126
|
.outline-head {
|
|
@@ -131,50 +131,14 @@ import{a0 as _,ae as N,af as f,ag as c,ah as k,ai as p,aG as G,ak as R,al as Y,a
|
|
|
131
131
|
margin-bottom: 6px;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
.outline-list {
|
|
135
|
-
display: grid;
|
|
136
|
-
gap: 2px;
|
|
137
|
-
margin: 0;
|
|
138
|
-
padding: 0;
|
|
139
|
-
list-style: none;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
134
|
.outline-row {
|
|
143
135
|
position: relative;
|
|
144
136
|
}
|
|
145
137
|
|
|
146
138
|
.outline-row a {
|
|
147
|
-
display: flex;
|
|
148
139
|
align-items: baseline;
|
|
149
140
|
gap: 10px;
|
|
150
141
|
padding: 7px 8px;
|
|
151
|
-
border-radius: var(--dpk-radius-sm);
|
|
152
|
-
color: var(--dpk-ink-soft);
|
|
153
|
-
font-size: 13px;
|
|
154
|
-
line-height: 1.4;
|
|
155
|
-
text-decoration: none;
|
|
156
|
-
transition:
|
|
157
|
-
background 140ms var(--dpk-ease),
|
|
158
|
-
color 140ms var(--dpk-ease),
|
|
159
|
-
box-shadow 140ms var(--dpk-ease);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.outline-row a:hover {
|
|
163
|
-
background: var(--dpk-paper-raised);
|
|
164
|
-
color: var(--dpk-ink);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.outline-row a:focus-visible {
|
|
168
|
-
outline: none;
|
|
169
|
-
box-shadow: var(--dpk-focus);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.outline-row[data-current='true'] a {
|
|
173
|
-
background: color-mix(in srgb, var(--dpk-accent) 8%, var(--dpk-paper-raised));
|
|
174
|
-
color: var(--dpk-ink);
|
|
175
|
-
box-shadow:
|
|
176
|
-
inset 0 0 0 1px color-mix(in srgb, var(--dpk-accent) 20%, transparent),
|
|
177
|
-
var(--dpk-shadow-xs);
|
|
178
142
|
}
|
|
179
143
|
|
|
180
144
|
/* A section slide opens a chapter: it reads as a heading in the outline. */
|
|
@@ -228,8 +192,17 @@ import{a0 as _,ae as N,af as f,ag as c,ah as k,ai as p,aG as G,ak as R,al as Y,a
|
|
|
228
192
|
}
|
|
229
193
|
|
|
230
194
|
.deck-empty {
|
|
195
|
+
display: block;
|
|
196
|
+
max-width: none;
|
|
231
197
|
margin: 48px auto;
|
|
198
|
+
padding: 0;
|
|
199
|
+
border: 0;
|
|
200
|
+
border-radius: 0;
|
|
201
|
+
background: transparent;
|
|
232
202
|
color: var(--dpk-ink-faint);
|
|
203
|
+
font-size: inherit;
|
|
204
|
+
line-height: inherit;
|
|
205
|
+
text-align: start;
|
|
233
206
|
}
|
|
234
207
|
|
|
235
208
|
/*
|
|
@@ -416,10 +389,6 @@ import{a0 as _,ae as N,af as f,ag as c,ah as k,ai as p,aG as G,ak as R,al as Y,a
|
|
|
416
389
|
/* ---------------------------------------------------------------- bar */
|
|
417
390
|
|
|
418
391
|
.deck-bar {
|
|
419
|
-
display: flex;
|
|
420
|
-
flex-wrap: wrap;
|
|
421
|
-
align-items: center;
|
|
422
|
-
gap: 8px 12px;
|
|
423
392
|
width: min(100%, 1180px);
|
|
424
393
|
padding: 8px 12px;
|
|
425
394
|
border: 1px solid var(--dpk-rule);
|
|
@@ -601,4 +570,4 @@ import{a0 as _,ae as N,af as f,ag as c,ah as k,ai as p,aG as G,ak as R,al as Y,a
|
|
|
601
570
|
transition: none;
|
|
602
571
|
}
|
|
603
572
|
}
|
|
604
|
-
`,
|
|
573
|
+
`,re='input, textarea, select, [contenteditable]:not([contenteditable="false"])',ce=t=>t instanceof HTMLElement&&(t.isContentEditable||t.matches(re));class B extends w{static{this.styles=[w.styles,_,de]}#e=new Map;#t={slide:"",count:0};definitionFor(e){return O(e)}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.#n)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.#n)}renderRegions(e){const i=m(this.locale);return{sidebar:se(e,i),sidebarHidden:e.state.slides.length===0,main:ne(e,i,{canFullscreen:document.fullscreenEnabled===!0,draftFor:s=>this.#e.get(s)??"",onStep:s=>this.#i(s),onFullscreen:()=>this.#l(),onDraft:(s,n)=>this.#s(s,n),onComment:s=>this.#o(s),onDeleteComment:s=>this.removeAction(s)})}}updated(){super.updated(),this.#a()}#a(){const e=this.renderRoot.querySelector(".slide-comment-list"),i={slide:this.navigation.slide??"",count:e?.childElementCount??0},s=this.#t;this.#t=i,!(e===null||i.slide===s.slide&&i.count<=s.count)&&(e.scrollTop=e.scrollHeight)}#i(e){const i=j(this.derivation.state,this.navigation.slide,e);i!==void 0&&this.navigate({slide:i})}#s(e,i){const s=new Map(this.#e);i===""?s.delete(e):s.set(e,i),this.#e=s,this.requestUpdate()}#o(e){const i=(this.#e.get(e)??"").trim();if(i==="")return;this.dispatch({type:k,target:{type:"slide",id:e},payload:{body:i}}).ok&&this.#s(e,"")}#l(){const e=this.renderRoot.querySelector(".stage");!(e instanceof HTMLElement)||document.fullscreenElement!==null||e.requestFullscreen().catch(()=>{})}#n=e=>{if(e.defaultPrevented||this.hidden)return;const i=P(e);i===null||e.composedPath().some(ce)||(e.preventDefault(),this.#i(i))}}const K=()=>{customElements.get("dpk-view-slides")||customElements.define("dpk-view-slides",B)},pe=Object.freeze(Object.defineProperty({__proto__:null,DpkViewSlides:B,SLIDE_LAYOUTS:y,defineSlidesElement:K,describeSlidesAction:z,emptySlidesBase:C,findSlide:q,findSlideIndex:r,parseSlidesBase:S,resolveSlidesNavigation:H,serializeSlidesAction:A,slideKeyStep:P,slidePosition:F,slidesBaseSchema:$,slidesCommentTargets:D,slidesCurrentTarget:M,slidesDefinitionFor:O,slidesHasTarget:L,slidesMessages:m,slidesTargetLabel:E,slidesTitle:T,stepSlide:j},Symbol.toStringTag,{value:"Module"}));export{K as d,pe as i};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import{a5 as d,au as p,av as a,aw as f,ac as l,aa as b,ax as o,ay as n,ak as v,X as k,j as m,ah as g,al as y,aF as q,as as r}from"./shared-BQqlFaPv.js";import{o as C}from"./shared-TrlnHjrJ.js";const h=d({en:{fallbackLabel:"Select",required:"Choose one."},ja:{fallbackLabel:"\u9078\u629E",required:"\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}),S=a({value:o(l(),n(1)),label:o(l(),n(1))}),w=a({options:b(S),value:f(l())}),c=i=>{const e=p(w,i),t=new Set;for(const s of e.options){if(t.has(s.value))throw new Error(`duplicate option value: ${s.value}`);t.add(s.value)}return{options:e.options,value:e.value??null}};class u extends v{static{this.formAssociated=!0}static{this.styles=[k,m,g`
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.field {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 6px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.field-label {
|
|
13
|
+
font-size: 11.5px;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
color: var(--dpk-ink-soft);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([block]) .dpk-rich-select {
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.error {
|
|
23
|
+
color: var(--dpk-danger);
|
|
24
|
+
font-size: 12px;
|
|
25
|
+
}
|
|
26
|
+
`]}static{this.properties={label:{type:String},placeholder:{type:String},name:{type:String,reflect:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},block:{type:Boolean,reflect:!0}}}#n=new y(this);#h=new q(this);#l=typeof this.attachInternals=="function"?this.attachInternals():null;#i=null;#a=[];#o=null;#e="";#r="";#t=null;constructor(){super(),this.label=null,this.placeholder=null,this.name=null,this.required=!1,this.disabled=!1,this.block=!1}connectedCallback(){super.connectedCallback(),this.#i=C(this,c,e=>{this.#o===null&&(e.ok?(this.#a=e.value.options,this.#t=null,e.value.value!==null&&(this.#e=e.value.value,this.#r=e.value.value)):(this.#a=[],this.#t=e.error),this.#s(),this.requestUpdate())})}disconnectedCallback(){super.disconnectedCallback(),this.#i?.(),this.#i=null}updated(){this.#c()}get value(){return this.#e}set value(e){const t=e??"";t!==this.#e&&(this.#e=t,this.#s(),this.requestUpdate())}get options(){return this.#o??this.#a}set options(e){this.#o=e??null,this.#t=null,this.requestUpdate()}get form(){return this.#l?.form??null}formResetCallback(){this.#e=this.#r,this.#s(),this.requestUpdate()}formStateRestoreCallback(e,t){typeof e=="string"&&(this.#e=e,this.#s(),this.requestUpdate())}#s(){this.#l?.setFormValue?.(this.#e===""?null:this.#e)}#c(){if(this.required&&this.#e===""){const e=this.renderRoot.querySelector(".dpk-rich-select")??void 0;this.#l?.setValidity?.({valueMissing:!0},h(this.#n.locale).required,e)}else this.#l?.setValidity?.({})}render(){if(this.#t!==null)return r`<p class="error">${this.#t}</p>`;const e=this.getAttribute("aria-label")??this.label??h(this.#n.locale).fallbackLabel,t=this.#h.render({options:this.options,value:this.#e,onChange:s=>this.#u(s),ariaLabel:e,placeholder:this.placeholder??void 0,disabled:this.disabled});return this.label===null?t:r`
|
|
27
|
+
<div class="field">
|
|
28
|
+
<span class="field-label">${this.label}</span>
|
|
29
|
+
${t}
|
|
30
|
+
</div>
|
|
31
|
+
`}#u(e){e!==this.#e&&(this.#e=e,this.#s(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-select-change",{detail:{value:e},bubbles:!0,composed:!0})))}}const x=()=>{customElements.get("dpk-select")||customElements.define("dpk-select",u)};export{u as D,x as d,c as p};
|