@ncino/web-components 13.10.0 → 13.11.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.
@@ -1,4 +1,4 @@
1
- import{property as h}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as d}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as f}from"../../../../utils/decorators/custom-element-decorator.js";import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as D}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{createRef as u,ref as p}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/ref.js";import{msg as g}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import{localized as _}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js";import"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import{ifDefined as m}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/if-defined.js";import{autoUpdate as v,computePosition as y}from"../../../../node_modules/.pnpm/@floating-ui_dom@1.7.5/node_modules/@floating-ui/dom/dist/floating-ui.dom.js";import I from"../../../../packages/web-components/src/components/input/gator/input-date/input-date.gator.scss.js";import{NgcInputText as T}from"../input-text/input-text.gator.js";import{NgcErrorEvent as b,NgcErrorReason as k}from"../../../../utils/error-utils.js";import"../../../icon-button/gator/icon-button.gator.js";import"../../../date-picker/base/gator/datepicker.gator.js";import{unsafeCSS as E}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var S=Object.defineProperty,x=Object.getOwnPropertyDescriptor,V=Object.getPrototypeOf,R=Reflect.get,l=(t,e,a,i)=>{for(var r=i>1?void 0:i?x(e,a):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,a,r):o(r))||r);return i&&r&&S(e,a,r),r},$=(t,e,a)=>R(V(t),a,e),N=(t=>(t.INVALID_FORMAT="invalid-format",t.LESS_THAN_MIN_DATE="less-than-min-date",t.GREATER_THAN_MAX_DATE="greater-than-max-date",t.OUTSIDE_RANGE="outside-range",t.INVALID_START_DATE="invalid-start-date",t.INVALID_END_DATE="invalid-end-date",t))(N||{});let s=class extends T{constructor(){super(...arguments),this.locale=navigator.language,this.sundayStart=!1,this.range=!1,this.startDateLabel="Start Date",this.endDateLabel="End Date",this.maskInput=!1,this.autoAddDateSeparators=!1,this._value="",this.datepickerRef=u(),this.datepickerTriggerRef=u(),this.startInputRef=u(),this.endInputRef=u(),this.groupRef=u(),this.dateValue=null,this._dateSeparator="/",this._messageInvalidFormat="Invalid date. Please provide a valid date with format {0}.",this._messageLessThanMinDate="Date must be after {0}.",this._messageGreaterThanMaxDate="Date must be before {0}.",this._messageOutsideRange="Date must be between {0} and {1}.",this._messageInvalidStartDate="{0} must come before {1}: {2}.",this._messageInvalidEndDate="{0} must come after {1}: {2}.",this._dateTimeOptions={year:"numeric",month:"2-digit",day:"2-digit"},this._datePickerVisible=!1,this._startDate=null,this._endDate=null,this._maskPattern="",this._dateString=""}connectedCallback(){super.connectedCallback(),this.endIcon="calendar"}updated(t){if(super.updated(t),t.has("locale")){(this.locale===void 0||this.locale==="")&&(this.locale=navigator.language),this.setLocaleDateFormat();const a=this.coerceValuePropToDate(this.value)??(this.dateValue instanceof Date&&!isNaN(this.dateValue.getTime())?this.dateValue:null);this._value=a?a.toLocaleDateString(this.locale,this._dateTimeOptions):""}if(t.has("value")&&this.syncInternalStateFromDate(this.coerceValuePropToDate(this.value)),t.has("dateValue"))if(this.dateValue&&this.dateValue instanceof Date&&!isNaN(this.dateValue.getTime())){const e=this.dateValue.toLocaleDateString(this.locale,this._dateTimeOptions);this._dateString=e,this.maskInput&&this.maskDate(e)}else this.dateValue===null&&(this._dateString="",this._maskPattern="");if(t.has("startDate")&&(this.startDate&&this.startDate instanceof Date&&!isNaN(this.startDate.getTime())?(this._startDate=this.startDate,this._startDateInputValue=this.startDate.toLocaleDateString(this.locale,this._dateTimeOptions)):(this._startDate=null,this._startDateInputValue="")),t.has("endDate")&&(this.endDate&&this.endDate instanceof Date&&!isNaN(this.endDate.getTime())?(this._endDate=this.endDate,this._endDateInputValue=this.endDate.toLocaleDateString(this.locale,this._dateTimeOptions)):(this._endDate=null,this._endDateInputValue="")),t.has("maskInput")&&this.value&&this.value instanceof Date&&!isNaN(this.value.getTime())){const e=this.value.toLocaleDateString(this.locale,this._dateTimeOptions);this._dateString=e,this.maskInput?(this.maskDate(e),this._value=this._maskPattern):this._value=e}if(t.has("autoAddDateSeparators")&&this.autoAddDateSeparators){const e=this.coerceValuePropToDate(this.value);this._value=e?e.toLocaleDateString(this.locale,this._dateTimeOptions):""}}render(){return D` ${this.range?this.rangeMarkup:super.render()} ${this.datepickerMarkup} `}get endIconMarkup(){return this.calendarIconMarkup}get calendarIconMarkup(){return D`
1
+ import{property as h}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as d}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as f}from"../../../../utils/decorators/custom-element-decorator.js";import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as D}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{createRef as u,ref as p}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/ref.js";import{msg as g}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import{localized as _}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js";import"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import{ifDefined as m}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/if-defined.js";import{autoUpdate as v,computePosition as y}from"../../../../node_modules/.pnpm/@floating-ui_dom@1.7.5/node_modules/@floating-ui/dom/dist/floating-ui.dom.js";import I from"../../../../packages/web-components/src/components/input/gator/input-date/input-date.gator.scss.js";import{NgcInputText as T}from"../input-text/input-text.gator.js";import{NgcErrorEvent as b,NgcErrorReason as k}from"../../../../utils/error-utils.js";import"../../../icon-button/gator/icon-button.gator.js";import"../../../date-picker/base/gator/datepicker.gator.js";import{unsafeCSS as E}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var S=Object.defineProperty,x=Object.getOwnPropertyDescriptor,R=Object.getPrototypeOf,V=Reflect.get,l=(t,e,a,i)=>{for(var n=i>1?void 0:i?x(e,a):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,a,n):o(n))||n);return i&&n&&S(e,a,n),n},$=(t,e,a)=>V(R(t),a,e),N=(t=>(t.INVALID_FORMAT="invalid-format",t.LESS_THAN_MIN_DATE="less-than-min-date",t.GREATER_THAN_MAX_DATE="greater-than-max-date",t.OUTSIDE_RANGE="outside-range",t.INVALID_START_DATE="invalid-start-date",t.INVALID_END_DATE="invalid-end-date",t))(N||{});let r=class extends T{constructor(){super(...arguments),this.locale=navigator.language,this.sundayStart=!1,this.range=!1,this.startDateLabel="Start Date",this.endDateLabel="End Date",this.maskInput=!1,this.autoAddDateSeparators=!1,this._value="",this.datepickerRef=u(),this.datepickerTriggerRef=u(),this.startInputRef=u(),this.endInputRef=u(),this.groupRef=u(),this.dateValue=null,this._dateSeparator="/",this._messageInvalidFormat="Invalid date. Please provide a valid date with format {0}.",this._messageLessThanMinDate="Date must be after {0}.",this._messageGreaterThanMaxDate="Date must be before {0}.",this._messageOutsideRange="Date must be between {0} and {1}.",this._messageInvalidStartDate="{0} must come before {1}: {2}.",this._messageInvalidEndDate="{0} must come after {1}: {2}.",this._dateTimeOptions={year:"numeric",month:"2-digit",day:"2-digit"},this._datePickerVisible=!1,this._startDate=null,this._endDate=null,this._maskPattern="",this._dateString=""}connectedCallback(){super.connectedCallback(),this.endIcon="calendar"}updated(t){if(super.updated(t),t.has("locale")){(this.locale===void 0||this.locale==="")&&(this.locale=navigator.language),this.setLocaleDateFormat();const a=this.coerceValuePropToDate(this.value)??(this.dateValue instanceof Date&&!isNaN(this.dateValue.getTime())?this.dateValue:null);this._value=a?a.toLocaleDateString(this.locale,this._dateTimeOptions):""}if(t.has("value")&&this.syncInternalStateFromDate(this.coerceValuePropToDate(this.value)),t.has("dateValue"))if(this.dateValue&&this.dateValue instanceof Date&&!isNaN(this.dateValue.getTime())){const e=this.dateValue.toLocaleDateString(this.locale,this._dateTimeOptions);this._dateString=e,this.maskInput&&this.maskDate(e)}else this.dateValue===null&&(this._dateString="",this._maskPattern="");if(t.has("startDate")&&(this.startDate&&this.startDate instanceof Date&&!isNaN(this.startDate.getTime())?(this._startDate=this.startDate,this._startDateInputValue=this.startDate.toLocaleDateString(this.locale,this._dateTimeOptions)):(this._startDate=null,this._startDateInputValue="")),t.has("endDate")&&(this.endDate&&this.endDate instanceof Date&&!isNaN(this.endDate.getTime())?(this._endDate=this.endDate,this._endDateInputValue=this.endDate.toLocaleDateString(this.locale,this._dateTimeOptions)):(this._endDate=null,this._endDateInputValue="")),t.has("maskInput")&&this.value&&this.value instanceof Date&&!isNaN(this.value.getTime())){const e=this.value.toLocaleDateString(this.locale,this._dateTimeOptions);this._dateString=e,this.maskInput?(this.maskDate(e),this._value=this._maskPattern):this._value=e}if(t.has("autoAddDateSeparators")&&this.autoAddDateSeparators){const e=this.coerceValuePropToDate(this.value);this._value=e?e.toLocaleDateString(this.locale,this._dateTimeOptions):""}}render(){return D` ${this.range?this.rangeMarkup:super.render()} ${this.datepickerMarkup} `}get endIconMarkup(){return this.calendarIconMarkup}get calendarIconMarkup(){return D`
2
2
  <ngc-icon-button
3
3
  slot="end-slot"
4
4
  ${p(this.datepickerTriggerRef)}
@@ -61,4 +61,4 @@ import{property as h}from"../../../../node_modules/.pnpm/@lit_reactive-element@2
61
61
  </div>
62
62
  ${this.bottomText}
63
63
  </div>
64
- `}setStartDate(t,e,a){this.errorText||(a?this.startInputRef.value.errorText=a:this.startInputRef.value.errorText=""),this._startDate=t,this._startDateInputValue=e}setEndDate(t,e,a){this.errorText||(a?this.endInputRef.value.errorText=a:this.endInputRef.value.errorText=""),this._endDate=t,this._endDateInputValue=e}get datepickerStartDate(){if(this._startDate instanceof Date&&!isNaN(this._startDate.getTime()))return this._startDate}get datepickerEndDate(){if(this._endDate instanceof Date&&!isNaN(this._endDate.getTime()))return this._endDate}handleRangeInputEvent(t,e){t.preventDefault(),t.stopPropagation();const a=t.detail.value;this.validateDate(e,a),this.dispatchEvent(new CustomEvent("input",this.rangeEventData))}handleRangeChangeEvent(t,e){t.preventDefault(),t.stopPropagation();const a=t.detail.value;this.validateDate(e,a),this.dispatchEvent(new CustomEvent("change",this.rangeEventData))}get rangeEventData(){return{bubbles:!0,composed:!0,detail:{startDate:this._startDate,endDate:this._endDate,value:this.dateRangeTextValue}}}get dateRangeTextValue(){const t=this._startDate instanceof Date?this._startDate.toLocaleDateString(this.locale,this._dateTimeOptions):"",e=this._endDate instanceof Date?this._endDate.toLocaleDateString(this.locale,this._dateTimeOptions):"";return`${t} - ${e}`}handleDatepickerRangeChange(t){!t.detail.startDate&&!t.detail.endDate&&this.closeDatepicker(),t.detail.startDate!==this._startDate&&(this._startDate=t.detail.startDate,this._startDateInputValue=t.detail.startDate?new Intl.DateTimeFormat(this.locale,this._dateTimeOptions).format(t.detail.startDate):""),t.detail.endDate!==this.endDate&&(this._endDate=t.detail.endDate,this._endDateInputValue=t.detail.endDate?new Intl.DateTimeFormat(this.locale,this._dateTimeOptions).format(t.detail.endDate):""),this.errorText||(this.endInputRef.value.errorText="",this.startInputRef.value.errorText=""),this.dispatchEvent(new CustomEvent("change",this.rangeEventData))}syncInternalStateFromDate(t){if(t&&!isNaN(t.getTime())){this.dateValue=t;const e=t.toLocaleDateString(this.locale,this._dateTimeOptions);this._dateString=e,this.maskInput&&this.maskDate(e),this.maskInput?this._value=this._maskPattern:this._value=e}else this._dateString="",this._maskPattern="",this.dateValue=null,this._value=""}coerceValuePropToDate(t){if(t==null)return null;if(t instanceof Date)return isNaN(t.getTime())?null:t;if(typeof t=="string"){const e=t.trim();if(e==="")return null;const a=this.tryParseIsoDateOnly(e);if(a)return a;const i=this.getDateValueFromLocalizedDateString(e);return i instanceof Date&&!isNaN(i.getTime())?i:null}if(typeof t=="number"&&Number.isFinite(t)){const e=new Date(t);return isNaN(e.getTime())?null:e}return null}tryParseIsoDateOnly(t){const e=/^(\d{4})-(\d{2})-(\d{2})(?:[Tt]|$)/.exec(t);if(!e)return null;const a=Number(e[1]),i=Number(e[2])-1,r=Number(e[3]),n=new Date(a,i,r);return n.getFullYear()!==a||n.getMonth()!==i||n.getDate()!==r?null:n}validateDate(t,e){let a=this.getDateValueFromLocalizedDateString(e),i=null;typeof a=="number"&&isNaN(a)&&(i=this.handleError("invalid-format")),a&&typeof a=="object"&&(this.minDate&&a<this.minDate&&(i=this.handleError("less-than-min-date")),this.maxDate&&a>this.maxDate&&(i=this.handleError("greater-than-max-date")),this.minDate&&this.maxDate&&(a<this.minDate||a>this.maxDate)&&(i=this.handleError("outside-range")),this.range&&(this._startDate&&a<this._startDate&&(i=this.handleError("invalid-end-date")),this._endDate&&a>this._endDate&&(i=this.handleError("invalid-start-date")))),t(a,i)}setLocaleDateFormat(){const t=new Intl.DateTimeFormat(this.locale).formatToParts(new Date("12/31/1999")),e=t.find(o=>o.type==="literal")?.value,a={day:"dd",month:"mm",year:"yyyy"},i={day:"([1-9]|0[1-9]|[12][0-9]|3[01])",month:"([1-9]|0[1-9]|1[0-2])",year:"\\d{4}"},r=new Map,n=new Map;t.forEach((o,c)=>{a[o.type]&&(r.set(c,a[o.type]),n.set(c,i[o.type]))}),this._dateSeparator=e||"/",this._localizedDateRegex=new RegExp(`^${Array.from(n.values()).join(this._dateSeparator)}$`),this.localizedExpectedDateFormat=Array.from(r.values()).join(this._dateSeparator),this._placeholder=this.localizedExpectedDateFormat}getDatePartsFromLocalizedDateString(t){const e=t.split(this._dateSeparator),a=this.localizedExpectedDateFormat?.split(this._dateSeparator)||[],i=a.findIndex(o=>o.toLowerCase().includes("y")),r=a.findIndex(o=>o.toLowerCase().includes("m")),n=a.findIndex(o=>o.toLowerCase().includes("d"));return{year:parseInt(e[i]),month:parseInt(e[r])-1,day:parseInt(e[n])}}getDateValueFromLocalizedDateString(t){if(!t||t==="")return null;if(!this._localizedDateRegex?.test(t))return NaN;const{year:a,month:i,day:r}=this.getDatePartsFromLocalizedDateString(t),n=new Date(a,i,r);return isNaN(n.getTime())?NaN:n}maskDate(t){const{year:e}=this.getDatePartsFromLocalizedDateString(t);this.localizedExpectedDateFormat&&(this._maskPattern=this.localizedExpectedDateFormat?.toLowerCase().replace("yyyy",e.toString()).replace("mm","XX").replace("dd","XX"))}autoFormatDate(t){if(!this.autoAddDateSeparators||!this.localizedExpectedDateFormat)return;const e=t.value.replace(/[^\d]/g,"").split(""),a=this.localizedExpectedDateFormat.split(this._dateSeparator).map(n=>n.length);let i=[];a.forEach(n=>{i.push(e.slice(0,n).reduce((o,c)=>o+c,"")),e.splice(0,n)}),i=i.filter(n=>n!=="");let r=i.join(this._dateSeparator);i.length<a.length&&i[i.length-1].length==a[a.length-1]&&(r+=this._dateSeparator),t.value!==r&&(t.value=r)}toggleVisibility(){this._datePickerVisible=!this._datePickerVisible,this._datePickerVisible&&(this.assignPosition(),this.datepickerRef.value?.shiftFocusToCalendarGrid())}assignPosition(){const t=this.range?this.endInputRef.value?.controlRef.value:this.controlRef.value;!this.datepickerRef||!this.datepickerRef.value||!t||(this._cleanup=v(t,this.datepickerRef.value,async()=>{if(!this.datepickerRef||!this.datepickerRef.value||!t)return;const{x:e,y:a,placement:i}=await y(t,this.datepickerRef.value,{placement:"bottom-end"});let r=i.includes("bottom")?4:-4;Object.assign(this.datepickerRef.value.style,{left:`${e}px`,top:`${a+r}px`})}))}handleError(t){switch(this.dispatchEvent(new b({errorReason:k.VALIDATION,component:{errorReason:t}})),t){case"invalid-format":return this._messageInvalidFormat.replace("{0}",this.localizedExpectedDateFormat);case"less-than-min-date":return this._messageLessThanMinDate.replace("{0}",this.minDate?.toLocaleDateString(this.locale,this._dateTimeOptions)||"");case"greater-than-max-date":return this._messageGreaterThanMaxDate.replace("{0}",this.maxDate?.toLocaleDateString(this.locale,this._dateTimeOptions)||"");case"outside-range":return this._messageOutsideRange.replace("{0}",this.minDate?.toLocaleDateString(this.locale,this._dateTimeOptions)||"").replace("{1}",this.maxDate?.toLocaleDateString(this.locale,this._dateTimeOptions)||"");case"invalid-start-date":return this._messageInvalidStartDate.replace("{0}",this.startDateLabel||"").replace("{1}",this.endDateLabel||"").replace("{2}",this._endDateInputValue||"");case"invalid-end-date":return this._messageInvalidEndDate.replace("{0}",this.endDateLabel||"").replace("{1}",this.startDateLabel||"").replace("{2}",this._startDateInputValue||"");default:return null}}};s.styles=[...$(s,s,"styles"),E(I)];l([h({type:Date})],s.prototype,"value",2);l([h({type:String,attribute:"locale"})],s.prototype,"locale",2);l([h({type:Date,attribute:"min-date"})],s.prototype,"minDate",2);l([h({type:Date,attribute:"max-date"})],s.prototype,"maxDate",2);l([h({type:Boolean,attribute:"sunday-start"})],s.prototype,"sundayStart",2);l([h({type:Boolean,attribute:"range"})],s.prototype,"range",2);l([h({type:Date,attribute:"start-date"})],s.prototype,"startDate",2);l([h({type:Date,attribute:"end-date"})],s.prototype,"endDate",2);l([h({type:String,attribute:"start-date-label"})],s.prototype,"startDateLabel",2);l([h({type:String,attribute:"end-date-label"})],s.prototype,"endDateLabel",2);l([h({type:Boolean,attribute:"mask-input"})],s.prototype,"maskInput",2);l([h({type:Boolean,attribute:"auto-add-date-separators"})],s.prototype,"autoAddDateSeparators",2);l([d()],s.prototype,"dateValue",2);l([d()],s.prototype,"_datePickerVisible",2);l([d()],s.prototype,"_startDate",2);l([d()],s.prototype,"_endDate",2);l([d()],s.prototype,"_startDateInputValue",2);l([d()],s.prototype,"_endDateInputValue",2);l([d()],s.prototype,"_maskPattern",2);l([d()],s.prototype,"_dateString",2);s=l([f("ngc-input-date"),_()],s);export{N as DateValidationError,s as NgcInputDate};
64
+ `}setStartDate(t,e,a){this.errorText||(a?this.startInputRef.value.errorText=a:this.startInputRef.value.errorText=""),this._startDate=t,this._startDateInputValue=e}setEndDate(t,e,a){this.errorText||(a?this.endInputRef.value.errorText=a:this.endInputRef.value.errorText=""),this._endDate=t,this._endDateInputValue=e}get datepickerStartDate(){if(this._startDate instanceof Date&&!isNaN(this._startDate.getTime()))return this._startDate}get datepickerEndDate(){if(this._endDate instanceof Date&&!isNaN(this._endDate.getTime()))return this._endDate}handleRangeInputEvent(t,e){t.preventDefault(),t.stopPropagation();const a=t.detail.value;this.validateDate(e,a),this.dispatchEvent(new CustomEvent("input",this.rangeEventData))}handleRangeChangeEvent(t,e){t.preventDefault(),t.stopPropagation();const a=t.detail.value;this.validateDate(e,a),this.dispatchEvent(new CustomEvent("change",this.rangeEventData))}get rangeEventData(){return{bubbles:!0,composed:!0,detail:{startDate:this._startDate,endDate:this._endDate,value:this.dateRangeTextValue}}}get dateRangeTextValue(){const t=this._startDate instanceof Date?this._startDate.toLocaleDateString(this.locale,this._dateTimeOptions):"",e=this._endDate instanceof Date?this._endDate.toLocaleDateString(this.locale,this._dateTimeOptions):"";return`${t} - ${e}`}handleDatepickerRangeChange(t){!t.detail.startDate&&!t.detail.endDate&&this.closeDatepicker(),t.detail.startDate!==this._startDate&&(this._startDate=t.detail.startDate,this._startDateInputValue=t.detail.startDate?new Intl.DateTimeFormat(this.locale,this._dateTimeOptions).format(t.detail.startDate):""),t.detail.endDate!==this.endDate&&(this._endDate=t.detail.endDate,this._endDateInputValue=t.detail.endDate?new Intl.DateTimeFormat(this.locale,this._dateTimeOptions).format(t.detail.endDate):""),this.errorText||(this.endInputRef.value.errorText="",this.startInputRef.value.errorText=""),this.dispatchEvent(new CustomEvent("change",this.rangeEventData))}syncInternalStateFromDate(t){if(t&&!isNaN(t.getTime())){this.dateValue=t;const e=t.toLocaleDateString(this.locale,this._dateTimeOptions);this._dateString=e,this.maskInput&&this.maskDate(e),this.maskInput?this._value=this._maskPattern:this._value=e}else this._dateString="",this._maskPattern="",this.dateValue=null,this._value=""}coerceValuePropToDate(t){if(t==null)return null;if(t instanceof Date)return isNaN(t.getTime())?null:t;if(typeof t=="string"){const e=t.trim();if(e==="")return null;const a=this.tryParseIsoDateOnly(e);if(a)return a;const i=this.getDateValueFromLocalizedDateString(e);return i instanceof Date&&!isNaN(i.getTime())?i:null}if(typeof t=="number"&&Number.isFinite(t)){const e=new Date(t);return isNaN(e.getTime())?null:e}return null}tryParseIsoDateOnly(t){const e=/^(\d{4})-(\d{2})-(\d{2})(?:[Tt]|$)/.exec(t);if(!e)return null;const a=Number(e[1]),i=Number(e[2])-1,n=Number(e[3]),s=new Date(a,i,n);return s.getFullYear()!==a||s.getMonth()!==i||s.getDate()!==n?null:s}validateDate(t,e){let a=this.getDateValueFromLocalizedDateString(e),i=null;typeof a=="number"&&isNaN(a)&&(i=this.handleError("invalid-format")),a&&typeof a=="object"&&(this.minDate&&a<this.minDate&&(i=this.handleError("less-than-min-date")),this.maxDate&&a>this.maxDate&&(i=this.handleError("greater-than-max-date")),this.minDate&&this.maxDate&&(a<this.minDate||a>this.maxDate)&&(i=this.handleError("outside-range")),this.range&&(this._startDate&&a<this._startDate&&(i=this.handleError("invalid-end-date")),this._endDate&&a>this._endDate&&(i=this.handleError("invalid-start-date")))),t(a,i)}setLocaleDateFormat(){const t=new Intl.DateTimeFormat(this.locale).formatToParts(new Date("12/31/1999")),e=t.find(o=>o.type==="literal")?.value,a={day:"dd",month:"mm",year:"yyyy"},i={day:"([1-9]|0[1-9]|[12][0-9]|3[01])",month:"([1-9]|0[1-9]|1[0-2])",year:"\\d{4}"},n=new Map,s=new Map;t.forEach((o,c)=>{a[o.type]&&(n.set(c,a[o.type]),s.set(c,i[o.type]))}),this._dateSeparator=e||"/",this._localizedDateRegex=new RegExp(`^${Array.from(s.values()).join(this._dateSeparator)}$`),this.localizedExpectedDateFormat=Array.from(n.values()).join(this._dateSeparator),this._placeholder=this.localizedExpectedDateFormat}getDatePartsFromLocalizedDateString(t){const e=t.split(this._dateSeparator),a=this.localizedExpectedDateFormat?.split(this._dateSeparator)||[],i=a.findIndex(o=>o.toLowerCase().includes("y")),n=a.findIndex(o=>o.toLowerCase().includes("m")),s=a.findIndex(o=>o.toLowerCase().includes("d"));return{year:parseInt(e[i]),month:parseInt(e[n])-1,day:parseInt(e[s])}}getDateValueFromLocalizedDateString(t){if(!t||t==="")return null;if(!this._localizedDateRegex?.test(t))return NaN;const{year:a,month:i,day:n}=this.getDatePartsFromLocalizedDateString(t),s=new Date(a,i,n);return isNaN(s.getTime())?NaN:s}maskDate(t){const{year:e}=this.getDatePartsFromLocalizedDateString(t);this.localizedExpectedDateFormat&&(this._maskPattern=this.localizedExpectedDateFormat?.toLowerCase().replace("yyyy",e.toString()).replace("mm","XX").replace("dd","XX"))}autoFormatDate(t){if(!this.autoAddDateSeparators||!this.localizedExpectedDateFormat)return;const e=t.value.replace(/[^\d]/g,"").split(""),a=this.localizedExpectedDateFormat.split(this._dateSeparator).map(s=>s.length);let i=[];a.forEach(s=>{i.push(e.slice(0,s).reduce((o,c)=>o+c,"")),e.splice(0,s)}),i=i.filter(s=>s!=="");let n=i.join(this._dateSeparator);i.length<a.length&&i[i.length-1].length==a[a.length-1]&&(n+=this._dateSeparator),t.value!==n&&(t.value=n)}toggleVisibility(){this._datePickerVisible=!this._datePickerVisible,this._datePickerVisible&&(this.assignPosition(),this.datepickerRef.value?.shiftFocusToCalendarGrid())}assignPosition(){const t=this.range?this.endInputRef.value?.controlRef.value:this.controlRef.value;!this.datepickerRef||!this.datepickerRef.value||!t||(this._cleanup=v(t,this.datepickerRef.value,async()=>{if(!this.datepickerRef||!this.datepickerRef.value||!t)return;const{x:e,y:a,placement:i}=await y(t,this.datepickerRef.value,{placement:"bottom-end",strategy:"fixed"});let n=i.includes("bottom")?4:-4;const s={left:`${e}px`,top:`${a+n}px`};this.range&&this.groupRef.value&&(s.width=`${this.groupRef.value.getBoundingClientRect().width}px`),Object.assign(this.datepickerRef.value.style,s)}))}handleError(t){switch(this.dispatchEvent(new b({errorReason:k.VALIDATION,component:{errorReason:t}})),t){case"invalid-format":return this._messageInvalidFormat.replace("{0}",this.localizedExpectedDateFormat);case"less-than-min-date":return this._messageLessThanMinDate.replace("{0}",this.minDate?.toLocaleDateString(this.locale,this._dateTimeOptions)||"");case"greater-than-max-date":return this._messageGreaterThanMaxDate.replace("{0}",this.maxDate?.toLocaleDateString(this.locale,this._dateTimeOptions)||"");case"outside-range":return this._messageOutsideRange.replace("{0}",this.minDate?.toLocaleDateString(this.locale,this._dateTimeOptions)||"").replace("{1}",this.maxDate?.toLocaleDateString(this.locale,this._dateTimeOptions)||"");case"invalid-start-date":return this._messageInvalidStartDate.replace("{0}",this.startDateLabel||"").replace("{1}",this.endDateLabel||"").replace("{2}",this._endDateInputValue||"");case"invalid-end-date":return this._messageInvalidEndDate.replace("{0}",this.endDateLabel||"").replace("{1}",this.startDateLabel||"").replace("{2}",this._startDateInputValue||"");default:return null}}};r.styles=[...$(r,r,"styles"),E(I)];l([h({type:Date})],r.prototype,"value",2);l([h({type:String,attribute:"locale"})],r.prototype,"locale",2);l([h({type:Date,attribute:"min-date"})],r.prototype,"minDate",2);l([h({type:Date,attribute:"max-date"})],r.prototype,"maxDate",2);l([h({type:Boolean,attribute:"sunday-start"})],r.prototype,"sundayStart",2);l([h({type:Boolean,attribute:"range"})],r.prototype,"range",2);l([h({type:Date,attribute:"start-date"})],r.prototype,"startDate",2);l([h({type:Date,attribute:"end-date"})],r.prototype,"endDate",2);l([h({type:String,attribute:"start-date-label"})],r.prototype,"startDateLabel",2);l([h({type:String,attribute:"end-date-label"})],r.prototype,"endDateLabel",2);l([h({type:Boolean,attribute:"mask-input"})],r.prototype,"maskInput",2);l([h({type:Boolean,attribute:"auto-add-date-separators"})],r.prototype,"autoAddDateSeparators",2);l([d()],r.prototype,"dateValue",2);l([d()],r.prototype,"_datePickerVisible",2);l([d()],r.prototype,"_startDate",2);l([d()],r.prototype,"_endDate",2);l([d()],r.prototype,"_startDateInputValue",2);l([d()],r.prototype,"_endDateInputValue",2);l([d()],r.prototype,"_maskPattern",2);l([d()],r.prototype,"_dateString",2);r=l([f("ngc-input-date"),_()],r);export{N as DateValidationError,r as NgcInputDate};
@@ -1,15 +1,15 @@
1
- import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{nothing as g,html as o}from"../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{property as v}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as $}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as F}from"../../../utils/decorators/custom-element-decorator.js";import{msg as f}from"../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import"../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import{NjcTable as P}from"../table.js";import{formatTableTextValue as T}from"../table-format-utils.js";import x from"../../../packages/web-components/src/components/table/gator/table.gator.scss.js";import _ from"../../../packages/styles/dist/tokens/primitive.tokens.css.js";import R from"../../../packages/styles/dist/tokens/semantic.tokens.css.js";import"./table-bulk-controls/table-bulk-controls.gator.js";import"./table-cells/table-cell-chip.gator.js";import"./table-cells/table-cell-avatar.gator.js";import"./table-cells/table-cell-checkbox.gator.js";import"./table-cells/table-cell-text-link.gator.js";import"./table-cells/table-cell-button.gator.js";import"./table-cells/table-cell-icon-button.gator.js";import"./table-cells/table-cell-input-dropdown.gator.js";import"./table-cells/table-cell-input-text.gator.js";import"./table-cells/table-cell-text.gator.js";import"../../checkbox/checkbox.gator.js";import"../../icon/gator/icon.gator.js";import"../../icon/gator/templates/index.js";import"../../icon-button/gator/icon-button.gator.js";import"../../popover/gator/popover.gator.js";import"../../checkbox-group/checkbox-group.gator.js";import"../../radio-group/radio-group.gator.js";import"../../button/gator/button.gator.js";import"../../chip/gator/chip.gator.js";import"../../input/gator/input-search/input-search.gator.js";import"../../skip-link/gator/base/skip-link.gator.js";import{unsafeCSS as k}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var A=Object.defineProperty,E=Object.getOwnPropertyDescriptor,p=(e,t,l,i)=>{for(var s=i>1?void 0:i?E(t,l):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(i?a(t,l,s):a(s))||s);return i&&s&&A(t,l,s),s};let d=class extends P{constructor(){super(...arguments),this.elevated=!1,this.includePagination=!1,this.skeleton=!1,this.sortField=null,this.sortDirection=null,this.filterValues={},this.selectedRows=[],this._currentPage=1,this._sortField=null,this._sortDirection=null,this._hoveredHeaderColumnField=null,this._pendingFilterValues={},this._filterSearchQuery={},this.renderHeaderFilterPopover=(e,t,l=!1)=>{const i=e.filterOptions??[],s=(this._filterSearchQuery[e.field]??"").toLowerCase(),r=s?i.filter(u=>u.label.toLowerCase().includes(s)):i,a=this.hasActiveFilter(e),h=e.filterMultiselect===!0,n=this.getEffectivePending(e),c=r.map(u=>({title:u.label,value:String(u.value)})),b=h?n.join(";"):"",m=h?"":n||"";return o`
1
+ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{nothing as g,html as o}from"../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{property as m}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as $}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as F}from"../../../utils/decorators/custom-element-decorator.js";import{msg as h}from"../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import{localized as x}from"../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js";import"../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import{NjcTable as T}from"../table.js";import{formatTableTextValue as P}from"../table-format-utils.js";import _ from"../../../packages/web-components/src/components/table/gator/table.gator.scss.js";import R from"../../../packages/styles/dist/tokens/primitive.tokens.css.js";import A from"../../../packages/styles/dist/tokens/semantic.tokens.css.js";import"./table-bulk-controls/table-bulk-controls.gator.js";import"./table-cells/table-cell-chip.gator.js";import"./table-cells/table-cell-avatar.gator.js";import"./table-cells/table-cell-checkbox.gator.js";import"./table-cells/table-cell-text-link.gator.js";import"./table-cells/table-cell-button.gator.js";import"./table-cells/table-cell-icon-button.gator.js";import"./table-cells/table-cell-input-dropdown.gator.js";import"./table-cells/table-cell-input-text.gator.js";import"./table-cells/table-cell-text.gator.js";import"../../checkbox/checkbox.gator.js";import"../../icon/gator/icon.gator.js";import"../../icon/gator/templates/index.js";import"../../icon-button/gator/icon-button.gator.js";import"../../popover/gator/popover.gator.js";import"../../checkbox-group/checkbox-group.gator.js";import"../../radio-group/radio-group.gator.js";import"../../button/gator/button.gator.js";import"../../chip/gator/chip.gator.js";import"../../input/gator/input-search/input-search.gator.js";import"../../skip-link/gator/base/skip-link.gator.js";import"../../illustration/gator/illustration.gator.js";import"../../illustration/gator/templates/index.js";import"../../card/gator/base/card.gator.js";import{unsafeCSS as k}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var E=Object.defineProperty,B=Object.getOwnPropertyDescriptor,u=(e,t,l,i)=>{for(var s=i>1?void 0:i?B(t,l):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(i?a(t,l,s):a(s))||s);return i&&s&&E(t,l,s),s};let p=class extends T{constructor(){super(...arguments),this.elevated=!1,this.includePagination=!1,this.skeleton=!1,this.sortField=null,this.sortDirection=null,this.filterValues={},this.selectedRows=[],this._currentPage=1,this._sortField=null,this._sortDirection=null,this._hoveredHeaderColumnField=null,this._pendingFilterValues={},this._filterSearchQuery={},this.renderHeaderFilterPopover=(e,t,l=!1)=>{const i=e.filterOptions??[],s=(this._filterSearchQuery[e.field]??"").toLowerCase(),r=s?i.filter(f=>f.label.toLowerCase().includes(s)):i,a=this.hasActiveFilter(e),c=e.filterMultiselect===!0,n=this.getEffectivePending(e),d=r.map(f=>({title:f.label,value:String(f.value)})),b=c?n.join(";"):"",v=c?"":n||"";return o`
2
2
  <span class="gator-table-header-filter-trigger-wrap ${t?"gator-table-header-filter-trigger-visible":""}">
