@chefuicore/core 0.3.0 → 0.4.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/dist/components/chef-ui-calendar.d.ts +61 -0
- package/dist/components/chef-ui-calendar.d.ts.map +1 -0
- package/dist/index.cjs +396 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +396 -30
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
"use strict";function e(e,t,i,o){var r,s=arguments.length,
|
|
1
|
+
"use strict";function e(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}"function"==typeof SuppressedError&&SuppressedError;
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),r=new WeakMap;let s=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=r.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&r.set(t,e))}return e}toString(){return this.cssText}};const
|
|
7
|
+
const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),r=new WeakMap;let s=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=r.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&r.set(t,e))}return e}toString(){return this.cssText}};const a=(e,...t)=>{const i=1===e.length?e[0]:t.reduce((t,i,o)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[o+1],e[0]);return new s(i,e,o)},n=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,o))(t)})(e):e,{is:c,defineProperty:l,getOwnPropertyDescriptor:h,getOwnPropertyNames:d,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,f=globalThis,v=f.trustedTypes,g=v?v.emptyScript:"",b=f.reactiveElementPolyfillSupport,y=(e,t)=>e,x={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},m=(e,t)=>!c(e,t),$={attribute:!0,type:String,converter:x,reflect:!1,useDefault:!1,hasChanged:m};
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
*/Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;let
|
|
12
|
+
*/Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;let w=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=$){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(e,i,t);void 0!==o&&l(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){const{get:o,set:r}=h(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:o,set(t){const s=o?.call(this);r?.call(this,t),this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??$}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,t=[...d(e),...p(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(n(e))}else void 0!==e&&t.push(n(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,o)=>{if(i)e.adoptedStyleSheets=o.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const i of o){const o=document.createElement("style"),r=t.litNonce;void 0!==r&&o.setAttribute("nonce",r),o.textContent=i.cssText,e.appendChild(o)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){const i=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,i);if(void 0!==o&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:x).toAttribute(t,i.type);this._$Em=e,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(e,t){const i=this.constructor,o=i._$Eh.get(e);if(void 0!==o&&this._$Em!==o){const e=i.getPropertyOptions(o),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:x;this._$Em=o;const s=r.fromAttribute(t,e.type);this[o]=s??this._$Ej?.get(o)??s,this._$Em=null}}requestUpdate(e,t,i){if(void 0!==e){const o=this.constructor,r=this[e];if(i??=o.getPropertyOptions(e),!((i.hasChanged??m)(r,t)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:o,wrapped:r},s){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),!0!==r||void 0!==s)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===o&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,o=this[t];!0!==e||this._$AL.has(t)||void 0===o||this.C(t,void 0,i,o)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[y("elementProperties")]=new Map,w[y("finalized")]=new Map,b?.({ReactiveElement:w}),(f.reactiveElementVersions??=[]).push("2.1.1");
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2017 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
17
|
*/
|
|
18
|
-
const
|
|
18
|
+
const C=globalThis,A=C.trustedTypes,_=A?A.createPolicy("lit-html",{createHTML:e=>e}):void 0,S="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,k="?"+M,E=`<${k}>`,U=document,D=()=>U.createComment(""),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,P=Array.isArray,z="[ \t\n\f\r]",I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,T=/-->/g,H=/>/g,N=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),L=/'/g,B=/"/g,R=/^(?:script|style|textarea|title)$/i,j=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),Y=j(1),F=j(2),V=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),W=new WeakMap,Z=U.createTreeWalker(U,129);function J(e,t){if(!P(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==_?_.createHTML(t):t}const Q=(e,t)=>{const i=e.length-1,o=[];let r,s=2===t?"<svg>":3===t?"<math>":"",a=I;for(let t=0;t<i;t++){const i=e[t];let n,c,l=-1,h=0;for(;h<i.length&&(a.lastIndex=h,c=a.exec(i),null!==c);)h=a.lastIndex,a===I?"!--"===c[1]?a=T:void 0!==c[1]?a=H:void 0!==c[2]?(R.test(c[2])&&(r=RegExp("</"+c[2],"g")),a=N):void 0!==c[3]&&(a=N):a===N?">"===c[0]?(a=r??I,l=-1):void 0===c[1]?l=-2:(l=a.lastIndex-c[2].length,n=c[1],a=void 0===c[3]?N:'"'===c[3]?B:L):a===B||a===L?a=N:a===T||a===H?a=I:(a=N,r=void 0);const d=a===N&&e[t+1].startsWith("/>")?" ":"";s+=a===I?i+E:l>=0?(o.push(n),i.slice(0,l)+S+i.slice(l)+M+d):i+M+(-2===l?t:d)}return[J(e,s+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]};class K{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let r=0,s=0;const a=e.length-1,n=this.parts,[c,l]=Q(e,t);if(this.el=K.createElement(c,i),Z.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(o=Z.nextNode())&&n.length<a;){if(1===o.nodeType){if(o.hasAttributes())for(const e of o.getAttributeNames())if(e.endsWith(S)){const t=l[s++],i=o.getAttribute(e).split(M),a=/([.?@])?(.*)/.exec(t);n.push({type:1,index:r,name:a[2],strings:i,ctor:"."===a[1]?ie:"?"===a[1]?oe:"@"===a[1]?re:te}),o.removeAttribute(e)}else e.startsWith(M)&&(n.push({type:6,index:r}),o.removeAttribute(e));if(R.test(o.tagName)){const e=o.textContent.split(M),t=e.length-1;if(t>0){o.textContent=A?A.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],D()),Z.nextNode(),n.push({type:2,index:++r});o.append(e[t],D())}}}else if(8===o.nodeType)if(o.data===k)n.push({type:2,index:r});else{let e=-1;for(;-1!==(e=o.data.indexOf(M,e+1));)n.push({type:7,index:r}),e+=M.length-1}r++}}static createElement(e,t){const i=U.createElement("template");return i.innerHTML=e,i}}function G(e,t,i=e,o){if(t===V)return t;let r=void 0!==o?i._$Co?.[o]:i._$Cl;const s=O(t)?void 0:t._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),void 0===s?r=void 0:(r=new s(e),r._$AT(e,i,o)),void 0!==o?(i._$Co??=[])[o]=r:i._$Cl=r),void 0!==r&&(t=G(e,r._$AS(e,t.values),r,o)),t}class X{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,o=(e?.creationScope??U).importNode(t,!0);Z.currentNode=o;let r=Z.nextNode(),s=0,a=0,n=i[0];for(;void 0!==n;){if(s===n.index){let t;2===n.type?t=new ee(r,r.nextSibling,this,e):1===n.type?t=new n.ctor(r,n.name,n.strings,this,e):6===n.type&&(t=new se(r,this,e)),this._$AV.push(t),n=i[++a]}s!==n?.index&&(r=Z.nextNode(),s++)}return Z.currentNode=U,o}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class ee{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,o){this.type=2,this._$AH=q,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=G(this,e,t),O(e)?e===q||null==e||""===e?(this._$AH!==q&&this._$AR(),this._$AH=q):e!==this._$AH&&e!==V&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>P(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==q&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T(U.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,o="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=K.createElement(J(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(t);else{const e=new X(o,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=W.get(e.strings);return void 0===t&&W.set(e.strings,t=new K(e)),t}k(e){P(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,o=0;for(const r of e)o===t.length?t.push(i=new ee(this.O(D()),this.O(D()),this,this.options)):i=t[o],i._$AI(r),o++;o<t.length&&(this._$AR(i&&i._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class te{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,o,r){this.type=1,this._$AH=q,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=q}_$AI(e,t=this,i,o){const r=this.strings;let s=!1;if(void 0===r)e=G(this,e,t,0),s=!O(e)||e!==this._$AH&&e!==V,s&&(this._$AH=e);else{const o=e;let a,n;for(e=r[0],a=0;a<r.length-1;a++)n=G(this,o[i+a],t,a),n===V&&(n=this._$AH[a]),s||=!O(n)||n!==this._$AH[a],n===q?e=q:e!==q&&(e+=(n??"")+r[a+1]),this._$AH[a]=n}s&&!o&&this.j(e)}j(e){e===q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ie extends te{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===q?void 0:e}}class oe extends te{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==q)}}class re extends te{constructor(e,t,i,o,r){super(e,t,i,o,r),this.type=5}_$AI(e,t=this){if((e=G(this,e,t,0)??q)===V)return;const i=this._$AH,o=e===q&&i!==q||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==q&&(i===q||o);o&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class se{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){G(this,e)}}const ae=C.litHtmlPolyfillSupport;ae?.(K,ee),(C.litHtmlVersions??=[]).push("3.3.1");const ne=globalThis;
|
|
19
19
|
/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/class ce extends
|
|
23
|
+
*/class ce extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const o=i?.renderBefore??t;let r=o._$litPart$;if(void 0===r){const e=i?.renderBefore??null;o._$litPart$=r=new ee(t.insertBefore(D(),e),e,void 0,i??{})}return r._$AI(e),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return V}}ce._$litElement$=!0,ce.finalized=!0,ne.litElementHydrateSupport?.({LitElement:ce});const le=ne.litElementPolyfillSupport;le?.({LitElement:ce}),(ne.litElementVersions??=[]).push("4.2.1");
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*/
|
|
29
|
-
const he=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},de={attribute:!0,type:String,converter:
|
|
29
|
+
const he=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},de={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:m},pe=(e=de,t,i)=>{const{kind:o,metadata:r}=i;let s=globalThis.litPropertyMetadata.get(r);if(void 0===s&&globalThis.litPropertyMetadata.set(r,s=new Map),"setter"===o&&((e=Object.create(e)).wrapped=!0),s.set(i.name,e),"accessor"===o){const{name:o}=i;return{set(i){const r=t.get.call(this);t.set.call(this,i),this.requestUpdate(o,r,e)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===o){const{name:o}=i;return function(i){const r=this[o];t.call(this,i),this.requestUpdate(o,r,e)}}throw Error("Unsupported decorator location: "+o)};
|
|
30
30
|
/**
|
|
31
31
|
* @license
|
|
32
32
|
* Copyright 2017 Google LLC
|
|
@@ -47,7 +47,7 @@ const he=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}
|
|
|
47
47
|
* Copyright 2017 Google LLC
|
|
48
48
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
49
49
|
*/
|
|
50
|
-
function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i))(t,i,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}class ge{constructor(){this.registry=new Map}register(e,t){this.registry.set(e,t)}resolve(e){return this.registry.get(e)}has(e){return this.registry.has(e)}list(){return Array.from(this.registry.keys()).sort()}}const be=new ge;be.register("plus",{outline:"M12 4v16M4 12h16",solid:"M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7z"}),be.register("check",{outline:"m5 13 4 4L19 7",solid:"M10 15.172 5.414 10.586 4 12l6 6L20 8l-1.414-1.414z"}),be.register("x",{outline:"M6 6l12 12M6 18L18 6",solid:"M6 6l12 12M6 18L18 6"}),be.register("trash",{outline:"M3 6h18M8 6V4h8v2m-1 0v12a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V6h10Z",solid:"M7 6h10v11a3 3 0 0 1-3 3H10a3 3 0 0 1-3-3V6Zm2-4h6v2H9z"}),be.register("lock",{outline:"M7 10V7a5 5 0 0 1 10 0v3m-9 0h8a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Z",solid:"M12 1a6 6 0 0 1 6 6v3h1a2 2 0 0 1 2 2v7a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-7a2 2 0 0 1 2-2h1V7a6 6 0 0 1 6-6Z"}),be.register("alert",{outline:"M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z",solid:"M11 7h2v6h-2zm0 8h2v2h-2z"}),be.register("info",{outline:"M12 8h.01M11 12h2v6h-2zm9 0a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z",solid:"M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm-1 8h2V7h-2v3Zm0 7h2v-6h-2v6Z"}),be.register("edit",{outline:"M4 21h4l11-11a2.828 2.828 0 1 0-4-4L4 17v4Z",solid:"M3 17.25 16.06 4.19l3.75 3.75L6.75 21H3v-3.75Z"}),be.register("search",{outline:"m21 21-4.35-4.35M10 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z",solid:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16a6.471 6.471 0 0 0 4.23-1.57l.27.28v.79L20 21.5 21.5 20 15.5 14z"}),be.register("save",{outline:"M5 5h10l4 4v10a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V5zm8 0v6H7V5",solid:"M17 3H5a2 2 0 0 0-2 2v16l4-4h10a2 2 0 0 0 2-2V7l-4-4z"}),be.register("arrow-right",{outline:"M5 12h14M13 5l7 7-7 7",solid:"M10 5l7 7-7 7V5z"}),be.register("arrow-left",{outline:"M19 12H5m6 7-7-7 7-7",solid:"M14 19l-7-7 7-7v14z"}),exports.ChefIcon=class extends ce{constructor(){super(...arguments),this.name="info",this.styleVariant="outline",this.ariaLabel=null}updated(){this.size&&this.style.setProperty("--chefui-icon-size",this.size),this.color&&this.style.setProperty("--chefui-icon-color",this.color)}renderPath(){const e=be.resolve(this.name);if(!e)return null;const t="solid"===this.styleVariant&&!!e.solid?e.solid:e.outline;return
|
|
50
|
+
function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i))(t,i,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}class ge{constructor(){this.registry=new Map}register(e,t){this.registry.set(e,t)}resolve(e){return this.registry.get(e)}has(e){return this.registry.has(e)}list(){return Array.from(this.registry.keys()).sort()}}const be=new ge;be.register("plus",{outline:"M12 4v16M4 12h16",solid:"M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7z"}),be.register("check",{outline:"m5 13 4 4L19 7",solid:"M10 15.172 5.414 10.586 4 12l6 6L20 8l-1.414-1.414z"}),be.register("x",{outline:"M6 6l12 12M6 18L18 6",solid:"M6 6l12 12M6 18L18 6"}),be.register("trash",{outline:"M3 6h18M8 6V4h8v2m-1 0v12a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V6h10Z",solid:"M7 6h10v11a3 3 0 0 1-3 3H10a3 3 0 0 1-3-3V6Zm2-4h6v2H9z"}),be.register("lock",{outline:"M7 10V7a5 5 0 0 1 10 0v3m-9 0h8a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Z",solid:"M12 1a6 6 0 0 1 6 6v3h1a2 2 0 0 1 2 2v7a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-7a2 2 0 0 1 2-2h1V7a6 6 0 0 1 6-6Z"}),be.register("alert",{outline:"M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z",solid:"M11 7h2v6h-2zm0 8h2v2h-2z"}),be.register("info",{outline:"M12 8h.01M11 12h2v6h-2zm9 0a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z",solid:"M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm-1 8h2V7h-2v3Zm0 7h2v-6h-2v6Z"}),be.register("edit",{outline:"M4 21h4l11-11a2.828 2.828 0 1 0-4-4L4 17v4Z",solid:"M3 17.25 16.06 4.19l3.75 3.75L6.75 21H3v-3.75Z"}),be.register("search",{outline:"m21 21-4.35-4.35M10 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z",solid:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16a6.471 6.471 0 0 0 4.23-1.57l.27.28v.79L20 21.5 21.5 20 15.5 14z"}),be.register("save",{outline:"M5 5h10l4 4v10a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V5zm8 0v6H7V5",solid:"M17 3H5a2 2 0 0 0-2 2v16l4-4h10a2 2 0 0 0 2-2V7l-4-4z"}),be.register("arrow-right",{outline:"M5 12h14M13 5l7 7-7 7",solid:"M10 5l7 7-7 7V5z"}),be.register("arrow-left",{outline:"M19 12H5m6 7-7-7 7-7",solid:"M14 19l-7-7 7-7v14z"}),exports.ChefIcon=class extends ce{constructor(){super(...arguments),this.name="info",this.styleVariant="outline",this.ariaLabel=null}updated(){this.size&&this.style.setProperty("--chefui-icon-size",this.size),this.color&&this.style.setProperty("--chefui-icon-color",this.color)}renderPath(){const e=be.resolve(this.name);if(!e)return null;const t="solid"===this.styleVariant&&!!e.solid?e.solid:e.outline;return F`<path d="${t}" />`}render(){const e=be.resolve(this.name),t="solid"===this.styleVariant&&!!e?.solid;return Y`
|
|
51
51
|
<svg
|
|
52
52
|
part="icon"
|
|
53
53
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -60,7 +60,7 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
60
60
|
>
|
|
61
61
|
${this.renderPath()}
|
|
62
62
|
</svg>
|
|
63
|
-
`}},exports.ChefIcon.styles=
|
|
63
|
+
`}},exports.ChefIcon.styles=a`
|
|
64
64
|
:host {
|
|
65
65
|
display: inline-flex;
|
|
66
66
|
--chefui-icon-size: 1.1em;
|
|
@@ -68,7 +68,7 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
68
68
|
line-height: 0;
|
|
69
69
|
}
|
|
70
70
|
svg { width: var(--chefui-icon-size); height: var(--chefui-icon-size); stroke-linecap: round; stroke-linejoin: round; }
|
|
71
|
-
`,e([ue({type:String,reflect:!0})],exports.ChefIcon.prototype,"name",void 0),e([ue({type:String,reflect:!0})],exports.ChefIcon.prototype,"styleVariant",void 0),e([ue({type:String,reflect:!0})],exports.ChefIcon.prototype,"size",void 0),e([ue({type:String,reflect:!0})],exports.ChefIcon.prototype,"color",void 0),e([ue({type:String,attribute:"aria-label"})],exports.ChefIcon.prototype,"ariaLabel",void 0),exports.ChefIcon=e([he("chef-icon")],exports.ChefIcon),exports.ChefButton=class extends ce{constructor(){super(...arguments),this.disabled=!1,this.variant="solid",this.type="button"}findAssociatedForm(){if(this.form){const e=this.ownerDocument.getElementById(this.form);if(e&&e instanceof HTMLFormElement)return e}return this.closest("form")}handleClick(e){if(this.disabled)return e.stopImmediatePropagation(),void e.preventDefault();this.dispatchEvent(new CustomEvent("chef-click",{bubbles:!0,composed:!0}));const t=this.findAssociatedForm();if(t)if("submit"===this.type){const e=document.createElement("button");e.type="submit",this.name&&(e.name=this.name),null!=this.value&&(e.value=this.value),e.hidden=!0,t.appendChild(e),e.click(),t.removeChild(e)}else"reset"===this.type&&t.reset()}render(){return
|
|
71
|
+
`,e([ue({type:String,reflect:!0})],exports.ChefIcon.prototype,"name",void 0),e([ue({type:String,reflect:!0})],exports.ChefIcon.prototype,"styleVariant",void 0),e([ue({type:String,reflect:!0})],exports.ChefIcon.prototype,"size",void 0),e([ue({type:String,reflect:!0})],exports.ChefIcon.prototype,"color",void 0),e([ue({type:String,attribute:"aria-label"})],exports.ChefIcon.prototype,"ariaLabel",void 0),exports.ChefIcon=e([he("chef-icon")],exports.ChefIcon),exports.ChefButton=class extends ce{constructor(){super(...arguments),this.disabled=!1,this.variant="solid",this.type="button"}findAssociatedForm(){if(this.form){const e=this.ownerDocument.getElementById(this.form);if(e&&e instanceof HTMLFormElement)return e}return this.closest("form")}handleClick(e){if(this.disabled)return e.stopImmediatePropagation(),void e.preventDefault();this.dispatchEvent(new CustomEvent("chef-click",{bubbles:!0,composed:!0}));const t=this.findAssociatedForm();if(t)if("submit"===this.type){const e=document.createElement("button");e.type="submit",this.name&&(e.name=this.name),null!=this.value&&(e.value=this.value),e.hidden=!0,t.appendChild(e),e.click(),t.removeChild(e)}else"reset"===this.type&&t.reset()}render(){return Y`
|
|
72
72
|
<button
|
|
73
73
|
type="button"
|
|
74
74
|
?disabled=${this.disabled}
|
|
@@ -78,11 +78,11 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
78
78
|
part="button"
|
|
79
79
|
>
|
|
80
80
|
<slot name="icon">
|
|
81
|
-
${this.icon?
|
|
81
|
+
${this.icon?Y`<chef-icon class="icon-fallback" name=${this.icon}></chef-icon>`:null}
|
|
82
82
|
</slot>
|
|
83
83
|
<slot></slot>
|
|
84
84
|
</button>
|
|
85
|
-
`}},exports.ChefButton.styles=
|
|
85
|
+
`}},exports.ChefButton.styles=a`
|
|
86
86
|
:host {
|
|
87
87
|
display: inline-block;
|
|
88
88
|
--chefui-color: #1976d2;
|
|
@@ -162,9 +162,9 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
162
162
|
height: 1.1em;
|
|
163
163
|
display: inline-flex;
|
|
164
164
|
}
|
|
165
|
-
`,e([ue({type:Boolean,reflect:!0})],exports.ChefButton.prototype,"disabled",void 0),e([ue({type:String,reflect:!0})],exports.ChefButton.prototype,"variant",void 0),e([ue({type:String,reflect:!0})],exports.ChefButton.prototype,"type",void 0),e([ue({type:String})],exports.ChefButton.prototype,"name",void 0),e([ue({type:String})],exports.ChefButton.prototype,"value",void 0),e([ue({type:String,reflect:!0})],exports.ChefButton.prototype,"form",void 0),e([ue({type:String,reflect:!0})],exports.ChefButton.prototype,"icon",void 0),exports.ChefButton=e([he("chef-button")],exports.ChefButton),exports.ChefUiSelect=class extends ce{constructor(){super(...arguments),this.placeholder="Select an option...",this.value="",this.disabled=!1,this.invalid=!1,this.options=[],this.required=!1,this.searchable=!1,this.searchPlaceholder="Search...",this.isOpen=!1,this.searchQuery="",this.handleOutsideClick=e=>{this.contains(e.target)||this.closeDropdown()}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){document.removeEventListener("click",this.handleOutsideClick),super.disconnectedCallback()}closeDropdown(){this.isOpen=!1,this.searchQuery=""}toggleDropdown(e){e.stopPropagation(),this.disabled||(this.isOpen=!this.isOpen,this.isOpen&&this.searchable&&setTimeout(()=>{this.searchInputEl?.focus()},100))}selectOption(e,t){if(t.stopPropagation(),this.disabled)return;const i=this.value;this.value=e,this.closeDropdown(),this.dispatchEvent(new CustomEvent("chef-change",{detail:{value:this.value,oldValue:i},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}handleKeyDown(e){if(!this.disabled)switch(e.key){case"Enter":case" ":if(e.target.classList.contains("search-input"))return;e.preventDefault(),this.toggleDropdown(e);break;case"Escape":e.preventDefault(),this.closeDropdown();break;case"ArrowDown":if(e.preventDefault(),this.isOpen){const e=this.getFilteredOptions(),t=e.findIndex(e=>e.value===this.value),i=Math.min(t+1,e.length-1);i>=0&&e[i]&&(this.value=e[i].value)}else this.isOpen=!0;break;case"ArrowUp":if(e.preventDefault(),this.isOpen){const e=this.getFilteredOptions(),t=e.findIndex(e=>e.value===this.value),i=Math.max(t-1,0);i>=0&&e[i]&&(this.value=e[i].value)}else this.isOpen=!0}}handleSearchInput(e){const t=e.target;this.searchQuery=t.value.toLowerCase()}getFilteredOptions(){return this.searchQuery?this.options.filter(e=>e.label.toLowerCase().includes(this.searchQuery)||e.value.toLowerCase().includes(this.searchQuery)):this.options}getSelectedOption(){return this.options.find(e=>e.value===this.value)}render(){const e=this.getSelectedOption(),t=this.getFilteredOptions();return
|
|
165
|
+
`,e([ue({type:Boolean,reflect:!0})],exports.ChefButton.prototype,"disabled",void 0),e([ue({type:String,reflect:!0})],exports.ChefButton.prototype,"variant",void 0),e([ue({type:String,reflect:!0})],exports.ChefButton.prototype,"type",void 0),e([ue({type:String})],exports.ChefButton.prototype,"name",void 0),e([ue({type:String})],exports.ChefButton.prototype,"value",void 0),e([ue({type:String,reflect:!0})],exports.ChefButton.prototype,"form",void 0),e([ue({type:String,reflect:!0})],exports.ChefButton.prototype,"icon",void 0),exports.ChefButton=e([he("chef-button")],exports.ChefButton),exports.ChefUiSelect=class extends ce{constructor(){super(...arguments),this.placeholder="Select an option...",this.value="",this.disabled=!1,this.invalid=!1,this.options=[],this.required=!1,this.searchable=!1,this.searchPlaceholder="Search...",this.isOpen=!1,this.searchQuery="",this.handleOutsideClick=e=>{this.contains(e.target)||this.closeDropdown()}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){document.removeEventListener("click",this.handleOutsideClick),super.disconnectedCallback()}closeDropdown(){this.isOpen=!1,this.searchQuery=""}toggleDropdown(e){e.stopPropagation(),this.disabled||(this.isOpen=!this.isOpen,this.isOpen&&this.searchable&&setTimeout(()=>{this.searchInputEl?.focus()},100))}selectOption(e,t){if(t.stopPropagation(),this.disabled)return;const i=this.value;this.value=e,this.closeDropdown(),this.dispatchEvent(new CustomEvent("chef-change",{detail:{value:this.value,oldValue:i},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}handleKeyDown(e){if(!this.disabled)switch(e.key){case"Enter":case" ":if(e.target.classList.contains("search-input"))return;e.preventDefault(),this.toggleDropdown(e);break;case"Escape":e.preventDefault(),this.closeDropdown();break;case"ArrowDown":if(e.preventDefault(),this.isOpen){const e=this.getFilteredOptions(),t=e.findIndex(e=>e.value===this.value),i=Math.min(t+1,e.length-1);i>=0&&e[i]&&(this.value=e[i].value)}else this.isOpen=!0;break;case"ArrowUp":if(e.preventDefault(),this.isOpen){const e=this.getFilteredOptions(),t=e.findIndex(e=>e.value===this.value),i=Math.max(t-1,0);i>=0&&e[i]&&(this.value=e[i].value)}else this.isOpen=!0}}handleSearchInput(e){const t=e.target;this.searchQuery=t.value.toLowerCase()}getFilteredOptions(){return this.searchQuery?this.options.filter(e=>e.label.toLowerCase().includes(this.searchQuery)||e.value.toLowerCase().includes(this.searchQuery)):this.options}getSelectedOption(){return this.options.find(e=>e.value===this.value)}render(){const e=this.getSelectedOption(),t=this.getFilteredOptions();return Y`
|
|
166
166
|
<div class="wrapper">
|
|
167
|
-
${this.label?
|
|
167
|
+
${this.label?Y`<label class="label">${this.label}</label>`:null}
|
|
168
168
|
|
|
169
169
|
<button
|
|
170
170
|
class="select-button"
|
|
@@ -179,10 +179,10 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
179
179
|
part="button"
|
|
180
180
|
>
|
|
181
181
|
<div class="selected-value ${e?"":"placeholder"}">
|
|
182
|
-
${this.prefixIcon?
|
|
182
|
+
${this.prefixIcon?Y`
|
|
183
183
|
<chef-icon class="prefix-icon" name=${this.prefixIcon}></chef-icon>
|
|
184
184
|
`:null}
|
|
185
|
-
${e?.icon?
|
|
185
|
+
${e?.icon?Y`
|
|
186
186
|
<chef-icon class="option-icon" name=${e.icon}></chef-icon>
|
|
187
187
|
`:null}
|
|
188
188
|
<span>${e?.label||this.placeholder}</span>
|
|
@@ -191,7 +191,7 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
191
191
|
</button>
|
|
192
192
|
|
|
193
193
|
<div class="dropdown ${this.isOpen?"open":""}" role="listbox" part="dropdown">
|
|
194
|
-
${this.searchable?
|
|
194
|
+
${this.searchable?Y`
|
|
195
195
|
<div class="search-wrapper">
|
|
196
196
|
<div class="search-icon-wrapper">
|
|
197
197
|
<chef-icon class="search-icon" name="search"></chef-icon>
|
|
@@ -206,8 +206,8 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
206
206
|
</div>
|
|
207
207
|
`:null}
|
|
208
208
|
|
|
209
|
-
${t.length>0?
|
|
210
|
-
${t.map(e=>
|
|
209
|
+
${t.length>0?Y`
|
|
210
|
+
${t.map(e=>Y`
|
|
211
211
|
<div
|
|
212
212
|
class="option"
|
|
213
213
|
role="option"
|
|
@@ -215,13 +215,13 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
215
215
|
@click=${t=>this.selectOption(e.value,t)}
|
|
216
216
|
part="option"
|
|
217
217
|
>
|
|
218
|
-
${e.icon?
|
|
218
|
+
${e.icon?Y`
|
|
219
219
|
<chef-icon class="option-icon" name=${e.icon}></chef-icon>
|
|
220
220
|
`:null}
|
|
221
221
|
<span>${e.label}</span>
|
|
222
222
|
</div>
|
|
223
223
|
`)}
|
|
224
|
-
`:
|
|
224
|
+
`:Y`
|
|
225
225
|
<div class="no-results">No results found</div>
|
|
226
226
|
`}
|
|
227
227
|
</div>
|
|
@@ -230,7 +230,7 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
230
230
|
<slot name="validation-message"></slot>
|
|
231
231
|
</div>
|
|
232
232
|
</div>
|
|
233
|
-
`}},exports.ChefUiSelect.styles=
|
|
233
|
+
`}},exports.ChefUiSelect.styles=a`
|
|
234
234
|
:host {
|
|
235
235
|
display: block;
|
|
236
236
|
--chefui-color: #7c3aed;
|
|
@@ -443,11 +443,11 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
443
443
|
margin-top: 6px;
|
|
444
444
|
font-size: 13px;
|
|
445
445
|
}
|
|
446
|
-
`,e([ue({type:String})],exports.ChefUiSelect.prototype,"label",void 0),e([ue({type:String,reflect:!0})],exports.ChefUiSelect.prototype,"placeholder",void 0),e([ue({type:String,reflect:!0})],exports.ChefUiSelect.prototype,"value",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiSelect.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiSelect.prototype,"invalid",void 0),e([ue({type:String})],exports.ChefUiSelect.prototype,"name",void 0),e([ue({type:Array})],exports.ChefUiSelect.prototype,"options",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiSelect.prototype,"required",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiSelect.prototype,"searchable",void 0),e([ue({type:String})],exports.ChefUiSelect.prototype,"prefixIcon",void 0),e([ue({type:String})],exports.ChefUiSelect.prototype,"searchPlaceholder",void 0),e([fe()],exports.ChefUiSelect.prototype,"isOpen",void 0),e([fe()],exports.ChefUiSelect.prototype,"searchQuery",void 0),e([ve(".dropdown")],exports.ChefUiSelect.prototype,"dropdownEl",void 0),e([ve(".search-input")],exports.ChefUiSelect.prototype,"searchInputEl",void 0),exports.ChefUiSelect=e([he("chef-ui-select")],exports.ChefUiSelect),exports.ChefUiAccordion=class extends ce{constructor(){super(...arguments),this.variant="default",this.multiple=!1,this.collapsible=!0}handleItemToggle(e){if(!this.multiple&&e.detail.expanded){this.querySelectorAll("chef-ui-accordion-item").forEach(t=>{t!==e.target&&(t.expanded=!1)})}}connectedCallback(){super.connectedCallback(),this.addEventListener("accordion-item-toggle",this.handleItemToggle)}disconnectedCallback(){this.removeEventListener("accordion-item-toggle",this.handleItemToggle),super.disconnectedCallback()}render(){return
|
|
446
|
+
`,e([ue({type:String})],exports.ChefUiSelect.prototype,"label",void 0),e([ue({type:String,reflect:!0})],exports.ChefUiSelect.prototype,"placeholder",void 0),e([ue({type:String,reflect:!0})],exports.ChefUiSelect.prototype,"value",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiSelect.prototype,"disabled",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiSelect.prototype,"invalid",void 0),e([ue({type:String})],exports.ChefUiSelect.prototype,"name",void 0),e([ue({type:Array})],exports.ChefUiSelect.prototype,"options",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiSelect.prototype,"required",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiSelect.prototype,"searchable",void 0),e([ue({type:String})],exports.ChefUiSelect.prototype,"prefixIcon",void 0),e([ue({type:String})],exports.ChefUiSelect.prototype,"searchPlaceholder",void 0),e([fe()],exports.ChefUiSelect.prototype,"isOpen",void 0),e([fe()],exports.ChefUiSelect.prototype,"searchQuery",void 0),e([ve(".dropdown")],exports.ChefUiSelect.prototype,"dropdownEl",void 0),e([ve(".search-input")],exports.ChefUiSelect.prototype,"searchInputEl",void 0),exports.ChefUiSelect=e([he("chef-ui-select")],exports.ChefUiSelect),exports.ChefUiAccordion=class extends ce{constructor(){super(...arguments),this.variant="default",this.multiple=!1,this.collapsible=!0}handleItemToggle(e){if(!this.multiple&&e.detail.expanded){this.querySelectorAll("chef-ui-accordion-item").forEach(t=>{t!==e.target&&(t.expanded=!1)})}}connectedCallback(){super.connectedCallback(),this.addEventListener("accordion-item-toggle",this.handleItemToggle)}disconnectedCallback(){this.removeEventListener("accordion-item-toggle",this.handleItemToggle),super.disconnectedCallback()}render(){return Y`
|
|
447
447
|
<div class="accordion-container" role="region">
|
|
448
448
|
<slot></slot>
|
|
449
449
|
</div>
|
|
450
|
-
`}},exports.ChefUiAccordion.styles=
|
|
450
|
+
`}},exports.ChefUiAccordion.styles=a`
|
|
451
451
|
:host {
|
|
452
452
|
display: block;
|
|
453
453
|
--chefui-accordion-bg: #1e293b;
|
|
@@ -486,7 +486,7 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
486
486
|
::slotted(chef-ui-accordion-item) {
|
|
487
487
|
display: block;
|
|
488
488
|
}
|
|
489
|
-
`,e([ue({type:String,reflect:!0})],exports.ChefUiAccordion.prototype,"variant",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiAccordion.prototype,"multiple",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiAccordion.prototype,"collapsible",void 0),exports.ChefUiAccordion=e([he("chef-ui-accordion")],exports.ChefUiAccordion),exports.ChefUiAccordionItem=class extends ce{constructor(){super(...arguments),this.expanded=!1,this.disabled=!1,this.title=""}toggle(){this.disabled||(this.expanded=!this.expanded,this.dispatchEvent(new CustomEvent("accordion-item-toggle",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("chef-toggle",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})))}handleKeyDown(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.toggle())}render(){return
|
|
489
|
+
`,e([ue({type:String,reflect:!0})],exports.ChefUiAccordion.prototype,"variant",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiAccordion.prototype,"multiple",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiAccordion.prototype,"collapsible",void 0),exports.ChefUiAccordion=e([he("chef-ui-accordion")],exports.ChefUiAccordion),exports.ChefUiAccordionItem=class extends ce{constructor(){super(...arguments),this.expanded=!1,this.disabled=!1,this.title=""}toggle(){this.disabled||(this.expanded=!this.expanded,this.dispatchEvent(new CustomEvent("accordion-item-toggle",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("chef-toggle",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})))}handleKeyDown(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.toggle())}render(){return Y`
|
|
490
490
|
<button
|
|
491
491
|
class="header"
|
|
492
492
|
role="button"
|
|
@@ -497,16 +497,16 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
497
497
|
part="header"
|
|
498
498
|
>
|
|
499
499
|
<div class="header-content">
|
|
500
|
-
${this.icon?
|
|
500
|
+
${this.icon?Y`
|
|
501
501
|
<chef-icon class="icon-prefix" name=${this.icon}></chef-icon>
|
|
502
|
-
`:
|
|
502
|
+
`:Y`
|
|
503
503
|
<slot name="icon"></slot>
|
|
504
504
|
`}
|
|
505
505
|
<div>
|
|
506
506
|
<div class="title">
|
|
507
507
|
<slot name="title">${this.title}</slot>
|
|
508
508
|
</div>
|
|
509
|
-
${this.subtitle?
|
|
509
|
+
${this.subtitle?Y`
|
|
510
510
|
<div class="subtitle">
|
|
511
511
|
<slot name="subtitle">${this.subtitle}</slot>
|
|
512
512
|
</div>
|
|
@@ -514,7 +514,7 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
514
514
|
</div>
|
|
515
515
|
</div>
|
|
516
516
|
<div class="header-end">
|
|
517
|
-
${this.badge?
|
|
517
|
+
${this.badge?Y`
|
|
518
518
|
<span class="badge">${this.badge}</span>
|
|
519
519
|
`:null}
|
|
520
520
|
<slot name="badge"></slot>
|
|
@@ -528,7 +528,7 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
528
528
|
</div>
|
|
529
529
|
</div>
|
|
530
530
|
</div>
|
|
531
|
-
`}},exports.ChefUiAccordionItem.styles=
|
|
531
|
+
`}},exports.ChefUiAccordionItem.styles=a`
|
|
532
532
|
:host {
|
|
533
533
|
display: block;
|
|
534
534
|
background: var(--chefui-accordion-bg, #1e293b);
|
|
@@ -687,5 +687,371 @@ function ve(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
687
687
|
width: 20px;
|
|
688
688
|
height: 20px;
|
|
689
689
|
}
|
|
690
|
-
`,e([ue({type:Boolean,reflect:!0})],exports.ChefUiAccordionItem.prototype,"expanded",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiAccordionItem.prototype,"disabled",void 0),e([ue({type:String})],exports.ChefUiAccordionItem.prototype,"title",void 0),e([ue({type:String})],exports.ChefUiAccordionItem.prototype,"subtitle",void 0),e([ue({type:String})],exports.ChefUiAccordionItem.prototype,"badge",void 0),e([ue({type:String})],exports.ChefUiAccordionItem.prototype,"icon",void 0),e([ue({type:String,reflect:!0})],exports.ChefUiAccordionItem.prototype,"variant",void 0),exports.ChefUiAccordionItem=e([he("chef-ui-accordion-item")],exports.ChefUiAccordionItem),exports.
|
|
690
|
+
`,e([ue({type:Boolean,reflect:!0})],exports.ChefUiAccordionItem.prototype,"expanded",void 0),e([ue({type:Boolean,reflect:!0})],exports.ChefUiAccordionItem.prototype,"disabled",void 0),e([ue({type:String})],exports.ChefUiAccordionItem.prototype,"title",void 0),e([ue({type:String})],exports.ChefUiAccordionItem.prototype,"subtitle",void 0),e([ue({type:String})],exports.ChefUiAccordionItem.prototype,"badge",void 0),e([ue({type:String})],exports.ChefUiAccordionItem.prototype,"icon",void 0),e([ue({type:String,reflect:!0})],exports.ChefUiAccordionItem.prototype,"variant",void 0),exports.ChefUiAccordionItem=e([he("chef-ui-accordion-item")],exports.ChefUiAccordionItem),exports.ChefUiCalendar=class extends ce{constructor(){super(...arguments),this.value="",this.disabledDates=[],this.highlightedDates=[],this.showToday=!0,this.showClear=!1,this.showFooter=!0,this.showLegend=!1,this.mode="single",this.weekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],this.firstDayOfWeek=0,this.showMonthYearDropdowns=!0,this.currentMonth=new Date,this.today=this.formatDate(new Date)}connectedCallback(){super.connectedCallback(),this.focusDate?this.currentMonth=this.parseDate(this.focusDate):this.value&&(this.currentMonth=this.parseDate(this.value))}formatDate(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}parseDate(e){const[t,i,o]=e.split("-").map(Number);return new Date(t,i-1,o)}isSameDay(e,t){return this.formatDate(e)===this.formatDate(t)}isDateDisabled(e){return!!this.disabledDates.includes(e)||(!!(this.min&&e<this.min)||(!!(this.max&&e>this.max)||!!(this.availableDates&&this.availableDates.length>0)&&!this.availableDates.includes(e)))}isDateInRange(e){return!("range"!==this.mode||!this.rangeStart||!this.rangeEnd)&&(e>this.rangeStart&&e<this.rangeEnd)}previousMonth(){this.currentMonth=new Date(this.currentMonth.getFullYear(),this.currentMonth.getMonth()-1),this.requestUpdate()}nextMonth(){this.currentMonth=new Date(this.currentMonth.getFullYear(),this.currentMonth.getMonth()+1),this.requestUpdate()}selectDate(e,t){if(!t)if("range"===this.mode)!this.rangeStart||this.rangeStart&&this.rangeEnd?(this.rangeStart=e,this.rangeEnd=void 0):(e<this.rangeStart?(this.rangeEnd=this.rangeStart,this.rangeStart=e):this.rangeEnd=e,this.dispatchEvent(new CustomEvent("chef-range-change",{detail:{rangeStart:this.rangeStart,rangeEnd:this.rangeEnd},bubbles:!0,composed:!0})));else{const t=this.value;this.value=e,this.dispatchEvent(new CustomEvent("chef-change",{detail:{value:this.value,oldValue:t,date:this.parseDate(e)},bubbles:!0,composed:!0}))}}goToToday(){this.currentMonth=new Date,"single"===this.mode&&(this.value=this.today,this.dispatchEvent(new CustomEvent("chef-change",{detail:{value:this.value,date:new Date},bubbles:!0,composed:!0})))}clearSelection(){this.value="",this.rangeStart=void 0,this.rangeEnd=void 0,this.dispatchEvent(new CustomEvent("chef-clear",{bubbles:!0,composed:!0}))}getDaysInMonth(){const e=this.currentMonth.getFullYear(),t=this.currentMonth.getMonth(),i=(new Date(e,t,1).getDay()-this.firstDayOfWeek+7)%7,o=new Date(e,t+1,0).getDate(),r=[],s=new Date(e,t,0).getDate();for(let o=i-1;o>=0;o--){const i=new Date(e,t-1,s-o);r.push({date:i,dateString:this.formatDate(i),outOfMonth:!0})}for(let i=1;i<=o;i++){const o=new Date(e,t,i);r.push({date:o,dateString:this.formatDate(o),outOfMonth:!1})}const a=42-r.length;for(let i=1;i<=a;i++){const o=new Date(e,t+1,i);r.push({date:o,dateString:this.formatDate(o),outOfMonth:!0})}return r}getMonthYearLabel(){return`${["January","February","March","April","May","June","July","August","September","October","November","December"][this.currentMonth.getMonth()]} ${this.currentMonth.getFullYear()}`}getAvailableYears(){if(this.availableYears&&this.availableYears.length>0)return this.availableYears;const e=(new Date).getFullYear(),t=this.startYear||e-10,i=this.endYear||e+10,o=[];for(let e=t;e<=i;e++)o.push(e);return o}getAvailableMonthsForDisplay(){if(this.availableMonths&&this.availableMonths.length>0)return this.availableMonths;const e=[];for(let t=0;t<12;t++)e.push(t);return e}isMonthAvailable(e,t){if(this.availableMonths&&this.availableMonths.length>0&&!this.availableMonths.includes(e))return!1;if(void 0!==this.startMonth||void 0!==this.endMonth){if(t===this.currentMonth.getFullYear()){if(void 0!==this.startMonth&&e<this.startMonth)return!1;if(void 0!==this.endMonth&&e>this.endMonth)return!1}}return!0}handleMonthChange(e){const t=e.target,i=parseInt(t.value);this.currentMonth=new Date(this.currentMonth.getFullYear(),i,1),this.requestUpdate(),this.dispatchEvent(new CustomEvent("chef-month-change",{detail:{month:i,year:this.currentMonth.getFullYear()},bubbles:!0,composed:!0}))}handleYearChange(e){const t=e.target,i=parseInt(t.value);this.currentMonth=new Date(i,this.currentMonth.getMonth(),1),this.requestUpdate(),this.dispatchEvent(new CustomEvent("chef-year-change",{detail:{year:i,month:this.currentMonth.getMonth()},bubbles:!0,composed:!0}))}getMonthNames(){return["January","February","March","April","May","June","July","August","September","October","November","December"]}getWeekdaysAdjusted(){const e=[...this.weekdays];for(let t=0;t<this.firstDayOfWeek;t++)e.push(e.shift());return e}render(){const e=this.getDaysInMonth(),t=this.getWeekdaysAdjusted(),i=this.getMonthNames(),o=this.getAvailableYears(),r=this.getAvailableMonthsForDisplay(),s=this.currentMonth.getFullYear(),a=this.currentMonth.getMonth();return Y`
|
|
691
|
+
<div class="calendar-container" role="application" aria-label="Calendar">
|
|
692
|
+
<div class="header">
|
|
693
|
+
<button
|
|
694
|
+
class="nav-button"
|
|
695
|
+
@click=${this.previousMonth}
|
|
696
|
+
aria-label="Previous month"
|
|
697
|
+
part="nav-button"
|
|
698
|
+
>
|
|
699
|
+
<chef-icon name="chevron-left"></chef-icon>
|
|
700
|
+
</button>
|
|
701
|
+
|
|
702
|
+
<div class="header-title" part="header-title">
|
|
703
|
+
${this.showMonthYearDropdowns?Y`
|
|
704
|
+
<select
|
|
705
|
+
class="month-select"
|
|
706
|
+
@change=${this.handleMonthChange}
|
|
707
|
+
.value=${a.toString()}
|
|
708
|
+
aria-label="Select month"
|
|
709
|
+
part="month-select"
|
|
710
|
+
>
|
|
711
|
+
${r.map(e=>Y`
|
|
712
|
+
<option
|
|
713
|
+
value=${e}
|
|
714
|
+
?selected=${e===a}
|
|
715
|
+
?disabled=${!this.isMonthAvailable(e,s)}
|
|
716
|
+
>
|
|
717
|
+
${i[e]}
|
|
718
|
+
</option>
|
|
719
|
+
`)}
|
|
720
|
+
</select>
|
|
721
|
+
|
|
722
|
+
<select
|
|
723
|
+
class="year-select"
|
|
724
|
+
@change=${this.handleYearChange}
|
|
725
|
+
.value=${s.toString()}
|
|
726
|
+
aria-label="Select year"
|
|
727
|
+
part="year-select"
|
|
728
|
+
>
|
|
729
|
+
${o.map(e=>Y`
|
|
730
|
+
<option value=${e} ?selected=${e===s}>
|
|
731
|
+
${e}
|
|
732
|
+
</option>
|
|
733
|
+
`)}
|
|
734
|
+
</select>
|
|
735
|
+
`:Y`
|
|
736
|
+
${this.getMonthYearLabel()}
|
|
737
|
+
`}
|
|
738
|
+
</div>
|
|
739
|
+
|
|
740
|
+
<button
|
|
741
|
+
class="nav-button"
|
|
742
|
+
@click=${this.nextMonth}
|
|
743
|
+
aria-label="Next month"
|
|
744
|
+
part="nav-button"
|
|
745
|
+
>
|
|
746
|
+
<chef-icon name="chevron-right"></chef-icon>
|
|
747
|
+
</button>
|
|
748
|
+
</div>
|
|
749
|
+
|
|
750
|
+
<div class="weekdays">
|
|
751
|
+
${t.map(e=>Y`
|
|
752
|
+
<div class="weekday">${e}</div>
|
|
753
|
+
`)}
|
|
754
|
+
</div>
|
|
755
|
+
|
|
756
|
+
<div class="days" role="grid">
|
|
757
|
+
${e.map(({date:e,dateString:t,outOfMonth:i})=>{const o=t===this.today,r=t===this.value,s=this.isDateDisabled(t),a=this.availableDates?.includes(t),n=this.highlightedDates.includes(t),c=t===this.focusDate,l=this.isDateInRange(t),h=t===this.rangeStart,d=t===this.rangeEnd,p=["day",i&&"out-of-month",o&&"today",r&&"selected",s&&"disabled",a&&"available",c&&"focused",l&&"in-range",h&&"range-start",d&&"range-end"].filter(Boolean).join(" ");return Y`
|
|
758
|
+
<button
|
|
759
|
+
class=${p}
|
|
760
|
+
@click=${()=>this.selectDate(t,s)}
|
|
761
|
+
aria-label=${`${e.getDate()} ${this.getMonthYearLabel()}`}
|
|
762
|
+
aria-selected=${r}
|
|
763
|
+
aria-disabled=${s}
|
|
764
|
+
role="gridcell"
|
|
765
|
+
part="day"
|
|
766
|
+
>
|
|
767
|
+
${e.getDate()}
|
|
768
|
+
${n?Y`<span class="day-indicator"></span>`:null}
|
|
769
|
+
</button>
|
|
770
|
+
`})}
|
|
771
|
+
</div>
|
|
772
|
+
|
|
773
|
+
${this.showFooter?Y`
|
|
774
|
+
<div class="footer">
|
|
775
|
+
${this.showToday?Y`
|
|
776
|
+
<button class="footer-button" @click=${this.goToToday}>
|
|
777
|
+
Today
|
|
778
|
+
</button>
|
|
779
|
+
`:null}
|
|
780
|
+
${this.showClear?Y`
|
|
781
|
+
<button class="footer-button" @click=${this.clearSelection}>
|
|
782
|
+
Clear
|
|
783
|
+
</button>
|
|
784
|
+
`:null}
|
|
785
|
+
</div>
|
|
786
|
+
`:null}
|
|
787
|
+
|
|
788
|
+
${this.showLegend?Y`
|
|
789
|
+
<div class="legend">
|
|
790
|
+
<div class="legend-item">
|
|
791
|
+
<div class="legend-box" style="background: var(--chefui-calendar-selected-bg);"></div>
|
|
792
|
+
<span>Selected</span>
|
|
793
|
+
</div>
|
|
794
|
+
<div class="legend-item">
|
|
795
|
+
<div class="legend-box" style="background: var(--chefui-calendar-today-bg); border-color: var(--chefui-calendar-today-border);"></div>
|
|
796
|
+
<span>Today</span>
|
|
797
|
+
</div>
|
|
798
|
+
${this.availableDates?Y`
|
|
799
|
+
<div class="legend-item">
|
|
800
|
+
<div class="legend-box" style="background: var(--chefui-calendar-available-bg); border-color: var(--chefui-calendar-available-border);"></div>
|
|
801
|
+
<span>Available</span>
|
|
802
|
+
</div>
|
|
803
|
+
`:null}
|
|
804
|
+
</div>
|
|
805
|
+
`:null}
|
|
806
|
+
</div>
|
|
807
|
+
`}},exports.ChefUiCalendar.styles=a`
|
|
808
|
+
:host {
|
|
809
|
+
display: block;
|
|
810
|
+
--chefui-calendar-bg: #1e293b;
|
|
811
|
+
--chefui-calendar-border: #334155;
|
|
812
|
+
--chefui-calendar-text: #e2e8f0;
|
|
813
|
+
--chefui-calendar-text-muted: #94a3b8;
|
|
814
|
+
--chefui-calendar-accent: #7c3aed;
|
|
815
|
+
--chefui-calendar-accent-hover: #6d28d9;
|
|
816
|
+
--chefui-calendar-today-bg: rgba(59, 130, 246, 0.15);
|
|
817
|
+
--chefui-calendar-today-border: #3b82f6;
|
|
818
|
+
--chefui-calendar-selected-bg: var(--chefui-calendar-accent);
|
|
819
|
+
--chefui-calendar-selected-text: #ffffff;
|
|
820
|
+
--chefui-calendar-disabled-text: #475569;
|
|
821
|
+
--chefui-calendar-disabled-bg: transparent;
|
|
822
|
+
--chefui-calendar-available-bg: rgba(16, 185, 129, 0.15);
|
|
823
|
+
--chefui-calendar-available-border: #10b981;
|
|
824
|
+
--chefui-calendar-radius: 12px;
|
|
825
|
+
--chefui-calendar-cell-size: 40px;
|
|
826
|
+
--chefui-calendar-transition: 150ms ease;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
.calendar-container {
|
|
830
|
+
background: var(--chefui-calendar-bg);
|
|
831
|
+
border: 1px solid var(--chefui-calendar-border);
|
|
832
|
+
border-radius: var(--chefui-calendar-radius);
|
|
833
|
+
padding: 16px;
|
|
834
|
+
max-width: 100%;
|
|
835
|
+
box-sizing: border-box;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
.header {
|
|
839
|
+
display: flex;
|
|
840
|
+
align-items: center;
|
|
841
|
+
justify-content: space-between;
|
|
842
|
+
margin-bottom: 16px;
|
|
843
|
+
gap: 12px;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
.header-title {
|
|
847
|
+
font-size: 16px;
|
|
848
|
+
font-weight: 600;
|
|
849
|
+
color: var(--chefui-calendar-text);
|
|
850
|
+
flex: 1;
|
|
851
|
+
text-align: center;
|
|
852
|
+
display: flex;
|
|
853
|
+
align-items: center;
|
|
854
|
+
justify-content: center;
|
|
855
|
+
gap: 8px;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
.month-select,
|
|
859
|
+
.year-select {
|
|
860
|
+
all: unset;
|
|
861
|
+
padding: 6px 10px;
|
|
862
|
+
border-radius: 6px;
|
|
863
|
+
background: rgba(124, 58, 237, 0.1);
|
|
864
|
+
cursor: pointer;
|
|
865
|
+
transition: background-color var(--chefui-calendar-transition);
|
|
866
|
+
font-size: 15px;
|
|
867
|
+
font-weight: 600;
|
|
868
|
+
color: var(--chefui-calendar-text);
|
|
869
|
+
border: 1px solid transparent;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.month-select:hover,
|
|
873
|
+
.year-select:hover {
|
|
874
|
+
background: rgba(124, 58, 237, 0.2);
|
|
875
|
+
border-color: rgba(124, 58, 237, 0.3);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.month-select:focus,
|
|
879
|
+
.year-select:focus {
|
|
880
|
+
outline: none;
|
|
881
|
+
border-color: var(--chefui-calendar-accent);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
.month-select option,
|
|
885
|
+
.year-select option {
|
|
886
|
+
background: var(--chefui-calendar-bg);
|
|
887
|
+
color: var(--chefui-calendar-text);
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.nav-button {
|
|
891
|
+
all: unset;
|
|
892
|
+
width: 32px;
|
|
893
|
+
height: 32px;
|
|
894
|
+
display: flex;
|
|
895
|
+
align-items: center;
|
|
896
|
+
justify-content: center;
|
|
897
|
+
border-radius: 8px;
|
|
898
|
+
cursor: pointer;
|
|
899
|
+
transition: background-color var(--chefui-calendar-transition);
|
|
900
|
+
color: var(--chefui-calendar-text);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.nav-button:hover {
|
|
904
|
+
background: rgba(124, 58, 237, 0.15);
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
.nav-button:active {
|
|
908
|
+
background: rgba(124, 58, 237, 0.25);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
.nav-button:disabled {
|
|
912
|
+
opacity: 0.3;
|
|
913
|
+
cursor: not-allowed;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
.weekdays {
|
|
917
|
+
display: grid;
|
|
918
|
+
grid-template-columns: repeat(7, 1fr);
|
|
919
|
+
gap: 4px;
|
|
920
|
+
margin-bottom: 8px;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
.weekday {
|
|
924
|
+
text-align: center;
|
|
925
|
+
font-size: 12px;
|
|
926
|
+
font-weight: 600;
|
|
927
|
+
color: var(--chefui-calendar-text-muted);
|
|
928
|
+
padding: 8px 0;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
.days {
|
|
932
|
+
display: grid;
|
|
933
|
+
grid-template-columns: repeat(7, 1fr);
|
|
934
|
+
gap: 4px;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
.day {
|
|
938
|
+
all: unset;
|
|
939
|
+
aspect-ratio: 1;
|
|
940
|
+
min-height: var(--chefui-calendar-cell-size);
|
|
941
|
+
display: flex;
|
|
942
|
+
align-items: center;
|
|
943
|
+
justify-content: center;
|
|
944
|
+
font-size: 14px;
|
|
945
|
+
border-radius: 8px;
|
|
946
|
+
cursor: pointer;
|
|
947
|
+
transition: all var(--chefui-calendar-transition);
|
|
948
|
+
color: var(--chefui-calendar-text);
|
|
949
|
+
position: relative;
|
|
950
|
+
box-sizing: border-box;
|
|
951
|
+
border: 2px solid transparent;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
.day:hover:not(.disabled):not(.out-of-month) {
|
|
955
|
+
background: rgba(124, 58, 237, 0.1);
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
.day.out-of-month {
|
|
959
|
+
color: var(--chefui-calendar-text-muted);
|
|
960
|
+
opacity: 0.3;
|
|
961
|
+
cursor: default;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
.day.today {
|
|
965
|
+
background: var(--chefui-calendar-today-bg);
|
|
966
|
+
border-color: var(--chefui-calendar-today-border);
|
|
967
|
+
font-weight: 600;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
.day.selected {
|
|
971
|
+
background: var(--chefui-calendar-selected-bg);
|
|
972
|
+
color: var(--chefui-calendar-selected-text);
|
|
973
|
+
font-weight: 600;
|
|
974
|
+
border-color: var(--chefui-calendar-selected-bg);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
.day.disabled {
|
|
978
|
+
color: var(--chefui-calendar-disabled-text);
|
|
979
|
+
background: var(--chefui-calendar-disabled-bg);
|
|
980
|
+
cursor: not-allowed;
|
|
981
|
+
opacity: 0.4;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
.day.available:not(.selected):not(.disabled) {
|
|
985
|
+
background: var(--chefui-calendar-available-bg);
|
|
986
|
+
border-color: var(--chefui-calendar-available-border);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
.day.in-range:not(.selected):not(.disabled) {
|
|
990
|
+
background: rgba(124, 58, 237, 0.1);
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
.day.range-start,
|
|
994
|
+
.day.range-end {
|
|
995
|
+
background: var(--chefui-calendar-selected-bg);
|
|
996
|
+
color: var(--chefui-calendar-selected-text);
|
|
997
|
+
font-weight: 600;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
.day-indicator {
|
|
1001
|
+
position: absolute;
|
|
1002
|
+
bottom: 3px;
|
|
1003
|
+
width: 4px;
|
|
1004
|
+
height: 4px;
|
|
1005
|
+
border-radius: 50%;
|
|
1006
|
+
background: var(--chefui-calendar-accent);
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
.footer {
|
|
1010
|
+
margin-top: 12px;
|
|
1011
|
+
padding-top: 12px;
|
|
1012
|
+
border-top: 1px solid var(--chefui-calendar-border);
|
|
1013
|
+
display: flex;
|
|
1014
|
+
gap: 8px;
|
|
1015
|
+
flex-wrap: wrap;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.footer-button {
|
|
1019
|
+
all: unset;
|
|
1020
|
+
padding: 6px 12px;
|
|
1021
|
+
border-radius: 6px;
|
|
1022
|
+
font-size: 13px;
|
|
1023
|
+
cursor: pointer;
|
|
1024
|
+
transition: all var(--chefui-calendar-transition);
|
|
1025
|
+
color: var(--chefui-calendar-text);
|
|
1026
|
+
background: rgba(124, 58, 237, 0.1);
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
.footer-button:hover {
|
|
1030
|
+
background: rgba(124, 58, 237, 0.2);
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
.legend {
|
|
1034
|
+
margin-top: 12px;
|
|
1035
|
+
padding-top: 12px;
|
|
1036
|
+
border-top: 1px solid var(--chefui-calendar-border);
|
|
1037
|
+
display: flex;
|
|
1038
|
+
flex-wrap: wrap;
|
|
1039
|
+
gap: 12px;
|
|
1040
|
+
font-size: 12px;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
.legend-item {
|
|
1044
|
+
display: flex;
|
|
1045
|
+
align-items: center;
|
|
1046
|
+
gap: 6px;
|
|
1047
|
+
color: var(--chefui-calendar-text-muted);
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
.legend-box {
|
|
1051
|
+
width: 16px;
|
|
1052
|
+
height: 16px;
|
|
1053
|
+
border-radius: 4px;
|
|
1054
|
+
border: 2px solid transparent;
|
|
1055
|
+
}
|
|
1056
|
+
`,e([ue({type:String})],exports.ChefUiCalendar.prototype,"value",void 0),e([ue({type:String})],exports.ChefUiCalendar.prototype,"min",void 0),e([ue({type:String})],exports.ChefUiCalendar.prototype,"max",void 0),e([ue({type:Array})],exports.ChefUiCalendar.prototype,"disabledDates",void 0),e([ue({type:Array})],exports.ChefUiCalendar.prototype,"availableDates",void 0),e([ue({type:Array})],exports.ChefUiCalendar.prototype,"highlightedDates",void 0),e([ue({type:String})],exports.ChefUiCalendar.prototype,"focusDate",void 0),e([ue({type:Boolean})],exports.ChefUiCalendar.prototype,"showToday",void 0),e([ue({type:Boolean})],exports.ChefUiCalendar.prototype,"showClear",void 0),e([ue({type:Boolean})],exports.ChefUiCalendar.prototype,"showFooter",void 0),e([ue({type:Boolean})],exports.ChefUiCalendar.prototype,"showLegend",void 0),e([ue({type:String})],exports.ChefUiCalendar.prototype,"mode",void 0),e([ue({type:String})],exports.ChefUiCalendar.prototype,"rangeStart",void 0),e([ue({type:String})],exports.ChefUiCalendar.prototype,"rangeEnd",void 0),e([ue({type:Array})],exports.ChefUiCalendar.prototype,"weekdays",void 0),e([ue({type:Number})],exports.ChefUiCalendar.prototype,"firstDayOfWeek",void 0),e([ue({type:Number})],exports.ChefUiCalendar.prototype,"startYear",void 0),e([ue({type:Number})],exports.ChefUiCalendar.prototype,"endYear",void 0),e([ue({type:Number})],exports.ChefUiCalendar.prototype,"startMonth",void 0),e([ue({type:Number})],exports.ChefUiCalendar.prototype,"endMonth",void 0),e([ue({type:Array})],exports.ChefUiCalendar.prototype,"availableMonths",void 0),e([ue({type:Array})],exports.ChefUiCalendar.prototype,"availableYears",void 0),e([ue({type:Boolean})],exports.ChefUiCalendar.prototype,"showMonthYearDropdowns",void 0),e([fe()],exports.ChefUiCalendar.prototype,"currentMonth",void 0),e([fe()],exports.ChefUiCalendar.prototype,"today",void 0),exports.ChefUiCalendar=e([he("chef-ui-calendar")],exports.ChefUiCalendar),exports.IconResolver=ge,exports.iconResolver=be;
|
|
691
1057
|
//# sourceMappingURL=index.cjs.map
|