blue-web 1.21.1 → 1.21.7

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.
Files changed (73) hide show
  1. package/LICENSE +164 -164
  2. package/README.md +74 -74
  3. package/dist/js/actions.d.ts +6 -6
  4. package/dist/js/color-mode.d.ts +4 -4
  5. package/dist/js/dialog.d.ts +18 -18
  6. package/dist/js/edit-view.d.ts +14 -14
  7. package/dist/js/edit-view.js +2 -2
  8. package/dist/js/input-splitted.d.ts +19 -19
  9. package/dist/js/odometer.d.ts +30 -30
  10. package/dist/js/odometer.js +8 -8
  11. package/dist/js/progress.d.ts +2 -2
  12. package/dist/js/read-view.d.ts +35 -35
  13. package/dist/js/read-view.js +18 -18
  14. package/dist/js/select-list.d.ts +46 -46
  15. package/dist/js/select-list.js +17 -17
  16. package/dist/js/shared.d.ts +14 -14
  17. package/dist/js/side-layout.d.ts +7 -7
  18. package/dist/js/utils.d.ts +18 -18
  19. package/dist/js/utils.js +6 -6
  20. package/dist/merged.scss +2170 -2170
  21. package/dist/neu.scss +92 -92
  22. package/dist/style.css +1 -1
  23. package/dist/style.min.css +1 -1
  24. package/dist/style.scss +62 -62
  25. package/dist/styles/_action-menu.scss +57 -57
  26. package/dist/styles/_actions.scss +37 -37
  27. package/dist/styles/_anchor.scss +42 -42
  28. package/dist/styles/_bootstrap-mixins_overwritten.scss +106 -106
  29. package/dist/styles/_bootstrap-variables.scss +46 -46
  30. package/dist/styles/_bootstrap.scss +64 -64
  31. package/dist/styles/_button-icon-wrapper.scss +28 -28
  32. package/dist/styles/_buttons.scss +120 -120
  33. package/dist/styles/_collapse.scss +72 -72
  34. package/dist/styles/_container-grid.scss +52 -52
  35. package/dist/styles/_devexpress.scss +104 -104
  36. package/dist/styles/_general.scss +55 -55
  37. package/dist/styles/_hover.scss +37 -37
  38. package/dist/styles/_input-group.scss +29 -29
  39. package/dist/styles/_inter.scss +19 -19
  40. package/dist/styles/_intro.scss +22 -22
  41. package/dist/styles/_keyframes.scss +73 -73
  42. package/dist/styles/_layout.scss +175 -175
  43. package/dist/styles/_menu-item.scss +86 -86
  44. package/dist/styles/_mixins.scss +6 -6
  45. package/dist/styles/_modal.scss +118 -118
  46. package/dist/styles/_page-header.scss +14 -14
  47. package/dist/styles/_scrollspy.scss +78 -78
  48. package/dist/styles/_status.scss +131 -131
  49. package/dist/styles/_text-icons.scss +15 -15
  50. package/dist/styles/_tooltips.scss +150 -150
  51. package/dist/styles/_utils.scss +20 -20
  52. package/dist/styles/_variables.scss +128 -128
  53. package/dist/styles/mixins/_action-menu.scss +64 -64
  54. package/dist/styles/mixins/_custom-property.scss +10 -10
  55. package/dist/styles/mixins/_menu-item.scss +136 -136
  56. package/dist/styles/mixins/_misc.scss +7 -7
  57. package/dist/styles/mixins/_scroll-shadow.scss +9 -9
  58. package/dist/styles/mixins/_switch.scss +91 -91
  59. package/package.json +87 -88
  60. package/dist/container-grid.css +0 -196
  61. package/dist/js/auto-theme.bundle.js +0 -1
  62. package/dist/js/auto-theme.d.ts +0 -26
  63. package/dist/js/auto-theme.js +0 -169
  64. package/dist/js/button.bundle.js +0 -1
  65. package/dist/js/button.d.ts +0 -6
  66. package/dist/js/button.js +0 -16
  67. package/dist/js/dialog.bundle.js.LICENSE.txt +0 -5
  68. package/dist/js/dxf-viewer.js +0 -129
  69. package/dist/js/searchbox.bundle.js +0 -2
  70. package/dist/js/searchbox.bundle.js.LICENSE.txt +0 -11
  71. package/dist/js/searchbox.d.ts +0 -16
  72. package/dist/js/searchbox.js +0 -158
  73. package/dist/tailwind-main.css +0 -737