3
3
  <ngc-icon-button
4
4
  id="filter-trigger-${e.field}"
5
5
  icon-name="filters-2"
6
6
  size="xsmall"
7
- icon-aria-label="${f("Filter by")} ${e.name}"
7
+ icon-aria-label="${h("Filter by")} ${e.name}"
8
8
  class="${a?"gator-table-header-filter-icon-active":""}"
9
9
  ></ngc-icon-button>
10
10
  <ngc-popover
11
11
  reference-id="filter-trigger-${e.field}"
12
- .title=${f("Filter")}
12
+ .title=${h("Filter")}
13
13
  size="small"
14
14
  placement="${l?"bottom-start":"bottom-end"}"
15
15
  .hideTippet="${!0}"
@@ -18,70 +18,85 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
18
18
  <div slot="content" class="gator-table-filter-popover-content">
19
19
  ${i.length>10?o`
20
20
  <ngc-input-search
21
- placeholder="${f("Search")}"
21
+ placeholder="${h("Search")}"
22
22
  .value="${this._filterSearchQuery[e.field]??""}"
23
- @input="${u=>this.handleFilterSearchInput(u,e)}"
23
+ @input="${f=>this.handleFilterSearchInput(f,e)}"
24
24
  class="gator-table-filter-popover-search"
25
25
  ></ngc-input-search>
26
26
  `:g}
