@phatvu/web-component-poc 1.0.5 → 1.0.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.
- package/dist/cjs/fast-button.cjs.entry.js +46 -0
- package/dist/cjs/{fast-button_4.cjs.entry.js → fast-carousel.cjs.entry.js} +1 -231
- package/dist/cjs/fast-input_4.cjs.entry.js +499 -0
- package/dist/cjs/{index-B2BTpdbN.js → index-BEvZs91D.js} +2 -2
- package/dist/cjs/job-card.cjs.entry.js +138 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/web-component-poc.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/button/button.js +2 -2
- package/dist/collection/components/fast-input/fast-input.css +55 -0
- package/dist/collection/components/fast-input/fast-input.js +335 -0
- package/dist/collection/components/job-card/job-card.css +247 -0
- package/dist/collection/components/job-card/job-card.js +435 -0
- package/dist/collection/components/jobs-item/jobs-item.js +5 -5
- package/dist/collection/components/jobs-list-only/jobs-list-only.js +185 -8
- package/dist/collection/components/jobs-list-reactive/jobs-list-reactive.css +8 -0
- package/dist/collection/components/jobs-list-reactive/jobs-list-reactive.js +203 -0
- package/dist/components/fast-button.js +1 -1
- package/dist/components/fast-carousel.js +1 -1
- package/dist/components/fast-input.d.ts +11 -0
- package/dist/components/fast-input.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/job-card.d.ts +11 -0
- package/dist/components/job-card.js +1 -0
- package/dist/components/jobs-item.js +1 -1
- package/dist/components/jobs-list-only.js +1 -1
- package/dist/components/jobs-list-reactive.d.ts +11 -0
- package/dist/components/jobs-list-reactive.js +1 -0
- package/dist/components/{p-ClQDwJJB.js → p-DQiaLjLf.js} +1 -1
- package/dist/esm/fast-button.entry.js +44 -0
- package/dist/esm/{fast-button_4.entry.js → fast-carousel.entry.js} +2 -229
- package/dist/esm/fast-input_4.entry.js +494 -0
- package/dist/esm/{index-Dk5CvWmb.js → index-C_ZLQIpp.js} +2 -2
- package/dist/esm/job-card.entry.js +136 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/web-component-poc.js +3 -3
- package/dist/types/components/fast-input/fast-input.d.ts +37 -0
- package/dist/types/components/job-card/job-card.d.ts +93 -0
- package/dist/types/components/jobs-item/jobs-item.d.ts +2 -2
- package/dist/types/components/jobs-list-only/jobs-list-only.d.ts +24 -2
- package/dist/types/components/jobs-list-reactive/jobs-list-reactive.d.ts +26 -0
- package/dist/types/components.d.ts +469 -7
- package/dist/types/mock/jobs-list-only.mock.d.ts +2 -2
- package/dist/types/types/jobs-list.d.ts +6 -2
- package/dist/web-component-poc/p-618fba28.entry.js +1 -0
- package/dist/web-component-poc/p-7d45772f.entry.js +1 -0
- package/dist/web-component-poc/p-bef7c8e2.entry.js +1 -0
- package/dist/web-component-poc/p-cfb9aed9.entry.js +1 -0
- package/dist/web-component-poc/web-component-poc.esm.js +1 -1
- package/hydrate/index.js +534 -6
- package/hydrate/index.mjs +534 -6
- package/package.json +9 -1
- package/dist/web-component-poc/p-df843533.entry.js +0 -1
- /package/dist/components/{p-UM9TUfe3.js → p-BiaJAQXY.js} +0 -0
- /package/dist/web-component-poc/{p-Dk5CvWmb.js → p-C_ZLQIpp.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as o,H as t,h as r}from"./p-BiaJAQXY.js";const a=o(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}job;index=0;applyButtonText="Apply Now";showBrand=!0;showReference=!1;showEmploymentType=!0;multiLocationText="More locations";remoteLocationText="Remote";enableKilometers=!1;showCommuteTime=!1;streetFormat="{street}, {city_state_abbr}";rootClass="";extraFieldsConfig=[];formatDistance(e){const o=this.enableKilometers?"Km":"Miles";return`${(this.enableKilometers?1.60934*e:e).toFixed(1)} ${o}`.replace(".0","")}isEmpty(e){return null==e||""===e||!(!Array.isArray(e)||0!==e.length)}getJobData(){if(!this.job)return null;if("string"==typeof this.job)try{return JSON.parse(this.job)}catch{return console.warn("job-card: Failed to parse job JSON string"),null}return this.job}render(){const e=this.getJobData();if(!e)return null;const o=function(e){const o=e.locations;if(o?.length)return o[0]}(e),t=o?function(e){return e.cityStateAbbr?e.cityStateAbbr:[e.streetAddress,e.city,e.stateAbbr||e.state,e.countryAbbr||e.country].filter(Boolean).join(", ")||e.locationText||""}(o):"",a=o?.distance??0,n=a>0?this.formatDistance(a):"",s=e.applyURL||(e.originalURL?`${"undefined"!=typeof window?window.location.origin:""}${e.originalURL}`:"#"),i=`${this.applyButtonText}, ${e.title||""}`,c=e.locations??[],l=c.length>1;return r("div",{class:("job-card "+this.rootClass).trim()},r("div",{class:"job-card__header"},r("h3",{class:"job-card__title"},r("a",{class:"job-card__title--link",href:s,target:"_blank",rel:"noopener noreferrer"},e.title||""),this.showReference&&r("span",{class:"job-card__reference "+(e.reference?"":"job-card__reference--empty")},e.reference||""),e.isRemote&&r("span",{class:this.remoteLocationText?"job-card__remote":"job-card__remote job-card__remote--empty"},this.remoteLocationText)),n&&r("div",{class:"job-card__distance"},r("span",{class:"job-card__distance--icon"},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},r("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z"}),r("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 8v4l2 2"}))),r("span",{class:"job-card__distance--label"},n))),r("div",{class:"job-card__content"},r("div",{class:"job-card__info"},r("div",{class:c.length?"job-card__street":"job-card__street job-card__street--empty"},r("div",{class:"job-card__street--label__wrapper"},r("span",{class:"job-card__street--icon"},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},r("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"}),r("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0z"}))),r("span",{class:"job-card__street--label"},t||"—")),l&&r("div",{class:"job-card__street--more-locations__wrapper"},r("span",{class:"job-card__street--amount"},"+",c.length-1),r("span",{class:"job-card__street--more-locations"},this.multiLocationText))),this.showBrand&&r("div",{class:e.brandName?"job-card__brand":"job-card__brand job-card__brand--empty"},r("span",{class:"job-card__brand--icon"},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},r("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21m-3.75 3.75h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008z"}))),r("span",{class:"job-card__brand--label"},e.brandName||"—")),this.showEmploymentType&&r("div",{class:e.employmentType?.length?"job-card__employment-type":"job-card__employment-type job-card__employment-type--empty"},r("span",{class:"job-card__employment-type--icon"},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},r("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0z"}))),e.employmentType?.length?e.employmentType?.map((e=>r("span",{key:e,class:"job-card__employment-type--label"},e))):r("span",{class:"job-card__employment-type--label"},"—")),(e.jobCardExtraFields??[]).length>0&&e.jobCardExtraFields?.map(((e,o)=>r("div",{key:o,class:this.isEmpty(e.value)?e.classname+"--empty":""+e.classname},Array.isArray(e.value)?e.value.map(((o,t)=>r("span",{key:t,class:e.classname+"--label"},o))):r("span",{class:e.classname+"--label"},e.value))))),r("a",{class:"job-card__apply",href:s,target:"_blank",rel:"noopener noreferrer","aria-label":i},r("span",{class:"job-card__apply--label"},this.applyButtonText),r("span",{class:"job-card__apply--icon"},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},r("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))))))}static get style(){return".job-card{display:block;padding:16px;border:1px solid #e0e0e0;border-radius:8px;background-color:#fff;box-shadow:0 2px 4px rgba(0, 0, 0, 0.08);transition:box-shadow 0.2s ease, border-color 0.2s ease}.job-card:hover{box-shadow:0 4px 8px rgba(0, 0, 0, 0.12);border-color:#d0d0d0}.job-card__header{margin-bottom:12px}.job-card__title{margin:0;font-size:18px;font-weight:700;display:flex;align-items:center;flex-wrap:wrap;gap:8px}.job-card__title--link{text-decoration:none;color:#1f9755;transition:color 0.2s ease}.job-card__title--link:hover{text-decoration:underline;color:#1a7a43}.job-card__reference{font-size:0.875em;color:#666;background-color:#f5f5f5;padding:2px 6px;border-radius:3px}.job-card__reference--empty{display:none}.job-card__remote{background:#e8f5e9;color:#2e7d32;border-radius:100px;padding:4px 12px;text-transform:uppercase;font-size:11px;font-weight:700;line-height:1.5;white-space:nowrap}.job-card__remote--empty{display:none}.job-card__distance{display:inline-flex;align-items:center;gap:4px;margin-top:6px;font-size:13px;font-weight:500;color:#555}.job-card__distance--icon{display:inline-flex;align-items:center}.job-card__distance--icon svg{width:16px;height:16px;color:#1f9755}.job-card__content{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.job-card__info{flex:1;display:flex;flex-direction:column;gap:8px}.job-card__street,.job-card__brand,.job-card__employment-type{display:flex;align-items:center;flex-wrap:wrap;gap:4px 6px;font-size:14px}.job-card__street--empty,.job-card__brand--empty,.job-card__employment-type--empty{color:#999}.job-card__street--icon,.job-card__brand--icon,.job-card__employment-type--icon{display:inline-flex;align-items:center;flex-shrink:0}.job-card__street--icon svg,.job-card__brand--icon svg,.job-card__employment-type--icon svg{width:16px;height:16px;color:#666}.job-card__street--label,.job-card__brand--label,.job-card__employment-type--label{color:#333}.job-card__street--label__wrapper{display:flex;align-items:center;gap:6px}.job-card__street--more-locations__wrapper{display:flex;align-items:center;gap:2px;font-size:12px;margin-left:2px}.job-card__street--amount{font-weight:600;color:#1f9755}.job-card__street--more-locations{color:#999}.job-card__apply{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:10px 16px;background-color:#198754;color:#fff;border-radius:4px;text-decoration:none;font-weight:600;font-size:14px;transition:background-color 0.2s ease, transform 0.1s ease;white-space:nowrap;flex-shrink:0}.job-card__apply:hover{background-color:#1a6f47;transform:translateY(-1px)}.job-card__apply:active{transform:translateY(0)}.job-card__apply--icon{display:inline-flex;align-items:center}.job-card__apply--icon svg{width:14px;height:14px}@media (max-width: 768px){.job-card{padding:12px}.job-card__content{flex-direction:column;gap:10px}.job-card__apply{width:100%;justify-content:center}.job-card__title{font-size:16px}}@media (max-width: 480px){.job-card{padding:10px}.job-card__title{font-size:15px}.job-card__distance{font-size:12px}.job-card__street,.job-card__brand,.job-card__employment-type{font-size:13px}}"}},[512,"job-card",{job:[1],index:[2],applyButtonText:[1,"apply-button-text"],showBrand:[4,"show-brand"],showReference:[4,"show-reference"],showEmploymentType:[4,"show-employment-type"],multiLocationText:[1,"multi-location-text"],remoteLocationText:[1,"remote-location-text"],enableKilometers:[4,"enable-kilometers"],showCommuteTime:[4,"show-commute-time"],streetFormat:[1,"street-format"],rootClass:[1,"root-class"],extraFieldsConfig:[16]}]);function n(){"undefined"!=typeof customElements&&["job-card"].forEach((o=>{"job-card"===o&&(customElements.get(e(o))||customElements.define(e(o),a))}))}n();const s=a,i=n;export{s as JobCard,i as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as o,d as s}from"./p-
|
|
1
|
+
import{J as o,d as s}from"./p-DQiaLjLf.js";const a=o,p=s;export{a as JobsItem,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as s,h as
|
|
1
|
+
import{t as e,p as t,H as s,c as o,h as i}from"./p-BiaJAQXY.js";import{d as a}from"./p-DQiaLjLf.js";const r=[{title:"Senior Software Engineer",reference:"REF-001",originalURL:"/jobs/senior-software-engineer",applyURL:"https://apply.example.com/1",brandName:"Engineering",isRemote:!1,locations:[{city:"San Francisco",stateAbbr:"CA",countryAbbr:"US",distance:5.2,streetAddress:"123 Market St",cityStateAbbr:"San Francisco, CA"}],employmentType:["Full-time","Permanent"]},{title:"Product Manager",reference:"",originalURL:"/jobs/product-manager",brandName:"Product",isRemote:!0,locations:[],employmentType:["Full-time"]},{title:"UX Designer",reference:"REF-003",originalURL:"/jobs/ux-designer",brandName:"Design",isRemote:!1,locations:[{city:"New York",stateAbbr:"NY",countryAbbr:"US",distance:0,cityStateAbbr:"New York, NY"},{city:"Boston",stateAbbr:"MA",countryAbbr:"US",cityStateAbbr:"Boston, MA"}],employmentType:["Full-time","Contract"]}],n=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.fetchComplete=o(this,"fetchComplete")}mockData=!1;jobs=[];loading=!1;totalJob=0;noResultsLine1="Sorry, we're not able to load results for your search.";noResultsLine2="Please refine your keywords in the search bar above and try again.";applyButtonText="Apply Now";showBrand=!0;showReference=!1;showEmploymentType=!0;streetFormat="{street}, {city_state_abbr}";multiLocationText="More locations";remoteLocationText="Remote";enableKilometers=!1;rootClass="";showCountText="";showSuggestions=!1;clearResultSuggestionsTitleText="Suggestions";clearResultSuggestionsLine1="Try different keywords";clearResultSuggestionsLine2="Make sure everything is spelled correctly";clearResultSuggestionsLine3="Try other locations";clearResultSuggestionsLine4="";autoFetch=!1;apiUrl="/api/get-jobs";watchParams="keyword";fetchedJobs=[];fetchedTotal=0;fetchLoading=!1;fetchComplete;searchExecutedHandler;popstateHandler;connectedCallback(){this.autoFetch&&(this.fetchJobs(),this.searchExecutedHandler=()=>this.fetchJobs(),this.popstateHandler=()=>this.fetchJobs(),document.addEventListener("search-executed",this.searchExecutedHandler),window.addEventListener("popstate",this.popstateHandler))}disconnectedCallback(){this.autoFetch&&(document.removeEventListener("search-executed",this.searchExecutedHandler),window.removeEventListener("popstate",this.popstateHandler))}async fetchJobs(){this.fetchLoading=!0;const e=new URLSearchParams(window.location.search),t=this.watchParams.split(",").map((e=>e.trim())).filter(Boolean),s=new URLSearchParams;for(const o of t){const t=e.get(o);null!==t&&s.set(o,t)}const o=`${this.apiUrl}?${""+s}`;try{const e=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({disable_switch_search_mode:!1})});if(!e.ok)throw Error("fetch failed");const t=await e.json();this.fetchedJobs=t.jobs,this.fetchedTotal=t.totalJob,this.fetchComplete.emit({jobs:t.jobs,totalJob:t.totalJob})}catch{}finally{this.fetchLoading=!1}}renderCountText(e,t){return this.showCountText.replace("{count}",e+"").replace("{total}",t+"")}getJobsArray(){if(this.mockData)return r;if(this.autoFetch)return this.fetchedJobs;const e=this.jobs;if(Array.isArray(e))return e;if("string"==typeof e)try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}return[]}renderJobItem(e,t){return i("jobs-item",{job:e,index:t,applyButtonText:this.applyButtonText,showBrand:this.showBrand,showReference:this.showReference,showEmploymentType:this.showEmploymentType,multiLocationText:this.multiLocationText,remoteLocationText:this.remoteLocationText,enableKilometers:this.enableKilometers})}render(){const e=this.getJobsArray(),t=!this.mockData&&(this.autoFetch?this.fetchLoading:this.loading),s=this.mockData?e.length:this.autoFetch?this.fetchedTotal:this.totalJob||e.length,o=!t&&0===s&&!this.showSuggestions,a=!t&&0===s&&this.showSuggestions;return i("div",{key:"1116855473d28d650641b9d962243bfcdcb434ec",class:("jobs-list-root "+this.rootClass).trim()},i("div",{key:"fcef04f1da9ad4e150af9f59921688f5781d9d43",class:"results-container"},this.autoFetch&&this.fetchLoading&&i("div",{key:"75b157c82c89691c7ce73d12ea0144b3b45485c3",class:"jobs-list-only__loading"},"Loading..."),i("div",{key:"b09f9879e10ee4a93e32177611912da5f19f3526",class:t?"loader":"loader hide","aria-hidden":!t}),s>0&&this.showCountText&&i("p",{key:"d10f800fb0a33d82531d5f1728bac4ceba2ed577",class:"jobs-list-only__count"},this.renderCountText(e.length,s)),s>0&&i("div",{key:"18153ed1338bd48f7be4f043b11ce15e3271f27b",class:"card"},i("ul",{key:"766e128b1fd5adb456530ae39e92ba8eb0b5d6cf",class:"results-list front"},e.map(((e,t)=>this.renderJobItem(e,t))))),o&&i("div",{key:"ed6f3d2bd2bbedabd6e69d508ea1425580e6941f",class:"share-jobs__no-results"},i("h2",{key:"2302656e33340c69e84cb949afb7256b8f35f440"},this.noResultsLine1),i("h3",{key:"1c7e6642441a96c04ee26883fdec4f81b0fe6cec"},this.noResultsLine2)),a&&i("div",{key:"be7af85f64455918545e88952ca6ff00f0a970c5",class:"card primary-color"},i("h4",{key:"2f63deb8131190eff882308544b15f767b6f3edc",class:"result-suggestions-title"},this.clearResultSuggestionsTitleText,":"),i("ul",{key:"cb18daaa9e2c2c442c5b906ed370dcd653b5262d",class:"results-list front"},i("li",{key:"ff1d5c6518b75c0daa35b43df7162b0dfecde25e",class:"result-suggestions-line"},this.clearResultSuggestionsLine1),i("li",{key:"4099fd7bf8dcf114eca28702a498ab0938f5de46",class:"result-suggestions-line"},this.clearResultSuggestionsLine2),i("li",{key:"fb65b54c3c0b14bc58112977eb4c7c56c1246a45",class:"result-suggestions-line"},this.clearResultSuggestionsLine3),this.clearResultSuggestionsLine4&&i("li",{key:"10f745e74cf68a2b1c42e6f49f810a8b59eb27b6",class:"result-suggestions-line"},this.clearResultSuggestionsLine4)))))}static get style(){return":host{display:block}.jobs-list-root{list-style:none}.results-container{position:relative}.loader{display:inline-block;width:24px;height:24px;border:2px solid #ddd;border-top-color:#1f9755;border-radius:50%;animation:jobs-list-spin 0.8s linear infinite}.loader.hide{display:none}@keyframes jobs-list-spin{to{transform:rotate(360deg)}}.card{border:0}.results-list{list-style:none;margin:0;padding:0;display:block}.results-list.front{margin:3px 0}.share-jobs__no-results{padding:24px;text-align:center}.share-jobs__no-results h2,.share-jobs__no-results h3{margin:8px 0;font-weight:600}.card.primary-color{padding:16px;border-radius:4px;background:#f8f9fa}.result-suggestions-title{margin:0 0 12px 0;font-size:16px}.results-list .result-suggestions-line{list-style:none;margin:4px 0}"}},[512,"jobs-list-only",{mockData:[4,"mock-data"],jobs:[1],loading:[4],totalJob:[2,"total-job"],noResultsLine1:[1,"no-results-line-1"],noResultsLine2:[1,"no-results-line-2"],applyButtonText:[1,"apply-button-text"],showBrand:[4,"show-brand"],showReference:[4,"show-reference"],showEmploymentType:[4,"show-employment-type"],streetFormat:[1,"street-format"],multiLocationText:[1,"multi-location-text"],remoteLocationText:[1,"remote-location-text"],enableKilometers:[4,"enable-kilometers"],rootClass:[1,"root-class"],showCountText:[1,"show-count-text"],showSuggestions:[4,"show-suggestions"],clearResultSuggestionsTitleText:[1,"clear-result-suggestions-title-text"],clearResultSuggestionsLine1:[1,"clear-result-suggestions-line-1"],clearResultSuggestionsLine2:[1,"clear-result-suggestions-line-2"],clearResultSuggestionsLine3:[1,"clear-result-suggestions-line-3"],clearResultSuggestionsLine4:[1,"clear-result-suggestions-line-4"],autoFetch:[4,"auto-fetch"],apiUrl:[1,"api-url"],watchParams:[1,"watch-params"],fetchedJobs:[32],fetchedTotal:[32],fetchLoading:[32]}]);function l(){"undefined"!=typeof customElements&&["jobs-list-only","jobs-item"].forEach((t=>{switch(t){case"jobs-list-only":customElements.get(e(t))||customElements.define(e(t),n);break;case"jobs-item":customElements.get(e(t))||a()}}))}l();const c=n,d=l;export{c as JobsListOnly,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface JobsListReactive extends Components.JobsListReactive, HTMLElement {}
|
|
4
|
+
export const JobsListReactive: {
|
|
5
|
+
prototype: JobsListReactive;
|
|
6
|
+
new (): JobsListReactive;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as s,H as e,c as o,h as a}from"./p-BiaJAQXY.js";const i=s(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.fetchComplete=o(this,"fetchComplete")}get el(){return this}apiUrl="/api/get-jobs";watchParams="keyword,location_name";loadingClass="loading";isLoading=!1;fetchComplete;templateEl=null;searchExecutedHandler;popstateHandler;connectedCallback(){this.templateEl=this.el.querySelector("template"),this.searchExecutedHandler=()=>this.fetchJobs(),this.popstateHandler=()=>this.fetchJobs(),document.addEventListener("search-executed",this.searchExecutedHandler),window.addEventListener("popstate",this.popstateHandler)}disconnectedCallback(){document.removeEventListener("search-executed",this.searchExecutedHandler),window.removeEventListener("popstate",this.popstateHandler)}buildQueryString(){const t=new URLSearchParams(window.location.search),s=this.watchParams.split(",").map((t=>t.trim())).filter(Boolean),e=new URLSearchParams;for(const o of s){const s=t.get(o);null!==s&&""!==s&&e.set(o,s)}return""+e}async fetchJobs(){this.isLoading=!0,this.el.classList.add(this.loadingClass);const t=this.buildQueryString(),s=t?`${this.apiUrl}?${t}`:this.apiUrl;try{const t=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({disable_switch_search_mode:!1})});if(!t.ok)throw Error("fetch failed");const e=await t.json();this.renderJobs(e.jobs),this.updateCountElements(e.jobs.length,e.totalJob),this.fetchComplete.emit({jobs:e.jobs,totalJob:e.totalJob})}catch{}finally{this.isLoading=!1,this.el.classList.remove(this.loadingClass)}}renderJobs(t){if(!this.templateEl)return;const s=Array.from(this.el.children);for(const t of s)t!==this.templateEl&&t.remove();for(const s of t){const t=this.templateEl.content.cloneNode(!0),e=t.querySelector("job-card");e&&e.setAttribute("job",JSON.stringify(s)),this.el.appendChild(t)}}updateCountElements(t,s){const e=document.querySelectorAll("[data-job-count]"),o=document.querySelectorAll("[data-job-total]");e.forEach((s=>{s.textContent=t+""})),o.forEach((t=>{t.textContent=s+""}))}render(){return a("slot",{key:"30a6fe9727eb877b6aafb99072c40811df121ba6"})}static get style(){return"jobs-list-reactive{display:block}jobs-list-reactive.loading{opacity:0.6;pointer-events:none}"}},[772,"jobs-list-reactive",{apiUrl:[1,"api-url"],watchParams:[1,"watch-params"],loadingClass:[1,"loading-class"],isLoading:[32]}]);function n(){"undefined"!=typeof customElements&&["jobs-list-reactive"].forEach((s=>{"jobs-list-reactive"===s&&(customElements.get(t(s))||customElements.define(t(s),i))}))}n();const c=i,r=n;export{c as JobsListReactive,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as s,h as i}from"./p-
|
|
1
|
+
import{t,p as e,H as s,h as i}from"./p-BiaJAQXY.js";const l=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost()}job;index=0;applyButtonText="Apply Now";showBrand=!0;showReference=!1;showEmploymentType=!0;multiLocationText="More locations";remoteLocationText="Remote";enableKilometers=!1;formatDistance(t){const e=this.enableKilometers?"Km":"Miles";return`${(this.enableKilometers?1.60934*t:t).toFixed(1)} ${e}`.replace(".0","")}render(){if(!this.job)return null;const t=function(t){const e=t.locations;if(e?.length)return e[0]}(this.job),e=t?(s=t).cityStateAbbr?s.cityStateAbbr:[s.streetAddress,s.city,s.stateAbbr||s.state,s.countryAbbr||s.country].filter(Boolean).join(", ")||s.locationText||"":"";var s;const l=t?.distance??0,r=l>0?this.formatDistance(l):"",n=this.job.applyURL||(this.job.originalURL?`${"undefined"!=typeof window?window.location.origin:""}${this.job.originalURL}`:"#"),o=`${this.applyButtonText}, ${this.job.title||""}`,a=this.job.locations??[],m=a.length>1;return i("li",{class:"results-list__item"},i("div",{class:"results-list__item-header"},i("h3",{class:"results-list__item-title"},i("a",{class:"results-list__item-title--link",href:n,target:"_blank",rel:"noopener noreferrer"},this.job.title||""),this.showReference&&i("span",{class:"reference "+(this.job.reference?"":"empty")},this.job.reference||""),this.job.isRemote&&i("span",{class:this.remoteLocationText?"remote":"remote remote--empty"},this.remoteLocationText)),r&&i("div",{class:"results-list__item-distance"},i("span",{class:"results-list__item-distance--icon"},i("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z"}),i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 8v4l2 2"}))),i("span",{class:"results-list__item-distance--label"},r))),i("div",{class:"results-list__item-content"},i("div",{class:"results-list__item-info"},i("div",{class:a.length?"results-list__item-street":"results-list__item-street results-list__item-street--empty"},i("div",{class:"results-list__item-street--label__wrapper"},i("span",{class:"results-list__item-street--icon"},i("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"}),i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0z"}))),i("span",{class:"results-list__item-street--label"},e||"—")),m&&i("div",{class:"results-list__item-street--more-locations__wrapper"},i("span",{class:"results-list__item-street--amount"},"+",a.length-1),i("span",{class:"results-list__item-street--more-locations"},this.multiLocationText))),this.showBrand&&i("div",{class:this.job.brandName?"results-list__item-brand":"results-list__item-brand results-list__item-brand--empty"},i("span",{class:"results-list__item-brand--icon"},i("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21m-3.75 3.75h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008z"}))),i("span",{class:"results-list__item-brand--label"},this.job.brandName||"—")),this.showEmploymentType&&i("div",{class:this.job.employmentType?.length?"results-list__item-employment-type":"results-list__item-employment-type results-list__item-employment-type--empty"},i("span",{class:"results-list__item-employment-type--icon"},i("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0z"}))),(this.job.employmentType?.length?this.job.employmentType:["—"]).map((t=>i("span",{key:t,class:"results-list__item-employment-type--label"},t)))),(this.job.jobCardExtraFields??[]).map(((t,e)=>i("div",{key:e,class:(Array.isArray(t.value)?t.value.length:t.value)?t.classname:`${t.classname}--empty`},Array.isArray(t.value)?t.value.map(((e,s)=>i("span",{key:s,class:`${t.classname}--label`},e))):i("span",{class:`${t.classname}--label`},String(t.value)))))),i("a",{class:"results-list__item-apply",href:n,target:"_blank",rel:"noopener noreferrer","aria-label":o},i("span",{class:"results-list__item-apply--label"},this.applyButtonText),i("span",{class:"results-list__item-apply--icon"},i("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 7l5 5m0 0l-5 5m5-5H6"}))))))}static get style(){return".results-list__item{list-style:none;padding:10px 0;border-bottom:1px solid #ddd;margin:15px 0;display:inline-block;width:100%;position:relative}.results-list__item:last-child{border-bottom:none}.results-list__item-header{margin:10px 0;font-size:18px;font-weight:700;display:flex;flex-direction:column}.results-list__item-title{margin:0}.results-list__item-title--link{text-decoration:none;color:#1f9755}.results-list__item-title--link:hover{text-decoration:underline}.reference{margin-left:8px;font-size:0.9em;color:#666}.reference.empty{display:none}.remote{background:#f3f3f3;color:#808285;border-radius:100px;padding:6px 16px;text-transform:uppercase;font-size:12px;font-weight:700;line-height:24px;margin-left:8px}.remote--empty{display:none}.results-list__item-distance{display:inline-flex;align-items:center;gap:4px;margin-top:4px;font-size:14px;font-weight:400}.results-list__item-distance--icon{display:inline-flex}.results-list__item-distance--icon svg{width:16px;height:16px}.results-list__item-content{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-top:8px}.results-list__item-info{flex:1}.results-list__item-street,.results-list__item-brand,.results-list__item-employment-type{margin:10px 0;display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}.results-list__item-street--empty,.results-list__item-brand--empty,.results-list__item-employment-type--empty{color:#999}.results-list__item-street--icon,.results-list__item-brand--icon,.results-list__item-employment-type--icon{margin-right:6px;display:inline-flex}.results-list__item-street--icon svg,.results-list__item-brand--icon svg,.results-list__item-employment-type--icon svg{width:16px;height:16px}.results-list__item-street--more-locations__wrapper{margin-left:8px}.results-list__item-street--amount{font-weight:600}.results-list__item-apply{margin:10px 0;padding:10px 20px;display:inline-flex;align-items:center;gap:8px;background-color:#198754;color:#fff;border-radius:3px;text-decoration:none;font-weight:600;flex-shrink:0}.results-list__item-apply:hover{background-color:#1f9755;color:#fff}.results-list__item-apply--icon svg{width:14px;height:14px}"}},[512,"jobs-item",{job:[16],index:[2],applyButtonText:[1,"apply-button-text"],showBrand:[4,"show-brand"],showReference:[4,"show-reference"],showEmploymentType:[4,"show-employment-type"],multiLocationText:[1,"multi-location-text"],remoteLocationText:[1,"remote-location-text"],enableKilometers:[4,"enable-kilometers"]}]);function r(){"undefined"!=typeof customElements&&["jobs-item"].forEach((e=>{"jobs-item"===e&&(customElements.get(t(e))||customElements.define(t(e),l))}))}r();export{l as J,r as d}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-C_ZLQIpp.js';
|
|
2
|
+
|
|
3
|
+
const buttonCss = () => `:host{display:inline-block}.custom-button{display:inline-flex;align-items:center;justify-content:center;padding:0.5rem 1rem;font-family:inherit;font-size:0.875rem;font-weight:500;line-height:1.25;border:none;border-radius:0.375rem;cursor:pointer;transition:background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease}.custom-button:focus{outline:2px solid var(--custom-button-focus-ring, #2563eb);outline-offset:2px}.custom-button:focus:not(:focus-visible){outline:none}.custom-button--primary{background-color:var(--custom-button-primary-bg, #2563eb);color:var(--custom-button-primary-color, #fff)}.custom-button--primary:hover:not(.custom-button--disabled){background-color:var(--custom-button-primary-hover-bg, #1d4ed8)}.custom-button--primary:active:not(.custom-button--disabled){background-color:var(--custom-button-primary-active-bg, #1e40af)}.custom-button--secondary{background-color:var(--custom-button-secondary-bg, #e5e7eb);color:var(--custom-button-secondary-color, #1f2937)}.custom-button--secondary:hover:not(.custom-button--disabled){background-color:var(--custom-button-secondary-hover-bg, #d1d5db)}.custom-button--secondary:active:not(.custom-button--disabled){background-color:var(--custom-button-secondary-active-bg, #9ca3af)}.custom-button--text{background-color:transparent;color:var(--custom-button-text-color, #2563eb)}.custom-button--text:hover:not(.custom-button--disabled){background-color:var(--custom-button-text-hover-bg, rgba(37, 99, 235, 0.08))}.custom-button--text:active:not(.custom-button--disabled){background-color:var(--custom-button-text-active-bg, rgba(37, 99, 235, 0.12))}.custom-button--disabled,.custom-button:disabled{opacity:0.6;cursor:not-allowed}`;
|
|
4
|
+
|
|
5
|
+
const CustomButton = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.buttonClick = createEvent(this, "buttonClick");
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Visual variant of the button.
|
|
12
|
+
*/
|
|
13
|
+
variant = 'primary';
|
|
14
|
+
/**
|
|
15
|
+
* Native button type (button or submit).
|
|
16
|
+
*/
|
|
17
|
+
type = 'button';
|
|
18
|
+
/**
|
|
19
|
+
* When true, the button is disabled and does not emit events.
|
|
20
|
+
*/
|
|
21
|
+
disabled = false;
|
|
22
|
+
/**
|
|
23
|
+
* Emitted when the button is clicked (not emitted when disabled).
|
|
24
|
+
*/
|
|
25
|
+
buttonClick;
|
|
26
|
+
handleClick = (e) => {
|
|
27
|
+
if (this.disabled) {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.buttonClick.emit(e);
|
|
33
|
+
};
|
|
34
|
+
render() {
|
|
35
|
+
return (h("button", { key: '3b74909afe4e305dfd38f0b07657202e3d5bfccd', type: this.type, class: {
|
|
36
|
+
'custom-button': true,
|
|
37
|
+
[`custom-button--${this.variant}`]: true,
|
|
38
|
+
'custom-button--disabled': this.disabled,
|
|
39
|
+
}, disabled: this.disabled, onClick: this.handleClick }, h("slot", { key: '49845d350e4665c5c66e30bd9262f788eaaa1e20' })));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
CustomButton.style = buttonCss();
|
|
43
|
+
|
|
44
|
+
export { CustomButton as fast_button };
|
|
@@ -1,45 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
|
|
3
|
-
const buttonCss = () => `:host{display:inline-block}.custom-button{display:inline-flex;align-items:center;justify-content:center;padding:0.5rem 1rem;font-family:inherit;font-size:0.875rem;font-weight:500;line-height:1.25;border:none;border-radius:0.375rem;cursor:pointer;transition:background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease}.custom-button:focus{outline:2px solid var(--custom-button-focus-ring, #2563eb);outline-offset:2px}.custom-button:focus:not(:focus-visible){outline:none}.custom-button--primary{background-color:var(--custom-button-primary-bg, #2563eb);color:var(--custom-button-primary-color, #fff)}.custom-button--primary:hover:not(.custom-button--disabled){background-color:var(--custom-button-primary-hover-bg, #1d4ed8)}.custom-button--primary:active:not(.custom-button--disabled){background-color:var(--custom-button-primary-active-bg, #1e40af)}.custom-button--secondary{background-color:var(--custom-button-secondary-bg, #e5e7eb);color:var(--custom-button-secondary-color, #1f2937)}.custom-button--secondary:hover:not(.custom-button--disabled){background-color:var(--custom-button-secondary-hover-bg, #d1d5db)}.custom-button--secondary:active:not(.custom-button--disabled){background-color:var(--custom-button-secondary-active-bg, #9ca3af)}.custom-button--text{background-color:transparent;color:var(--custom-button-text-color, #2563eb)}.custom-button--text:hover:not(.custom-button--disabled){background-color:var(--custom-button-text-hover-bg, rgba(37, 99, 235, 0.08))}.custom-button--text:active:not(.custom-button--disabled){background-color:var(--custom-button-text-active-bg, rgba(37, 99, 235, 0.12))}.custom-button--disabled,.custom-button:disabled{opacity:0.6;cursor:not-allowed}`;
|
|
4
|
-
|
|
5
|
-
const CustomButton = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.buttonClick = createEvent(this, "buttonClick");
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Visual variant of the button.
|
|
12
|
-
*/
|
|
13
|
-
variant = 'primary';
|
|
14
|
-
/**
|
|
15
|
-
* Native button type (button or submit).
|
|
16
|
-
*/
|
|
17
|
-
type = 'button';
|
|
18
|
-
/**
|
|
19
|
-
* When true, the button is disabled and does not emit events.
|
|
20
|
-
*/
|
|
21
|
-
disabled = false;
|
|
22
|
-
/**
|
|
23
|
-
* Emitted when the button is clicked (not emitted when disabled).
|
|
24
|
-
*/
|
|
25
|
-
buttonClick;
|
|
26
|
-
handleClick = (e) => {
|
|
27
|
-
if (this.disabled) {
|
|
28
|
-
e.preventDefault();
|
|
29
|
-
e.stopPropagation();
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
this.buttonClick.emit(e);
|
|
33
|
-
};
|
|
34
|
-
render() {
|
|
35
|
-
return (h("button", { key: '3b74909afe4e305dfd38f0b07657202e3d5bfccd', type: this.type, class: {
|
|
36
|
-
'custom-button': true,
|
|
37
|
-
[`custom-button--${this.variant}`]: true,
|
|
38
|
-
'custom-button--disabled': this.disabled,
|
|
39
|
-
}, disabled: this.disabled, onClick: this.handleClick }, h("slot", { key: '49845d350e4665c5c66e30bd9262f788eaaa1e20' })));
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
CustomButton.style = buttonCss();
|
|
1
|
+
import { r as registerInstance, g as getElement, h } from './index-C_ZLQIpp.js';
|
|
43
2
|
|
|
44
3
|
function isNumber(subject) {
|
|
45
4
|
return typeof subject === 'number';
|
|
@@ -1945,190 +1904,4 @@ const AppCarousel = class {
|
|
|
1945
1904
|
};
|
|
1946
1905
|
AppCarousel.style = carouselCss();
|
|
1947
1906
|
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
function getLocationLabel(loc) {
|
|
1951
|
-
if (loc.cityStateAbbr)
|
|
1952
|
-
return loc.cityStateAbbr;
|
|
1953
|
-
const parts = [loc.streetAddress, loc.city, loc.stateAbbr || loc.state, loc.countryAbbr || loc.country].filter(Boolean);
|
|
1954
|
-
return parts.join(', ') || loc.locationText || '';
|
|
1955
|
-
}
|
|
1956
|
-
function getFirstLocation(job) {
|
|
1957
|
-
const locs = job.locations;
|
|
1958
|
-
if (!locs?.length)
|
|
1959
|
-
return undefined;
|
|
1960
|
-
return locs[0];
|
|
1961
|
-
}
|
|
1962
|
-
const JobsItem = class {
|
|
1963
|
-
constructor(hostRef) {
|
|
1964
|
-
registerInstance(this, hostRef);
|
|
1965
|
-
}
|
|
1966
|
-
job;
|
|
1967
|
-
index = 0;
|
|
1968
|
-
applyButtonText = 'Apply Now';
|
|
1969
|
-
showBrand = true;
|
|
1970
|
-
showReference = false;
|
|
1971
|
-
showEmploymentType = true;
|
|
1972
|
-
multiLocationText = 'More locations';
|
|
1973
|
-
remoteLocationText = 'Remote';
|
|
1974
|
-
enableKilometers = false;
|
|
1975
|
-
formatDistance(distance) {
|
|
1976
|
-
const value = this.enableKilometers ? distance * 1.60934 : distance;
|
|
1977
|
-
const unit = this.enableKilometers ? 'Km' : 'Miles';
|
|
1978
|
-
const str = `${value.toFixed(1)} ${unit}`.replace('.0', '');
|
|
1979
|
-
return str;
|
|
1980
|
-
}
|
|
1981
|
-
render() {
|
|
1982
|
-
if (!this.job)
|
|
1983
|
-
return null;
|
|
1984
|
-
const firstLoc = getFirstLocation(this.job);
|
|
1985
|
-
const locationLabel = firstLoc ? getLocationLabel(firstLoc) : '';
|
|
1986
|
-
const distance = firstLoc?.distance ?? 0;
|
|
1987
|
-
const distanceLabel = distance > 0 ? this.formatDistance(distance) : '';
|
|
1988
|
-
const applyHref = this.job.applyURL ||
|
|
1989
|
-
(this.job.originalURL ? `${typeof window !== 'undefined' ? window.location.origin : ''}${this.job.originalURL}` : '#');
|
|
1990
|
-
const applyLabel = `${this.applyButtonText}, ${this.job.title || ''}`;
|
|
1991
|
-
const locs = this.job.locations ?? [];
|
|
1992
|
-
const hasMultipleLocations = locs.length > 1;
|
|
1993
|
-
return (h("li", { class: "results-list__item" }, h("div", { class: "results-list__item-header" }, h("h3", { class: "results-list__item-title" }, h("a", { class: "results-list__item-title--link", href: applyHref, target: "_blank", rel: "noopener noreferrer" }, this.job.title || ''), this.showReference && (h("span", { class: `reference ${this.job.reference ? '' : 'empty'}` }, this.job.reference || '')), this.job.isRemote && (h("span", { class: this.remoteLocationText ? 'remote' : 'remote remote--empty' }, this.remoteLocationText))), distanceLabel && (h("div", { class: "results-list__item-distance" }, h("span", { class: "results-list__item-distance--icon" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z" }), h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M12 8v4l2 2" }))), h("span", { class: "results-list__item-distance--label" }, distanceLabel)))), h("div", { class: "results-list__item-content" }, h("div", { class: "results-list__item-info" }, h("div", { class: locs.length
|
|
1994
|
-
? 'results-list__item-street'
|
|
1995
|
-
: 'results-list__item-street results-list__item-street--empty' }, h("div", { class: "results-list__item-street--label__wrapper" }, h("span", { class: "results-list__item-street--icon" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0z" }), h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0z" }))), h("span", { class: "results-list__item-street--label" }, locationLabel || '—')), hasMultipleLocations && (h("div", { class: "results-list__item-street--more-locations__wrapper" }, h("span", { class: "results-list__item-street--amount" }, "+", locs.length - 1), h("span", { class: "results-list__item-street--more-locations" }, this.multiLocationText)))), this.showBrand && (h("div", { class: this.job.brandName
|
|
1996
|
-
? 'results-list__item-brand'
|
|
1997
|
-
: 'results-list__item-brand results-list__item-brand--empty' }, h("span", { class: "results-list__item-brand--icon" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21m-3.75 3.75h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008z" }))), h("span", { class: "results-list__item-brand--label" }, this.job.brandName || '—'))), this.showEmploymentType && (h("div", { class: this.job.employmentType?.length
|
|
1998
|
-
? 'results-list__item-employment-type'
|
|
1999
|
-
: 'results-list__item-employment-type results-list__item-employment-type--empty' }, h("span", { class: "results-list__item-employment-type--icon" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0z" }))), (this.job.employmentType?.length ? this.job.employmentType : ['—']).map((type) => (h("span", { key: type, class: "results-list__item-employment-type--label" }, type))))), (this.job.jobCardExtraFields ?? []).map((field, i) => (h("div", { key: i, class: (Array.isArray(field.value) ? field.value.length : field.value)
|
|
2000
|
-
? field.classname
|
|
2001
|
-
: `${field.classname}--empty` }, Array.isArray(field.value)
|
|
2002
|
-
? field.value.map((v, j) => (h("span", { key: j, class: `${field.classname}--label` }, v)))
|
|
2003
|
-
: (h("span", { class: `${field.classname}--label` }, String(field.value))))))), h("a", { class: "results-list__item-apply", href: applyHref, target: "_blank", rel: "noopener noreferrer", "aria-label": applyLabel }, h("span", { class: "results-list__item-apply--label" }, this.applyButtonText), h("span", { class: "results-list__item-apply--icon" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M13 7l5 5m0 0l-5 5m5-5H6" })))))));
|
|
2004
|
-
}
|
|
2005
|
-
};
|
|
2006
|
-
JobsItem.style = jobsItemCss();
|
|
2007
|
-
|
|
2008
|
-
/**
|
|
2009
|
-
* Mock jobs for local development and docs.
|
|
2010
|
-
* Use in www or static HTML: jobs='...' (JSON.stringify(mockJobs)).
|
|
2011
|
-
*/
|
|
2012
|
-
const mockJobsListOnly = [
|
|
2013
|
-
{
|
|
2014
|
-
title: 'Senior Software Engineer',
|
|
2015
|
-
reference: 'REF-001',
|
|
2016
|
-
originalURL: '/jobs/senior-software-engineer',
|
|
2017
|
-
applyURL: 'https://apply.example.com/1',
|
|
2018
|
-
brandName: 'Engineering',
|
|
2019
|
-
isRemote: false,
|
|
2020
|
-
locations: [
|
|
2021
|
-
{
|
|
2022
|
-
city: 'San Francisco',
|
|
2023
|
-
stateAbbr: 'CA',
|
|
2024
|
-
countryAbbr: 'US',
|
|
2025
|
-
distance: 5.2,
|
|
2026
|
-
streetAddress: '123 Market St',
|
|
2027
|
-
cityStateAbbr: 'San Francisco, CA',
|
|
2028
|
-
},
|
|
2029
|
-
],
|
|
2030
|
-
employmentType: ['Full-time', 'Permanent'],
|
|
2031
|
-
},
|
|
2032
|
-
{
|
|
2033
|
-
title: 'Product Manager',
|
|
2034
|
-
reference: '',
|
|
2035
|
-
originalURL: '/jobs/product-manager',
|
|
2036
|
-
brandName: 'Product',
|
|
2037
|
-
isRemote: true,
|
|
2038
|
-
locations: [],
|
|
2039
|
-
employmentType: ['Full-time'],
|
|
2040
|
-
},
|
|
2041
|
-
{
|
|
2042
|
-
title: 'UX Designer',
|
|
2043
|
-
reference: 'REF-003',
|
|
2044
|
-
originalURL: '/jobs/ux-designer',
|
|
2045
|
-
brandName: 'Design',
|
|
2046
|
-
isRemote: false,
|
|
2047
|
-
locations: [
|
|
2048
|
-
{
|
|
2049
|
-
city: 'New York',
|
|
2050
|
-
stateAbbr: 'NY',
|
|
2051
|
-
countryAbbr: 'US',
|
|
2052
|
-
distance: 0,
|
|
2053
|
-
cityStateAbbr: 'New York, NY',
|
|
2054
|
-
},
|
|
2055
|
-
{
|
|
2056
|
-
city: 'Boston',
|
|
2057
|
-
stateAbbr: 'MA',
|
|
2058
|
-
countryAbbr: 'US',
|
|
2059
|
-
cityStateAbbr: 'Boston, MA',
|
|
2060
|
-
},
|
|
2061
|
-
],
|
|
2062
|
-
employmentType: ['Full-time', 'Contract'],
|
|
2063
|
-
},
|
|
2064
|
-
];
|
|
2065
|
-
|
|
2066
|
-
const jobsListOnlyCss = () => `:host{display:block}.jobs-list-root{list-style:none}.results-container{position:relative}.loader{display:inline-block;width:24px;height:24px;border:2px solid #ddd;border-top-color:#1f9755;border-radius:50%;animation:jobs-list-spin 0.8s linear infinite}.loader.hide{display:none}@keyframes jobs-list-spin{to{transform:rotate(360deg)}}.card{border:0}.results-list{list-style:none;margin:0;padding:0;display:block}.results-list.front{margin:3px 0}.share-jobs__no-results{padding:24px;text-align:center}.share-jobs__no-results h2,.share-jobs__no-results h3{margin:8px 0;font-weight:600}.card.primary-color{padding:16px;border-radius:4px;background:#f8f9fa}.result-suggestions-title{margin:0 0 12px 0;font-size:16px}.results-list .result-suggestions-line{list-style:none;margin:4px 0}`;
|
|
2067
|
-
|
|
2068
|
-
const defaultNoResultsLine1 = "Sorry, we're not able to load results for your search.";
|
|
2069
|
-
const defaultNoResultsLine2 = 'Please refine your keywords in the search bar above and try again.';
|
|
2070
|
-
const JobsListOnly = class {
|
|
2071
|
-
constructor(hostRef) {
|
|
2072
|
-
registerInstance(this, hostRef);
|
|
2073
|
-
}
|
|
2074
|
-
/**
|
|
2075
|
-
* When "true", use built-in mock data (for local/dev/docs). Otherwise use `jobs` from API/parent.
|
|
2076
|
-
*/
|
|
2077
|
-
mockData = false;
|
|
2078
|
-
/** List of jobs to display. Pass as JSON string from attribute or as array via property (e.g. from React). Ignored when mock-data="true". */
|
|
2079
|
-
jobs = [];
|
|
2080
|
-
/** Show loading spinner. Ignored when mock-data="true" (mock shows data immediately). */
|
|
2081
|
-
loading = false;
|
|
2082
|
-
/** Total job count (for screen readers / schema). */
|
|
2083
|
-
totalJob = 0;
|
|
2084
|
-
noResultsLine1 = defaultNoResultsLine1;
|
|
2085
|
-
noResultsLine2 = defaultNoResultsLine2;
|
|
2086
|
-
applyButtonText = 'Apply Now';
|
|
2087
|
-
showBrand = true;
|
|
2088
|
-
showReference = false;
|
|
2089
|
-
showEmploymentType = true;
|
|
2090
|
-
streetFormat = '{street}, {city_state_abbr}';
|
|
2091
|
-
multiLocationText = 'More locations';
|
|
2092
|
-
remoteLocationText = 'Remote';
|
|
2093
|
-
enableKilometers = false;
|
|
2094
|
-
/** Extra CSS class on the root element (avoid prop name "class" / "classname" reserved). */
|
|
2095
|
-
rootClass = '';
|
|
2096
|
-
showSuggestions = false;
|
|
2097
|
-
clearResultSuggestionsTitleText = 'Suggestions';
|
|
2098
|
-
clearResultSuggestionsLine1 = 'Try different keywords';
|
|
2099
|
-
clearResultSuggestionsLine2 = 'Make sure everything is spelled correctly';
|
|
2100
|
-
clearResultSuggestionsLine3 = 'Try other locations';
|
|
2101
|
-
clearResultSuggestionsLine4 = '';
|
|
2102
|
-
getJobsArray() {
|
|
2103
|
-
if (this.mockData) {
|
|
2104
|
-
return mockJobsListOnly;
|
|
2105
|
-
}
|
|
2106
|
-
const j = this.jobs;
|
|
2107
|
-
if (Array.isArray(j))
|
|
2108
|
-
return j;
|
|
2109
|
-
if (typeof j === 'string') {
|
|
2110
|
-
try {
|
|
2111
|
-
const parsed = JSON.parse(j);
|
|
2112
|
-
return Array.isArray(parsed) ? parsed : [];
|
|
2113
|
-
}
|
|
2114
|
-
catch {
|
|
2115
|
-
return [];
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
return [];
|
|
2119
|
-
}
|
|
2120
|
-
renderJobItem(job, index) {
|
|
2121
|
-
return (h("jobs-item", { job: job, index: index, applyButtonText: this.applyButtonText, showBrand: this.showBrand, showReference: this.showReference, showEmploymentType: this.showEmploymentType, multiLocationText: this.multiLocationText, remoteLocationText: this.remoteLocationText, enableKilometers: this.enableKilometers }));
|
|
2122
|
-
}
|
|
2123
|
-
render() {
|
|
2124
|
-
const jobsArray = this.getJobsArray();
|
|
2125
|
-
const loading = this.mockData ? false : this.loading;
|
|
2126
|
-
const totalJob = this.mockData ? jobsArray.length : (this.totalJob || jobsArray.length);
|
|
2127
|
-
const showNoResults = !loading && totalJob === 0 && !this.showSuggestions;
|
|
2128
|
-
const showSuggestionsBlock = !loading && totalJob === 0 && this.showSuggestions;
|
|
2129
|
-
return (h("div", { key: '9e69d40c649b4f16617f522c89bc87d4cbffe1e3', class: `jobs-list-root ${this.rootClass}`.trim() }, h("div", { key: '7daf1c09dd1d5553a335f3c81c894a331964ee96', class: "results-container" }, h("div", { key: '9ab3db2b834359a64faee61f8c3dc2daca8211d9', class: loading ? 'loader' : 'loader hide', "aria-hidden": !loading }), totalJob > 0 && (h("div", { key: 'c729ccdf715105b9fbc7af0a1f148c82535772c1', class: "card" }, h("ul", { key: 'b0c5b6baccf7b94819cc2ad9ab970981a5294b42', class: "results-list front" }, jobsArray.map((job, index) => this.renderJobItem(job, index))))), showNoResults && (h("div", { key: '8f1684ddde51474e9c1699f93fb01c56e5406a51', class: "share-jobs__no-results" }, h("h2", { key: '2e3bc4b6b7647e3939588102d659e777207e46e9' }, this.noResultsLine1), h("h3", { key: 'f4881f19ad5db8fdd47aa4d31e1e0435f08da1ab' }, this.noResultsLine2))), showSuggestionsBlock && (h("div", { key: 'ed34907fd90f28571786045f21525895cef6e98a', class: "card primary-color" }, h("h4", { key: '33e96147f1b427df874656c1e0647af1d97fea29', class: "result-suggestions-title" }, this.clearResultSuggestionsTitleText, ":"), h("ul", { key: '570fd8e5068f1a7c809fad47347fe5f469da8bc6', class: "results-list front" }, h("li", { key: 'b5d22dfb448d2888dc010d6e494d1834d3d60034', class: "result-suggestions-line" }, this.clearResultSuggestionsLine1), h("li", { key: '77c1e8bbe9ab238e4f05fdbaf43551aef4f2a36e', class: "result-suggestions-line" }, this.clearResultSuggestionsLine2), h("li", { key: '0bd9503bf686213ae087f74a7b5f2cc62f9c96b7', class: "result-suggestions-line" }, this.clearResultSuggestionsLine3), this.clearResultSuggestionsLine4 && (h("li", { key: '961b2904347e1c5fc6b355a069790f0f2997917f', class: "result-suggestions-line" }, this.clearResultSuggestionsLine4))))))));
|
|
2130
|
-
}
|
|
2131
|
-
};
|
|
2132
|
-
JobsListOnly.style = jobsListOnlyCss();
|
|
2133
|
-
|
|
2134
|
-
export { CustomButton as fast_button, AppCarousel as fast_carousel, JobsItem as jobs_item, JobsListOnly as jobs_list_only };
|
|
1907
|
+
export { AppCarousel as fast_carousel };
|