@@ -1,129 +0,0 @@
1
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { DxfViewer as DxfViewerLib } from "dxf-viewer";
5
- export class DxfViewer extends HTMLElement {
6
- constructor() {
7
- super(...arguments);
8
- _defineProperty(this, "viewer", null);
9
- _defineProperty(this, "container", null);
10
- _defineProperty(this, "resizeObserver", null);
11
- _defineProperty(this, "THREE", null);
12
- }
13
- static get observedAttributes() {
14
- return ["src", "clear-color", "auto-resize"];
15
- }
16
- async connectedCallback() {
17
- if (!this.THREE) {
18
- this.THREE = await import("three");
19
- }
20
- this.render();
21
- this.loadDxf();
22
- }
23
- disconnectedCallback() {
24
- this.cleanup();
25
- }
26
- attributeChangedCallback(name, oldValue, newValue) {
27
- if (oldValue === newValue) return;
28
- if (name === "src") {
29
- this.loadDxf();
30
- }
31
- }
32
- render() {
33
- this.container = document.createElement("div");
34
- this.container.style.width = "100%";
35
- this.container.style.height = "100%";
36
- this.container.style.minHeight = "400px";
37
- this.appendChild(this.container);
38
- if (this.getAttribute("auto-resize") !== "false") {
39
- this.resizeObserver = new ResizeObserver(() => {
40
- if (this.viewer && this.container) {
41
- this.viewer.SetSize(this.container.clientWidth, this.container.clientHeight);
42
- }
43
- });
44
- this.resizeObserver.observe(this.container);
45
- }
46
- }
47
- async loadDxf() {
48
- if (!this.container) return;
49
- const src = this.getAttribute("src");
50
- if (!src) return;
51
- try {
52
- if (this.viewer) {
53
- this.viewer.Destroy();
54
- this.viewer = null;
55
- }
56
- this.container.innerHTML = "";
57
- this.viewer = new DxfViewerLib(this.container, {
58
- clearColor: this.parseClearColor(this.getAttribute("clear-color") || "#ffffff"),
59
- autoResize: this.getAttribute("auto-resize") !== "false",
60
- sceneOptions: {
61
- wireframeMesh: this.getAttribute("wireframe") === "true"
62
- }
63
- });
64
- const fontsAttr = this.getAttribute("fonts");
65
- const fonts = fontsAttr ? fontsAttr.split(",").map(f => f.trim()) : null;
66
- await this.viewer.Load({
67
- url: src,
68
- fonts: fonts
69
- });
70
- this.viewer.Subscribe("loaded", () => {
71
- this.dispatchEvent(new CustomEvent("dxf-loaded", {
72
- detail: {
73
- viewer: this.viewer
74
- }
75
- }));
76
- });
77
- this.viewer.Subscribe("message", event => {
78
- console.log("DXF Viewer message:", event.message);
79
- });
80
- } catch (error) {
81
- console.error("Error loading DXF file:", error);
82
- this.dispatchEvent(new CustomEvent("dxf-error", {
83
- detail: {
84
- error
85
- }
86
- }));
87
- }
88
- }
89
- parseClearColor(color) {
90
- if (!this.THREE) return null;
91
- if (!color) return new this.THREE.Color(0xffffff);
92
- return new this.THREE.Color(color);
93
- }
94
- cleanup() {
95
- if (this.resizeObserver) {
96
- this.resizeObserver.disconnect();
97
- this.resizeObserver = null;
98
- }
99
- if (this.viewer) {
100
- this.viewer.Destroy();
101
- this.viewer = null;
102
- }
103
- }
104
- getViewer() {
105
- return this.viewer;
106
- }
107
- async reload() {
108
- await this.loadDxf();
109
- }
110
- showLayer(name, show) {
111
- if (this.viewer) {
112
- this.viewer.ShowLayer(name, show);
113
- }
114
- }
115
- fitView(minX, maxX, minY, maxY) {
116
- let padding = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
117
- if (this.viewer) {
118
- this.viewer.FitView(minX, maxX, minY, maxY, padding);
119
- }
120
- }
121
- getLayers() {
122
- return this.viewer ? Array.from(this.viewer.GetLayers()) : [];
123
- }
124
- getBounds() {
125
- var _this$viewer;
126
- return ((_this$viewer = this.viewer) === null || _this$viewer === void 0 ? void 0 : _this$viewer.GetBounds()) || null;
127
- }
128
- }
129
- customElements.define("dxf-viewer", DxfViewer);
@@ -1,2 +0,0 @@
1
- /*! For license information please see searchbox.bundle.js.LICENSE.txt */
2
- (()=>{"use strict";const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),r=new WeakMap;class s{constructor(t,e,r){if(this._$cssResult$=!0,r!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const i=this.t;if(e&&void 0===t){const e=void 0!==i&&1===i.length;e&&(t=r.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&r.set(i,t))}return t}toString(){return this.cssText}}const n=(i,r)=>{if(e)i.adoptedStyleSheets=r.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of r){const r=document.createElement("style"),s=t.litNonce;void 0!==s&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},o=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,i))(e)})(t):t,{is:a,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:d,getPrototypeOf:p}=Object,u=globalThis,f=u.trustedTypes,m=f?f.emptyScript:"",y=u.reactiveElementPolyfillSupport,v=(t,e)=>t,$={toAttribute(t,e){switch(e){case Boolean:t=t?m:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},g=(t,e)=>!a(t,e),_={attribute:!0,type:String,converter:$,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;class A extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=_){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);void 0!==r&&l(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:s}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:r,set(e){const n=r?.call(this);s?.call(this,e),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const t=p(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const t=this.properties,e=[...h(t),...d(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return n(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:$).toAttribute(e,i.type);this._$Em=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(t,e){const i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=i.getPropertyOptions(r),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:$;this._$Em=r;const n=s.fromAttribute(e,t.type);this[r]=n??this._$Ej?.get(r)??n,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const r=this.constructor,s=this[t];if(i??=r.getPropertyOptions(t),!((i.hasChanged??g)(s,e)||i.useDefault&&i.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:s},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),!0!==s||void 0!==n)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===r&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,r=this[e];!0!==t||this._$AL.has(e)||void 0===r||this.C(e,void 0,i,r)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[v("elementProperties")]=new Map,A[v("finalized")]=new Map,y?.({ReactiveElement:A}),(u.reactiveElementVersions??=[]).push("2.1.1");const b=globalThis,E=b.trustedTypes,w=E?E.createPolicy("lit-html",{createHTML:t=>t}):void 0,k="$lit$",x=`lit$${Math.random().toFixed(9).slice(2)}$`,S="?"+x,C=`<${S}>`,P=document,O=()=>P.createComment(""),T=t=>null===t||"object"!=typeof t&&"function"!=typeof t,U=Array.isArray,D="[ \t\n\f\r]",M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,H=/>/g,I=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),N=/'/g,z=/"/g,j=/^(?:script|style|textarea|title)$/i,L=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),q=L(1),B=(L(2),L(3),Symbol.for("lit-noChange")),F=Symbol.for("lit-nothing"),W=new WeakMap,V=P.createTreeWalker(P,129);function K(t,e){if(!U(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==w?w.createHTML(e):e}const J=(t,e)=>{const i=t.length-1,r=[];let s,n=2===e?"<svg>":3===e?"<math>":"",o=M;for(let e=0;e<i;e++){const i=t[e];let a,l,c=-1,h=0;for(;h<i.length&&(o.lastIndex=h,l=o.exec(i),null!==l);)h=o.lastIndex,o===M?"!--"===l[1]?o=R:void 0!==l[1]?o=H:void 0!==l[2]?(j.test(l[2])&&(s=RegExp("</"+l[2],"g")),o=I):void 0!==l[3]&&(o=I):o===I?">"===l[0]?(o=s??M,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?I:'"'===l[3]?z:N):o===z||o===N?o=I:o===R||o===H?o=M:(o=I,s=void 0);const d=o===I&&t[e+1].startsWith("/>")?" ":"";n+=o===M?i+C:c>=0?(r.push(a),i.slice(0,c)+k+i.slice(c)+x+d):i+x+(-2===c?e:d)}return[K(t,n+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]};class Z{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let s=0,n=0;const o=t.length-1,a=this.parts,[l,c]=J(t,e);if(this.el=Z.createElement(l,i),V.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=V.nextNode())&&a.length<o;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(k)){const e=c[n++],i=r.getAttribute(t).split(x),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:o[2],strings:i,ctor:"."===o[1]?tt:"?"===o[1]?et:"@"===o[1]?it:Y}),r.removeAttribute(t)}else t.startsWith(x)&&(a.push({type:6,index:s}),r.removeAttribute(t));if(j.test(r.tagName)){const t=r.textContent.split(x),e=t.length-1;if(e>0){r.textContent=E?E.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],O()),V.nextNode(),a.push({type:2,index:++s});r.append(t[e],O())}}}else if(8===r.nodeType)if(r.data===S)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=r.data.indexOf(x,t+1));)a.push({type:7,index:s}),t+=x.length-1}s++}}static createElement(t,e){const i=P.createElement("template");return i.innerHTML=t,i}}function G(t,e,i=t,r){if(e===B)return e;let s=void 0!==r?i._$Co?.[r]:i._$Cl;const n=T(e)?void 0:e._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),void 0===n?s=void 0:(s=new n(t),s._$AT(t,i,r)),void 0!==r?(i._$Co??=[])[r]=s:i._$Cl=s),void 0!==s&&(e=G(t,s._$AS(t,e.values),s,r)),e}class Q{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??P).importNode(e,!0);V.currentNode=r;let s=V.nextNode(),n=0,o=0,a=i[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new X(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new rt(s,this,t)),this._$AV.push(e),a=i[++o]}n!==a?.index&&(s=V.nextNode(),n++)}return V.currentNode=P,r}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class X{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=F,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=G(this,t,e),T(t)?t===F||null==t||""===t?(this._$AH!==F&&this._$AR(),this._$AH=F):t!==this._$AH&&t!==B&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>U(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==F&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Z.createElement(K(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new Q(r,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=W.get(t.strings);return void 0===e&&W.set(t.strings,e=new Z(t)),e}k(t){U(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const s of t)r===e.length?e.push(i=new X(this.O(O()),this.O(O()),this,this.options)):i=e[r],i._$AI(s),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class Y{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,s){this.type=1,this._$AH=F,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=F}_$AI(t,e=this,i,r){const s=this.strings;let n=!1;if(void 0===s)t=G(this,t,e,0),n=!T(t)||t!==this._$AH&&t!==B,n&&(this._$AH=t);else{const r=t;let o,a;for(t=s[0],o=0;o<s.length-1;o++)a=G(this,r[i+o],e,o),a===B&&(a=this._$AH[o]),n||=!T(a)||a!==this._$AH[o],a===F?t=F:t!==F&&(t+=(a??"")+s[o+1]),this._$AH[o]=a}n&&!r&&this.j(t)}j(t){t===F?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class tt extends Y{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===F?void 0:t}}class et extends Y{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==F)}}class it extends Y{constructor(t,e,i,r,s){super(t,e,i,r,s),this.type=5}_$AI(t,e=this){if((t=G(this,t,e,0)??F)===B)return;const i=this._$AH,r=t===F&&i!==F||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==F&&(i===F||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class rt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){G(this,t)}}const st=b.litHtmlPolyfillSupport;st?.(Z,X),(b.litHtmlVersions??=[]).push("3.3.1");const nt=globalThis;class ot extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const r=i?.renderBefore??e;let s=r._$litPart$;if(void 0===s){const t=i?.renderBefore??null;r._$litPart$=s=new X(e.insertBefore(O(),t),t,void 0,i??{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return B}}ot._$litElement$=!0,ot.finalized=!0,nt.litElementHydrateSupport?.({LitElement:ot});const at=nt.litElementPolyfillSupport;at?.({LitElement:ot}),(nt.litElementVersions??=[]).push("4.2.1");const lt={attribute:!0,type:String,converter:$,reflect:!1,hasChanged:g},ct=(t=lt,e,i)=>{const{kind:r,metadata:s}=i;let n=globalThis.litPropertyMetadata.get(s);if(void 0===n&&globalThis.litPropertyMetadata.set(s,n=new Map),"setter"===r&&((t=Object.create(t)).wrapped=!0),n.set(i.name,t),"accessor"===r){const{name:r}=i;return{set(i){const s=e.get.call(this);e.set.call(this,i),this.requestUpdate(r,s,t)},init(e){return void 0!==e&&this.C(r,void 0,t,e),e}}}if("setter"===r){const{name:r}=i;return function(i){const s=this[r];e.call(this,i),this.requestUpdate(r,s,t)}}throw Error("Unsupported decorator location: "+r)};function ht(t){return(e,i)=>"object"==typeof i?ct(t,e,i):((t,e,i)=>{const r=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),r?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function dt(t){return ht({...t,state:!0,attribute:!1})}var pt,ut,ft,mt;function yt(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function vt(){vt=function(){return t};var t={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(t,e){["method","field"].forEach(function(i){e.forEach(function(e){e.kind===i&&"own"===e.placement&&this.defineClassElement(t,e)},this)},this)},initializeClassElements:function(t,e){var i=t.prototype;["method","field"].forEach(function(r){e.forEach(function(e){var s=e.placement;if(e.kind===r&&("static"===s||"prototype"===s)){var n="static"===s?t:i;this.defineClassElement(n,e)}},this)},this)},defineClassElement:function(t,e){var i=e.descriptor;if("field"===e.kind){var r=e.initializer;i={enumerable:i.enumerable,writable:i.writable,configurable:i.configurable,value:void 0===r?void 0:r.call(t)}}Object.defineProperty(t,e.key,i)},decorateClass:function(t,e){var i=[],r=[],s={static:[],prototype:[],own:[]};if(t.forEach(function(t){this.addElementPlacement(t,s)},this),t.forEach(function(t){if(!_t(t))return i.push(t);var e=this.decorateElement(t,s);i.push(e.element),i.push.apply(i,e.extras),r.push.apply(r,e.finishers)},this),!e)return{elements:i,finishers:r};var n=this.decorateConstructor(i,e);return r.push.apply(r,n.finishers),n.finishers=r,n},addElementPlacement:function(t,e,i){var r=e[t.placement];if(!i&&-1!==r.indexOf(t.key))throw new TypeError("Duplicated element ("+t.key+")");r.push(t.key)},decorateElement:function(t,e){for(var i=[],r=[],s=t.decorators,n=s.length-1;n>=0;n--){var o=e[t.placement];o.splice(o.indexOf(t.key),1);var a=this.fromElementDescriptor(t),l=this.toElementFinisherExtras((0,s[n])(a)||a);t=l.element,this.addElementPlacement(t,e),l.finisher&&r.push(l.finisher);var c=l.extras;if(c){for(var h=0;h<c.length;h++)this.addElementPlacement(c[h],e);i.push.apply(i,c)}}return{element:t,finishers:r,extras:i}},decorateConstructor:function(t,e){for(var i=[],r=e.length-1;r>=0;r--){var s=this.fromClassDescriptor(t),n=this.toClassDescriptor((0,e[r])(s)||s);if(void 0!==n.finisher&&i.push(n.finisher),void 0!==n.elements){t=n.elements;for(var o=0;o<t.length-1;o++)for(var a=o+1;a<t.length;a++)if(t[o].key===t[a].key&&t[o].placement===t[a].placement)throw new TypeError("Duplicated element ("+t[o].key+")")}}return{elements:t,finishers:i}},fromElementDescriptor:function(t){var e={kind:t.kind,key:t.key,placement:t.placement,descriptor:t.descriptor};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===t.kind&&(e.initializer=t.initializer),e},toElementDescriptors:function(t){if(void 0!==t)return(e=t,function(t){if(Array.isArray(t))return t}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return wt(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?wt(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(t){var e=this.toElementDescriptor(t);return this.disallowProperty(t,"finisher","An element descriptor"),this.disallowProperty(t,"extras","An element descriptor"),e},this);var e},toElementDescriptor:function(t){var e=t.kind+"";if("method"!==e&&"field"!==e)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+e+'"');var i=Et(t.key),r=t.placement+"";if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var s=t.descriptor;this.disallowProperty(t,"elements","An element descriptor");var n={kind:e,key:i,placement:r,descriptor:Object.assign({},s)};return"field"!==e?this.disallowProperty(t,"initializer","A method descriptor"):(this.disallowProperty(s,"get","The property descriptor of a field descriptor"),this.disallowProperty(s,"set","The property descriptor of a field descriptor"),this.disallowProperty(s,"value","The property descriptor of a field descriptor"),n.initializer=t.initializer),n},toElementFinisherExtras:function(t){return{element:this.toElementDescriptor(t),finisher:bt(t,"finisher"),extras:this.toElementDescriptors(t.extras)}},fromClassDescriptor:function(t){var e={kind:"class",elements:t.map(this.fromElementDescriptor,this)};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),e},toClassDescriptor:function(t){var e=t.kind+"";if("class"!==e)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+e+'"');this.disallowProperty(t,"key","A class descriptor"),this.disallowProperty(t,"placement","A class descriptor"),this.disallowProperty(t,"descriptor","A class descriptor"),this.disallowProperty(t,"initializer","A class descriptor"),this.disallowProperty(t,"extras","A class descriptor");var i=bt(t,"finisher");return{elements:this.toElementDescriptors(t.elements),finisher:i}},runClassFinishers:function(t,e){for(var i=0;i<e.length;i++){var r=(0,e[i])(t);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");t=r}}return t},disallowProperty:function(t,e,i){if(void 0!==t[e])throw new TypeError(i+" can't have a ."+e+" property.")}};return t}function $t(t){var e,i=Et(t.key);"method"===t.kind?e={value:t.value,writable:!0,configurable:!0,enumerable:!1}:"get"===t.kind?e={get:t.value,configurable:!0,enumerable:!1}:"set"===t.kind?e={set:t.value,configurable:!0,enumerable:!1}:"field"===t.kind&&(e={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===t.kind?"field":"method",key:i,placement:t.static?"static":"field"===t.kind?"own":"prototype",descriptor:e};return t.decorators&&(r.decorators=t.decorators),"field"===t.kind&&(r.initializer=t.value),r}function gt(t,e){void 0!==t.descriptor.get?e.descriptor.get=t.descriptor.get:e.descriptor.set=t.descriptor.set}function _t(t){return t.decorators&&t.decorators.length}function At(t){return void 0!==t&&!(void 0===t.value&&void 0===t.writable)}function bt(t,e){var i=t[e];if(void 0!==i&&"function"!=typeof i)throw new TypeError("Expected '"+e+"' to be a function");return i}function Et(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}function wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}!function(t,e,i){var r=vt(),s=e(function(t){r.initializeInstanceElements(t,n.elements)},i),n=r.decorateClass(function(t){for(var e=[],i=function(t){return"method"===t.kind&&t.key===n.key&&t.placement===n.placement},r=0;r<t.length;r++){var s,n=t[r];if("method"===n.kind&&(s=e.find(i)))if(At(n.descriptor)||At(s.descriptor)){if(_t(n)||_t(s))throw new ReferenceError("Duplicated methods ("+n.key+") can't be decorated.");s.descriptor=n.descriptor}else{if(_t(n)){if(_t(s))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+n.key+").");s.decorators=n.decorators}gt(n,s)}else e.push(n)}return e}(s.d.map($t)),t);r.initializeClassElements(s.F,n.elements),r.runClassFinishers(s.F,n.finishers)}([(t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("blue-searchbox")],function(t,e){return{F:class extends e{constructor(){super(...arguments),t(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>((t,...e)=>{const r=1===t.length?t[0]:e.reduce((e,i,r)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]);return new s(r,t,i)})(pt||(pt=yt(['\n :host {\n display: block;\n position: relative;\n max-width: 400px;\n font-family: system-ui, sans-serif;\n }\n\n .search-container {\n position: relative;\n }\n\n input {\n width: 100%;\n padding: 0.5rem 0.75rem;\n border: 1px solid #ccc;\n border-radius: 0.375rem;\n font-size: 1rem;\n }\n\n .results {\n background: white;\n border: 1px solid #ccc;\n border-radius: 0.375rem;\n margin-top: 0.25rem;\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0.5rem;\n padding: 0.5rem;\n box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);\n z-index: 10;\n }\n\n .group {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n .group-title {\n font-weight: 600;\n font-size: 0.875rem;\n margin-bottom: 0.25rem;\n }\n\n [role="option"] {\n padding: 0.25rem 0.5rem;\n border-radius: 0.25rem;\n cursor: pointer;\n }\n\n [role="option"].active,\n [role="option"]:hover {\n background: #e8f0fe;\n outline: none;\n }\n '])))},{kind:"field",decorators:[ht({type:Array})],key:"people",value:()=>["Alice","Bob","Charlie"]},{kind:"field",decorators:[ht({type:Array})],key:"documents",value:()=>["Spec.docx","Roadmap.pdf","Meeting Notes.txt"]},{kind:"field",decorators:[dt()],key:"query",value:()=>""},{kind:"field",decorators:[dt()],key:"activeIndex",value:()=>-1},{kind:"field",decorators:[dt()],key:"expanded",value:()=>!1},{kind:"field",decorators:[dt()],key:"results",value:()=>[]},{kind:"method",key:"render",value:function(){return q(ut||(ut=yt(['\n <div\n class="search-container"\n role="combobox"\n aria-haspopup="listbox"\n aria-expanded=','\n aria-owns="results-list"\n >\n <input\n type="text"\n placeholder="Search..."\n .value=',"\n @input=","\n @keydown=",'\n aria-controls="results-list"\n aria-activedescendant=','\n aria-autocomplete="list"\n />\n\n ',"\n </div>\n "])),this.expanded,this.query,this.onInput,this.onKeyDown,this.activeIndex>=0?"opt-"+this.activeIndex:"",this.expanded?q(ft||(ft=yt(['\n <div class="results" id="results-list" role="listbox">\n <div class="group">\n <div class="group-title">People</div>\n ','\n </div>\n <div class="group">\n <div class="group-title">Documents</div>\n ',"\n </div>\n </div>\n "])),this.people.filter(t=>t.toLowerCase().includes(this.query.toLowerCase())).map(t=>this.renderOption(t,"People")),this.documents.filter(t=>t.toLowerCase().includes(this.query.toLowerCase())).map(t=>this.renderOption(t,"Documents"))):null)}},{kind:"method",key:"renderOption",value:function(t,e){const i=this.results.findIndex(i=>i.label===t&&i.group===e),r=i===this.activeIndex;return q(mt||(mt=yt(['\n <div\n role="option"\n id="opt-','"\n class=',"\n @click=","\n >\n ","\n </div>\n "])),i,r?"active":"",()=>this.selectOption(i),t)}},{kind:"method",key:"onInput",value:function(t){const e=t.target.value;this.query=e,this.updateResults(),this.expanded=this.results.length>0,this.activeIndex=-1}},{kind:"method",key:"updateResults",value:function(){const t=this.query.toLowerCase();this.results=[...this.people.filter(e=>e.toLowerCase().includes(t)).map(t=>({group:"People",label:t})),...this.documents.filter(e=>e.toLowerCase().includes(t)).map(t=>({group:"Documents",label:t}))]}},{kind:"method",key:"onKeyDown",value:function(t){if(!this.expanded&&"ArrowDown"===t.key)return this.expanded=!0,void this.updateResults();"ArrowDown"===t.key?(t.preventDefault(),this.activeIndex=(this.activeIndex+1)%this.results.length,this.requestUpdate()):"ArrowUp"===t.key?(t.preventDefault(),this.activeIndex=(this.activeIndex-1+this.results.length)%this.results.length,this.requestUpdate()):"Enter"===t.key&&this.activeIndex>=0?this.selectOption(this.activeIndex):"Escape"===t.key&&(this.expanded=!1)}},{kind:"method",key:"selectOption",value:function(t){const e=this.results[t];e&&(this.query=e.label,this.expanded=!1,this.activeIndex=-1,this.dispatchEvent(new CustomEvent("select",{detail:e})))}}]}},ot)})();
@@ -1,11 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
-
7
- /**
8
- * @license
9
- * Copyright 2019 Google LLC
10
- * SPDX-License-Identifier: BSD-3-Clause
11
- */
@@ -1,16 +0,0 @@
1
- import { LitElement } from "lit";
2
- export declare class BlueSearchBox extends LitElement {
3
- static styles: import("lit").CSSResult;
4
- people: string[];
5
- documents: string[];
6
- private query;
7
- private activeIndex;
8
- private expanded;
9
- private results;
10
- render(): import("lit-html").TemplateResult<1>;
11
- private renderOption;
12
- private onInput;
13
- private updateResults;
14
- private onKeyDown;
15
- private selectOption;
16
- }
@@ -1,158 +0,0 @@
1
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
2
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
3
- function _decorate(e, r, t, i) { var o = _getDecoratorsApi(); if (i) for (var n = 0; n < i.length; n++) o = i[n](o); var s = r(function (e) { o.initializeInstanceElements(e, a.elements); }, t), a = o.decorateClass(_coalesceClassElements(s.d.map(_createElementDescriptor)), e); return o.initializeClassElements(s.F, a.elements), o.runClassFinishers(s.F, a.finishers); }
4
- function _getDecoratorsApi() { _getDecoratorsApi = function () { return e; }; var e = { elementsDefinitionOrder: [["method"], ["field"]], initializeInstanceElements: function (e, r) { ["method", "field"].forEach(function (t) { r.forEach(function (r) { r.kind === t && "own" === r.placement && this.defineClassElement(e, r); }, this); }, this); }, initializeClassElements: function (e, r) { var t = e.prototype; ["method", "field"].forEach(function (i) { r.forEach(function (r) { var o = r.placement; if (r.kind === i && ("static" === o || "prototype" === o)) { var n = "static" === o ? e : t; this.defineClassElement(n, r); } }, this); }, this); }, defineClassElement: function (e, r) { var t = r.descriptor; if ("field" === r.kind) { var i = r.initializer; t = { enumerable: t.enumerable, writable: t.writable, configurable: t.configurable, value: void 0 === i ? void 0 : i.call(e) }; } Object.defineProperty(e, r.key, t); }, decorateClass: function (e, r) { var t = [], i = [], o = { static: [], prototype: [], own: [] }; if (e.forEach(function (e) { this.addElementPlacement(e, o); }, this), e.forEach(function (e) { if (!_hasDecorators(e)) return t.push(e); var r = this.decorateElement(e, o); t.push(r.element), t.push.apply(t, r.extras), i.push.apply(i, r.finishers); }, this), !r) return { elements: t, finishers: i }; var n = this.decorateConstructor(t, r); return i.push.apply(i, n.finishers), n.finishers = i, n; }, addElementPlacement: function (e, r, t) { var i = r[e.placement]; if (!t && -1 !== i.indexOf(e.key)) throw new TypeError("Duplicated element (" + e.key + ")"); i.push(e.key); }, decorateElement: function (e, r) { for (var t = [], i = [], o = e.decorators, n = o.length - 1; n >= 0; n--) { var s = r[e.placement]; s.splice(s.indexOf(e.key), 1); var a = this.fromElementDescriptor(e), l = this.toElementFinisherExtras((0, o[n])(a) || a); e = l.element, this.addElementPlacement(e, r), l.finisher && i.push(l.finisher); var c = l.extras; if (c) { for (var p = 0; p < c.length; p++) this.addElementPlacement(c[p], r); t.push.apply(t, c); } } return { element: e, finishers: i, extras: t }; }, decorateConstructor: function (e, r) { for (var t = [], i = r.length - 1; i >= 0; i--) { var o = this.fromClassDescriptor(e), n = this.toClassDescriptor((0, r[i])(o) || o); if (void 0 !== n.finisher && t.push(n.finisher), void 0 !== n.elements) { e = n.elements; for (var s = 0; s < e.length - 1; s++) for (var a = s + 1; a < e.length; a++) if (e[s].key === e[a].key && e[s].placement === e[a].placement) throw new TypeError("Duplicated element (" + e[s].key + ")"); } } return { elements: e, finishers: t }; }, fromElementDescriptor: function (e) { var r = { kind: e.kind, key: e.key, placement: e.placement, descriptor: e.descriptor }; return Object.defineProperty(r, Symbol.toStringTag, { value: "Descriptor", configurable: !0 }), "field" === e.kind && (r.initializer = e.initializer), r; }, toElementDescriptors: function (e) { if (void 0 !== e) return _toArray(e).map(function (e) { var r = this.toElementDescriptor(e); return this.disallowProperty(e, "finisher", "An element descriptor"), this.disallowProperty(e, "extras", "An element descriptor"), r; }, this); }, toElementDescriptor: function (e) { var r = e.kind + ""; if ("method" !== r && "field" !== r) throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "' + r + '"'); var t = _toPropertyKey(e.key), i = e.placement + ""; if ("static" !== i && "prototype" !== i && "own" !== i) throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "' + i + '"'); var o = e.descriptor; this.disallowProperty(e, "elements", "An element descriptor"); var n = { kind: r, key: t, placement: i, descriptor: Object.assign({}, o) }; return "field" !== r ? this.disallowProperty(e, "initializer", "A method descriptor") : (this.disallowProperty(o, "get", "The property descriptor of a field descriptor"), this.disallowProperty(o, "set", "The property descriptor of a field descriptor"), this.disallowProperty(o, "value", "The property descriptor of a field descriptor"), n.initializer = e.initializer), n; }, toElementFinisherExtras: function (e) { return { element: this.toElementDescriptor(e), finisher: _optionalCallableProperty(e, "finisher"), extras: this.toElementDescriptors(e.extras) }; }, fromClassDescriptor: function (e) { var r = { kind: "class", elements: e.map(this.fromElementDescriptor, this) }; return Object.defineProperty(r, Symbol.toStringTag, { value: "Descriptor", configurable: !0 }), r; }, toClassDescriptor: function (e) { var r = e.kind + ""; if ("class" !== r) throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "' + r + '"'); this.disallowProperty(e, "key", "A class descriptor"), this.disallowProperty(e, "placement", "A class descriptor"), this.disallowProperty(e, "descriptor", "A class descriptor"), this.disallowProperty(e, "initializer", "A class descriptor"), this.disallowProperty(e, "extras", "A class descriptor"); var t = _optionalCallableProperty(e, "finisher"); return { elements: this.toElementDescriptors(e.elements), finisher: t }; }, runClassFinishers: function (e, r) { for (var t = 0; t < r.length; t++) { var i = (0, r[t])(e); if (void 0 !== i) { if ("function" != typeof i) throw new TypeError("Finishers must return a constructor."); e = i; } } return e; }, disallowProperty: function (e, r, t) { if (void 0 !== e[r]) throw new TypeError(t + " can't have a ." + r + " property."); } }; return e; }
5
- function _createElementDescriptor(e) { var r, t = _toPropertyKey(e.key); "method" === e.kind ? r = { value: e.value, writable: !0, configurable: !0, enumerable: !1 } : "get" === e.kind ? r = { get: e.value, configurable: !0, enumerable: !1 } : "set" === e.kind ? r = { set: e.value, configurable: !0, enumerable: !1 } : "field" === e.kind && (r = { configurable: !0, writable: !0, enumerable: !0 }); var i = { kind: "field" === e.kind ? "field" : "method", key: t, placement: e.static ? "static" : "field" === e.kind ? "own" : "prototype", descriptor: r }; return e.decorators && (i.decorators = e.decorators), "field" === e.kind && (i.initializer = e.value), i; }
6
- function _coalesceGetterSetter(e, r) { void 0 !== e.descriptor.get ? r.descriptor.get = e.descriptor.get : r.descriptor.set = e.descriptor.set; }
7
- function _coalesceClassElements(e) { for (var r = [], isSameElement = function (e) { return "method" === e.kind && e.key === o.key && e.placement === o.placement; }, t = 0; t < e.length; t++) { var i, o = e[t]; if ("method" === o.kind && (i = r.find(isSameElement))) { if (_isDataDescriptor(o.descriptor) || _isDataDescriptor(i.descriptor)) { if (_hasDecorators(o) || _hasDecorators(i)) throw new ReferenceError("Duplicated methods (" + o.key + ") can't be decorated."); i.descriptor = o.descriptor; } else { if (_hasDecorators(o)) { if (_hasDecorators(i)) throw new ReferenceError("Decorators can't be placed on different accessors with for the same property (" + o.key + ")."); i.decorators = o.decorators; } _coalesceGetterSetter(o, i); } } else r.push(o); } return r; }
8
- function _hasDecorators(e) { return e.decorators && e.decorators.length; }
9
- function _isDataDescriptor(e) { return void 0 !== e && !(void 0 === e.value && void 0 === e.writable); }
10
- function _optionalCallableProperty(e, r) { var t = e[r]; if (void 0 !== t && "function" != typeof t) throw new TypeError("Expected '" + r + "' to be a function"); return t; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
- function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
14
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
16
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
17
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
18
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
19
- import { LitElement, html, css } from "lit";
20
- import { customElement, state, property } from "lit/decorators.js";
21
- export let BlueSearchBox = _decorate([customElement("blue-searchbox")], function (_initialize, _LitElement) {
22
- class BlueSearchBox extends _LitElement {
23
- constructor() {
24
- super(...arguments);
25
- _initialize(this);
26
- }
27
- }
28
- return {
29
- F: BlueSearchBox,
30
- d: [{
31
- kind: "field",
32
- static: true,
33
- key: "styles",
34
- value() {
35
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :host {\n display: block;\n position: relative;\n max-width: 400px;\n font-family: system-ui, sans-serif;\n }\n\n .search-container {\n position: relative;\n }\n\n input {\n width: 100%;\n padding: 0.5rem 0.75rem;\n border: 1px solid #ccc;\n border-radius: 0.375rem;\n font-size: 1rem;\n }\n\n .results {\n background: white;\n border: 1px solid #ccc;\n border-radius: 0.375rem;\n margin-top: 0.25rem;\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0.5rem;\n padding: 0.5rem;\n box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);\n z-index: 10;\n }\n\n .group {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n .group-title {\n font-weight: 600;\n font-size: 0.875rem;\n margin-bottom: 0.25rem;\n }\n\n [role=\"option\"] {\n padding: 0.25rem 0.5rem;\n border-radius: 0.25rem;\n cursor: pointer;\n }\n\n [role=\"option\"].active,\n [role=\"option\"]:hover {\n background: #e8f0fe;\n outline: none;\n }\n "])));
36
- }
37
- }, {
38
- kind: "field",
39
- decorators: [property({
40
- type: Array
41
- })],
42
- key: "people",
43
- value() {
44
- return ["Alice", "Bob", "Charlie"];
45
- }
46
- }, {
47
- kind: "field",
48
- decorators: [property({
49
- type: Array
50
- })],
51
- key: "documents",
52
- value() {
53
- return ["Spec.docx", "Roadmap.pdf", "Meeting Notes.txt"];
54
- }
55
- }, {
56
- kind: "field",
57
- decorators: [state()],
58
- key: "query",
59
- value() {
60
- return "";
61
- }
62
- }, {
63
- kind: "field",
64
- decorators: [state()],
65
- key: "activeIndex",
66
- value() {
67
- return -1;
68
- }
69
- }, {
70
- kind: "field",
71
- decorators: [state()],
72
- key: "expanded",
73
- value() {
74
- return false;
75
- }
76
- }, {
77
- kind: "field",
78
- decorators: [state()],
79
- key: "results",
80
- value() {
81
- return [];
82
- }
83
- }, {
84
- kind: "method",
85
- key: "render",
86
- value: function render() {
87
- return html(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n <div\n class=\"search-container\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded=", "\n aria-owns=\"results-list\"\n >\n <input\n type=\"text\"\n placeholder=\"Search...\"\n .value=", "\n @input=", "\n @keydown=", "\n aria-controls=\"results-list\"\n aria-activedescendant=", "\n aria-autocomplete=\"list\"\n />\n\n ", "\n </div>\n "])), this.expanded, this.query, this.onInput, this.onKeyDown, this.activeIndex >= 0 ? "opt-" + this.activeIndex : "", this.expanded ? html(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n <div class=\"results\" id=\"results-list\" role=\"listbox\">\n <div class=\"group\">\n <div class=\"group-title\">People</div>\n ", "\n </div>\n <div class=\"group\">\n <div class=\"group-title\">Documents</div>\n ", "\n </div>\n </div>\n "])), this.people.filter(p => p.toLowerCase().includes(this.query.toLowerCase())).map(p => this.renderOption(p, "People")), this.documents.filter(d => d.toLowerCase().includes(this.query.toLowerCase())).map(d => this.renderOption(d, "Documents"))) : null);
88
- }
89
- }, {
90
- kind: "method",
91
- key: "renderOption",
92
- value: function renderOption(label, group) {
93
- const index = this.results.findIndex(r => r.label === label && r.group === group);
94
- const isActive = index === this.activeIndex;
95
- return html(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n <div\n role=\"option\"\n id=\"opt-", "\"\n class=", "\n @click=", "\n >\n ", "\n </div>\n "])), index, isActive ? "active" : "", () => this.selectOption(index), label);
96
- }
97
- }, {
98
- kind: "method",
99
- key: "onInput",
100
- value: function onInput(e) {
101
- const value = e.target.value;
102
- this.query = value;
103
- this.updateResults();
104
- this.expanded = this.results.length > 0;
105
- this.activeIndex = -1;
106
- }
107
- }, {
108
- kind: "method",
109
- key: "updateResults",
110
- value: function updateResults() {
111
- const q = this.query.toLowerCase();
112
- this.results = [...this.people.filter(p => p.toLowerCase().includes(q)).map(label => ({
113
- group: "People",
114
- label
115
- })), ...this.documents.filter(d => d.toLowerCase().includes(q)).map(label => ({
116
- group: "Documents",
117
- label
118
- }))];
119
- }
120
- }, {
121
- kind: "method",
122
- key: "onKeyDown",
123
- value: function onKeyDown(e) {
124
- if (!this.expanded && e.key === "ArrowDown") {
125
- this.expanded = true;
126
- this.updateResults();
127
- return;
128
- }
129
- if (e.key === "ArrowDown") {
130
- e.preventDefault();
131
- this.activeIndex = (this.activeIndex + 1) % this.results.length;
132
- this.requestUpdate();
133
- } else if (e.key === "ArrowUp") {
134
- e.preventDefault();
135
- this.activeIndex = (this.activeIndex - 1 + this.results.length) % this.results.length;
136
- this.requestUpdate();
137
- } else if (e.key === "Enter" && this.activeIndex >= 0) {
138
- this.selectOption(this.activeIndex);
139
- } else if (e.key === "Escape") {
140
- this.expanded = false;
141
- }
142
- }
143
- }, {
144
- kind: "method",
145
- key: "selectOption",
146
- value: function selectOption(index) {
147
- const item = this.results[index];
148
- if (!item) return;
149
- this.query = item.label;
150
- this.expanded = false;
151
- this.activeIndex = -1;
152
- this.dispatchEvent(new CustomEvent("select", {
153
- detail: item
154
- }));
155
- }
156
- }]
157
- };
158
- }, LitElement);