27
- ${h?o`
27
+ ${c?o`
28
28
  <ngc-checkbox-group
29
- .options="${c}"
29
+ .options="${d}"
30
30
  .value="${b}"
31
- aria-label="${f("Filter by")} ${e.name}"
32
- @change="${u=>this.handleFilterCheckboxGroupChange(u,e)}"
31
+ aria-label="${h("Filter by")} ${e.name}"
32
+ @change="${f=>this.handleFilterCheckboxGroupChange(f,e)}"
33
33
  ></ngc-checkbox-group>
34
34
  `:o`
35
35
  <ngc-radio-group
36
- .options="${c}"
37
- .value="${m}"
38
- aria-label="${f("Filter by")} ${e.name}"
39
- @change="${u=>this.handleFilterRadioGroupChange(u,e)}"
36
+ .options="${d}"
37
+ .value="${v}"
38
+ aria-label="${h("Filter by")} ${e.name}"
39
+ @change="${f=>this.handleFilterRadioGroupChange(f,e)}"
40
40
  ></ngc-radio-group>
41
41
  `}
42
42
  </div>
43
43
  <div slot="footer" class="gator-table-filter-popover-footer">
44
- <ngc-button variant="primary" @click="${()=>this.handleFilterPopoverApply(e)}">${f("Apply")}</ngc-button>
45
- <ngc-button variant="base" @click="${()=>this.handleFilterPopoverClear(e)}">${f("Clear")}</ngc-button>
44
+ <ngc-button variant="primary" @click="${()=>this.handleFilterPopoverApply(e)}">${h("Apply")}</ngc-button>
45
+ <ngc-button variant="base" @click="${()=>this.handleFilterPopoverClear(e)}">${h("Clear")}</ngc-button>
46
46
  </div>
47
47
  </ngc-popover>
48
48
  </span>
49
- `},this.handleClearAllFilters=()=>{if(!this.columns?.length||!this.filterValues)return;const e=t=>t.filterOptions??[];for(const t of this.columns){if(!t.filterable||e(t).length===0)continue;const l=this.filterValues[t.field];if(l==null)continue;if(t.filterMultiselect===!0?l.length>0:l!==""){const s=t.filterMultiselect===!0?[]:"";this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:t.field,value:s}}))}}this.requestUpdate()}}updated(e){super.updated(e),e.has("data")&&queueMicrotask(()=>{this.selectedRows=this.data.filter(t=>t.selected&&!t.isTableHeader)})}render(){if(!this.skeleton&&!this.columns)return null;const e=this.skeleton?this._skeletonLoaderColumns:this.columns;return this.renderWrapper(this.getTableHeader(e),this.getTableBody(e,this.displayedRowData))}getColumnCellStyle(e){const t=e.width??(e.cellType==="icon-button"?"5%":void 0);return t?`width: ${t}; box-sizing: border-box`:""}get _skeletonLoaderColumns(){const e=this.columns?.length||6;let t=[];for(let l=0;l<e;l++)t=t.concat({field:`skeleton-loader-${l}`,name:`skeleton-loader-${l}`});return t}get tableElevatedClass(){return this.elevated?"gator-table-elevated":""}get showBulkControls(){return this.selectable&&this.selectedRows.length>0}renderWrapper(e,t){const l=this.getActiveFilterChips();return o`
49
+ `},this.handleClearAllFilters=()=>{if(!this.columns?.length||!this.filterValues)return;const e=l=>l.filterOptions??[],t={};for(const l of this.columns)!l.filterable||e(l).length===0||(t[l.field]=l.filterMultiselect===!0?[]:"");this.dispatchEvent(new CustomEvent("clearfilters",{bubbles:!0,composed:!0,detail:{values:t}})),this.requestUpdate()}}updated(e){super.updated(e),e.has("data")&&queueMicrotask(()=>{this.selectedRows=this.data.filter(t=>t.selected&&!t.isTableHeader)})}render(){if(!this.skeleton&&!this.columns)return null;const e=this.skeleton?this._skeletonLoaderColumns:this.columns;return this.renderWrapper(this.getTableHeader(e),this.getTableBody(e,this.displayedRowData))}getColumnCellStyle(e){const t=e.width??(e.cellType==="icon-button"?"5%":void 0);return t?`width: ${t}; box-sizing: border-box`:""}get _skeletonLoaderColumns(){const e=this.columns?.length||6;let t=[];for(let l=0;l<e;l++)t=t.concat({field:`skeleton-loader-${l}`,name:`skeleton-loader-${l}`});return t}get tableElevatedClass(){return this.elevated?"gator-table-elevated":""}get showBulkControls(){return this.selectable&&this.selectedRows.length>0}renderWrapper(e,t){const l=this.getActiveFilterChips(),i=l.length>0,s=i?h("No data matches the current filters."):h("Start by adding some data.");return o`
50
50
  <ngc-table-bulk-controls
51
51
  ?visible="${this.showBulkControls}"
52
52
  .selectedRows="${this.selectedRows.length}"
53
53
  .totalRows="${this.data.length}"
54
- ?allSelected="${this.selectedRows.length===this.data.filter(i=>!i.isTableHeader&&!i.disabled).length}"
54
+ ?allSelected="${this.selectedRows.length===this.data.filter(r=>!r.isTableHeader&&!r.disabled).length}"
55
55
  @selectall="${this.handleSelectAll}"
56
56
  >
57
57
  <slot name="bulk-controls"></slot>
58
58
  </ngc-table-bulk-controls>
59
- ${!this.skeleton&&l.length>0?o`
60
- <div class="gator-table-filter-chips" role="region" aria-label="${f("Active filters")}">
61
- ${l.map(({column:i,value:s,label:r})=>o`
59
+ ${!this.skeleton&&i?o`
60
+ <div class="gator-table-filter-chips" role="region" aria-label="${h("Active filters")}">
61
+ ${l.map(({column:r,value:a,label:c})=>o`
62
62
  <ngc-chip
63
63
  dismissible
64
64
  size="small"
65
- @dismiss="${()=>this.handleFilterChipDismiss(i,s)}"
66
- >${i.name}: ${r}</ngc-chip>
65
+ @dismiss="${()=>this.handleFilterChipDismiss(r,a)}"
66
+ >${r.name}: ${c}</ngc-chip>
67
67
  `)}
68
68
  ${l.length>1?o`
69
69
  <button
70
70
  type="button"
71
71
  class="gator-table-filter-chips-clear-all"
72
72
  @click="${this.handleClearAllFilters}"
73
- >${f("Clear all")}</button>
73
+ >${h("Clear all")}</button>
74
74
  `:g}
75
75
  </div>
76
76
  `:g}
77
- <table
78
- class="gator-table ${this.tableElevatedClass}"
79
- role="grid"
80
- aria-labelledby="${this.tableAriaLabelledBy}"
81
- >
82
- ${e} ${t}
83
- </table>
84
- ${this.includePagination&&!this.skeleton?o`
77
+ ${this.data.length===0&&!this.skeleton?o`
78
+ <ngc-card class="gator-table-empty-state-card">
79
+ <div class="gator-table-empty-state">
80
+ <ngc-illustration
81
+ name="empty-box"
82
+ title-text="${h("No results found")}"
83
+ .bodyText="${s}"
84
+ size="medium"
85
+ >
86
+ ${i?o`<ngc-button @click="${this.handleClearAllFilters}">${h("Clear filters")}</ngc-button>`:g}
87
+ </ngc-illustration>
88
+ </div>
89
+ </ngc-card>
90
+ `:o`
91
+ <table
92
+ class="gator-table ${this.tableElevatedClass}"
93
+ role="grid"
94
+ aria-labelledby="${this.tableAriaLabelledBy}"
95
+ >
96
+ ${e} ${t}
97
+ </table>
98
+ `}
99
+ ${this.includePagination&&!this.skeleton&&this.data.length>0?o`
85
100
  <ngc-table-pagination
86
101
  items-per-page="${this.itemsPerPage}"
87
102
  total-items="${this.data.length}"
@@ -94,7 +109,7 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
94
109
  `}handlePageChanged(e){this._currentPage=e.detail.page}handleItemsPerPageChanged(e){this.itemsPerPage=e.detail.itemsPerPage}getTableHeader(e){const t=e.map((l,i)=>this.getTableHeaderColumn(l,i===0));return!this.skeleton&&this.selectable&&t.unshift(o`
95
110
  <th id="col-select" scope="col">
96
111
  <ngc-checkbox
97
- title-text="${f("Select All")}"
112
+ title-text="${h("Select All")}"
98
113
  hide-label
99
114
  ?selected="${this.selectedRows.length===this.data.filter(l=>!l.isTableHeader&&!l.disabled).length}"
100
115
  @change="${l=>this.handleSelectAll(l)}"
@@ -111,12 +126,12 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
111
126
  height="24"
112
127
  rounded
113
128
  ></ngc-skeleton-loader>
114
- `,s=`col-${e.field}`,r=!this.skeleton&&e.sortable===!0,a=!this.skeleton&&e.filterable===!0&&e.filterOptions?.length,h=r?this.getSortAriaSort(e):void 0,n=r&&this.effectiveSortField===e.field,c=a&&this.hasActiveFilter(e),b=r||a,m=r?o`
129
+ `,s=`col-${e.field}`,r=!this.skeleton&&e.sortable===!0,a=!this.skeleton&&e.filterable===!0&&e.filterOptions?.length,c=r?this.getSortAriaSort(e):void 0,n=r&&this.effectiveSortField===e.field,d=a&&this.hasActiveFilter(e),b=r||a,v=r?o`
115
130
  <div
116
131
  class="gator-table-header-sort-trigger"
117
132
  role="button"
118
133
  tabindex="0"
119
- aria-label="${f("Sort by")} ${e.name}"
134
+ aria-label="${h("Sort by")} ${e.name}"
120
135
  @click="${()=>this.handleSortColumn(e)}"
121
136
  @keydown="${C=>C.key==="Enter"||C.key===" "?(C.preventDefault(),this.handleSortColumn(e)):null}"
122
137
  >
@@ -125,16 +140,16 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
125
140
  <ngc-icon name="${this.getSortIcon(e)}" class="gator-table-sort-icon" size="x-small"></ngc-icon>
126
141
  </span>
127
142
  </div>
128
- `:o`<span class="gator-table-header-label">${e.name}</span>`,u=!!(a&&(this._hoveredHeaderColumnField===e.field||c||this.isFilterPopoverOpen(e))),y=l?i:o`
143
+ `:o`<span class="gator-table-header-label">${e.name}</span>`,f=!!(a&&(this._hoveredHeaderColumnField===e.field||d||this.isFilterPopoverOpen(e))),y=l?i:o`
129
144
  <div class="gator-table-header-cell-inner">
130
- ${m}
131
- ${a?this.renderHeaderFilterPopover(e,u,t):g}
145
+ ${v}
146
+ ${a?this.renderHeaderFilterPopover(e,f,t):g}
132
147
  </div>
133
- `,S=[n?"gator-table-header-cell-sort-active":"",c?"gator-table-header-cell-filter-active":"",b?"gator-table-header-cell-interactive":""].filter(Boolean).join(" "),w=this.getColumnCellStyle(e);return o`
148
+ `,S=[n?"gator-table-header-cell-sort-active":"",d?"gator-table-header-cell-filter-active":"",b?"gator-table-header-cell-interactive":""].filter(Boolean).join(" "),w=this.getColumnCellStyle(e);return o`
134
149
  <th
135
150
  id="${s}"
136
151
  scope="col"
137
- aria-sort="${h??g}"
152
+ aria-sort="${c??g}"
138
153
  class="${S}"
139
154
  style="${w||g}"
140
155
  @mouseenter="${a||r?()=>this._hoveredHeaderColumnField=e.field:g}"
@@ -142,15 +157,15 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
142
157
  >
143
158
  ${y}
144
159
  </th>
145
- `}getEffectivePending(e){const t=this._pendingFilterValues[e.field];return t!==void 0?t:this.filterValues[e.field]??(e.filterMultiselect===!0?[]:"")}getFilterPopoverForColumn(e){return this.shadowRoot?.querySelector(`ngc-popover[reference-id="filter-trigger-${e.field}"]`)??null}isFilterPopoverOpen(e){return this.getFilterPopoverForColumn(e)?.isOpen===!0}handleFilterPopoverClosed(e){this._filterSearchQuery={...this._filterSearchQuery,[e.field]:""}}handleFilterSearchInput(e,t){const l=e.detail?.value??"";this._filterSearchQuery={...this._filterSearchQuery,[t.field]:l},this.requestUpdate()}handleFilterCheckboxGroupChange(e,t){const l=e.detail??"",i=l?l.split(";").filter(Boolean):[];this._pendingFilterValues={...this._pendingFilterValues,[t.field]:i},this.requestUpdate()}handleFilterRadioGroupChange(e,t){const l=e.detail??"";this._pendingFilterValues={...this._pendingFilterValues,[t.field]:l},this.requestUpdate()}handleFilterPopoverApply(e){const t=this.getEffectivePending(e);this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:t}}));const l={...this._pendingFilterValues};delete l[e.field],this._pendingFilterValues=l,this.getFilterPopoverForColumn(e)?.hidePopover?.(),this.requestUpdate()}handleFilterPopoverClear(e){const l=e.filterMultiselect===!0?[]:"";this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:l}}));const i={...this._pendingFilterValues};delete i[e.field],this._pendingFilterValues=i,this.getFilterPopoverForColumn(e)?.hidePopover?.(),this.requestUpdate()}hasActiveFilter(e){const t=this.filterValues[e.field];return t==null?!1:e.filterMultiselect===!0?t.length>0:t!==""}getActiveFilterChips(){if(!this.columns?.length||!this.filterValues)return[];const e=[],t=l=>l.filterOptions??[];for(const l of this.columns){if(!l.filterable||t(l).length===0)continue;const i=this.filterValues[l.field];if(i==null)continue;if(l.filterMultiselect===!0){const r=i;for(const a of r){const h=t(l).find(n=>String(n.value)===a);e.push({column:l,value:a,label:h?.label??a})}}else{const r=i;if(r==="")continue;const a=t(l).find(h=>String(h.value)===r);e.push({column:l,value:r,label:a?.label??r})}}return e}handleFilterChipDismiss(e,t){const l=e.filterMultiselect===!0,i=this.filterValues[e.field],s=l?(i||[]).filter(r=>r!==t):"";this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:s}})),this.requestUpdate()}getTableBody(e,t){const l=[];let i={rows:[]};return t.forEach(s=>{s.isTableHeader?((i.rows.length>0||i.header)&&l.push(i),i={header:s,rows:[]}):i.rows.push(s)}),(i.rows.length>0||i.header)&&l.push(i),l.length===0&&t.length>0&&l.push({rows:t}),o`
160
+ `}getEffectivePending(e){const t=this._pendingFilterValues[e.field];return t!==void 0?t:this.filterValues[e.field]??(e.filterMultiselect===!0?[]:"")}getFilterPopoverForColumn(e){return this.shadowRoot?.querySelector(`ngc-popover[reference-id="filter-trigger-${e.field}"]`)??null}isFilterPopoverOpen(e){return this.getFilterPopoverForColumn(e)?.isOpen===!0}handleFilterPopoverClosed(e){this._filterSearchQuery={...this._filterSearchQuery,[e.field]:""}}handleFilterSearchInput(e,t){const l=e.detail?.value??"";this._filterSearchQuery={...this._filterSearchQuery,[t.field]:l},this.requestUpdate()}handleFilterCheckboxGroupChange(e,t){const l=e.detail??"",i=l?l.split(";").filter(Boolean):[];this._pendingFilterValues={...this._pendingFilterValues,[t.field]:i},this.requestUpdate()}handleFilterRadioGroupChange(e,t){const l=e.detail??"";this._pendingFilterValues={...this._pendingFilterValues,[t.field]:l},this.requestUpdate()}handleFilterPopoverApply(e){const t=this.getEffectivePending(e);this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:t}}));const l={...this._pendingFilterValues};delete l[e.field],this._pendingFilterValues=l,this.getFilterPopoverForColumn(e)?.hidePopover?.(),this.requestUpdate()}handleFilterPopoverClear(e){const l=e.filterMultiselect===!0?[]:"";this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:l}}));const i={...this._pendingFilterValues};delete i[e.field],this._pendingFilterValues=i,this.getFilterPopoverForColumn(e)?.hidePopover?.(),this.requestUpdate()}hasActiveFilter(e){const t=this.filterValues[e.field];return t==null?!1:e.filterMultiselect===!0?t.length>0:t!==""}getActiveFilterChips(){if(!this.columns?.length||!this.filterValues)return[];const e=[],t=l=>l.filterOptions??[];for(const l of this.columns){if(!l.filterable||t(l).length===0)continue;const i=this.filterValues[l.field];if(i==null)continue;if(l.filterMultiselect===!0){const r=i;for(const a of r){const c=t(l).find(n=>String(n.value)===a);e.push({column:l,value:a,label:c?.label??a})}}else{const r=i;if(r==="")continue;const a=t(l).find(c=>String(c.value)===r);e.push({column:l,value:r,label:a?.label??r})}}return e}handleFilterChipDismiss(e,t){const l=e.filterMultiselect===!0,i=this.filterValues[e.field],s=l?(i||[]).filter(r=>r!==t):"";this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:s}})),this.requestUpdate()}getTableBody(e,t){const l=[];let i={rows:[]};return t.forEach(s=>{s.isTableHeader?((i.rows.length>0||i.header)&&l.push(i),i={header:s,rows:[]}):i.rows.push(s)}),(i.rows.length>0||i.header)&&l.push(i),l.length===0&&t.length>0&&l.push({rows:t}),o`
146
161
  ${l.map(s=>this.getCategoryBody(s,e))}
147
- `}getCategoryBody(e,t){let l="",i="",s="";e.header&&(l=e.header.headerText||e.header.categoryText||e.header.name||"Category",s=`category-${l.toLowerCase().replace(/\s+/g,"-")}`,i=s);const r=e.header?this.getTableHeaderRow(t,e.header):"",a=e.rows.map(c=>this.getTableBodyRow(c,t,s,this.data.indexOf(c))),h=t.some(c=>c.includedInTotals===!0),n=e.rows.length>0&&h?this.getTotalRow(e.rows,t,s):"";return o`
162
+ `}getCategoryBody(e,t){let l="",i="",s="";e.header&&(l=e.header.headerText||e.header.categoryText||e.header.name||"Category",s=`category-${l.toLowerCase().replace(/\s+/g,"-")}`,i=s);const r=e.header?this.getTableHeaderRow(t,e.header):"",a=e.rows.map(d=>this.getTableBodyRow(d,t,s,this.data.indexOf(d))),c=t.some(d=>d.includedInTotals===!0),n=e.rows.length>0&&c?this.getTotalRow(e.rows,t,s):"";return o`
148
163
  <tbody role="rowgroup" ${i?o`aria-labelledby="${i}"`:""}>
149
164
  ${r}
150
165
  ${a}
151
166
  ${n}
152
167
  </tbody>
153
- `}getTotalRow(e,t,l){const i={};t.forEach(n=>{i[n.field]=0,n.includedInTotals&&e.forEach(c=>{const b=this.parseNumericValue(c[n.field]);b!==null&&(i[n.field]+=b)})});const s=l?`${l}-total`:"total-row",r=o`
168
+ `}getTotalRow(e,t,l){const i={};t.forEach(n=>{i[n.field]=0,n.includedInTotals&&e.forEach(d=>{const b=this.parseNumericValue(d[n.field]);b!==null&&(i[n.field]+=b)})});const s=l?`${l}-total`:"total-row",r=o`
154
169
  <th
155
170
  id="${s}"
156
171
  scope="row"
@@ -158,7 +173,7 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
158
173
  >
159
174
  Total
160
175
  </th>
161
- `,a=t.map(n=>{const c=`col-${n.field}`,b=[s,l,c].filter(Boolean).join(" ");return n.includedInTotals?o`
176
+ `,a=t.map(n=>{const d=`col-${n.field}`,b=[s,l,d].filter(Boolean).join(" ");return n.includedInTotals?o`
162
177
  <td
163
178
  role="gridcell"
164
179
  headers="${b}"
@@ -175,11 +190,11 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
175
190
  >
176
191
  &nbsp;
177
192
  </td>
178
- `}),h=this.selectable?[r,...a]:[r,...a.slice(1)];return o`
193
+ `}),c=this.selectable?[r,...a]:[r,...a.slice(1)];return o`
179
194
  <tr role="row" class="gator-table-total-row">
180
- ${h}
195
+ ${c}
181
196
  </tr>
182
- `}parseNumericValue(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=e.replace(/[^0-9.-]/g,""),l=parseFloat(t);if(!isNaN(l))return l}return null}formatTotal(e,t){if(typeof t.cellRenderer=="function"){const i=t.cellConfig?.decimalPlaces??t.decimalPlaces??2;return t.cellRenderer({[t.field]:e.toFixed(i)})}return T(e,t.cellConfig,t.decimalPlaces)}getTableBodyRow(e,t,l,i){const s=t.map(r=>this.getTableBodyCell(e,r,l,i??0));if(!this.skeleton&&this.selectable){const r=l?`col-select ${l}`:"col-select";s.unshift(o`
197
+ `}parseNumericValue(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=e.replace(/[^0-9.-]/g,""),l=parseFloat(t);if(!isNaN(l))return l}return null}formatTotal(e,t){if(typeof t.cellRenderer=="function"){const i=t.cellConfig?.decimalPlaces??t.decimalPlaces??2;return t.cellRenderer({[t.field]:e.toFixed(i)})}return P(e,t.cellConfig,t.decimalPlaces)}getTableBodyRow(e,t,l,i){const s=t.map(r=>this.getTableBodyCell(e,r,l,i??0));if(!this.skeleton&&this.selectable){const r=l?`col-select ${l}`:"col-select";s.unshift(o`
183
198
  <td role="gridcell" class="gator-table-checkbox-column" headers="${r}">
184
199
  <ngc-checkbox
185
200
  label="test"
@@ -199,19 +214,19 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
199
214
  ${i}
200
215
  </th>
201
216
  </tr>
202
- `}handleTableBodyRowSelected(e,t){t.disabled||(e.detail.selected?(t.selected=!0,this.selectedRows.push(t),this.addSkipLinkToBulkActions(e.target)):(t.selected=!1,this.selectedRows=this.selectedRows.filter(l=>l!==t),this.removeSkipLinkToBulkActions(e.target)),this.dispatchEvent(new CustomEvent("rowselected",{bubbles:!0,composed:!0,detail:{data:t,selectedRows:this.selectedRows}}))),this.requestUpdate()}addSkipLinkToBulkActions(e){e.parentNode?.querySelector("ngc-skip-link")||e.parentNode?.insertBefore(this.getSkipToBulkActionsMarkup(e),e)}getSkipToBulkActionsMarkup(e){const t=document.createElement("ngc-skip-link");return t.target=this.shadowRoot?.querySelector("ngc-table-bulk-controls")||"",t.text=f("Jump to table actions"),t.referenceElement=e,t.placement="top-start",t.xOffset=4,t.yOffset=-12,t.onblur=this.removeSkipLinkToBulkActions.bind(this,e),t}removeSkipLinkToBulkActions(e){e.parentNode?.querySelector("ngc-skip-link")?.remove()}get displayedRowData(){if(this.skeleton){let i=[];for(let s=0;s<5;s++)i=i.concat({skeleton:!0});return i}if(!this.includePagination)return this.data;const e=(this._currentPage-1)*this.itemsPerPage,t=e+this.itemsPerPage;return this.data.slice(e,t)}getTableBodyCell(e,t,l,i=0){const s=!!e.skeleton,r=o`
217
+ `}handleTableBodyRowSelected(e,t){t.disabled||(e.detail.selected?(t.selected=!0,this.selectedRows.push(t),this.addSkipLinkToBulkActions(e.target)):(t.selected=!1,this.selectedRows=this.selectedRows.filter(l=>l!==t),this.removeSkipLinkToBulkActions(e.target)),this.dispatchEvent(new CustomEvent("rowselected",{bubbles:!0,composed:!0,detail:{data:t,selectedRows:this.selectedRows}}))),this.requestUpdate()}addSkipLinkToBulkActions(e){e.parentNode?.querySelector("ngc-skip-link")||e.parentNode?.insertBefore(this.getSkipToBulkActionsMarkup(e),e)}getSkipToBulkActionsMarkup(e){const t=document.createElement("ngc-skip-link");return t.target=this.shadowRoot?.querySelector("ngc-table-bulk-controls")||"",t.text=h("Jump to table actions"),t.referenceElement=e,t.placement="top-start",t.xOffset=4,t.yOffset=-12,t.onblur=this.removeSkipLinkToBulkActions.bind(this,e),t}removeSkipLinkToBulkActions(e){e.parentNode?.querySelector("ngc-skip-link")?.remove()}get displayedRowData(){if(this.skeleton){let i=[];for(let s=0;s<5;s++)i=i.concat({skeleton:!0});return i}if(!this.includePagination)return this.data;const e=(this._currentPage-1)*this.itemsPerPage,t=e+this.itemsPerPage;return this.data.slice(e,t)}getTableBodyCell(e,t,l,i=0){const s=!!e.skeleton,r=o`
203
218
  <ngc-skeleton-loader
204
219
  full-width
205
220
  height="24"
206
221
  rounded
207
222
  ></ngc-skeleton-loader>
208
- `,a=`col-${t.field}`,h=l?`${a} ${l}`:a,n=s?this.getCellAlignClass(t):"",c=s?r:this.renderCellByType(e,t,i,l??"");return o`
223
+ `,a=`col-${t.field}`,c=l?`${a} ${l}`:a,n=s?this.getCellAlignClass(t):"",d=s?r:this.renderCellByType(e,t,i,l??"");return o`
209
224
  <td
210
225
  role="gridcell"
211
- headers="${h}"
226
+ headers="${c}"
212
227
  class="${n}"
213
228
  style="${this.getColumnCellStyle(t)||g}"
214
229
  >
215
- ${c}
230
+ ${d}
216
231
  </td>
217
- `}getCellAlignClass(e){return`gator-table-cell-${e.cellConfig?.align??"left"}`}renderCellByType(e,t,l,i){const s=a=>this.handleCellChange(a),r=a=>this.handleCellClick(a);switch(t.cellType){case"chip":return o`<ngc-table-cell-chip .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-chip>`;case"avatar":return o`<ngc-table-cell-avatar .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-avatar>`;case"checkbox":return o`<ngc-table-cell-checkbox .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-checkbox>`;case"text-link":return o`<ngc-table-cell-text-link .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-text-link>`;case"button":return o`<ngc-table-cell-button .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-button>`;case"icon-button":return o`<ngc-table-cell-icon-button .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-icon-button>`;case"input-dropdown":return o`<ngc-table-cell-input-dropdown .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-input-dropdown>`;case"input-text":return o`<ngc-table-cell-input-text .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-input-text>`;default:return o`<ngc-table-cell-text .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-text>`}}handleCellChange(e){e.stopPropagation();const{rowIndex:t,field:l,value:i}=e.detail??{};this.dispatchEvent(new CustomEvent("cellchange",{bubbles:!0,composed:!0,detail:{rowIndex:t,field:l,value:i}}))}handleCellClick(e){e.stopPropagation();const{rowIndex:t,field:l,value:i}=e.detail??{};this.dispatchEvent(new CustomEvent("cellclick",{bubbles:!0,composed:!0,detail:{rowIndex:t,field:l,...i!==void 0&&{value:i}}}))}};d.styles=[k(R),k(_),k(x)];p([v({type:Boolean})],d.prototype,"elevated",2);p([v({type:Boolean,attribute:"include-pagination"})],d.prototype,"includePagination",2);p([v({type:Boolean})],d.prototype,"skeleton",2);p([v({type:String,attribute:"sort-field"})],d.prototype,"sortField",2);p([v({type:String,attribute:"sort-direction"})],d.prototype,"sortDirection",2);p([v({type:Object,attribute:!1})],d.prototype,"filterValues",2);p([$()],d.prototype,"selectedRows",2);p([$()],d.prototype,"_currentPage",2);p([$()],d.prototype,"_sortField",2);p([$()],d.prototype,"_sortDirection",2);p([$()],d.prototype,"_hoveredHeaderColumnField",2);p([$()],d.prototype,"_pendingFilterValues",2);p([$()],d.prototype,"_filterSearchQuery",2);d=p([F("ngc-table")],d);export{d as NgcTable};
232
+ `}getCellAlignClass(e){return`gator-table-cell-${e.cellConfig?.align??"left"}`}renderCellByType(e,t,l,i){const s=a=>this.handleCellChange(a),r=a=>this.handleCellClick(a);switch(t.cellType){case"chip":return o`<ngc-table-cell-chip .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-chip>`;case"avatar":return o`<ngc-table-cell-avatar .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-avatar>`;case"checkbox":return o`<ngc-table-cell-checkbox .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-checkbox>`;case"text-link":return o`<ngc-table-cell-text-link .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-text-link>`;case"button":return o`<ngc-table-cell-button .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-button>`;case"icon-button":return o`<ngc-table-cell-icon-button .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-icon-button>`;case"input-dropdown":return o`<ngc-table-cell-input-dropdown .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-input-dropdown>`;case"input-text":return o`<ngc-table-cell-input-text .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-input-text>`;default:return o`<ngc-table-cell-text .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-text>`}}handleCellChange(e){e.stopPropagation();const{rowIndex:t,field:l,value:i}=e.detail??{};this.dispatchEvent(new CustomEvent("cellchange",{bubbles:!0,composed:!0,detail:{rowIndex:t,field:l,value:i}}))}handleCellClick(e){e.stopPropagation();const{rowIndex:t,field:l,value:i}=e.detail??{};this.dispatchEvent(new CustomEvent("cellclick",{bubbles:!0,composed:!0,detail:{rowIndex:t,field:l,...i!==void 0&&{value:i}}}))}};p.styles=[k(A),k(R),k(_)];u([m({type:Boolean})],p.prototype,"elevated",2);u([m({type:Boolean,attribute:"include-pagination"})],p.prototype,"includePagination",2);u([m({type:Boolean})],p.prototype,"skeleton",2);u([m({type:String,attribute:"sort-field"})],p.prototype,"sortField",2);u([m({type:String,attribute:"sort-direction"})],p.prototype,"sortDirection",2);u([m({type:Object,attribute:!1})],p.prototype,"filterValues",2);u([$()],p.prototype,"selectedRows",2);u([$()],p.prototype,"_currentPage",2);u([$()],p.prototype,"_sortField",2);u([$()],p.prototype,"_sortDirection",2);u([$()],p.prototype,"_hoveredHeaderColumnField",2);u([$()],p.prototype,"_pendingFilterValues",2);u([$()],p.prototype,"_filterSearchQuery",2);p=u([F("ngc-table"),x()],p);export{p as NgcTable};
@@ -1 +1 @@
1
- const t=":root,:host{position:relative}.datepicker{position:absolute;top:0;left:0;display:none;z-index:1;width:var(--ngc-datepicker-width, 20rem)}.datepicker-visible{display:flex}.datepicker[range]{width:100%}.gator-input-date-range{display:flex;flex-direction:row;justify-content:space-between;gap:var(--spacing-8);align-items:start;margin-top:var(--spacing-5)}.gator-input-date-range ngc-input-text{--ngc-input-label-font-size: var(--font-size-body-3);--ngc-input-label-line-height: var(--line-height-body-3);width:100%}@media(max-width:400px){.gator-input-date-range{flex-direction:column;gap:0}}[disabled]{--ngc-icon-button-disabled-color: #BFBFBF}ngc-input-text[error-text]{--ngc-help-text-display: none}";export{t as default};
1
+ const t=":root,:host{position:relative}.datepicker{position:fixed;top:0;left:0;display:none;z-index:1;width:var(--ngc-datepicker-width, 20rem)}.datepicker-visible{display:flex}.gator-input-date-range{display:flex;flex-direction:row;justify-content:space-between;gap:var(--spacing-8);align-items:start;margin-top:var(--spacing-5)}.gator-input-date-range ngc-input-text{--ngc-input-label-font-size: var(--font-size-body-3);--ngc-input-label-line-height: var(--line-height-body-3);width:100%}@media(max-width:400px){.gator-input-date-range{flex-direction:column;gap:0}}[disabled]{--ngc-icon-button-disabled-color: #BFBFBF}ngc-input-text[error-text]{--ngc-help-text-display: none}";export{t as default};
@@ -1 +1 @@
1
- const r='.gator-table-filter-chips{display:flex;flex-wrap:wrap;gap:var(--spacing-8);padding:var(--spacing-8) 0;align-items:center}.gator-table-filter-chips-clear-all{font-family:var(--font-family-body, "Open Sans"),sans-serif;font-size:var(--font-size-body-2);font-weight:var(--font-weight-regular, 400);line-height:var(--line-height-body-2);letter-spacing:var(--letter-spacing-default, 0);color:var(--color-text-brand, var(--color-text-primary));background:none;border:none;padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.gator-table-filter-chips-clear-all:hover{color:var(--color-feedback-brand-secondary)}.gator-table-filter-chips-clear-all:focus{outline:none}.gator-table-filter-chips-clear-all:focus-visible{outline:2px solid var(--color-border-focus, currentColor);outline-offset:2px}.gator-table{font-family:var(--font-family-body, "Open Sans"),sans-serif;border-spacing:0;width:100%;overflow:auto;border-radius:var(--ngc-table-border-radius, var(--border-radius-medium));background-color:var(--ngc-table-row-background-color, var(--color-surface-primary))}.gator-table thead>th,.gator-table thead>tr{height:3rem;min-height:3rem}.gator-table thead>th :first-child,.gator-table thead>tr :first-child{border-top-left-radius:var(--ngc-table-border-radius, var(--border-radius-medium))}.gator-table thead>th :last-child,.gator-table thead>tr :last-child{border-top-right-radius:var(--ngc-table-border-radius, var(--border-radius-medium))}.gator-table tbody>tr,.gator-table tfoot>tr{min-height:3rem;height:3rem}.gator-table th{background:var(--ngc-table-header-background-color, var(--color-surface-brand));text-align:left;padding:var(--spacing-5) var(--spacing-8);border-bottom:1px solid var(--ngc-table-header-border-bottom-color, var(--color-border-tertiary))}.gator-table th:hover{background:var(--ngc-table-header-background-color-hover, var(--color-surface-brand-secondary))}.gator-table .gator-table-header-cell-interactive{cursor:default}.gator-table .gator-table-header-cell-inner{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-5);width:100%;min-width:0}.gator-table .gator-table-header-sort-trigger{display:inline-flex;align-items:center;gap:8px;min-width:0;cursor:pointer;flex:1}.gator-table .gator-table-header-sort-trigger:focus{outline:none}.gator-table .gator-table-header-sort-trigger:focus-visible{outline:2px solid var(--color-border-focus, currentColor);outline-offset:2px;border-radius:0}.gator-table .gator-table-header-label{min-width:0}.gator-table .gator-table-sort-icon-wrap{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;pointer-events:none}.gator-table .gator-table-sort-icon{flex-shrink:0}.gator-table th:not(.gator-table-header-cell-sort-active) .gator-table-header-sort-trigger .gator-table-sort-icon-wrap .gator-table-sort-icon{opacity:0}.gator-table th:hover .gator-table-header-sort-trigger .gator-table-sort-icon-wrap .gator-table-sort-icon,.gator-table th.gator-table-header-cell-sort-active .gator-table-header-sort-trigger .gator-table-sort-icon-wrap .gator-table-sort-icon{opacity:1}.gator-table .gator-table-header-filter-trigger-wrap{flex-shrink:0;display:inline-flex;align-items:center;width:2rem;margin-left:var(--spacing-5);opacity:0;pointer-events:none;transition:opacity .15s ease}.gator-table .gator-table-header-filter-trigger-wrap.gator-table-header-filter-trigger-visible{opacity:1;pointer-events:auto}.gator-table .gator-table-header-filter-icon-active{color:var(--color-text-brand, currentColor)}.gator-table .gator-table-header-filter-trigger-wrap,.gator-table .gator-table-header-filter-trigger-wrap ngc-popover{font-weight:var(--font-weight-regular)}.gator-table .gator-table-filter-popover-content{min-width:0;display:flex;flex-direction:column;gap:var(--spacing-5)}.gator-table .gator-table-filter-popover-search{--ngc-input-search-margin-bottom: 0}.gator-table .gator-table-filter-popover-footer{display:flex;gap:var(--spacing-5);justify-content:flex-start;width:100%}.gator-table [dir=rtl] th.mat-header-cell{text-align:right}.gator-table td{padding:var(--spacing-5) var(--spacing-8);border-bottom:1px solid var(--ngc-table-row-border-bottom-color, var(--color-border-tertiary))}.gator-table tr:has(td:hover){background:var(--ngc-table-row-background-color-hover, var(--color-surface-secondary))}.gator-table tbody:last-child>tr:last-child th:first-child,.gator-table tbody:last-child>tr:last-child td:first-child{border-bottom-left-radius:var(--ngc-table-border-radius, var(--border-radius-medium))}.gator-table tbody:last-child>tr:last-child td:last-child{border-bottom-right-radius:var(--ngc-table-border-radius, var(--border-radius-medium))}.gator-table th:first-of-type,.gator-table td:first-of-type{padding-left:24px}.gator-table [dir=rtl] th:first-of-type,.gator-table [dir=rtl] td:first-of-type{padding-left:0;padding-right:24px}.gator-table th:last-of-type,.gator-table td:last-of-type{padding-right:24px}.gator-table [dir=rtl] th:last-of-type,.gator-table [dir=rtl] td:last-of-type{padding-right:0;padding-left:24px}.gator-table ngc-checkbox{--ngc-input-margin-bottom: 0}.gator-table ngc-input-dropdown,.gator-table ngc-input-text{--ngc-input-margin-bottom: 0}.gator-table .gator-table-cell-left{text-align:left}.gator-table .gator-table-cell-center{text-align:center}.gator-table .gator-table-cell-right{text-align:right}.gator-table .gator-table-cell-avatar{display:flex;align-items:center;gap:var(--spacing-4, 8px)}.gator-table .gator-table-cell-avatar .gator-table-cell-avatar-label{flex:1}.gator-table-checkbox-column{width:1%}.gator-table-row-selected{background-color:var(--ngc-table-row-background-color-selected, var(--color-surface-brand))}.gator-table-elevated{box-shadow:var(--shadow-1-card)}.gator-table-category-header{background-color:var(--ngc-table-header-background-color, var(--color-surface-brand))}.gator-table-category-header:hover{background-color:var(--ngc-table-header-hover-background-color, var(--color-surface-brand-secondary))!important}.gator-table-category-header th{border-bottom:none!important;font-weight:var(--font-weight-bold);background-color:var(--ngc-table-header-background-color, var(--color-surface-brand));color:var(--color-text-primary);line-height:var(--line-height-subtitle-2);letter-spacing:var(--letter-spacing-default)}.gator-table-total-row{background-color:var(--ngc-table-total-row-background-color, var(--color-surface-secondary))!important;font-weight:var(--font-weight-bold)}.gator-table-total-row:hover{background-color:var(--ngc-table-total-row-hover-background-color, var(--color-surface-tertiary))!important}.gator-table-total-row td,.gator-table-total-row th{background-color:var(--ngc-table-total-row-background-color, var(--color-surface-secondary))!important;border-top:1px solid var(--ngc-table-total-row-border-bottom-color, var(--color-border-tertiary));border-bottom:none!important}.gator-table-total-row th:hover{background-color:var(--ngc-table-total-row-background-color, var(--color-surface-tertiary))!important}.gator-table-total-label{font-weight:var(--font-weight-bold);color:var(--color-text-primary)}';export{r as default};
1
+ const r='.gator-table-filter-chips{display:flex;flex-wrap:wrap;gap:var(--spacing-8);padding:var(--spacing-8) 0;align-items:center}.gator-table-filter-chips-clear-all{font-family:var(--font-family-body, "Open Sans"),sans-serif;font-size:var(--font-size-body-2);font-weight:var(--font-weight-regular, 400);line-height:var(--line-height-body-2);letter-spacing:var(--letter-spacing-default, 0);color:var(--color-text-brand, var(--color-text-primary));background:none;border:none;padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.gator-table-filter-chips-clear-all:hover{color:var(--color-feedback-brand-secondary)}.gator-table-filter-chips-clear-all:focus{outline:none}.gator-table-filter-chips-clear-all:focus-visible{outline:2px solid var(--color-border-focus, currentColor);outline-offset:2px}.gator-table{font-family:var(--font-family-body, "Open Sans"),sans-serif;border-spacing:0;width:100%;overflow:auto;border-radius:var(--ngc-table-border-radius, var(--border-radius-medium));background-color:var(--ngc-table-row-background-color, var(--color-surface-primary))}.gator-table thead>th,.gator-table thead>tr{height:3rem;min-height:3rem}.gator-table thead>th :first-child,.gator-table thead>tr :first-child{border-top-left-radius:var(--ngc-table-border-radius, var(--border-radius-medium))}.gator-table thead>th :last-child,.gator-table thead>tr :last-child{border-top-right-radius:var(--ngc-table-border-radius, var(--border-radius-medium))}.gator-table tbody>tr,.gator-table tfoot>tr{min-height:3rem;height:3rem}.gator-table th{background:var(--ngc-table-header-background-color, var(--color-surface-brand));text-align:left;padding:var(--spacing-5) var(--spacing-8);border-bottom:1px solid var(--ngc-table-header-border-bottom-color, var(--color-border-tertiary))}.gator-table th:hover{background:var(--ngc-table-header-background-color-hover, var(--color-surface-brand-secondary))}.gator-table .gator-table-header-cell-interactive{cursor:default}.gator-table .gator-table-header-cell-inner{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-5);width:100%;min-width:0}.gator-table .gator-table-header-sort-trigger{display:inline-flex;align-items:center;gap:8px;min-width:0;cursor:pointer;flex:1}.gator-table .gator-table-header-sort-trigger:focus{outline:none}.gator-table .gator-table-header-sort-trigger:focus-visible{outline:2px solid var(--color-border-focus, currentColor);outline-offset:2px;border-radius:0}.gator-table .gator-table-header-label{min-width:0}.gator-table .gator-table-sort-icon-wrap{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;pointer-events:none}.gator-table .gator-table-sort-icon{flex-shrink:0}.gator-table th:not(.gator-table-header-cell-sort-active) .gator-table-header-sort-trigger .gator-table-sort-icon-wrap .gator-table-sort-icon{opacity:0}.gator-table th:hover .gator-table-header-sort-trigger .gator-table-sort-icon-wrap .gator-table-sort-icon,.gator-table th.gator-table-header-cell-sort-active .gator-table-header-sort-trigger .gator-table-sort-icon-wrap .gator-table-sort-icon{opacity:1}.gator-table .gator-table-header-filter-trigger-wrap{flex-shrink:0;display:inline-flex;align-items:center;width:2rem;margin-left:var(--spacing-5);opacity:0;pointer-events:none;transition:opacity .15s ease}.gator-table .gator-table-header-filter-trigger-wrap.gator-table-header-filter-trigger-visible{opacity:1;pointer-events:auto}.gator-table .gator-table-header-filter-icon-active{color:var(--color-text-brand, currentColor)}.gator-table .gator-table-header-filter-trigger-wrap,.gator-table .gator-table-header-filter-trigger-wrap ngc-popover{font-weight:var(--font-weight-regular)}.gator-table .gator-table-filter-popover-content{min-width:0;display:flex;flex-direction:column;gap:var(--spacing-5)}.gator-table .gator-table-filter-popover-search{--ngc-input-search-margin-bottom: 0}.gator-table .gator-table-filter-popover-footer{display:flex;gap:var(--spacing-5);justify-content:flex-start;width:100%}.gator-table [dir=rtl] th.mat-header-cell{text-align:right}.gator-table td{padding:var(--spacing-5) var(--spacing-8);border-bottom:1px solid var(--ngc-table-row-border-bottom-color, var(--color-border-tertiary))}.gator-table tr:has(td:hover){background:var(--ngc-table-row-background-color-hover, var(--color-surface-secondary))}.gator-table tbody:last-child>tr:last-child th:first-child,.gator-table tbody:last-child>tr:last-child td:first-child{border-bottom-left-radius:var(--ngc-table-border-radius, var(--border-radius-medium))}.gator-table tbody:last-child>tr:last-child td:last-child{border-bottom-right-radius:var(--ngc-table-border-radius, var(--border-radius-medium))}.gator-table th:first-of-type,.gator-table td:first-of-type{padding-left:24px}.gator-table [dir=rtl] th:first-of-type,.gator-table [dir=rtl] td:first-of-type{padding-left:0;padding-right:24px}.gator-table th:last-of-type,.gator-table td:last-of-type{padding-right:24px}.gator-table [dir=rtl] th:last-of-type,.gator-table [dir=rtl] td:last-of-type{padding-right:0;padding-left:24px}.gator-table ngc-checkbox{--ngc-input-margin-bottom: 0}.gator-table ngc-input-dropdown,.gator-table ngc-input-text{--ngc-input-margin-bottom: 0}.gator-table .gator-table-cell-left{text-align:left}.gator-table .gator-table-cell-center{text-align:center}.gator-table .gator-table-cell-right{text-align:right}.gator-table .gator-table-cell-avatar{display:flex;align-items:center;gap:var(--spacing-4, 8px)}.gator-table .gator-table-cell-avatar .gator-table-cell-avatar-label{flex:1}.gator-table-empty-state-card{display:block;width:100%;border-radius:var(--border-radius-x-large, 16px);background:var(--color-surface-secondary, #F7F7F7);--ngc-card-border-radius: var(--border-radius-x-large, 16px);--ngc-card-background-color: var(--color-surface-secondary, #F7F7F7);--ngc-card-width: 100%;--ngc-card-max-width: none}.gator-table-empty-state{display:flex;justify-content:center;align-items:center;width:100%;padding:var(--spacing-10) 0}.gator-table-checkbox-column{width:1%}.gator-table-row-selected{background-color:var(--ngc-table-row-background-color-selected, var(--color-surface-brand))}.gator-table-elevated{box-shadow:var(--shadow-1-card)}.gator-table-category-header{background-color:var(--ngc-table-header-background-color, var(--color-surface-brand))}.gator-table-category-header:hover{background-color:var(--ngc-table-header-hover-background-color, var(--color-surface-brand-secondary))!important}.gator-table-category-header th{border-bottom:none!important;font-weight:var(--font-weight-bold);background-color:var(--ngc-table-header-background-color, var(--color-surface-brand));color:var(--color-text-primary);line-height:var(--line-height-subtitle-2);letter-spacing:var(--letter-spacing-default)}.gator-table-total-row{background-color:var(--ngc-table-total-row-background-color, var(--color-surface-secondary))!important;font-weight:var(--font-weight-bold)}.gator-table-total-row:hover{background-color:var(--ngc-table-total-row-hover-background-color, var(--color-surface-tertiary))!important}.gator-table-total-row td,.gator-table-total-row th{background-color:var(--ngc-table-total-row-background-color, var(--color-surface-secondary))!important;border-top:1px solid var(--ngc-table-total-row-border-bottom-color, var(--color-border-tertiary));border-bottom:none!important}.gator-table-total-row th:hover{background-color:var(--ngc-table-total-row-background-color, var(--color-surface-tertiary))!important}.gator-table-total-label{font-weight:var(--font-weight-bold);color:var(--color-text-primary)}';export{r as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ncino/web-components",
3
3
  "author": "nCino",
4
- "version": "13.10.0",
4
+ "version": "13.11.0",
5
5
  "license": "(c) Copyright 2023 nCino, Inc., all rights reserved",
6
6
  "publishConfig": {
7
7
  "registry": "https://registry.npmjs.org/"
@@ -100,10 +100,10 @@
100
100
  "vite-plugin-static-copy": "^3.3.0",
101
101
  "vitest": "^4.1.0",
102
102
  "yaml-eslint-parser": "^2.0.0",
103
- "@ncino/styles": "13.10.0"
103
+ "@ncino/styles": "13.11.0"
104
104
  },
105
105
  "peerDependencies": {
106
- "@ncino/styles": "13.10.0"
106
+ "@ncino/styles": "13.11.0"
107
107
  },
108
108
  "bugs": {
109
109
  "url": "https://github.com/ncino/force-sdk-web-components/issues"
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@ncino/web-components",
4
- "version": "13.9.2",
4
+ "version": "13.10.1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {