@tylertech/forge 2.13.0-next.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/custom-elements.json +106 -107
- package/dist/esm/app-bar/help-button/index.js +1 -1
- package/dist/esm/app-bar/index.js +1 -1
- package/dist/esm/autocomplete/index.js +1 -1
- package/dist/esm/bottom-sheet/index.js +1 -1
- package/dist/esm/chip-field/index.js +1 -1
- package/dist/esm/chunks/{chunk.Z5P6EA5L.js → chunk.6QMDYUVT.js} +2 -2
- package/dist/esm/chunks/{chunk.Z5P6EA5L.js.map → chunk.6QMDYUVT.js.map} +0 -0
- package/dist/esm/chunks/{chunk.VH3PVW2V.js → chunk.6SGRP4FO.js} +2 -2
- package/dist/esm/chunks/{chunk.VH3PVW2V.js.map → chunk.6SGRP4FO.js.map} +0 -0
- package/dist/esm/chunks/{chunk.SZL74RTY.js → chunk.6XXKSGW5.js} +2 -2
- package/dist/esm/chunks/{chunk.SZL74RTY.js.map → chunk.6XXKSGW5.js.map} +0 -0
- package/dist/esm/chunks/chunk.75KFBRF6.js +7 -0
- package/dist/esm/chunks/{chunk.CYJBOJMX.js.map → chunk.75KFBRF6.js.map} +2 -2
- package/dist/esm/chunks/chunk.BX7242PC.js +7 -0
- package/dist/esm/chunks/chunk.BX7242PC.js.map +7 -0
- package/dist/esm/chunks/{chunk.K32ME33N.js → chunk.DQBSFX46.js} +2 -2
- package/dist/esm/chunks/{chunk.K32ME33N.js.map → chunk.DQBSFX46.js.map} +0 -0
- package/dist/esm/chunks/chunk.EJ4ASQET.js +7 -0
- package/dist/esm/chunks/chunk.EJ4ASQET.js.map +7 -0
- package/dist/esm/chunks/{chunk.KGW63HJX.js → chunk.F2TKPPK7.js} +2 -2
- package/dist/esm/chunks/{chunk.KGW63HJX.js.map → chunk.F2TKPPK7.js.map} +0 -0
- package/dist/esm/chunks/{chunk.DML4YNQF.js → chunk.HSJQA42U.js} +2 -2
- package/dist/esm/chunks/{chunk.DML4YNQF.js.map → chunk.HSJQA42U.js.map} +2 -2
- package/dist/esm/chunks/{chunk.DGOV5RDW.js → chunk.HUWXZ4ZN.js} +2 -2
- package/dist/esm/chunks/{chunk.DGOV5RDW.js.map → chunk.HUWXZ4ZN.js.map} +2 -2
- package/dist/esm/chunks/{chunk.D3DLVPPE.js → chunk.J2ODMCFS.js} +2 -2
- package/dist/esm/chunks/{chunk.D3DLVPPE.js.map → chunk.J2ODMCFS.js.map} +0 -0
- package/dist/esm/chunks/{chunk.E4ZTNVXI.js → chunk.J6CIWTDH.js} +2 -2
- package/dist/esm/chunks/{chunk.E4ZTNVXI.js.map → chunk.J6CIWTDH.js.map} +0 -0
- package/dist/esm/chunks/chunk.LMOYZQZJ.js +7 -0
- package/dist/esm/chunks/chunk.LMOYZQZJ.js.map +7 -0
- package/dist/esm/chunks/chunk.NNGE722W.js +7 -0
- package/dist/esm/chunks/chunk.NNGE722W.js.map +7 -0
- package/dist/esm/chunks/{chunk.32SMESZX.js → chunk.O2XO3IRX.js} +2 -2
- package/dist/esm/chunks/{chunk.32SMESZX.js.map → chunk.O2XO3IRX.js.map} +0 -0
- package/dist/esm/chunks/{chunk.2ZSAAJDN.js → chunk.ON3JVSSR.js} +2 -2
- package/dist/esm/chunks/{chunk.2ZSAAJDN.js.map → chunk.ON3JVSSR.js.map} +0 -0
- package/dist/esm/chunks/chunk.PZTAIVJW.js +7 -0
- package/dist/esm/chunks/chunk.PZTAIVJW.js.map +7 -0
- package/dist/esm/chunks/{chunk.NTFA7FCB.js → chunk.QEHJJKFZ.js} +2 -2
- package/dist/esm/chunks/{chunk.NTFA7FCB.js.map → chunk.QEHJJKFZ.js.map} +0 -0
- package/dist/esm/chunks/chunk.QOZLQPKE.js +7 -0
- package/dist/esm/chunks/chunk.QOZLQPKE.js.map +7 -0
- package/dist/esm/chunks/{chunk.G5Q2CUUE.js → chunk.RGWUF3J2.js} +2 -2
- package/dist/esm/chunks/{chunk.G5Q2CUUE.js.map → chunk.RGWUF3J2.js.map} +0 -0
- package/dist/esm/chunks/{chunk.F3W3XMGT.js → chunk.RST65QIB.js} +2 -2
- package/dist/esm/chunks/{chunk.F3W3XMGT.js.map → chunk.RST65QIB.js.map} +0 -0
- package/dist/esm/chunks/{chunk.WUIIZZQD.js → chunk.WIUER75G.js} +2 -2
- package/dist/esm/chunks/{chunk.WUIIZZQD.js.map → chunk.WIUER75G.js.map} +0 -0
- package/dist/esm/chunks/{chunk.V7P3QPNM.js → chunk.Y7Q6QI5V.js} +2 -2
- package/dist/esm/chunks/{chunk.V7P3QPNM.js.map → chunk.Y7Q6QI5V.js.map} +2 -2
- package/dist/esm/chunks/chunk.YPUWII7L.js +7 -0
- package/dist/esm/chunks/{chunk.5PQTSZ7G.js.map → chunk.YPUWII7L.js.map} +2 -2
- package/dist/esm/date-picker/index.js +1 -1
- package/dist/esm/date-range-picker/index.js +1 -1
- package/dist/esm/dialog/index.js +1 -1
- package/dist/esm/file-picker/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/list/index.js +1 -1
- package/dist/esm/list/list/index.js +1 -1
- package/dist/esm/list/list-item/index.js +1 -1
- package/dist/esm/list-dropdown/index.js +1 -1
- package/dist/esm/menu/index.js +1 -1
- package/dist/esm/paginator/index.js +1 -1
- package/dist/esm/select/core/index.js +1 -1
- package/dist/esm/select/index.js +1 -1
- package/dist/esm/select/option/index.js +1 -1
- package/dist/esm/select/select/index.js +1 -1
- package/dist/esm/select/select-dropdown/index.js +1 -1
- package/dist/esm/split-view/index.js +1 -1
- package/dist/esm/split-view/split-view/index.js +1 -1
- package/dist/esm/split-view/split-view-panel/index.js +1 -1
- package/dist/esm/switch/index.js +1 -1
- package/dist/esm/text-field/index.js +1 -1
- package/dist/esm/time-picker/index.js +1 -1
- package/esm/chip-field/chip-field.js +1 -1
- package/esm/date-range-picker/date-range-picker-foundation.d.ts +1 -0
- package/esm/date-range-picker/date-range-picker-foundation.js +13 -1
- package/esm/dialog/dialog-adapter.d.ts +5 -5
- package/esm/dialog/dialog-adapter.js +31 -30
- package/esm/dialog/dialog-foundation.d.ts +2 -4
- package/esm/dialog/dialog-foundation.js +38 -55
- package/esm/dialog/dialog.d.ts +0 -4
- package/esm/dialog/dialog.js +1 -7
- package/esm/file-picker/file-picker.js +1 -1
- package/esm/list/list-item/list-item-adapter.d.ts +7 -2
- package/esm/list/list-item/list-item-adapter.js +10 -4
- package/esm/list/list-item/list-item-foundation.js +8 -2
- package/esm/list/list-item/list-item.d.ts +1 -1
- package/esm/list/list-item/list-item.js +1 -1
- package/esm/select/core/base-select-adapter.js +11 -1
- package/esm/select/core/base-select-foundation.js +7 -3
- package/esm/select/option/option-constants.d.ts +3 -0
- package/esm/select/option/option-constants.js +5 -1
- package/esm/select/option/option-foundation.d.ts +2 -2
- package/esm/select/option/option-foundation.js +1 -0
- package/esm/select/select/select.js +1 -1
- package/esm/split-view/split-view/split-view-constants.d.ts +0 -1
- package/esm/split-view/split-view-panel/split-view-panel-adapter.d.ts +4 -1
- package/esm/split-view/split-view-panel/split-view-panel-adapter.js +17 -6
- package/esm/split-view/split-view-panel/split-view-panel-constants.d.ts +1 -0
- package/esm/split-view/split-view-panel/split-view-panel-constants.js +2 -1
- package/esm/split-view/split-view-panel/split-view-panel-foundation.js +1 -4
- package/esm/split-view/split-view-panel/split-view-panel-utils.d.ts +6 -0
- package/esm/split-view/split-view-panel/split-view-panel-utils.js +17 -0
- package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
- package/esm/switch/switch.d.ts +1 -0
- package/esm/switch/switch.js +13 -9
- package/esm/text-field/text-field.js +1 -1
- package/package.json +1 -1
- package/styles/field/_base.scss +4 -2
- package/styles/field/_variables.scss +0 -3
- package/dist/esm/chunks/chunk.5D6UB4DL.js +0 -7
- package/dist/esm/chunks/chunk.5D6UB4DL.js.map +0 -7
- package/dist/esm/chunks/chunk.5PQTSZ7G.js +0 -7
- package/dist/esm/chunks/chunk.7JTKKFL4.js +0 -7
- package/dist/esm/chunks/chunk.7JTKKFL4.js.map +0 -7
- package/dist/esm/chunks/chunk.CYJBOJMX.js +0 -7
- package/dist/esm/chunks/chunk.IGMTMR3D.js +0 -7
- package/dist/esm/chunks/chunk.IGMTMR3D.js.map +0 -7
- package/dist/esm/chunks/chunk.TCCPCDJK.js +0 -7
- package/dist/esm/chunks/chunk.TCCPCDJK.js.map +0 -7
- package/dist/esm/chunks/chunk.VQKRN5IQ.js +0 -7
- package/dist/esm/chunks/chunk.VQKRN5IQ.js.map +0 -7
- package/dist/esm/chunks/chunk.YK2PXI6D.js +0 -7
- package/dist/esm/chunks/chunk.YK2PXI6D.js.map +0 -7
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2022 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{b as x,c as C}from"./chunk.OAKTW64X.js";import{a as y}from"./chunk.MIYZJUXH.js";import{a as E}from"./chunk.A23NSEWA.js";import{a as l}from"./chunk.B3IJU6XJ.js";import{a as b,b as L}from"./chunk.BSZ2LBJX.js";import{a as _}from"./chunk.3E5QKMHL.js";import{a as v,e as f,g as c}from"./chunk.HN4PXH3D.js";import{k as p,l as u}from"./chunk.G76HB2FK.js";import{f as s}from"./chunk.MCIQXNKY.js";var D=`${L}file-picker`,I={ACCEPT:"accept",MAX_SIZE:"max-size",CAPTURE:"capture",MULTIPLE:"multiple",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},T={HIGHLIGHT:"highlight",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},S={CONTAINER:"container",BUTTON:"button",INPUT:"input"},A={CONTAINER:"#container",BUTTON:"#button",INPUT:"#input",BUTTON_SLOT:"#button-slot"},P={FILES_CHANGED:`${D}-change`},i={elementName:D,attributes:I,classes:T,ids:S,selectors:A,events:P};var d=class extends E{constructor(e){super(e);this._container=c(e,i.selectors.CONTAINER),this._buttonSlot=c(e,i.selectors.BUTTON_SLOT),this._input=c(e,i.selectors.INPUT),this._inputEventListener=()=>{this._input.value="",this._input.click()},this._container.addEventListener("click",this._inputEventListener)}registerButtonSlotListener(e){this._buttonSlot.addEventListener("slotchange",e)}registerInputChangeListener(e){this._input.addEventListener("change",e)}registerDragEnterListener(e){this._container.addEventListener("dragenter",e)}registerDragLeaveListener(e){this._container.addEventListener("dragleave",e)}registerDragOverListener(e){this._container.addEventListener("dragover",e)}registerDropListener(e){this._container.addEventListener("drop",e)}removeDragEnterListener(e){this._container.removeEventListener("dragenter",e)}removeDragLeaveListener(e){this._container.removeEventListener("dragleave",e)}removeDragOverListener(e){this._container.removeEventListener("dragover",e)}removeDropListener(e){this._container.removeEventListener("drop",e)}initializeButton(){let e=this._component.querySelector("button");this._button=e||void 0}setHighlightState(e){this._container.classList.contains(i.classes.HIGHLIGHT)!==e&&this._container.classList.toggle(i.classes.HIGHLIGHT)}setAccept(e){e?this._input.setAttribute("accept",e):this._input.removeAttribute("accept")}setCapture(e){e?this._input.setAttribute("capture",e):this._input.removeAttribute("capture")}setMultiple(e){e?this._input.setAttribute("multiple",""):this._input.removeAttribute("multiple")}setDisabled(e){e?(this._container.removeEventListener("click",this._inputEventListener),this._button.setAttribute("disabled",""),this._container.setAttribute("disabled","")):(this._container.addEventListener("click",this._inputEventListener),this._button.removeAttribute("disabled"),this._container.removeAttribute("disabled"))}setCompact(e){this._container.classList.contains(i.classes.COMPACT)!==e&&this._container.classList.toggle(i.classes.COMPACT)}setBorderless(e){this._container.classList.contains(i.classes.BORDERLESS)!==e&&this._container.classList.toggle(i.classes.BORDERLESS)}};var h=class{constructor(t){this._adapter=t;this._accept=null;this._maxSize=null;this._capture=null;this._multiple=!1;this._disabled=!1;this._compact=!1;this._borderless=!1;this._buttonSlotListener=e=>this._onButtonSlotChanged(e),this._inputChangeListener=e=>this._onInputChange(e),this._dragEnterListener=e=>this._onDragEnter(e),this._dragLeaveListener=e=>this._onDragLeave(e),this._dragOverListener=e=>this._onDragOver(e),this._dropListener=e=>this._onDrop(e),this._adapter.registerButtonSlotListener(this._buttonSlotListener),this._adapter.registerInputChangeListener(this._inputChangeListener),this._compact||this._registerDragListeners()}initialize(){this._adapter.initializeButton()}_onButtonSlotChanged(t){this._adapter.initializeButton()}_onInputChange(t){let e=t.target.files;e&&this._handleFiles(e)}_onDragEnter(t){this._handleDragEvent(t,!0)}_onDragLeave(t){this._handleDragEvent(t,!1)}_onDragOver(t){this._handleDragEvent(t,!0)}_onDrop(t){if(this._handleDragEvent(t,!1),!this._disabled){let e=t.dataTransfer;if(e){let a=e.files;this._handleFiles(a)}}}_registerDragListeners(){this._adapter.registerDragEnterListener(this._dragEnterListener),this._adapter.registerDragLeaveListener(this._dragLeaveListener),this._adapter.registerDragOverListener(this._dragOverListener),this._adapter.registerDropListener(this._dropListener)}_removeDragListeners(){this._adapter.removeDragEnterListener(this._dragEnterListener),this._adapter.removeDragLeaveListener(this._dragLeaveListener),this._adapter.removeDragOverListener(this._dragOverListener),this._adapter.removeDropListener(this._dropListener)}_handleFiles(t){let e={};if(t){let a=this._sortFiles(t),o=a.legalFiles||null;!this._multiple&&o&&o.length>1&&(o=o.splice(1)),e=a}this._adapter.emitHostEvent(i.events.FILES_CHANGED,e)}_sortFiles(t){let e=[],a=[];if(!this._accept&&!this.maxSize)return e=Array.from(t),{legalFiles:e,illegalFiles:a};let o=this._accept?this._accept.split(",").map(r=>r.trim().toLowerCase()):[""];for(let r=0;r<t.length;r++)!o.some(m=>t[r].type.toLowerCase().match(m)||t[r].name.toLowerCase().match("\\"+m))||this._maxSize&&t[r].size>this._maxSize?a.push(t[r]):e.push(t[r]);return{legalFiles:e,illegalFiles:a}}_handleDragEvent(t,e){this._disabled||(t.preventDefault(),t.stopPropagation(),this._adapter.setHighlightState(e))}get accept(){return this._accept}set accept(t){this._accept!==t&&(this._accept=t,this._adapter.setAccept(t),t?this._adapter.setHostAttribute(i.attributes.ACCEPT,t):this._adapter.removeHostAttribute(i.attributes.ACCEPT))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize!==t&&(this._maxSize=t,t?this._adapter.setHostAttribute(i.attributes.MAX_SIZE,t.toString()):this._adapter.removeHostAttribute(i.attributes.MAX_SIZE))}get capture(){return this._capture}set capture(t){this._capture!==t&&(this._capture=t,this._adapter.setCapture(t),t?this._adapter.setHostAttribute(i.attributes.CAPTURE,t):this._adapter.removeHostAttribute(i.attributes.CAPTURE))}get multiple(){return this._multiple}set multiple(t){this._multiple!==t&&(this._multiple=t,this._adapter.setMultiple(t),t?this._adapter.setHostAttribute(i.attributes.MULTIPLE):this._adapter.removeHostAttribute(i.attributes.MULTIPLE))}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._adapter.setDisabled(t),t?this._adapter.setHostAttribute(i.attributes.DISABLED):this._adapter.removeHostAttribute(i.attributes.DISABLED))}get compact(){return this._compact}set compact(t){this._compact!==t&&(this._compact=t,this._adapter.setCompact(t),t?(this._adapter.setHostAttribute(i.attributes.COMPACT),this._removeDragListeners()):(this._adapter.removeHostAttribute(i.attributes.COMPACT),this._registerDragListeners()))}get borderless(){return this._borderless}set borderless(t){this._borderless!==t&&(this._borderless=t,this._adapter.setBorderless(t),t?this._adapter.setHostAttribute(i.attributes.BORDERLESS):this._adapter.removeHostAttribute(i.attributes.BORDERLESS))}};var F='<template><form class="forge-file-picker" id="container" part="form"><div class="forge-file-picker__primary" id="primary" part="primary"><slot name="primary"></slot></div><slot id="button-slot"></slot><div class="forge-file-picker__secondary" id="secondary" part="secondary"><slot name="secondary"></slot></div><input type="file" class="forge-file-picker__input" id="input" part="input"></form><div class="forge-file-picker__helper-text" part="helper-text-container"><slot name="helper-text"></slot></div></template>',O='.forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;height:auto;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker__helper-text ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}',n=class extends _{constructor(){super();f(this,F,O),this._foundation=new h(new d(this))}static get observedAttributes(){return[i.attributes.ACCEPT,i.attributes.MAX_SIZE,i.attributes.CAPTURE,i.attributes.MULTIPLE,i.attributes.DISABLED,i.attributes.COMPACT,i.attributes.BORDERLESS]}connectedCallback(){this._foundation.initialize()}attributeChangedCallback(e,a,o){switch(e){case i.attributes.ACCEPT:this.accept=o;break;case i.attributes.MAX_SIZE:this.maxSize=u(o);break;case i.attributes.CAPTURE:this.capture=o;break;case i.attributes.MULTIPLE:this.multiple=p(o);break;case i.attributes.DISABLED:this.disabled=p(o);break;case i.attributes.COMPACT:this.compact=p(o);break;case i.attributes.BORDERLESS:this.borderless=p(o);break}}};s([l()],n.prototype,"accept",2),s([l()],n.prototype,"maxSize",2),s([l()],n.prototype,"capture",2),s([l()],n.prototype,"multiple",2),s([l()],n.prototype,"disabled",2),s([l()],n.prototype,"compact",2),s([l()],n.prototype,"borderless",2),n=s([b({name:i.elementName,dependencies:[x]})],n);var k=class extends y{constructor(t){super(t)}_build(){return document.createElement(i.elementName)}_configure(){var t,e,a,o;if((t=this._config.options)!=null&&t.primaryText){let r=document.createElement("span");r.slot="primary",r.textContent=this._config.options.primaryText,this._element.appendChild(r)}if((e=this._config.options)!=null&&e.secondaryText){let r=document.createElement("span");r.slot="secondary",r.textContent=this._config.options.secondaryText,this._element.appendChild(r)}if((a=this._config.options)!=null&&a.buttonText&&new C({options:{parent:this._element,text:this._config.options.buttonText},props:{type:"outlined"}}),(o=this._config.options)!=null&&o.helperText){let r=document.createElement("span");r.slot="helper-text",r.textContent=this._config.options.helperText,this._element.appendChild(r)}}onChange(t){this._element.addEventListener(i.events.FILES_CHANGED,e=>t(e.detail))}};function pe(){v(n)}export{i as a,d as b,h as c,n as d,k as e,pe as f};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{b as x,c as C}from"./chunk.OAKTW64X.js";import{a as y}from"./chunk.MIYZJUXH.js";import{a as E}from"./chunk.A23NSEWA.js";import{a as l}from"./chunk.B3IJU6XJ.js";import{a as f,b as L}from"./chunk.BSZ2LBJX.js";import{a as _}from"./chunk.3E5QKMHL.js";import{a as v,e as b,g as c}from"./chunk.HN4PXH3D.js";import{k as p,l as u}from"./chunk.G76HB2FK.js";import{f as s}from"./chunk.MCIQXNKY.js";var D=`${L}file-picker`,I={ACCEPT:"accept",MAX_SIZE:"max-size",CAPTURE:"capture",MULTIPLE:"multiple",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},T={HIGHLIGHT:"highlight",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},S={CONTAINER:"container",BUTTON:"button",INPUT:"input"},A={CONTAINER:"#container",BUTTON:"#button",INPUT:"#input",BUTTON_SLOT:"#button-slot"},P={FILES_CHANGED:`${D}-change`},i={elementName:D,attributes:I,classes:T,ids:S,selectors:A,events:P};var d=class extends E{constructor(e){super(e);this._container=c(e,i.selectors.CONTAINER),this._buttonSlot=c(e,i.selectors.BUTTON_SLOT),this._input=c(e,i.selectors.INPUT),this._inputEventListener=()=>{this._input.value="",this._input.click()},this._container.addEventListener("click",this._inputEventListener)}registerButtonSlotListener(e){this._buttonSlot.addEventListener("slotchange",e)}registerInputChangeListener(e){this._input.addEventListener("change",e)}registerDragEnterListener(e){this._container.addEventListener("dragenter",e)}registerDragLeaveListener(e){this._container.addEventListener("dragleave",e)}registerDragOverListener(e){this._container.addEventListener("dragover",e)}registerDropListener(e){this._container.addEventListener("drop",e)}removeDragEnterListener(e){this._container.removeEventListener("dragenter",e)}removeDragLeaveListener(e){this._container.removeEventListener("dragleave",e)}removeDragOverListener(e){this._container.removeEventListener("dragover",e)}removeDropListener(e){this._container.removeEventListener("drop",e)}initializeButton(){let e=this._component.querySelector("button");this._button=e||void 0}setHighlightState(e){this._container.classList.contains(i.classes.HIGHLIGHT)!==e&&this._container.classList.toggle(i.classes.HIGHLIGHT)}setAccept(e){e?this._input.setAttribute("accept",e):this._input.removeAttribute("accept")}setCapture(e){e?this._input.setAttribute("capture",e):this._input.removeAttribute("capture")}setMultiple(e){e?this._input.setAttribute("multiple",""):this._input.removeAttribute("multiple")}setDisabled(e){e?(this._container.removeEventListener("click",this._inputEventListener),this._button.setAttribute("disabled",""),this._container.setAttribute("disabled","")):(this._container.addEventListener("click",this._inputEventListener),this._button.removeAttribute("disabled"),this._container.removeAttribute("disabled"))}setCompact(e){this._container.classList.contains(i.classes.COMPACT)!==e&&this._container.classList.toggle(i.classes.COMPACT)}setBorderless(e){this._container.classList.contains(i.classes.BORDERLESS)!==e&&this._container.classList.toggle(i.classes.BORDERLESS)}};var h=class{constructor(t){this._adapter=t;this._accept=null;this._maxSize=null;this._capture=null;this._multiple=!1;this._disabled=!1;this._compact=!1;this._borderless=!1;this._buttonSlotListener=e=>this._onButtonSlotChanged(e),this._inputChangeListener=e=>this._onInputChange(e),this._dragEnterListener=e=>this._onDragEnter(e),this._dragLeaveListener=e=>this._onDragLeave(e),this._dragOverListener=e=>this._onDragOver(e),this._dropListener=e=>this._onDrop(e),this._adapter.registerButtonSlotListener(this._buttonSlotListener),this._adapter.registerInputChangeListener(this._inputChangeListener),this._compact||this._registerDragListeners()}initialize(){this._adapter.initializeButton()}_onButtonSlotChanged(t){this._adapter.initializeButton()}_onInputChange(t){let e=t.target.files;e&&this._handleFiles(e)}_onDragEnter(t){this._handleDragEvent(t,!0)}_onDragLeave(t){this._handleDragEvent(t,!1)}_onDragOver(t){this._handleDragEvent(t,!0)}_onDrop(t){if(this._handleDragEvent(t,!1),!this._disabled){let e=t.dataTransfer;if(e){let a=e.files;this._handleFiles(a)}}}_registerDragListeners(){this._adapter.registerDragEnterListener(this._dragEnterListener),this._adapter.registerDragLeaveListener(this._dragLeaveListener),this._adapter.registerDragOverListener(this._dragOverListener),this._adapter.registerDropListener(this._dropListener)}_removeDragListeners(){this._adapter.removeDragEnterListener(this._dragEnterListener),this._adapter.removeDragLeaveListener(this._dragLeaveListener),this._adapter.removeDragOverListener(this._dragOverListener),this._adapter.removeDropListener(this._dropListener)}_handleFiles(t){let e={};if(t){let a=this._sortFiles(t),o=a.legalFiles||null;!this._multiple&&o&&o.length>1&&(o=o.splice(1)),e=a}this._adapter.emitHostEvent(i.events.FILES_CHANGED,e)}_sortFiles(t){let e=[],a=[];if(!this._accept&&!this.maxSize)return e=Array.from(t),{legalFiles:e,illegalFiles:a};let o=this._accept?this._accept.split(",").map(r=>r.trim().toLowerCase()):[""];for(let r=0;r<t.length;r++)!o.some(m=>t[r].type.toLowerCase().match(m)||t[r].name.toLowerCase().match("\\"+m))||this._maxSize&&t[r].size>this._maxSize?a.push(t[r]):e.push(t[r]);return{legalFiles:e,illegalFiles:a}}_handleDragEvent(t,e){this._disabled||(t.preventDefault(),t.stopPropagation(),this._adapter.setHighlightState(e))}get accept(){return this._accept}set accept(t){this._accept!==t&&(this._accept=t,this._adapter.setAccept(t),t?this._adapter.setHostAttribute(i.attributes.ACCEPT,t):this._adapter.removeHostAttribute(i.attributes.ACCEPT))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize!==t&&(this._maxSize=t,t?this._adapter.setHostAttribute(i.attributes.MAX_SIZE,t.toString()):this._adapter.removeHostAttribute(i.attributes.MAX_SIZE))}get capture(){return this._capture}set capture(t){this._capture!==t&&(this._capture=t,this._adapter.setCapture(t),t?this._adapter.setHostAttribute(i.attributes.CAPTURE,t):this._adapter.removeHostAttribute(i.attributes.CAPTURE))}get multiple(){return this._multiple}set multiple(t){this._multiple!==t&&(this._multiple=t,this._adapter.setMultiple(t),t?this._adapter.setHostAttribute(i.attributes.MULTIPLE):this._adapter.removeHostAttribute(i.attributes.MULTIPLE))}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._adapter.setDisabled(t),t?this._adapter.setHostAttribute(i.attributes.DISABLED):this._adapter.removeHostAttribute(i.attributes.DISABLED))}get compact(){return this._compact}set compact(t){this._compact!==t&&(this._compact=t,this._adapter.setCompact(t),t?(this._adapter.setHostAttribute(i.attributes.COMPACT),this._removeDragListeners()):(this._adapter.removeHostAttribute(i.attributes.COMPACT),this._registerDragListeners()))}get borderless(){return this._borderless}set borderless(t){this._borderless!==t&&(this._borderless=t,this._adapter.setBorderless(t),t?this._adapter.setHostAttribute(i.attributes.BORDERLESS):this._adapter.removeHostAttribute(i.attributes.BORDERLESS))}};var F='<template><form class="forge-file-picker" id="container" part="form"><div class="forge-file-picker__primary" id="primary" part="primary"><slot name="primary"></slot></div><slot id="button-slot"></slot><div class="forge-file-picker__secondary" id="secondary" part="secondary"><slot name="secondary"></slot></div><input type="file" class="forge-file-picker__input" id="input" part="input"></form><div class="forge-file-picker__helper-text" part="helper-text-container"><slot name="helper-text"></slot></div></template>',O=".forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}",n=class extends _{constructor(){super();b(this,F,O),this._foundation=new h(new d(this))}static get observedAttributes(){return[i.attributes.ACCEPT,i.attributes.MAX_SIZE,i.attributes.CAPTURE,i.attributes.MULTIPLE,i.attributes.DISABLED,i.attributes.COMPACT,i.attributes.BORDERLESS]}connectedCallback(){this._foundation.initialize()}attributeChangedCallback(e,a,o){switch(e){case i.attributes.ACCEPT:this.accept=o;break;case i.attributes.MAX_SIZE:this.maxSize=u(o);break;case i.attributes.CAPTURE:this.capture=o;break;case i.attributes.MULTIPLE:this.multiple=p(o);break;case i.attributes.DISABLED:this.disabled=p(o);break;case i.attributes.COMPACT:this.compact=p(o);break;case i.attributes.BORDERLESS:this.borderless=p(o);break}}};s([l()],n.prototype,"accept",2),s([l()],n.prototype,"maxSize",2),s([l()],n.prototype,"capture",2),s([l()],n.prototype,"multiple",2),s([l()],n.prototype,"disabled",2),s([l()],n.prototype,"compact",2),s([l()],n.prototype,"borderless",2),n=s([f({name:i.elementName,dependencies:[x]})],n);var k=class extends y{constructor(t){super(t)}_build(){return document.createElement(i.elementName)}_configure(){var t,e,a,o;if((t=this._config.options)!=null&&t.primaryText){let r=document.createElement("span");r.slot="primary",r.textContent=this._config.options.primaryText,this._element.appendChild(r)}if((e=this._config.options)!=null&&e.secondaryText){let r=document.createElement("span");r.slot="secondary",r.textContent=this._config.options.secondaryText,this._element.appendChild(r)}if((a=this._config.options)!=null&&a.buttonText&&new C({options:{parent:this._element,text:this._config.options.buttonText},props:{type:"outlined"}}),(o=this._config.options)!=null&&o.helperText){let r=document.createElement("span");r.slot="helper-text",r.textContent=this._config.options.helperText,this._element.appendChild(r)}}onChange(t){this._element.addEventListener(i.events.FILES_CHANGED,e=>t(e.detail))}};function pe(){v(n)}export{i as a,d as b,h as c,n as d,k as e,pe as f};
|
|
7
|
+
//# sourceMappingURL=chunk.Y7Q6QI5V.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/file-picker/file-picker-constants.ts", "../../src/file-picker/file-picker-adapter.ts", "../../src/file-picker/file-picker-foundation.ts", "../../src/file-picker/file-picker.ts", "../../src/file-picker/file-picker-component-delegate.ts", "../../src/file-picker/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}file-picker`;\n\nconst attributes = {\n ACCEPT: 'accept',\n MAX_SIZE: 'max-size',\n CAPTURE: 'capture',\n MULTIPLE: 'multiple',\n DISABLED: 'disabled',\n COMPACT: 'compact',\n BORDERLESS: 'borderless'\n};\n\nconst classes = {\n HIGHLIGHT: 'highlight',\n DISABLED: 'disabled',\n COMPACT: 'compact',\n BORDERLESS: 'borderless'\n};\n\nconst ids = {\n CONTAINER: 'container',\n BUTTON: 'button',\n INPUT: 'input'\n};\n\nconst selectors = {\n CONTAINER: '#container',\n BUTTON: '#button',\n INPUT: '#input',\n BUTTON_SLOT: '#button-slot'\n};\n\nconst events = {\n FILES_CHANGED: `${elementName}-change`\n};\n\nexport const FILE_PICKER_CONSTANTS = {\n elementName,\n attributes,\n classes,\n ids,\n selectors,\n events\n};\n\nexport interface IFilePickerChangeEventData {\n legalFiles?: File[];\n illegalFiles?: File[];\n}\n", "import { getShadowElement, emitEvent } from '@tylertech/forge-core';\n\nimport { IFilePickerComponent } from './file-picker';\nimport { FILE_PICKER_CONSTANTS } from './file-picker-constants';\nimport { BaseAdapter, IBaseAdapter } from '../core';\n\nexport interface IFilePickerAdapter extends IBaseAdapter {\n registerButtonSlotListener(listener: (evt: Event) => void): void;\n registerInputChangeListener(listener: (evt: Event) => void): void;\n registerDragEnterListener(listener: (evt: DragEvent) => void): void;\n registerDragLeaveListener(listener: (evt: DragEvent) => void): void;\n registerDragOverListener(listener: (evt: DragEvent) => void): void;\n registerDropListener(listener: (evt: DragEvent) => void): void;\n removeDragEnterListener(listener: (evt: DragEvent) => void): void;\n removeDragLeaveListener(listener: (evt: DragEvent) => void): void;\n removeDragOverListener(listener: (evt: DragEvent) => void): void;\n removeDropListener(listener: (evt: DragEvent) => void): void;\n initializeButton(): void;\n setHighlightState(value: boolean): void;\n setAccept(value: string | null | undefined): void;\n setCapture(value: string | null | undefined): void;\n setMultiple(value: boolean): void;\n setDisabled(value: boolean): void;\n setCompact(value: boolean): void;\n setBorderless(value: boolean): void;\n}\n\nexport class FilePickerAdapter extends BaseAdapter<IFilePickerComponent> implements IFilePickerAdapter {\n private _container: HTMLElement;\n private _buttonSlot: HTMLSlotElement;\n private _button: HTMLButtonElement;\n private _input: HTMLInputElement;\n private _inputEventListener: () => void;\n\n constructor(component: IFilePickerComponent) {\n super(component);\n\n this._container = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.CONTAINER);\n this._buttonSlot = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.BUTTON_SLOT) as HTMLSlotElement;\n this._input = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.INPUT) as HTMLInputElement;\n\n this._inputEventListener = () => {\n this._input.value = '';\n this._input.click();\n };\n\n this._container.addEventListener('click', this._inputEventListener);\n }\n\n public registerButtonSlotListener(listener: (evt: Event) => void): void {\n this._buttonSlot.addEventListener('slotchange', listener);\n }\n\n public registerInputChangeListener(listener: (evt: Event) => void): void {\n this._input.addEventListener('change', listener);\n }\n\n public registerDragEnterListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragenter', listener);\n }\n\n public registerDragLeaveListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragleave', listener);\n }\n\n public registerDragOverListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragover', listener);\n }\n\n public registerDropListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('drop', listener);\n }\n\n public removeDragEnterListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragenter', listener);\n }\n\n public removeDragLeaveListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragleave', listener);\n }\n\n public removeDragOverListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragover', listener);\n }\n\n public removeDropListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('drop', listener);\n }\n\n public initializeButton(): void {\n const button = this._component.querySelector('button') as HTMLButtonElement;\n this._button = button || undefined;\n }\n\n /**\n * Sets the highlight state of the file picker.\n * @param value True if the highlight should be applied and false if not.\n */\n public setHighlightState(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.HIGHLIGHT) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.HIGHLIGHT);\n }\n }\n\n /**\n * Sets the accept attribute of the input.\n * @param value The accept string.\n */\n public setAccept(value: string | null | undefined): void {\n if (value) {\n this._input.setAttribute('accept', value);\n } else {\n this._input.removeAttribute('accept');\n }\n }\n\n /**\n * Sets the capture attribute of the input.\n * @param value The capture string.\n */\n public setCapture(value: string | null | undefined): void {\n if (value) {\n this._input.setAttribute('capture', value);\n } else {\n this._input.removeAttribute('capture');\n }\n }\n\n /**\n * Sets the multiple attribute of the input.\n * @param value The multiple state.\n */\n public setMultiple(value: boolean): void {\n if (value) {\n this._input.setAttribute('multiple', '');\n } else {\n this._input.removeAttribute('multiple');\n }\n }\n\n /**\n * Sets the disabled state of the file picker.\n * @param value The disabled state.\n */\n public setDisabled(value: boolean): void {\n if (value) {\n this._container.removeEventListener('click', this._inputEventListener);\n this._button.setAttribute('disabled', '');\n this._container.setAttribute('disabled', '');\n } else {\n this._container.addEventListener('click', this._inputEventListener);\n this._button.removeAttribute('disabled');\n this._container.removeAttribute('disabled');\n }\n }\n\n /**\n * Sets the compact state of the file picker.\n * @param value The compact state.\n */\n public setCompact(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.COMPACT) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.COMPACT);\n }\n }\n\n /**\n * Sets the borderless state of the file picker.\n * @param value The borderless state.\n */\n public setBorderless(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.BORDERLESS) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.BORDERLESS);\n }\n }\n}\n", "import { ICustomElementFoundation } from '@tylertech/forge-core';\n\nimport { IFilePickerAdapter } from './file-picker-adapter';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\n\nexport interface IFilePickerFoundation extends ICustomElementFoundation {\n accept: string | null | undefined;\n maxSize: number | null | undefined;\n capture: string | null | undefined;\n multiple: boolean;\n disabled: boolean;\n compact: boolean;\n borderless: boolean;\n}\n\nexport class FilePickerFoundation implements IFilePickerFoundation {\n private _accept: string | null | undefined = null;\n private _maxSize: number | null | undefined = null;\n private _capture: string | null | undefined = null;\n private _multiple = false;\n private _disabled = false;\n private _compact = false;\n private _borderless = false;\n private _buttonSlotListener: (evt: Event) => void;\n private _inputChangeListener: (evt: Event) => void;\n private _dragEnterListener: (evt: DragEvent) => void;\n private _dragLeaveListener: (evt: DragEvent) => void;\n private _dragOverListener: (evt: DragEvent) => void;\n private _dropListener: (evt: DragEvent) => void;\n\n constructor(private _adapter: IFilePickerAdapter) {\n this._buttonSlotListener = evt => this._onButtonSlotChanged(evt);\n this._inputChangeListener = evt => this._onInputChange(evt);\n this._dragEnterListener = evt => this._onDragEnter(evt);\n this._dragLeaveListener = evt => this._onDragLeave(evt);\n this._dragOverListener = evt => this._onDragOver(evt);\n this._dropListener = evt => this._onDrop(evt);\n\n this._adapter.registerButtonSlotListener(this._buttonSlotListener);\n this._adapter.registerInputChangeListener(this._inputChangeListener);\n if (!this._compact) {\n this._registerDragListeners();\n }\n }\n\n public initialize(): void {\n this._adapter.initializeButton();\n }\n\n private _onButtonSlotChanged(evt: Event): void {\n this._adapter.initializeButton();\n }\n\n private _onInputChange(evt: Event): void {\n const files = (evt.target as HTMLInputElement).files;\n if (files) {\n this._handleFiles(files);\n }\n }\n\n private _onDragEnter(evt: DragEvent): void {\n this._handleDragEvent(evt, true);\n }\n\n private _onDragLeave(evt: DragEvent): void {\n this._handleDragEvent(evt, false);\n }\n\n private _onDragOver(evt: DragEvent): void {\n this._handleDragEvent(evt, true);\n }\n\n private _onDrop(evt: DragEvent): void {\n this._handleDragEvent(evt, false);\n\n if (!this._disabled) {\n const dataTransfer = evt.dataTransfer;\n if (dataTransfer) {\n const files = dataTransfer.files;\n this._handleFiles(files);\n }\n }\n }\n\n private _registerDragListeners(): void {\n this._adapter.registerDragEnterListener(this._dragEnterListener);\n this._adapter.registerDragLeaveListener(this._dragLeaveListener);\n this._adapter.registerDragOverListener(this._dragOverListener);\n this._adapter.registerDropListener(this._dropListener);\n }\n\n private _removeDragListeners(): void {\n this._adapter.removeDragEnterListener(this._dragEnterListener);\n this._adapter.removeDragLeaveListener(this._dragLeaveListener);\n this._adapter.removeDragOverListener(this._dragOverListener);\n this._adapter.removeDropListener(this._dropListener);\n }\n\n private _handleFiles(fileList: FileList): void {\n let data: IFilePickerChangeEventData = {};\n if (fileList) {\n const sortedFiles = this._sortFiles(fileList);\n let files = sortedFiles.legalFiles || null;\n\n // Ensure that we can only drop 1 file if not in multiple mode\n if (!this._multiple && files && files.length > 1) {\n files = files.splice(1);\n }\n\n data = sortedFiles;\n }\n this._adapter.emitHostEvent(FILE_PICKER_CONSTANTS.events.FILES_CHANGED, data);\n }\n\n private _sortFiles(files: FileList): IFilePickerChangeEventData {\n let legalFiles: File[] = [];\n const illegalFiles: File[] = [];\n\n if (!this._accept && !this.maxSize) {\n legalFiles = Array.from(files);\n return { legalFiles, illegalFiles };\n }\n\n const formats = this._accept ? this._accept.split(',').map(f => f.trim().toLowerCase()) : [''];\n\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < files.length; i++) {\n if (!formats.some(f => {\n return files[i].type.toLowerCase().match(f) || files[i].name.toLowerCase().match('\\\\' + f);\n }) || (this._maxSize && files[i].size > this._maxSize)) {\n illegalFiles.push(files[i]);\n } else {\n legalFiles.push(files[i]);\n }\n }\n\n return { legalFiles, illegalFiles };\n }\n\n private _handleDragEvent(evt: DragEvent, isOverTarget: boolean): void {\n if (!this._disabled) {\n evt.preventDefault();\n evt.stopPropagation();\n this._adapter.setHighlightState(isOverTarget);\n }\n }\n\n /** Get and set the allowed file types */\n public get accept(): string | null | undefined {\n return this._accept;\n }\n public set accept(value: string | null | undefined) {\n if (this._accept !== value) {\n this._accept = value;\n this._adapter.setAccept(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.ACCEPT, value);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.ACCEPT);\n }\n }\n }\n\n /** Get and set the maximum allowed file size */\n public get maxSize(): number | null | undefined {\n return this._maxSize;\n }\n public set maxSize(value: number | null | undefined) {\n if (this._maxSize !== value) {\n this._maxSize = value;\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.MAX_SIZE, value.toString());\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.MAX_SIZE);\n }\n }\n }\n\n /** Get and set the camera to use when capturing video or images */\n public get capture(): string | null | undefined {\n return this._capture;\n }\n public set capture(value: string | null | undefined) {\n if (this._capture !== value) {\n this._capture = value;\n this._adapter.setCapture(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.CAPTURE, value);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.CAPTURE);\n }\n }\n }\n\n /** Get and set whether multiple files are allowed */\n public get multiple(): boolean {\n return this._multiple;\n }\n public set multiple(value: boolean) {\n if (this._multiple !== value) {\n this._multiple = value;\n this._adapter.setMultiple(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.MULTIPLE);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.MULTIPLE);\n }\n }\n }\n\n /** Get and set whether the file picker is disabled */\n public get disabled(): boolean {\n return this._disabled;\n }\n public set disabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._adapter.setDisabled(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.DISABLED);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.DISABLED);\n }\n }\n }\n\n /** Get and set whether the file picker is compact */\n public get compact(): boolean {\n return this._compact;\n }\n public set compact(value: boolean) {\n if (this._compact !== value) {\n this._compact = value;\n this._adapter.setCompact(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.COMPACT);\n this._removeDragListeners();\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.COMPACT);\n this._registerDragListeners();\n }\n }\n }\n\n /** Get and set whether the file picker is borderless */\n public get borderless(): boolean {\n return this._borderless;\n }\n public set borderless(value: boolean) {\n if (this._borderless !== value) {\n this._borderless = value;\n this._adapter.setBorderless(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.BORDERLESS);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.BORDERLESS);\n }\n }\n }\n}\n", "import { attachShadowTemplate, coerceBoolean, coerceNumber, CustomElement, FoundationProperty } from '@tylertech/forge-core';\nimport { ButtonComponent } from '../button';\nimport { BaseComponent, IBaseComponent } from '../core/base/base-component';\nimport { FilePickerAdapter } from './file-picker-adapter';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\nimport { FilePickerFoundation } from './file-picker-foundation';\n\nconst template = '<template><form class=\\\"forge-file-picker\\\" id=\\\"container\\\" part=\\\"form\\\"><div class=\\\"forge-file-picker__primary\\\" id=\\\"primary\\\" part=\\\"primary\\\"><slot name=\\\"primary\\\"></slot></div><slot id=\\\"button-slot\\\"></slot><div class=\\\"forge-file-picker__secondary\\\" id=\\\"secondary\\\" part=\\\"secondary\\\"><slot name=\\\"secondary\\\"></slot></div><input type=\\\"file\\\" class=\\\"forge-file-picker__input\\\" id=\\\"input\\\" part=\\\"input\\\"></form><div class=\\\"forge-file-picker__helper-text\\\" part=\\\"helper-text-container\\\"><slot name=\\\"helper-text\\\"></slot></div></template>';\nconst styles = '.forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;height:auto;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker__helper-text ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:\\\"\\\";vertical-align:0}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}';\n\nexport interface IFilePickerComponent extends IBaseComponent {\n accept: string | null | undefined;\n maxSize: number | null | undefined;\n capture: string | null | undefined;\n multiple: boolean;\n disabled: boolean;\n compact: boolean;\n borderless: boolean;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-file-picker': IFilePickerComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-file-picker-change': CustomEvent<IFilePickerChangeEventData>;\n }\n}\n\n/**\n * The web component class behind the `<forge-file-picker>` custom element.\n * \n * @tag forge-file-picker\n */\n@CustomElement({\n name: FILE_PICKER_CONSTANTS.elementName,\n dependencies: [ButtonComponent]\n})\nexport class FilePickerComponent extends BaseComponent implements IFilePickerComponent {\n public static get observedAttributes(): string[] {\n return [\n FILE_PICKER_CONSTANTS.attributes.ACCEPT,\n FILE_PICKER_CONSTANTS.attributes.MAX_SIZE,\n FILE_PICKER_CONSTANTS.attributes.CAPTURE,\n FILE_PICKER_CONSTANTS.attributes.MULTIPLE,\n FILE_PICKER_CONSTANTS.attributes.DISABLED,\n FILE_PICKER_CONSTANTS.attributes.COMPACT,\n FILE_PICKER_CONSTANTS.attributes.BORDERLESS\n ];\n }\n\n private _foundation: FilePickerFoundation;\n\n constructor() {\n super();\n attachShadowTemplate(this, template, styles);\n this._foundation = new FilePickerFoundation(new FilePickerAdapter(this));\n }\n\n public connectedCallback(): void {\n this._foundation.initialize();\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case FILE_PICKER_CONSTANTS.attributes.ACCEPT:\n this.accept = newValue;\n break;\n case FILE_PICKER_CONSTANTS.attributes.MAX_SIZE:\n this.maxSize = coerceNumber(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.CAPTURE:\n this.capture = newValue;\n break;\n case FILE_PICKER_CONSTANTS.attributes.MULTIPLE:\n this.multiple = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.DISABLED:\n this.disabled = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.COMPACT:\n this.compact = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.BORDERLESS:\n this.borderless = coerceBoolean(newValue);\n break;\n }\n }\n\n /** Gets and sets the allowed file types */\n @FoundationProperty()\n public accept: string | null | undefined;\n\n /** Gets and sets the maximum allowed file size */\n @FoundationProperty()\n public maxSize: number | null | undefined;\n\n /** Gets and sets the camera to use when capturing video or images */\n @FoundationProperty()\n public capture: string | null | undefined;\n\n /** Gets and sets whether multiple files are allowed */\n @FoundationProperty()\n public multiple: boolean;\n\n /** Gets and sets whether the file picker is disabled */\n @FoundationProperty()\n public disabled: boolean;\n\n /** Gets and sets whether the file picker is compact */\n @FoundationProperty()\n public compact: boolean;\n\n /** Gets and sets whether the file picker is borderless */\n @FoundationProperty()\n public borderless: boolean;\n}\n", "import { ButtonComponentDelegate } from '../button/button-component-delegate';\nimport { BaseComponentDelegate, IBaseComponentDelegateConfig, IBaseComponentDelegateOptions } from '../core/delegates/base-component-delegate';\nimport { IFilePickerComponent } from './file-picker';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\n\nexport type FilePickerComponentDelegateProps = Partial<IFilePickerComponent>;\nexport interface IFilePickerComponentDelegateOptions extends IBaseComponentDelegateOptions {\n primaryText?: string;\n secondaryText?: string;\n helperText?: string;\n buttonText?: string;\n}\nexport interface IFilePickerComponentDelegateConfig extends IBaseComponentDelegateConfig<IFilePickerComponent, IFilePickerComponentDelegateOptions> {}\n\nexport class FilePickerComponentDelegate extends BaseComponentDelegate<IFilePickerComponent, IFilePickerComponentDelegateOptions> {\n constructor(config?: IFilePickerComponentDelegateConfig) {\n super(config);\n }\n\n protected _build(): IFilePickerComponent {\n return document.createElement(FILE_PICKER_CONSTANTS.elementName);\n }\n\n protected _configure(): void {\n if (this._config.options?.primaryText) {\n const primarySpan = document.createElement('span');\n primarySpan.slot = 'primary';\n primarySpan.textContent = this._config.options.primaryText;\n this._element.appendChild(primarySpan);\n }\n\n if (this._config.options?.secondaryText) {\n const secondarySpan = document.createElement('span');\n secondarySpan.slot = 'secondary';\n secondarySpan.textContent = this._config.options.secondaryText;\n this._element.appendChild(secondarySpan);\n }\n\n if (this._config.options?.buttonText) {\n new ButtonComponentDelegate({\n options: {\n parent: this._element,\n text: this._config.options.buttonText\n },\n props: { type: 'outlined' }\n });\n }\n\n if (this._config.options?.helperText) {\n const helperTextSpan = document.createElement('span');\n helperTextSpan.slot = 'helper-text';\n helperTextSpan.textContent = this._config.options.helperText;\n this._element.appendChild(helperTextSpan);\n }\n }\n\n public onChange(cb: (evt: IFilePickerChangeEventData) => void): void {\n this._element.addEventListener(FILE_PICKER_CONSTANTS.events.FILES_CHANGED, (evt: CustomEvent<IFilePickerChangeEventData>) => cb(evt.detail));\n }\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { FilePickerComponent } from './file-picker';\n\nexport * from './file-picker-adapter';\nexport * from './file-picker-constants';\nexport * from './file-picker-foundation';\nexport * from './file-picker';\nexport * from './file-picker-component-delegate';\n\nexport function defineFilePickerComponent(): void {\n defineCustomElement(FilePickerComponent);\n}\n"],
|
|
5
|
-
"mappings": "2YAEA,GAAM,GAA2C,GAAG,eAE9C,EAAa,CACjB,OAAQ,SACR,SAAU,WACV,QAAS,UACT,SAAU,WACV,SAAU,WACV,QAAS,UACT,WAAY,YACd,EAEM,EAAU,CACd,UAAW,YACX,SAAU,WACV,QAAS,UACT,WAAY,YACd,EAEM,EAAM,CACV,UAAW,YACX,OAAQ,SACR,MAAO,OACT,EAEM,EAAY,CAChB,UAAW,aACX,OAAQ,UACR,MAAO,SACP,YAAa,cACf,EAEM,EAAS,CACb,cAAe,GAAG,UACpB,EAEa,EAAwB,CACnC,cACA,aACA,UACA,MACA,YACA,QACF,EClBO,GAAM,GAAN,aAAgC,EAAgE,CAOrG,YAAY,EAAiC,CAC3C,MAAM,CAAS,EAEf,KAAK,WAAa,EAAiB,EAAW,EAAsB,UAAU,SAAS,EACvF,KAAK,YAAc,EAAiB,EAAW,EAAsB,UAAU,WAAW,EAC1F,KAAK,OAAS,EAAiB,EAAW,EAAsB,UAAU,KAAK,EAE/E,KAAK,oBAAsB,IAAM,CAC/B,KAAK,OAAO,MAAQ,GACpB,KAAK,OAAO,MAAM,CACpB,EAEA,KAAK,WAAW,iBAAiB,QAAS,KAAK,mBAAmB,CACpE,CAEA,AAAO,2BAA2B,EAAsC,CACtE,KAAK,YAAY,iBAAiB,aAAc,CAAQ,CAC1D,CAEA,AAAO,4BAA4B,EAAsC,CACvE,KAAK,OAAO,iBAAiB,SAAU,CAAQ,CACjD,CAEA,AAAO,0BAA0B,EAA0C,CACzE,KAAK,WAAW,iBAAiB,YAAa,CAAQ,CACxD,CAEA,AAAO,0BAA0B,EAA0C,CACzE,KAAK,WAAW,iBAAiB,YAAa,CAAQ,CACxD,CAEA,AAAO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T_NAME_PREFIX}file-picker`;\n\nconst attributes = {\n ACCEPT: 'accept',\n MAX_SIZE: 'max-size',\n CAPTURE: 'capture',\n MULTIPLE: 'multiple',\n DISABLED: 'disabled',\n COMPACT: 'compact',\n BORDERLESS: 'borderless'\n};\n\nconst classes = {\n HIGHLIGHT: 'highlight',\n DISABLED: 'disabled',\n COMPACT: 'compact',\n BORDERLESS: 'borderless'\n};\n\nconst ids = {\n CONTAINER: 'container',\n BUTTON: 'button',\n INPUT: 'input'\n};\n\nconst selectors = {\n CONTAINER: '#container',\n BUTTON: '#button',\n INPUT: '#input',\n BUTTON_SLOT: '#button-slot'\n};\n\nconst events = {\n FILES_CHANGED: `${elementName}-change`\n};\n\nexport const FILE_PICKER_CONSTANTS = {\n elementName,\n attributes,\n classes,\n ids,\n selectors,\n events\n};\n\nexport interface IFilePickerChangeEventData {\n legalFiles?: File[];\n illegalFiles?: File[];\n}\n", "import { getShadowElement, emitEvent } from '@tylertech/forge-core';\n\nimport { IFilePickerComponent } from './file-picker';\nimport { FILE_PICKER_CONSTANTS } from './file-picker-constants';\nimport { BaseAdapter, IBaseAdapter } from '../core';\n\nexport interface IFilePickerAdapter extends IBaseAdapter {\n registerButtonSlotListener(listener: (evt: Event) => void): void;\n registerInputChangeListener(listener: (evt: Event) => void): void;\n registerDragEnterListener(listener: (evt: DragEvent) => void): void;\n registerDragLeaveListener(listener: (evt: DragEvent) => void): void;\n registerDragOverListener(listener: (evt: DragEvent) => void): void;\n registerDropListener(listener: (evt: DragEvent) => void): void;\n removeDragEnterListener(listener: (evt: DragEvent) => void): void;\n removeDragLeaveListener(listener: (evt: DragEvent) => void): void;\n removeDragOverListener(listener: (evt: DragEvent) => void): void;\n removeDropListener(listener: (evt: DragEvent) => void): void;\n initializeButton(): void;\n setHighlightState(value: boolean): void;\n setAccept(value: string | null | undefined): void;\n setCapture(value: string | null | undefined): void;\n setMultiple(value: boolean): void;\n setDisabled(value: boolean): void;\n setCompact(value: boolean): void;\n setBorderless(value: boolean): void;\n}\n\nexport class FilePickerAdapter extends BaseAdapter<IFilePickerComponent> implements IFilePickerAdapter {\n private _container: HTMLElement;\n private _buttonSlot: HTMLSlotElement;\n private _button: HTMLButtonElement;\n private _input: HTMLInputElement;\n private _inputEventListener: () => void;\n\n constructor(component: IFilePickerComponent) {\n super(component);\n\n this._container = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.CONTAINER);\n this._buttonSlot = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.BUTTON_SLOT) as HTMLSlotElement;\n this._input = getShadowElement(component, FILE_PICKER_CONSTANTS.selectors.INPUT) as HTMLInputElement;\n\n this._inputEventListener = () => {\n this._input.value = '';\n this._input.click();\n };\n\n this._container.addEventListener('click', this._inputEventListener);\n }\n\n public registerButtonSlotListener(listener: (evt: Event) => void): void {\n this._buttonSlot.addEventListener('slotchange', listener);\n }\n\n public registerInputChangeListener(listener: (evt: Event) => void): void {\n this._input.addEventListener('change', listener);\n }\n\n public registerDragEnterListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragenter', listener);\n }\n\n public registerDragLeaveListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragleave', listener);\n }\n\n public registerDragOverListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('dragover', listener);\n }\n\n public registerDropListener(listener: (evt: DragEvent) => void): void {\n this._container.addEventListener('drop', listener);\n }\n\n public removeDragEnterListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragenter', listener);\n }\n\n public removeDragLeaveListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragleave', listener);\n }\n\n public removeDragOverListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('dragover', listener);\n }\n\n public removeDropListener(listener: (evt: DragEvent) => void): void {\n this._container.removeEventListener('drop', listener);\n }\n\n public initializeButton(): void {\n const button = this._component.querySelector('button') as HTMLButtonElement;\n this._button = button || undefined;\n }\n\n /**\n * Sets the highlight state of the file picker.\n * @param value True if the highlight should be applied and false if not.\n */\n public setHighlightState(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.HIGHLIGHT) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.HIGHLIGHT);\n }\n }\n\n /**\n * Sets the accept attribute of the input.\n * @param value The accept string.\n */\n public setAccept(value: string | null | undefined): void {\n if (value) {\n this._input.setAttribute('accept', value);\n } else {\n this._input.removeAttribute('accept');\n }\n }\n\n /**\n * Sets the capture attribute of the input.\n * @param value The capture string.\n */\n public setCapture(value: string | null | undefined): void {\n if (value) {\n this._input.setAttribute('capture', value);\n } else {\n this._input.removeAttribute('capture');\n }\n }\n\n /**\n * Sets the multiple attribute of the input.\n * @param value The multiple state.\n */\n public setMultiple(value: boolean): void {\n if (value) {\n this._input.setAttribute('multiple', '');\n } else {\n this._input.removeAttribute('multiple');\n }\n }\n\n /**\n * Sets the disabled state of the file picker.\n * @param value The disabled state.\n */\n public setDisabled(value: boolean): void {\n if (value) {\n this._container.removeEventListener('click', this._inputEventListener);\n this._button.setAttribute('disabled', '');\n this._container.setAttribute('disabled', '');\n } else {\n this._container.addEventListener('click', this._inputEventListener);\n this._button.removeAttribute('disabled');\n this._container.removeAttribute('disabled');\n }\n }\n\n /**\n * Sets the compact state of the file picker.\n * @param value The compact state.\n */\n public setCompact(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.COMPACT) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.COMPACT);\n }\n }\n\n /**\n * Sets the borderless state of the file picker.\n * @param value The borderless state.\n */\n public setBorderless(value: boolean): void {\n if (this._container.classList.contains(FILE_PICKER_CONSTANTS.classes.BORDERLESS) !== value) {\n this._container.classList.toggle(FILE_PICKER_CONSTANTS.classes.BORDERLESS);\n }\n }\n}\n", "import { ICustomElementFoundation } from '@tylertech/forge-core';\n\nimport { IFilePickerAdapter } from './file-picker-adapter';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\n\nexport interface IFilePickerFoundation extends ICustomElementFoundation {\n accept: string | null | undefined;\n maxSize: number | null | undefined;\n capture: string | null | undefined;\n multiple: boolean;\n disabled: boolean;\n compact: boolean;\n borderless: boolean;\n}\n\nexport class FilePickerFoundation implements IFilePickerFoundation {\n private _accept: string | null | undefined = null;\n private _maxSize: number | null | undefined = null;\n private _capture: string | null | undefined = null;\n private _multiple = false;\n private _disabled = false;\n private _compact = false;\n private _borderless = false;\n private _buttonSlotListener: (evt: Event) => void;\n private _inputChangeListener: (evt: Event) => void;\n private _dragEnterListener: (evt: DragEvent) => void;\n private _dragLeaveListener: (evt: DragEvent) => void;\n private _dragOverListener: (evt: DragEvent) => void;\n private _dropListener: (evt: DragEvent) => void;\n\n constructor(private _adapter: IFilePickerAdapter) {\n this._buttonSlotListener = evt => this._onButtonSlotChanged(evt);\n this._inputChangeListener = evt => this._onInputChange(evt);\n this._dragEnterListener = evt => this._onDragEnter(evt);\n this._dragLeaveListener = evt => this._onDragLeave(evt);\n this._dragOverListener = evt => this._onDragOver(evt);\n this._dropListener = evt => this._onDrop(evt);\n\n this._adapter.registerButtonSlotListener(this._buttonSlotListener);\n this._adapter.registerInputChangeListener(this._inputChangeListener);\n if (!this._compact) {\n this._registerDragListeners();\n }\n }\n\n public initialize(): void {\n this._adapter.initializeButton();\n }\n\n private _onButtonSlotChanged(evt: Event): void {\n this._adapter.initializeButton();\n }\n\n private _onInputChange(evt: Event): void {\n const files = (evt.target as HTMLInputElement).files;\n if (files) {\n this._handleFiles(files);\n }\n }\n\n private _onDragEnter(evt: DragEvent): void {\n this._handleDragEvent(evt, true);\n }\n\n private _onDragLeave(evt: DragEvent): void {\n this._handleDragEvent(evt, false);\n }\n\n private _onDragOver(evt: DragEvent): void {\n this._handleDragEvent(evt, true);\n }\n\n private _onDrop(evt: DragEvent): void {\n this._handleDragEvent(evt, false);\n\n if (!this._disabled) {\n const dataTransfer = evt.dataTransfer;\n if (dataTransfer) {\n const files = dataTransfer.files;\n this._handleFiles(files);\n }\n }\n }\n\n private _registerDragListeners(): void {\n this._adapter.registerDragEnterListener(this._dragEnterListener);\n this._adapter.registerDragLeaveListener(this._dragLeaveListener);\n this._adapter.registerDragOverListener(this._dragOverListener);\n this._adapter.registerDropListener(this._dropListener);\n }\n\n private _removeDragListeners(): void {\n this._adapter.removeDragEnterListener(this._dragEnterListener);\n this._adapter.removeDragLeaveListener(this._dragLeaveListener);\n this._adapter.removeDragOverListener(this._dragOverListener);\n this._adapter.removeDropListener(this._dropListener);\n }\n\n private _handleFiles(fileList: FileList): void {\n let data: IFilePickerChangeEventData = {};\n if (fileList) {\n const sortedFiles = this._sortFiles(fileList);\n let files = sortedFiles.legalFiles || null;\n\n // Ensure that we can only drop 1 file if not in multiple mode\n if (!this._multiple && files && files.length > 1) {\n files = files.splice(1);\n }\n\n data = sortedFiles;\n }\n this._adapter.emitHostEvent(FILE_PICKER_CONSTANTS.events.FILES_CHANGED, data);\n }\n\n private _sortFiles(files: FileList): IFilePickerChangeEventData {\n let legalFiles: File[] = [];\n const illegalFiles: File[] = [];\n\n if (!this._accept && !this.maxSize) {\n legalFiles = Array.from(files);\n return { legalFiles, illegalFiles };\n }\n\n const formats = this._accept ? this._accept.split(',').map(f => f.trim().toLowerCase()) : [''];\n\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < files.length; i++) {\n if (!formats.some(f => {\n return files[i].type.toLowerCase().match(f) || files[i].name.toLowerCase().match('\\\\' + f);\n }) || (this._maxSize && files[i].size > this._maxSize)) {\n illegalFiles.push(files[i]);\n } else {\n legalFiles.push(files[i]);\n }\n }\n\n return { legalFiles, illegalFiles };\n }\n\n private _handleDragEvent(evt: DragEvent, isOverTarget: boolean): void {\n if (!this._disabled) {\n evt.preventDefault();\n evt.stopPropagation();\n this._adapter.setHighlightState(isOverTarget);\n }\n }\n\n /** Get and set the allowed file types */\n public get accept(): string | null | undefined {\n return this._accept;\n }\n public set accept(value: string | null | undefined) {\n if (this._accept !== value) {\n this._accept = value;\n this._adapter.setAccept(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.ACCEPT, value);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.ACCEPT);\n }\n }\n }\n\n /** Get and set the maximum allowed file size */\n public get maxSize(): number | null | undefined {\n return this._maxSize;\n }\n public set maxSize(value: number | null | undefined) {\n if (this._maxSize !== value) {\n this._maxSize = value;\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.MAX_SIZE, value.toString());\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.MAX_SIZE);\n }\n }\n }\n\n /** Get and set the camera to use when capturing video or images */\n public get capture(): string | null | undefined {\n return this._capture;\n }\n public set capture(value: string | null | undefined) {\n if (this._capture !== value) {\n this._capture = value;\n this._adapter.setCapture(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.CAPTURE, value);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.CAPTURE);\n }\n }\n }\n\n /** Get and set whether multiple files are allowed */\n public get multiple(): boolean {\n return this._multiple;\n }\n public set multiple(value: boolean) {\n if (this._multiple !== value) {\n this._multiple = value;\n this._adapter.setMultiple(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.MULTIPLE);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.MULTIPLE);\n }\n }\n }\n\n /** Get and set whether the file picker is disabled */\n public get disabled(): boolean {\n return this._disabled;\n }\n public set disabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._adapter.setDisabled(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.DISABLED);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.DISABLED);\n }\n }\n }\n\n /** Get and set whether the file picker is compact */\n public get compact(): boolean {\n return this._compact;\n }\n public set compact(value: boolean) {\n if (this._compact !== value) {\n this._compact = value;\n this._adapter.setCompact(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.COMPACT);\n this._removeDragListeners();\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.COMPACT);\n this._registerDragListeners();\n }\n }\n }\n\n /** Get and set whether the file picker is borderless */\n public get borderless(): boolean {\n return this._borderless;\n }\n public set borderless(value: boolean) {\n if (this._borderless !== value) {\n this._borderless = value;\n this._adapter.setBorderless(value);\n if (value) {\n this._adapter.setHostAttribute(FILE_PICKER_CONSTANTS.attributes.BORDERLESS);\n } else {\n this._adapter.removeHostAttribute(FILE_PICKER_CONSTANTS.attributes.BORDERLESS);\n }\n }\n }\n}\n", "import { attachShadowTemplate, coerceBoolean, coerceNumber, CustomElement, FoundationProperty } from '@tylertech/forge-core';\nimport { ButtonComponent } from '../button';\nimport { BaseComponent, IBaseComponent } from '../core/base/base-component';\nimport { FilePickerAdapter } from './file-picker-adapter';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\nimport { FilePickerFoundation } from './file-picker-foundation';\n\nconst template = '<template><form class=\\\"forge-file-picker\\\" id=\\\"container\\\" part=\\\"form\\\"><div class=\\\"forge-file-picker__primary\\\" id=\\\"primary\\\" part=\\\"primary\\\"><slot name=\\\"primary\\\"></slot></div><slot id=\\\"button-slot\\\"></slot><div class=\\\"forge-file-picker__secondary\\\" id=\\\"secondary\\\" part=\\\"secondary\\\"><slot name=\\\"secondary\\\"></slot></div><input type=\\\"file\\\" class=\\\"forge-file-picker__input\\\" id=\\\"input\\\" part=\\\"input\\\"></form><div class=\\\"forge-file-picker__helper-text\\\" part=\\\"helper-text-container\\\"><slot name=\\\"helper-text\\\"></slot></div></template>';\nconst styles = '.forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}';\n\nexport interface IFilePickerComponent extends IBaseComponent {\n accept: string | null | undefined;\n maxSize: number | null | undefined;\n capture: string | null | undefined;\n multiple: boolean;\n disabled: boolean;\n compact: boolean;\n borderless: boolean;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-file-picker': IFilePickerComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-file-picker-change': CustomEvent<IFilePickerChangeEventData>;\n }\n}\n\n/**\n * The web component class behind the `<forge-file-picker>` custom element.\n * \n * @tag forge-file-picker\n */\n@CustomElement({\n name: FILE_PICKER_CONSTANTS.elementName,\n dependencies: [ButtonComponent]\n})\nexport class FilePickerComponent extends BaseComponent implements IFilePickerComponent {\n public static get observedAttributes(): string[] {\n return [\n FILE_PICKER_CONSTANTS.attributes.ACCEPT,\n FILE_PICKER_CONSTANTS.attributes.MAX_SIZE,\n FILE_PICKER_CONSTANTS.attributes.CAPTURE,\n FILE_PICKER_CONSTANTS.attributes.MULTIPLE,\n FILE_PICKER_CONSTANTS.attributes.DISABLED,\n FILE_PICKER_CONSTANTS.attributes.COMPACT,\n FILE_PICKER_CONSTANTS.attributes.BORDERLESS\n ];\n }\n\n private _foundation: FilePickerFoundation;\n\n constructor() {\n super();\n attachShadowTemplate(this, template, styles);\n this._foundation = new FilePickerFoundation(new FilePickerAdapter(this));\n }\n\n public connectedCallback(): void {\n this._foundation.initialize();\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case FILE_PICKER_CONSTANTS.attributes.ACCEPT:\n this.accept = newValue;\n break;\n case FILE_PICKER_CONSTANTS.attributes.MAX_SIZE:\n this.maxSize = coerceNumber(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.CAPTURE:\n this.capture = newValue;\n break;\n case FILE_PICKER_CONSTANTS.attributes.MULTIPLE:\n this.multiple = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.DISABLED:\n this.disabled = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.COMPACT:\n this.compact = coerceBoolean(newValue);\n break;\n case FILE_PICKER_CONSTANTS.attributes.BORDERLESS:\n this.borderless = coerceBoolean(newValue);\n break;\n }\n }\n\n /** Gets and sets the allowed file types */\n @FoundationProperty()\n public accept: string | null | undefined;\n\n /** Gets and sets the maximum allowed file size */\n @FoundationProperty()\n public maxSize: number | null | undefined;\n\n /** Gets and sets the camera to use when capturing video or images */\n @FoundationProperty()\n public capture: string | null | undefined;\n\n /** Gets and sets whether multiple files are allowed */\n @FoundationProperty()\n public multiple: boolean;\n\n /** Gets and sets whether the file picker is disabled */\n @FoundationProperty()\n public disabled: boolean;\n\n /** Gets and sets whether the file picker is compact */\n @FoundationProperty()\n public compact: boolean;\n\n /** Gets and sets whether the file picker is borderless */\n @FoundationProperty()\n public borderless: boolean;\n}\n", "import { ButtonComponentDelegate } from '../button/button-component-delegate';\nimport { BaseComponentDelegate, IBaseComponentDelegateConfig, IBaseComponentDelegateOptions } from '../core/delegates/base-component-delegate';\nimport { IFilePickerComponent } from './file-picker';\nimport { FILE_PICKER_CONSTANTS, IFilePickerChangeEventData } from './file-picker-constants';\n\nexport type FilePickerComponentDelegateProps = Partial<IFilePickerComponent>;\nexport interface IFilePickerComponentDelegateOptions extends IBaseComponentDelegateOptions {\n primaryText?: string;\n secondaryText?: string;\n helperText?: string;\n buttonText?: string;\n}\nexport interface IFilePickerComponentDelegateConfig extends IBaseComponentDelegateConfig<IFilePickerComponent, IFilePickerComponentDelegateOptions> {}\n\nexport class FilePickerComponentDelegate extends BaseComponentDelegate<IFilePickerComponent, IFilePickerComponentDelegateOptions> {\n constructor(config?: IFilePickerComponentDelegateConfig) {\n super(config);\n }\n\n protected _build(): IFilePickerComponent {\n return document.createElement(FILE_PICKER_CONSTANTS.elementName);\n }\n\n protected _configure(): void {\n if (this._config.options?.primaryText) {\n const primarySpan = document.createElement('span');\n primarySpan.slot = 'primary';\n primarySpan.textContent = this._config.options.primaryText;\n this._element.appendChild(primarySpan);\n }\n\n if (this._config.options?.secondaryText) {\n const secondarySpan = document.createElement('span');\n secondarySpan.slot = 'secondary';\n secondarySpan.textContent = this._config.options.secondaryText;\n this._element.appendChild(secondarySpan);\n }\n\n if (this._config.options?.buttonText) {\n new ButtonComponentDelegate({\n options: {\n parent: this._element,\n text: this._config.options.buttonText\n },\n props: { type: 'outlined' }\n });\n }\n\n if (this._config.options?.helperText) {\n const helperTextSpan = document.createElement('span');\n helperTextSpan.slot = 'helper-text';\n helperTextSpan.textContent = this._config.options.helperText;\n this._element.appendChild(helperTextSpan);\n }\n }\n\n public onChange(cb: (evt: IFilePickerChangeEventData) => void): void {\n this._element.addEventListener(FILE_PICKER_CONSTANTS.events.FILES_CHANGED, (evt: CustomEvent<IFilePickerChangeEventData>) => cb(evt.detail));\n }\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { FilePickerComponent } from './file-picker';\n\nexport * from './file-picker-adapter';\nexport * from './file-picker-constants';\nexport * from './file-picker-foundation';\nexport * from './file-picker';\nexport * from './file-picker-component-delegate';\n\nexport function defineFilePickerComponent(): void {\n defineCustomElement(FilePickerComponent);\n}\n"],
|
|
5
|
+
"mappings": "2YAEA,GAAM,GAA2C,GAAG,eAE9C,EAAa,CACjB,OAAQ,SACR,SAAU,WACV,QAAS,UACT,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AsB,cAAe,CACvC,GAAM,GAAgB,SAAS,cAAc,MAAM,EACnD,EAAc,KAAO,YACrB,EAAc,YAAc,KAAK,QAAQ,QAAQ,cACjD,KAAK,SAAS,YAAY,CAAa,CACzC,CAYA,GAVI,QAAK,QAAQ,UAAb,QAAsB,YACxB,GAAI,GAAwB,CAC1B,QAAS,CACP,OAAQ,KAAK,SACb,KAAM,KAAK,QAAQ,QAAQ,UAC7B,EACA,MAAO,CAAE,KAAM,UAAW,CAC5B,CAAC,EAGC,QAAK,QAAQ,UAAb,QAAsB,WAAY,CACpC,GAAM,GAAiB,SAAS,cAAc,MAAM,EACpD,EAAe,KAAO,cACtB,EAAe,YAAc,KAAK,QAAQ,QAAQ,WAClD,KAAK,SAAS,YAAY,CAAc,CAC1C,CACF,CAEA,AAAO,SAAS,EAAqD,CACnE,KAAK,SAAS,iBAAiB,EAAsB,OAAO,cAAe,AAAC,GAAiD,EAAG,EAAI,MAAM,CAAC,CAC7I,CACF,ECjDO,aAA2C,CAChD,EAAoB,CAAmB,CACzC",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Tyler Technologies, Inc.
|
|
4
|
+
* License: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import{a as w,b as k,c as C}from"./chunk.RPPBBBYG.js";import{e as L}from"./chunk.Y6MPWPZU.js";import{a as E}from"./chunk.24D46RLZ.js";import{a as _,b as y}from"./chunk.BSZ2LBJX.js";import{a as v,e as x,g as s}from"./chunk.HN4PXH3D.js";import{s as u}from"./chunk.R4NDFXVA.js";import{f as h}from"./chunk.MCIQXNKY.js";var g=`${y}chip-field`,M={ROOT:"forge-chip-field"},n={LABEL:"label",HELPER_TEXT:"helper-text",MEMBER:"member"},I={ROOT:`.${M.ROOT}`,INPUT_CONTAINER:".forge-field__input-container",INPUT:"input",LABEL:`[slot=${n.LABEL}]`,HELPER_TEXT:`[slot=${n.HELPER_TEXT}]`,MEMBER:`[slot=${n.MEMBER}]`,LABEL_SLOT:`slot[name=${n.LABEL}]`,MEMBER_SLOT:`slot[name=${n.MEMBER}]`},z={MEMBER_ADDED:`${g}-member-added`,MEMBER_REMOVED:`${g}-member-removed`},i={elementName:g,classes:M,slots:n,selectors:I,events:z};var d=class extends w{constructor(e){super(e)}initialize(){super.initialize(i.selectors.ROOT),this._memberSlot=s(this._component,i.selectors.MEMBER_SLOT),this._inputContainerElement=s(this._component,i.selectors.INPUT_CONTAINER)}addRootListener(e,o){this._rootElement.addEventListener(e,o)}removeRootListener(e,o){this._rootElement.removeEventListener(e,o)}addMemberSlotListener(e){this._memberSlot.addEventListener("slotchange",e)}removeMemberSlotListener(e){this._memberSlot&&this._memberSlot.removeEventListener("slotchange",e)}addInputContainerListener(e,o){this._inputContainerElement.addEventListener(e,o)}removeInputContainerListener(e,o){this._inputContainerElement.removeEventListener(e,o)}fieldHasValue(){return!!this._component.querySelector(i.selectors.MEMBER)||super.inputHasValue()}focusInput(){!this._inputElement||this._inputElement.focus()}getSlottedMemberElements(){return this._component.querySelectorAll(i.selectors.MEMBER)}};var a=class extends k{constructor(e){super(e);this._adapter=e;this._memberSlotListener=()=>this._onMemberSlotChanged(),this._inputContainerMouseDownListener=o=>this._onInputContainerMouseDown(o),this._handleRootKeyDown=o=>this._onRootKeyDown(o),this._handleKeyDown=o=>this._onKeyDown(o)}initialize(){super.initialize(),this._adapter.addMemberSlotListener(this._memberSlotListener),this._adapter.addInputContainerListener("mousedown",this._inputContainerMouseDownListener),this._adapter.addRootListener("keydown",this._handleRootKeyDown),this._adapter.addInputListener("keydown",this._handleKeyDown)}disconnect(){super.disconnect(),this._adapter.removeMemberSlotListener(this._memberSlotListener),this._adapter.removeInputContainerListener("mousedown",this._inputContainerMouseDownListener),this._adapter.removeRootListener("keydown",this._handleRootKeyDown),this._adapter.removeInputListener("keydown",this._handleKeyDown)}_onInputContainerMouseDown(e){e.preventDefault(),this._adapter.focusInput()}_onBlur(e){let o=e.target;o.value="",super._onBlur(e)}_onRootKeyDown(e){if(!this._adapter.inputHasValue())switch(e.key){case"Right":case"ArrowRight":this._focusNextMember();break;case"Left":case"ArrowLeft":this._focusPreviousMember();break;case"Backspace":case"Delete":case"Del":this._removeMember();break;default:break}}_onKeyDown(e){let o=e.target;switch(e.key){case"Enter":this._addMember(o);break;case"Esc":case"Escape":case"Tab":o.value="";break;default:break}}_focusNextMember(){let e=this._adapter.getSlottedMemberElements();if(!(e.length<1||this._adapter.inputHasFocus()))for(let o=0;o<e.length;o++){let t=e.item(o),r=e.item(o+1);if(this._memberIsActive(t))if(r){r.focus();break}else this._adapter.focusInput()}}_focusPreviousMember(){let e=this._adapter.getSlottedMemberElements();if(!(e.length<1)){if(this._adapter.inputHasFocus()){e[e.length-1].focus();return}for(let o=0;o<e.length;o++){let t=e.item(o-1),r=e.item(o);if(this._memberIsActive(r)&&t){t.focus();break}}}}_memberIsActive(e){return u()===e||e.hasAttribute("focused")}_getActiveMember(){let e=this._adapter.getSlottedMemberElements();for(let o=0;o<e.length;o++){let t=e.item(o);if(this._memberIsActive(t))return t}return null}_addMember(e){let o=e.value.trim();o&&o.length>0&&this._adapter.emitHostEvent(i.events.MEMBER_ADDED,o),e.value=""}_removeMember(){let e=this._getActiveMember();if(!e){let o=this._adapter.getSlottedMemberElements();e=o.item(o.length-1)}!e||(this._focusNextMember(),this._adapter.emitHostEvent(i.events.MEMBER_REMOVED,e))}_onMemberSlotChanged(){this.floatLabel(this._adapter.fieldHasValue()||this._adapter.inputHasFocus()),this._adapter.getSlottedMemberElements().forEach(e=>e.tabIndex=-1)}};var F='<template><div class="forge-chip-field__wrapper" part="root"><div class="forge-chip-field forge-field" part="container"><slot name="leading"></slot><div class="forge-field__label-input-container" part="label-input-container"><slot name="label"></slot><div class="forge-field__input-container" part="input-container"><slot name="member"></slot><slot></slot></div></div><slot name="trailing"></slot><div class="forge-field__addon-end-container" part="addon-end-container"><slot name="addon-end"></slot></div></div><slot name="helper-text"></slot></div></template>',D='.forge-field::before{content:"";display:-webkit-box;display:flex;position:absolute;top:0;right:0;left:0;z-index:-1;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;max-width:100%;height:100%;pointer-events:none;border-style:solid;border-width:1px;-webkit-transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);background-color:transparent;background-color:var(--forge-chip-field-theme-background,transparent);text-align:left}.forge-field[dir=rtl]::before,[dir=rtl] .forge-field::before{text-align:right}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused)::before{border-color:rgba(0,0,0,.38);border-color:var(--mdc-theme-text-icon-on-background,rgba(0,0,0,.38))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused):hover::before{border-color:rgba(0,0,0,.87);border-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled)::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-field--invalid:not(.forge-field--disabled)::before{border-color:#b00020;border-color:var(--mdc-theme-error,#b00020)}.forge-field--invalid:not(.forge-field--disabled):not(.forge-field--focused):hover::before{border-color:#db8a98;border-color:var(--forge-theme-error-hover,#db8a98)}.forge-field--disabled::before{border-color:rgba(0,0,0,.12);border-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--shape-rounded){border-radius:4px}.forge-field:not(.forge-field--shape-rounded)::before{border-radius:4px}.forge-field--shape-rounded{border-radius:28px}.forge-field--shape-rounded::before{border-radius:28px}.forge-field--disabled::before{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5)}.forge-field--focused::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);border-width:2px}.forge-field__label-input-container{position:relative;-webkit-box-flex:1;flex:1 1 0.0001px;height:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;min-width:0}.forge-field ::slotted(label){color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65));pointer-events:none;right:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);font-size:var(--mdc-typography-subtitle1-font-size, 1rem);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.1rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;-webkit-transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field ::slotted(label[dir=rtl]),[dir=rtl] .forge-field ::slotted(label){right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.forge-field--dense:not(.forge-field--roomy) ::slotted(label){display:none}.forge-field--required ::slotted(label)::after{content:none}.forge-field--required ::slotted(label)::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:"*";margin-right:4px}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label){font-size:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(label){font-size:1rem}.forge-field--disabled ::slotted(label){color:rgba(0,0,0,.38);color:var(--forge-theme-label-disabled-on-background,rgba(0,0,0,.38))}.forge-field--invalid:not(.forge-field--disabled) ::slotted(label){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) ::slotted(label){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label){top:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(label){top:1.285rem}.forge-field:not(.forge-field--shape-rounded):not(.forge-field--leading) ::slotted(label){left:12px!important}.forge-field--shape-rounded:not(.forge-field--leading) ::slotted(label){left:32px!important}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end):not(.forge-field--shape-rounded) ::slotted(label){padding-right:12px}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end).forge-field--shape-rounded ::slotted(label){padding-right:32px}.forge-field ::slotted(label.forge-floating-label--float-above){color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65))}.forge-field--disabled ::slotted(label.forge-floating-label--float-above){color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6))}.forge-field--invalid:not(.forge-field--disabled) ::slotted(label.forge-floating-label--float-above){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) ::slotted(label.forge-floating-label--float-above){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--float-above){-webkit-transform:translateY(-.54rem) scale(.8125);transform:translateY(-.54rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--float-above){-webkit-transform:translateY(-.72rem) scale(.8125);transform:translateY(-.72rem) scale(.8125);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe){-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.62rem) scale(1);transform:translateY(-.62rem) scale(1);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe){-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.8rem) scale(1);transform:translateY(-.8rem) scale(1);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--unfloat-above-start-keyframe){-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.62rem) scale(.8125);transform:translateY(-.62rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--unfloat-above-start-keyframe){-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.8rem) scale(.8125);transform:translateY(-.8rem) scale(.8125);cursor:auto}.forge-field~::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-field:not(.forge-field--dense):not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field--roomy:not(.forge-field--dense)~::slotted([slot=helper-text]){font-size:.875rem}.forge-field--dense:not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field~::slotted([slot=helper-text]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled)~::slotted([slot=helper-text]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field:not(.forge-field--shape-rounded)~::slotted([slot=helper-text]){margin-left:12px}.forge-field--shape-rounded~::slotted([slot=helper-text]){margin-left:32px}.forge-field ::slotted([slot=leading]){display:-webkit-box;display:flex;align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=leading]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=leading]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=leading]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=leading]){margin:0 4px}.forge-field ::slotted([slot=leading]:not(forge-icon-button)){padding:6px}.forge-field ::slotted([slot=trailing]){align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=trailing]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=trailing]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=trailing]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=trailing]){margin:0 4px}.forge-field ::slotted([slot=trailing]:not(forge-icon-button)){padding:6px}.forge-field__addon-end-container{display:none}.forge-field--addon-end .forge-field__addon-end-container{height:100%;width:auto;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;padding:0 4px;border-left-width:1px;border-left-style:solid;-webkit-transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.54);border-left-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container:hover{border-left-color:rgba(0,0,0,.87);border-left-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#3f51b5;border-left-color:var(--mdc-theme-primary,#3f51b5)}.forge-field.forge-field--invalid:not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#b00020;border-left-color:var(--mdc-theme-error,#b00020)}.forge-field.forge-field--invalid:not(.forge-field--focused):not(.forge-field--disabled) .forge-field__addon-end-container:hover{border-left-color:#db8a98;border-left-color:var(--forge-theme-error-hover,#db8a98)}.forge-field.forge-field--disabled .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.12);border-left-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=addon-end]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=addon-end]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=addon-end]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-chip-field{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;position:relative;z-index:1;z-index:var(--forge-z-index-surface,1);margin-top:0;margin-top:var(--forge-chip-field-margin-top,0)}.forge-chip-field.forge-field--disabled{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5);cursor:not-allowed}.forge-chip-field .forge-chip-field{display:grid;grid-template-columns:[leading] -webkit-min-content [input] 1fr [trailing] -webkit-min-content [addon-end] -webkit-min-content [end];grid-template-columns:[leading] min-content [input] 1fr [trailing] min-content [addon-end] min-content [end]}.forge-chip-field .forge-chip-field:not(.forge-field--dense):not(.forge-field--roomy){height:auto;min-height:46px;min-height:var(--forge-chip-field-height,46px)}.forge-chip-field .forge-chip-field.forge-field--roomy:not(.forge-field--dense){height:auto;min-height:3.5rem;min-height:var(--forge-chip-field-height,3.5rem)}.forge-chip-field .forge-chip-field.forge-field--dense:not(.forge-field--roomy){height:auto;min-height:1.5rem;min-height:var(--forge-chip-field-height,1.5rem)}.forge-field__label-input-container{grid-column-start:input;grid-column-end:trailing}.forge-field__input-container{-webkit-box-flex:1;flex:1 1 0.0001px;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;flex-wrap:wrap;-webkit-box-align:start;align-items:flex-start;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-field__input-container{padding:2px 12px}.forge-field--label .forge-field__input-container{padding-top:22px}.forge-field--roomy.forge-field--label .forge-field__input-container{padding-top:22px}.forge-field--shape-rounded:not(.forge-field--leading) .forge-field__input-container{padding-left:32px}.forge-field--leading:not(.forge-field--shape-rounded) .forge-field__input-container{padding-left:0}.forge-field--shape-rounded.forge-field--leading .forge-field__input-container{padding-left:0}.forge-field--label .forge-field__input-container{padding-bottom:2px}.forge-field--roomy.forge-field--label .forge-field__input-container{padding-bottom:2px}.forge-field--shape-rounded:not(.forge-field--trailing):not(.forge-field--addon-end) .forge-field__input-container{padding-right:32px}.forge-field--addon-end:not(.forge-field--shape-rounded) .forge-field__input-container,.forge-field--trailing:not(.forge-field--shape-rounded) .forge-field__input-container{padding-right:0}.forge-field--shape-rounded.forge-field--addon-end .forge-field__input-container,.forge-field--shape-rounded.forge-field--trailing .forge-field__input-container{padding-right:0}.forge-field ::slotted([slot=member]){display:block}.forge-field--disabled ::slotted([slot=member]){--mdc-theme-primary:rgba(0, 0, 0, 0.38);--mdc-theme-primary:var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38));cursor:not-allowed;pointer-events:none}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=member]){margin:2px 8px 2px 0}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=member]){margin:6px 12px 6px 0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=member]){margin:2px 6px 2px 0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=member]){--forge-chip-min-height:20px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=member]){--forge-chip-min-height:16px}.forge-field ::slotted(input){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);align-self:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;-webkit-transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);border:none;background:0 0;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;line-height:normal;min-width:0}.forge-field ::slotted(input)::-webkit-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::-moz-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input):-ms-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::-ms-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input):invalid{-webkit-box-shadow:none;box-shadow:none}.forge-field ::slotted(input):-webkit-autofill{z-index:auto!important}.forge-field:not(.forge-field--disabled) ::slotted(input){color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--disabled ::slotted(input){color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6));cursor:not-allowed}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){font-size:1rem;font-size:var(--forge-chip-field-font-size, 1rem)}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){font-size:1rem;font-size:var(--forge-chip-field-font-size, 1rem)}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){font-size:.875rem;font-size:var(--forge-chip-field-font-size, .875rem)}.forge-field ::slotted(input){-webkit-box-flex:1;flex:1 1 0.0001px;min-width:40px;display:block;align-self:flex-start;padding:0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){margin:4px 0}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){margin:6px 0}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){margin:2px 0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){height:1rem;line-height:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){height:1.25rem;line-height:1.25rem}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){height:1rem;line-height:1rem}.forge-field ::slotted([slot=leading]){grid-column-start:leading;grid-column-end:input;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=leading]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=leading]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=leading]){margin-top:0;margin-bottom:0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=leading]){padding-top:0;padding-bottom:0}.forge-field ::slotted([slot=trailing]){grid-column-start:trailing;grid-column-end:addon-end;display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=trailing]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=trailing]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=trailing]){margin-top:0;margin-bottom:0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=trailing]){padding-top:0;padding-bottom:0}.forge-field--addon-end .forge-field__addon-end-container{grid-column-start:addon-end;grid-column-end:end;display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=addon-end]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=addon-end]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=addon-end]){margin-top:0;margin-bottom:0}.forge-field ::slotted(forge-icon-button){display:-webkit-inline-box!important;display:inline-flex!important}:host{display:block;contain:layout}:host([hidden]){display:none}',l=class extends C{constructor(){super(),x(this,F,D),this._foundation=new a(new d(this))}};l=h([_({name:i.elementName,dependencies:[L]})],l);var T=class extends E{constructor(e){super(e)}_build(){var o,t;let e=document.createElement(i.elementName);return this._inputElement=this._buildInputElement(e),(o=this._config.options)!=null&&o.leadingElement&&(this._config.options.leadingElement.slot="leading",e.appendChild(this._config.options.leadingElement)),(t=this._config.options)!=null&&t.trailingElement&&(this._config.options.trailingElement.slot="trailing",e.appendChild(this._config.options.trailingElement)),e.appendChild(this._inputElement),e}_configure(){var e,o;(e=this._config.options)!=null&&e.helperText&&this.setHelperText(this._config.options.helperText),typeof((o=this._config.options)==null?void 0:o.label)=="string"&&this._createLabel(this._config.options.label)}get value(){return this._inputElement.value}set value(e){this._inputElement.value=e}get disabled(){return this._inputElement.disabled}set disabled(e){this._inputElement.disabled=e}get invalid(){return this._element.invalid||!1}set invalid(e){this._element.invalid=e}get inputElement(){return this._inputElement}get labelElement(){return this._labelElement}onChange(e){this._inputElement.addEventListener("input",o=>e(o.target.value))}onFocus(e){this._inputElement.addEventListener("focus",o=>e(o))}onBlur(e){this._inputElement.addEventListener("blur",o=>e(o))}setLabel(e){e?this._labelElement?this._labelElement.textContent=e:this._createLabel(e):this._labelElement&&(this._element.removeChild(this._labelElement),this._labelElement=void 0)}setHelperText(e){e?(this._helperTextElement||(this._helperTextElement=document.createElement("span"),this._helperTextElement.slot="helper-text",this._element.appendChild(this._helperTextElement)),this._helperTextElement.textContent=e):this._helperTextElement&&(this._element.removeChild(this._helperTextElement),this._helperTextElement=void 0)}floatLabel(e){this._element.floatLabel(e)}_createLabel(e){var o;this._labelElement=document.createElement("label"),this._labelElement.textContent=e,(o=this._config.options)!=null&&o.id&&this._labelElement.setAttribute("for",this._config.options.id),this._element.appendChild(this._labelElement)}_buildInputElement(e){var t,r,p,b,c;let o=document.createElement("input");return o.type=((t=this._config.options)==null?void 0:t.type)||"text",((r=this._config.options)==null?void 0:r.value)!==void 0&&(o.value=this._config.options.value),(p=this._config.options)!=null&&p.id&&(o.id=this._config.options.id),typeof((b=this._config.options)==null?void 0:b.placeholder)=="string"&&(o.placeholder=(c=this._config.options)==null?void 0:c.placeholder),e.appendChild(o),o}};function fe(){v(l)}export{i as a,d as b,a as c,l as d,T as e,fe as f};
|
|
7
|
+
//# sourceMappingURL=chunk.YPUWII7L.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/chip-field/chip-field-constants.ts", "../../src/chip-field/chip-field-adapter.ts", "../../src/chip-field/chip-field-foundation.ts", "../../src/chip-field/chip-field.ts", "../../src/chip-field/chip-field-component-delegate.ts", "../../src/chip-field/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}chip-field`;\n\nconst classes = {\n ROOT: 'forge-chip-field'\n};\n\nconst slots = {\n LABEL: 'label',\n HELPER_TEXT: 'helper-text',\n MEMBER: 'member'\n};\n\nconst selectors = {\n ROOT: `.${classes.ROOT}`,\n INPUT_CONTAINER: '.forge-field__input-container',\n INPUT: 'input',\n LABEL: `[slot=${slots.LABEL}]`,\n HELPER_TEXT: `[slot=${slots.HELPER_TEXT}]`,\n MEMBER: `[slot=${slots.MEMBER}]`,\n LABEL_SLOT: `slot[name=${slots.LABEL}]`,\n MEMBER_SLOT: `slot[name=${slots.MEMBER}]`\n};\n\nconst events = {\n MEMBER_ADDED: `${elementName}-member-added`,\n MEMBER_REMOVED: `${elementName}-member-removed`\n};\n\nexport const CHIP_FIELD_CONSTANTS = {\n elementName,\n classes,\n slots,\n selectors,\n events\n};\n\nexport {\n FieldDensityType as ChipFieldDensityType,\n FieldFloatLabelType as ChipFieldFloatLabelType,\n FieldShapeType as ChipFieldShapeType\n} from '../field/field-constants';\n", "import { IChipFieldComponent } from './chip-field';\nimport { getShadowElement } from '@tylertech/forge-core';\nimport { CHIP_FIELD_CONSTANTS } from './chip-field-constants';\nimport { FieldAdapter, IFieldAdapter } from '../field/field-adapter';\n\nexport interface IChipFieldAdapter extends IFieldAdapter {\n // root\n addRootListener(type: string, callback: (event: Event) => void): void;\n removeRootListener(type: string, callback: (event: Event) => void): void;\n\n // member\n addMemberSlotListener(listener: (evt: Event) => void): void;\n removeMemberSlotListener(listener: (evt: Event) => void): void;\n\n addInputContainerListener(type: string, callback: (event: Event) => void): void;\n removeInputContainerListener(type: string, callback: (event: Event) => void): void;\n\n // state selectors\n getSlottedMemberElements(): NodeListOf<HTMLElement>;\n\n // state actions\n focusInput(): void;\n}\n\nexport class ChipFieldAdapter extends FieldAdapter implements IChipFieldAdapter {\n protected _memberSlot: HTMLSlotElement;\n protected _inputContainerElement: HTMLElement;\n\n constructor(component: IChipFieldComponent) {\n super(component);\n }\n\n public initialize(): void {\n super.initialize(CHIP_FIELD_CONSTANTS.selectors.ROOT);\n this._memberSlot = getShadowElement(this._component, CHIP_FIELD_CONSTANTS.selectors.MEMBER_SLOT) as HTMLSlotElement;\n this._inputContainerElement = getShadowElement(this._component, CHIP_FIELD_CONSTANTS.selectors.INPUT_CONTAINER) as HTMLElement;\n }\n\n public addRootListener(type: string, callback: (event: Event) => void): void {\n this._rootElement.addEventListener(type, callback);\n }\n\n public removeRootListener(type: string, callback: (event: Event) => void): void {\n this._rootElement.removeEventListener(type, callback);\n }\n\n public addMemberSlotListener(listener: (evt: Event) => void): void {\n this._memberSlot.addEventListener('slotchange', listener);\n }\n\n public removeMemberSlotListener(listener: (evt: Event) => void): void {\n if (this._memberSlot) {\n this._memberSlot.removeEventListener('slotchange', listener);\n }\n }\n\n public addInputContainerListener(type: string, callback: (event: Event) => void): void {\n this._inputContainerElement.addEventListener(type, callback);\n }\n\n public removeInputContainerListener(type: string, callback: (event: Event) => void): void {\n this._inputContainerElement.removeEventListener(type, callback);\n }\n\n public override fieldHasValue(): boolean {\n const aMemberExists = !!this._component.querySelector(CHIP_FIELD_CONSTANTS.selectors.MEMBER);\n return aMemberExists || super.inputHasValue();\n }\n\n public focusInput(): void {\n if (!this._inputElement) {\n return;\n }\n\n this._inputElement.focus();\n }\n\n public getSlottedMemberElements(): NodeListOf<HTMLElement> {\n return this._component.querySelectorAll<HTMLElement>(CHIP_FIELD_CONSTANTS.selectors.MEMBER);\n }\n}\n", "import { getActiveElement } from '@tylertech/forge-core';\nimport { IChipFieldAdapter } from './chip-field-adapter';\nimport { CHIP_FIELD_CONSTANTS } from './chip-field-constants';\nimport { IFieldFoundation, FieldFoundation } from '../field/field-foundation';\n\nexport interface IChipFieldFoundation extends IFieldFoundation {}\n\nexport class ChipFieldFoundation extends FieldFoundation implements IChipFieldFoundation {\n private _memberSlotListener: () => void;\n private _inputContainerMouseDownListener: (evt: MouseEvent) => void;\n private _handleRootKeyDown: (event: KeyboardEvent) => void;\n private _handleKeyDown: (event: KeyboardEvent) => void;\n\n constructor(protected _adapter: IChipFieldAdapter) {\n super(_adapter);\n this._memberSlotListener = () => this._onMemberSlotChanged();\n this._inputContainerMouseDownListener = evt => this._onInputContainerMouseDown(evt);\n this._handleRootKeyDown = evt => this._onRootKeyDown(evt);\n this._handleKeyDown = evt => this._onKeyDown(evt);\n }\n\n public initialize(): void {\n super.initialize();\n this._adapter.addMemberSlotListener(this._memberSlotListener);\n this._adapter.addInputContainerListener('mousedown', this._inputContainerMouseDownListener);\n this._adapter.addRootListener('keydown', this._handleRootKeyDown);\n this._adapter.addInputListener('keydown', this._handleKeyDown);\n }\n\n public disconnect(): void {\n super.disconnect();\n this._adapter.removeMemberSlotListener(this._memberSlotListener);\n this._adapter.removeInputContainerListener('mousedown', this._inputContainerMouseDownListener);\n this._adapter.removeRootListener('keydown', this._handleRootKeyDown);\n this._adapter.removeInputListener('keydown', this._handleKeyDown);\n }\n\n private _onInputContainerMouseDown(evt: MouseEvent): void {\n evt.preventDefault();\n this._adapter.focusInput();\n }\n\n protected _onBlur(event: Event): void {\n const input = event.target as HTMLInputElement;\n input.value = '';\n super._onBlur(event);\n }\n\n private _onRootKeyDown(event: KeyboardEvent): void {\n if (this._adapter.inputHasValue()) {\n return;\n }\n\n switch (event.key) {\n case 'Right':\n case 'ArrowRight':\n this._focusNextMember();\n break;\n case 'Left':\n case 'ArrowLeft':\n this._focusPreviousMember();\n break;\n case 'Backspace':\n case 'Delete':\n case 'Del':\n this._removeMember();\n break;\n default:\n break;\n }\n }\n\n private _onKeyDown(event: KeyboardEvent): void {\n const input = event.target as HTMLInputElement;\n switch (event.key) {\n case 'Enter':\n this._addMember(input);\n break;\n case 'Esc':\n case 'Escape':\n case 'Tab':\n input.value = '';\n break;\n default:\n break;\n }\n }\n\n private _focusNextMember(): void {\n const members = this._adapter.getSlottedMemberElements();\n if (members.length < 1 || this._adapter.inputHasFocus()) {\n return;\n }\n\n for (let i = 0; i < members.length; i++) {\n const member = members.item(i);\n const nextMember = members.item(i + 1);\n\n if (this._memberIsActive(member)) {\n if (nextMember) {\n nextMember.focus();\n break;\n } else {\n this._adapter.focusInput();\n }\n }\n }\n }\n\n private _focusPreviousMember(): void {\n const members = this._adapter.getSlottedMemberElements();\n if (members.length < 1) {\n return;\n }\n\n if (this._adapter.inputHasFocus()) {\n members[members.length - 1].focus();\n return;\n }\n\n for (let i = 0; i < members.length; i++) {\n const previousMember = members.item(i - 1);\n const member = members.item(i);\n\n if (this._memberIsActive(member) && previousMember) {\n previousMember.focus();\n break;\n }\n }\n }\n\n private _memberIsActive(ele: HTMLElement): boolean {\n return getActiveElement() === ele || ele.hasAttribute('focused');\n }\n\n private _getActiveMember(): HTMLElement | null {\n const members = this._adapter.getSlottedMemberElements();\n\n for (let i = 0; i < members.length; i++) {\n const member = members.item(i);\n if (this._memberIsActive(member)) {\n return member;\n }\n }\n\n return null;\n }\n\n private _addMember(input: HTMLInputElement): void {\n const cleanInputValue = input.value.trim();\n if (cleanInputValue && cleanInputValue.length > 0) {\n this._adapter.emitHostEvent(CHIP_FIELD_CONSTANTS.events.MEMBER_ADDED, cleanInputValue);\n }\n\n input.value = '';\n }\n\n private _removeMember(): void {\n let memberToRemove = this._getActiveMember();\n if (!memberToRemove) {\n const members = this._adapter.getSlottedMemberElements();\n memberToRemove = members.item(members.length - 1);\n }\n\n if (!memberToRemove) {\n return;\n }\n\n this._focusNextMember();\n this._adapter.emitHostEvent(CHIP_FIELD_CONSTANTS.events.MEMBER_REMOVED, memberToRemove);\n }\n\n private _onMemberSlotChanged(): void {\n this.floatLabel(this._adapter.fieldHasValue() || this._adapter.inputHasFocus());\n this._adapter.getSlottedMemberElements().forEach(x => x.tabIndex = -1);\n }\n}\n", "import { CustomElement, attachShadowTemplate } from '@tylertech/forge-core';\nimport { ChipFieldAdapter } from './chip-field-adapter';\nimport { ChipFieldFoundation } from './chip-field-foundation';\nimport { CHIP_FIELD_CONSTANTS } from './chip-field-constants';\nimport { ChipComponent } from '../chips';\nimport { FieldComponent, IFieldComponent } from '../field/field';\n\nconst template = '<template><div class=\\\"forge-chip-field__wrapper\\\" part=\\\"root\\\"><div class=\\\"forge-chip-field forge-field\\\" part=\\\"container\\\"><slot name=\\\"leading\\\"></slot><div class=\\\"forge-field__label-input-container\\\" part=\\\"label-input-container\\\"><slot name=\\\"label\\\"></slot><div class=\\\"forge-field__input-container\\\" part=\\\"input-container\\\"><slot name=\\\"member\\\"></slot><slot></slot></div></div><slot name=\\\"trailing\\\"></slot><div class=\\\"forge-field__addon-end-container\\\" part=\\\"addon-end-container\\\"><slot name=\\\"addon-end\\\"></slot></div></div><slot name=\\\"helper-text\\\"></slot></div></template>';\nconst styles = '.forge-field::before{content:\\\"\\\";display:-webkit-box;display:flex;position:absolute;top:0;right:0;left:0;z-index:-1;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;max-width:100%;height:100%;pointer-events:none;border-style:solid;border-width:1px;-webkit-transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);background-color:transparent;background-color:var(--forge-chip-field-theme-background,transparent);text-align:left}.forge-field[dir=rtl]::before,[dir=rtl] .forge-field::before{text-align:right}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused)::before{border-color:rgba(0,0,0,.38);border-color:var(--mdc-theme-text-icon-on-background,rgba(0,0,0,.38))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused):hover::before{border-color:rgba(0,0,0,.87);border-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled)::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-field--invalid:not(.forge-field--disabled)::before{border-color:#b00020;border-color:var(--mdc-theme-error,#b00020)}.forge-field--invalid:not(.forge-field--disabled):not(.forge-field--focused):hover::before{border-color:#db8a98;border-color:var(--forge-theme-error-hover,#db8a98)}.forge-field--disabled::before{border-color:rgba(0,0,0,.12);border-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--shape-rounded){border-radius:4px}.forge-field:not(.forge-field--shape-rounded)::before{border-radius:4px}.forge-field--shape-rounded{border-radius:28px}.forge-field--shape-rounded::before{border-radius:28px}.forge-field--disabled::before{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5)}.forge-field--focused::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);border-width:2px}.forge-field__label-input-container{position:relative;-webkit-box-flex:1;flex:1 1 0.0001px;height:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;min-width:0}.forge-field ::slotted(label){color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65));pointer-events:none;right:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);font-size:var(--mdc-typography-subtitle1-font-size, 1rem);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.1rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;-webkit-transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field ::slotted(label[dir=rtl]),[dir=rtl] .forge-field ::slotted(label){right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.forge-field--dense:not(.forge-field--roomy) ::slotted(label){display:none}.forge-field--required ::slotted(label)::after{content:none}.forge-field--required ::slotted(label)::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:\\\"*\\\";margin-right:4px}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label){font-size:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(label){font-size:1rem}.forge-field--disabled ::slotted(label){color:rgba(0,0,0,.38);color:var(--forge-theme-label-disabled-on-background,rgba(0,0,0,.38))}.forge-field--invalid:not(.forge-field--disabled) ::slotted(label){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) ::slotted(label){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label){top:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(label){top:1.285rem}.forge-field:not(.forge-field--shape-rounded):not(.forge-field--leading) ::slotted(label){left:12px!important}.forge-field--shape-rounded:not(.forge-field--leading) ::slotted(label){left:32px!important}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end):not(.forge-field--shape-rounded) ::slotted(label){padding-right:12px}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end).forge-field--shape-rounded ::slotted(label){padding-right:32px}.forge-field ::slotted(label.forge-floating-label--float-above){color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65))}.forge-field--disabled ::slotted(label.forge-floating-label--float-above){color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6))}.forge-field--invalid:not(.forge-field--disabled) ::slotted(label.forge-floating-label--float-above){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) ::slotted(label.forge-floating-label--float-above){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--float-above){-webkit-transform:translateY(-.54rem) scale(.8125);transform:translateY(-.54rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--float-above){-webkit-transform:translateY(-.72rem) scale(.8125);transform:translateY(-.72rem) scale(.8125);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe){-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.62rem) scale(1);transform:translateY(-.62rem) scale(1);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe){-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.8rem) scale(1);transform:translateY(-.8rem) scale(1);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--unfloat-above-start-keyframe){-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.62rem) scale(.8125);transform:translateY(-.62rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--unfloat-above-start-keyframe){-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.8rem) scale(.8125);transform:translateY(-.8rem) scale(.8125);cursor:auto}.forge-field~::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;height:auto}.forge-field~::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:\\\"\\\";vertical-align:0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field--roomy:not(.forge-field--dense)~::slotted([slot=helper-text]){font-size:.875rem}.forge-field--dense:not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field~::slotted([slot=helper-text]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled)~::slotted([slot=helper-text]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field:not(.forge-field--shape-rounded)~::slotted([slot=helper-text]){margin-left:12px}.forge-field--shape-rounded~::slotted([slot=helper-text]){margin-left:32px}.forge-field ::slotted([slot=leading]){display:-webkit-box;display:flex;align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=leading]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=leading]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=leading]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=leading]){margin:0 4px}.forge-field ::slotted([slot=leading]:not(forge-icon-button)){padding:6px}.forge-field ::slotted([slot=trailing]){align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=trailing]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=trailing]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=trailing]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=trailing]){margin:0 4px}.forge-field ::slotted([slot=trailing]:not(forge-icon-button)){padding:6px}.forge-field__addon-end-container{display:none}.forge-field--addon-end .forge-field__addon-end-container{height:100%;width:auto;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;padding:0 4px;border-left-width:1px;border-left-style:solid;-webkit-transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.54);border-left-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container:hover{border-left-color:rgba(0,0,0,.87);border-left-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#3f51b5;border-left-color:var(--mdc-theme-primary,#3f51b5)}.forge-field.forge-field--invalid:not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#b00020;border-left-color:var(--mdc-theme-error,#b00020)}.forge-field.forge-field--invalid:not(.forge-field--focused):not(.forge-field--disabled) .forge-field__addon-end-container:hover{border-left-color:#db8a98;border-left-color:var(--forge-theme-error-hover,#db8a98)}.forge-field.forge-field--disabled .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.12);border-left-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=addon-end]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=addon-end]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=addon-end]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-chip-field{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;position:relative;z-index:1;z-index:var(--forge-z-index-surface,1);margin-top:0;margin-top:var(--forge-chip-field-margin-top,0)}.forge-chip-field.forge-field--disabled{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5);cursor:not-allowed}.forge-chip-field .forge-chip-field{display:grid;grid-template-columns:[leading] -webkit-min-content [input] 1fr [trailing] -webkit-min-content [addon-end] -webkit-min-content [end];grid-template-columns:[leading] min-content [input] 1fr [trailing] min-content [addon-end] min-content [end]}.forge-chip-field .forge-chip-field:not(.forge-field--dense):not(.forge-field--roomy){height:auto;min-height:46px;min-height:var(--forge-chip-field-height,46px)}.forge-chip-field .forge-chip-field.forge-field--roomy:not(.forge-field--dense){height:auto;min-height:3.5rem;min-height:var(--forge-chip-field-height,3.5rem)}.forge-chip-field .forge-chip-field.forge-field--dense:not(.forge-field--roomy){height:auto;min-height:1.5rem;min-height:var(--forge-chip-field-height,1.5rem)}.forge-field__label-input-container{grid-column-start:input;grid-column-end:trailing}.forge-field__input-container{-webkit-box-flex:1;flex:1 1 0.0001px;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;flex-wrap:wrap;-webkit-box-align:start;align-items:flex-start;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-field__input-container{padding:2px 12px}.forge-field--label .forge-field__input-container{padding-top:22px}.forge-field--roomy.forge-field--label .forge-field__input-container{padding-top:22px}.forge-field--shape-rounded:not(.forge-field--leading) .forge-field__input-container{padding-left:32px}.forge-field--leading:not(.forge-field--shape-rounded) .forge-field__input-container{padding-left:0}.forge-field--shape-rounded.forge-field--leading .forge-field__input-container{padding-left:0}.forge-field--label .forge-field__input-container{padding-bottom:2px}.forge-field--roomy.forge-field--label .forge-field__input-container{padding-bottom:2px}.forge-field--shape-rounded:not(.forge-field--trailing):not(.forge-field--addon-end) .forge-field__input-container{padding-right:32px}.forge-field--addon-end:not(.forge-field--shape-rounded) .forge-field__input-container,.forge-field--trailing:not(.forge-field--shape-rounded) .forge-field__input-container{padding-right:0}.forge-field--shape-rounded.forge-field--addon-end .forge-field__input-container,.forge-field--shape-rounded.forge-field--trailing .forge-field__input-container{padding-right:0}.forge-field ::slotted([slot=member]){display:block}.forge-field--disabled ::slotted([slot=member]){--mdc-theme-primary:rgba(0, 0, 0, 0.38);--mdc-theme-primary:var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38));cursor:not-allowed;pointer-events:none}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=member]){margin:2px 8px 2px 0}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=member]){margin:6px 12px 6px 0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=member]){margin:2px 6px 2px 0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=member]){--forge-chip-min-height:20px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=member]){--forge-chip-min-height:16px}.forge-field ::slotted(input){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);align-self:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;-webkit-transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);border:none;background:0 0;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;line-height:normal;min-width:0}.forge-field ::slotted(input)::-webkit-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::-moz-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input):-ms-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::-ms-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input):invalid{-webkit-box-shadow:none;box-shadow:none}.forge-field ::slotted(input):-webkit-autofill{z-index:auto!important}.forge-field:not(.forge-field--disabled) ::slotted(input){color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--disabled ::slotted(input){color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6));cursor:not-allowed}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){font-size:1rem;font-size:var(--forge-chip-field-font-size, 1rem)}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){font-size:1rem;font-size:var(--forge-chip-field-font-size, 1rem)}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){font-size:.875rem;font-size:var(--forge-chip-field-font-size, .875rem)}.forge-field ::slotted(input){-webkit-box-flex:1;flex:1 1 0.0001px;min-width:40px;display:block;align-self:flex-start;padding:0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){margin:4px 0}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){margin:6px 0}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){margin:2px 0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){height:1rem;line-height:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){height:1.25rem;line-height:1.25rem}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){height:1rem;line-height:1rem}.forge-field ::slotted([slot=leading]){grid-column-start:leading;grid-column-end:input;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=leading]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=leading]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=leading]){margin-top:0;margin-bottom:0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=leading]){padding-top:0;padding-bottom:0}.forge-field ::slotted([slot=trailing]){grid-column-start:trailing;grid-column-end:addon-end;display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=trailing]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=trailing]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=trailing]){margin-top:0;margin-bottom:0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=trailing]){padding-top:0;padding-bottom:0}.forge-field--addon-end .forge-field__addon-end-container{grid-column-start:addon-end;grid-column-end:end;display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=addon-end]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=addon-end]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=addon-end]){margin-top:0;margin-bottom:0}.forge-field ::slotted(forge-icon-button){display:-webkit-inline-box!important;display:inline-flex!important}:host{display:block;contain:layout}:host([hidden]){display:none}';\n\nexport interface IChipFieldComponent extends IFieldComponent { }\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-chip-field': IChipFieldComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-chip-field-member-added': CustomEvent<string>;\n 'forge-chip-field-member-removed': CustomEvent<HTMLElement>;\n }\n}\n\n/**\n * The web component class behind the `<forge-chip-field>` custom element.\n * \n * @tag forge-chip-field\n */\n@CustomElement({\n name: CHIP_FIELD_CONSTANTS.elementName,\n dependencies: [ChipComponent]\n})\nexport class ChipFieldComponent extends FieldComponent<ChipFieldFoundation> implements IChipFieldComponent {\n constructor() {\n super();\n attachShadowTemplate(this, template, styles);\n this._foundation = new ChipFieldFoundation(new ChipFieldAdapter(this));\n }\n}\n", "import { IBaseComponentDelegateConfig } from '../core/delegates/base-component-delegate';\nimport { FormFieldComponentDelegate, IFormFieldComponentDelegateOptions } from '../core/delegates/form-field-component-delegate';\nimport { IChipFieldComponent } from './chip-field';\nimport { CHIP_FIELD_CONSTANTS } from './chip-field-constants';\n\nexport type ChipFieldComponentDelegateProps = Partial<IChipFieldComponent>;\nexport interface IChipFieldComponentDelegateOptions extends IFormFieldComponentDelegateOptions {\n id?: string;\n label?: string;\n type?: string;\n value?: string;\n helperText?: string;\n placeholder?: string;\n leadingElement?: HTMLElement;\n trailingElement?: HTMLElement;\n}\nexport interface IChipFieldComponentDelegateConfig extends IBaseComponentDelegateConfig<IChipFieldComponent, IChipFieldComponentDelegateOptions> {}\n\nexport class ChipFieldComponentDelegate extends FormFieldComponentDelegate<IChipFieldComponent, IChipFieldComponentDelegateOptions> {\n private _inputElement: HTMLInputElement;\n private _labelElement: HTMLLabelElement | undefined;\n private _helperTextElement: HTMLSpanElement | undefined;\n\n constructor(config?: IChipFieldComponentDelegateConfig) {\n super(config);\n }\n\n protected _build(): IChipFieldComponent {\n const chipField = document.createElement(CHIP_FIELD_CONSTANTS.elementName);\n\n this._inputElement = this._buildInputElement(chipField);\n\n if (this._config.options?.leadingElement) {\n this._config.options.leadingElement.slot = 'leading';\n chipField.appendChild(this._config.options.leadingElement);\n }\n if (this._config.options?.trailingElement) {\n this._config.options.trailingElement.slot = 'trailing';\n chipField.appendChild(this._config.options.trailingElement);\n }\n\n chipField.appendChild(this._inputElement);\n return chipField;\n }\n\n protected override _configure(): void {\n if (this._config.options?.helperText) {\n this.setHelperText(this._config.options.helperText);\n }\n if (typeof this._config.options?.label === 'string') {\n this._createLabel(this._config.options.label);\n }\n }\n\n public get value(): string {\n return this._inputElement.value;\n }\n public set value(value: string) {\n this._inputElement.value = value;\n }\n\n public get disabled(): boolean {\n return this._inputElement.disabled;\n }\n public set disabled(value: boolean) {\n this._inputElement.disabled = value;\n }\n\n public get invalid(): boolean {\n return this._element.invalid || false;\n }\n public set invalid(value: boolean) {\n this._element.invalid = value;\n }\n\n public get inputElement(): HTMLInputElement {\n return this._inputElement;\n }\n\n public get labelElement(): HTMLLabelElement | undefined {\n return this._labelElement;\n }\n\n public onChange(listener: (value: string) => void): void {\n this._inputElement.addEventListener('input', evt => listener((evt.target as HTMLInputElement).value));\n }\n\n public onFocus(listener: (evt: Event) => void): void {\n this._inputElement.addEventListener('focus', evt => listener(evt));\n }\n\n public onBlur(listener: (evt: Event) => void): void {\n this._inputElement.addEventListener('blur', evt => listener(evt));\n }\n\n public setLabel(text: string | null): void {\n if (text) {\n if (this._labelElement) {\n this._labelElement.textContent = text;\n } else {\n this._createLabel(text);\n }\n } else if (this._labelElement) {\n this._element.removeChild(this._labelElement);\n this._labelElement = undefined;\n }\n }\n\n public setHelperText(text: string | null): void {\n if (text) {\n if (!this._helperTextElement) {\n this._helperTextElement = document.createElement('span');\n this._helperTextElement.slot = 'helper-text';\n this._element.appendChild(this._helperTextElement);\n }\n this._helperTextElement.textContent = text;\n } else if (this._helperTextElement) {\n this._element.removeChild(this._helperTextElement);\n this._helperTextElement = undefined;\n }\n }\n\n public floatLabel(value: boolean): void {\n this._element.floatLabel(value);\n }\n\n private _createLabel(text: string): void {\n this._labelElement = document.createElement('label');\n this._labelElement.textContent = text;\n if (this._config.options?.id) {\n this._labelElement.setAttribute('for', this._config.options.id);\n }\n this._element.appendChild(this._labelElement);\n }\n\n private _buildInputElement(chipField: IChipFieldComponent): HTMLInputElement {\n const inputElement = document.createElement('input');\n inputElement.type = this._config.options?.type || 'text';\n\n if (this._config.options?.value !== undefined) {\n inputElement.value = this._config.options.value;\n }\n if (this._config.options?.id) {\n inputElement.id = this._config.options.id;\n }\n if (typeof this._config.options?.placeholder === 'string') {\n inputElement.placeholder = this._config.options?.placeholder;\n }\n\n chipField.appendChild(inputElement);\n return inputElement;\n }\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { ChipFieldComponent } from './chip-field';\n\nexport * from './chip-field-adapter';\nexport * from './chip-field-component-delegate';\nexport * from './chip-field-constants';\nexport * from './chip-field-foundation';\nexport * from './chip-field';\n\nexport function defineChipFieldComponent(): void {\n defineCustomElement(ChipFieldComponent);\n}\n"],
|
|
5
|
-
"mappings": "2TAEA,GAAM,GAA2C,GAAG,cAE9C,EAAU,CACd,KAAM,kBACR,EAEM,EAAQ,CACZ,MAAO,QACP,YAAa,cACb,OAAQ,QACV,EAEM,EAAY,CAChB,KAAM,IAAI,EAAQ,OAClB,gBAAiB,gCACjB,MAAO,QACP,MAAO,SAAS,EAAM,SACtB,YAAa,SAAS,EAAM,eAC5B,OAAQ,SAAS,EAAM,UACvB,WAAY,aAAa,EAAM,SAC/B,YAAa,aAAa,EAAM,SAClC,EAEM,EAAS,CACb,aAAc,GAAG,iBACjB,eAAgB,GAAG,kBACrB,EAEa,EAAuB,CAClC,cACA,UACA,QACA,YACA,QACF,ECZO,GAAM,GAAN,aAA+B,EAA0C,CAI9E,YAAY,EAAgC,CAC1C,MAAM,CAAS,CACjB,CAEA,AAAO,YAAmB,CACxB,MAAM,WAAW,EAAqB,UAAU,IAAI,EACpD,KAAK,YAAc,EAAiB,KAAK,WAAY,EAAqB,UAAU,WAAW,EAC/F,KAAK,uBAAyB,EAAiB,KAAK,WAAY,EAAqB,UAAU,eAAe,CAChH,CAEA,AAAO,gBAAgB,EAAc,EAAwC,CAC3E,KAAK,aAAa,iBAAiB,EAAM,CAAQ,CACnD,CAEA,AAAO,mBAAmB,EAAc,EAAwC,CAC9E,KAAK,aAAa,oBAAoB,EAAM,CAAQ,CACtD,CAEA,AAAO,sBAAsB,EAAsC,CACjE,KAAK,YAAY,iBAAiB,aAAc,CAAQ,CAC1D,CAEA,AAAO,yBAAyB,EAAsC,CACpE,AAAI,KAAK,aACP,KAAK,YAAY,oBAAoB,aAAc,CAAQ,CAE/D,CAEA,AAAO,0BAA0B,EAAc,EAAwC,CACrF,KAAK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,AAAQ,kBAAuC,CAC7C,GAAM,GAAU,KAAK,SAAS,yBAAyB,EAEvD,OAAS,GAAI,EAAG,EAAI,EAAQ,OAAQ,IAAK,CACvC,GAAM,GAAS,EAAQ,KAAK,CAAC,EAC7B,GAAI,KAAK,gBAAgB,CAAM,EAC7B,MAAO,EAEX,CAEA,MAAO,KACT,CAEA,AAAQ,WAAW,EAA+B,CAChD,GAAM,GAAkB,EAAM,MAAM,KAAK,EACzC,AAAI,GAAmB,EAAgB,OAAS,GAC9C,KAAK,SAAS,cAAc,EAAqB,OAAO,aAAc,CAAe,EAGvF,EAAM,MAAQ,EAChB,CAEA,AAAQ,eAAsB,CAC5B,GAAI,GAAiB,KAAK,iBAAiB,EAC3C,GAAI,CAAC,EAAgB,CACnB,GAAM,GAAU,KAAK,SAAS,yBAAyB,EACvD,EAAiB,EAAQ,KAAK,EAAQ,OAAS,CAAC,CAClD,CAEA,AAAI,CAAC,GAIL,MAAK,iBAAiB,EACtB,KAAK,SAAS,cAAc,EAAqB,OAAO,eAAgB,CAAc,EACxF,CAEA,AAAQ,sBAA6B,CACnC,KAAK,WAAW,KAAK,SAAS,cAAc,GAAK,KAAK,SAAS,cAAc,CAAC,EAC9E,KAAK,SAAS,yBAAyB,EAAE,QAAQ,GAAK,EAAE,SAAW,EAAE,CACvE,CACF,ECzKA,GAAM,GAAW,ojBACX,EAAS,
|
|
4
|
+
"sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}chip-field`;\n\nconst classes = {\n ROOT: 'forge-chip-field'\n};\n\nconst slots = {\n LABEL: 'label',\n HELPER_TEXT: 'helper-text',\n MEMBER: 'member'\n};\n\nconst selectors = {\n ROOT: `.${classes.ROOT}`,\n INPUT_CONTAINER: '.forge-field__input-container',\n INPUT: 'input',\n LABEL: `[slot=${slots.LABEL}]`,\n HELPER_TEXT: `[slot=${slots.HELPER_TEXT}]`,\n MEMBER: `[slot=${slots.MEMBER}]`,\n LABEL_SLOT: `slot[name=${slots.LABEL}]`,\n MEMBER_SLOT: `slot[name=${slots.MEMBER}]`\n};\n\nconst events = {\n MEMBER_ADDED: `${elementName}-member-added`,\n MEMBER_REMOVED: `${elementName}-member-removed`\n};\n\nexport const CHIP_FIELD_CONSTANTS = {\n elementName,\n classes,\n slots,\n selectors,\n events\n};\n\nexport {\n FieldDensityType as ChipFieldDensityType,\n FieldFloatLabelType as ChipFieldFloatLabelType,\n FieldShapeType as ChipFieldShapeType\n} from '../field/field-constants';\n", "import { IChipFieldComponent } from './chip-field';\nimport { getShadowElement } from '@tylertech/forge-core';\nimport { CHIP_FIELD_CONSTANTS } from './chip-field-constants';\nimport { FieldAdapter, IFieldAdapter } from '../field/field-adapter';\n\nexport interface IChipFieldAdapter extends IFieldAdapter {\n // root\n addRootListener(type: string, callback: (event: Event) => void): void;\n removeRootListener(type: string, callback: (event: Event) => void): void;\n\n // member\n addMemberSlotListener(listener: (evt: Event) => void): void;\n removeMemberSlotListener(listener: (evt: Event) => void): void;\n\n addInputContainerListener(type: string, callback: (event: Event) => void): void;\n removeInputContainerListener(type: string, callback: (event: Event) => void): void;\n\n // state selectors\n getSlottedMemberElements(): NodeListOf<HTMLElement>;\n\n // state actions\n focusInput(): void;\n}\n\nexport class ChipFieldAdapter extends FieldAdapter implements IChipFieldAdapter {\n protected _memberSlot: HTMLSlotElement;\n protected _inputContainerElement: HTMLElement;\n\n constructor(component: IChipFieldComponent) {\n super(component);\n }\n\n public initialize(): void {\n super.initialize(CHIP_FIELD_CONSTANTS.selectors.ROOT);\n this._memberSlot = getShadowElement(this._component, CHIP_FIELD_CONSTANTS.selectors.MEMBER_SLOT) as HTMLSlotElement;\n this._inputContainerElement = getShadowElement(this._component, CHIP_FIELD_CONSTANTS.selectors.INPUT_CONTAINER) as HTMLElement;\n }\n\n public addRootListener(type: string, callback: (event: Event) => void): void {\n this._rootElement.addEventListener(type, callback);\n }\n\n public removeRootListener(type: string, callback: (event: Event) => void): void {\n this._rootElement.removeEventListener(type, callback);\n }\n\n public addMemberSlotListener(listener: (evt: Event) => void): void {\n this._memberSlot.addEventListener('slotchange', listener);\n }\n\n public removeMemberSlotListener(listener: (evt: Event) => void): void {\n if (this._memberSlot) {\n this._memberSlot.removeEventListener('slotchange', listener);\n }\n }\n\n public addInputContainerListener(type: string, callback: (event: Event) => void): void {\n this._inputContainerElement.addEventListener(type, callback);\n }\n\n public removeInputContainerListener(type: string, callback: (event: Event) => void): void {\n this._inputContainerElement.removeEventListener(type, callback);\n }\n\n public override fieldHasValue(): boolean {\n const aMemberExists = !!this._component.querySelector(CHIP_FIELD_CONSTANTS.selectors.MEMBER);\n return aMemberExists || super.inputHasValue();\n }\n\n public focusInput(): void {\n if (!this._inputElement) {\n return;\n }\n\n this._inputElement.focus();\n }\n\n public getSlottedMemberElements(): NodeListOf<HTMLElement> {\n return this._component.querySelectorAll<HTMLElement>(CHIP_FIELD_CONSTANTS.selectors.MEMBER);\n }\n}\n", "import { getActiveElement } from '@tylertech/forge-core';\nimport { IChipFieldAdapter } from './chip-field-adapter';\nimport { CHIP_FIELD_CONSTANTS } from './chip-field-constants';\nimport { IFieldFoundation, FieldFoundation } from '../field/field-foundation';\n\nexport interface IChipFieldFoundation extends IFieldFoundation {}\n\nexport class ChipFieldFoundation extends FieldFoundation implements IChipFieldFoundation {\n private _memberSlotListener: () => void;\n private _inputContainerMouseDownListener: (evt: MouseEvent) => void;\n private _handleRootKeyDown: (event: KeyboardEvent) => void;\n private _handleKeyDown: (event: KeyboardEvent) => void;\n\n constructor(protected _adapter: IChipFieldAdapter) {\n super(_adapter);\n this._memberSlotListener = () => this._onMemberSlotChanged();\n this._inputContainerMouseDownListener = evt => this._onInputContainerMouseDown(evt);\n this._handleRootKeyDown = evt => this._onRootKeyDown(evt);\n this._handleKeyDown = evt => this._onKeyDown(evt);\n }\n\n public initialize(): void {\n super.initialize();\n this._adapter.addMemberSlotListener(this._memberSlotListener);\n this._adapter.addInputContainerListener('mousedown', this._inputContainerMouseDownListener);\n this._adapter.addRootListener('keydown', this._handleRootKeyDown);\n this._adapter.addInputListener('keydown', this._handleKeyDown);\n }\n\n public disconnect(): void {\n super.disconnect();\n this._adapter.removeMemberSlotListener(this._memberSlotListener);\n this._adapter.removeInputContainerListener('mousedown', this._inputContainerMouseDownListener);\n this._adapter.removeRootListener('keydown', this._handleRootKeyDown);\n this._adapter.removeInputListener('keydown', this._handleKeyDown);\n }\n\n private _onInputContainerMouseDown(evt: MouseEvent): void {\n evt.preventDefault();\n this._adapter.focusInput();\n }\n\n protected _onBlur(event: Event): void {\n const input = event.target as HTMLInputElement;\n input.value = '';\n super._onBlur(event);\n }\n\n private _onRootKeyDown(event: KeyboardEvent): void {\n if (this._adapter.inputHasValue()) {\n return;\n }\n\n switch (event.key) {\n case 'Right':\n case 'ArrowRight':\n this._focusNextMember();\n break;\n case 'Left':\n case 'ArrowLeft':\n this._focusPreviousMember();\n break;\n case 'Backspace':\n case 'Delete':\n case 'Del':\n this._removeMember();\n break;\n default:\n break;\n }\n }\n\n private _onKeyDown(event: KeyboardEvent): void {\n const input = event.target as HTMLInputElement;\n switch (event.key) {\n case 'Enter':\n this._addMember(input);\n break;\n case 'Esc':\n case 'Escape':\n case 'Tab':\n input.value = '';\n break;\n default:\n break;\n }\n }\n\n private _focusNextMember(): void {\n const members = this._adapter.getSlottedMemberElements();\n if (members.length < 1 || this._adapter.inputHasFocus()) {\n return;\n }\n\n for (let i = 0; i < members.length; i++) {\n const member = members.item(i);\n const nextMember = members.item(i + 1);\n\n if (this._memberIsActive(member)) {\n if (nextMember) {\n nextMember.focus();\n break;\n } else {\n this._adapter.focusInput();\n }\n }\n }\n }\n\n private _focusPreviousMember(): void {\n const members = this._adapter.getSlottedMemberElements();\n if (members.length < 1) {\n return;\n }\n\n if (this._adapter.inputHasFocus()) {\n members[members.length - 1].focus();\n return;\n }\n\n for (let i = 0; i < members.length; i++) {\n const previousMember = members.item(i - 1);\n const member = members.item(i);\n\n if (this._memberIsActive(member) && previousMember) {\n previousMember.focus();\n break;\n }\n }\n }\n\n private _memberIsActive(ele: HTMLElement): boolean {\n return getActiveElement() === ele || ele.hasAttribute('focused');\n }\n\n private _getActiveMember(): HTMLElement | null {\n const members = this._adapter.getSlottedMemberElements();\n\n for (let i = 0; i < members.length; i++) {\n const member = members.item(i);\n if (this._memberIsActive(member)) {\n return member;\n }\n }\n\n return null;\n }\n\n private _addMember(input: HTMLInputElement): void {\n const cleanInputValue = input.value.trim();\n if (cleanInputValue && cleanInputValue.length > 0) {\n this._adapter.emitHostEvent(CHIP_FIELD_CONSTANTS.events.MEMBER_ADDED, cleanInputValue);\n }\n\n input.value = '';\n }\n\n private _removeMember(): void {\n let memberToRemove = this._getActiveMember();\n if (!memberToRemove) {\n const members = this._adapter.getSlottedMemberElements();\n memberToRemove = members.item(members.length - 1);\n }\n\n if (!memberToRemove) {\n return;\n }\n\n this._focusNextMember();\n this._adapter.emitHostEvent(CHIP_FIELD_CONSTANTS.events.MEMBER_REMOVED, memberToRemove);\n }\n\n private _onMemberSlotChanged(): void {\n this.floatLabel(this._adapter.fieldHasValue() || this._adapter.inputHasFocus());\n this._adapter.getSlottedMemberElements().forEach(x => x.tabIndex = -1);\n }\n}\n", "import { CustomElement, attachShadowTemplate } from '@tylertech/forge-core';\nimport { ChipFieldAdapter } from './chip-field-adapter';\nimport { ChipFieldFoundation } from './chip-field-foundation';\nimport { CHIP_FIELD_CONSTANTS } from './chip-field-constants';\nimport { ChipComponent } from '../chips';\nimport { FieldComponent, IFieldComponent } from '../field/field';\n\nconst template = '<template><div class=\\\"forge-chip-field__wrapper\\\" part=\\\"root\\\"><div class=\\\"forge-chip-field forge-field\\\" part=\\\"container\\\"><slot name=\\\"leading\\\"></slot><div class=\\\"forge-field__label-input-container\\\" part=\\\"label-input-container\\\"><slot name=\\\"label\\\"></slot><div class=\\\"forge-field__input-container\\\" part=\\\"input-container\\\"><slot name=\\\"member\\\"></slot><slot></slot></div></div><slot name=\\\"trailing\\\"></slot><div class=\\\"forge-field__addon-end-container\\\" part=\\\"addon-end-container\\\"><slot name=\\\"addon-end\\\"></slot></div></div><slot name=\\\"helper-text\\\"></slot></div></template>';\nconst styles = '.forge-field::before{content:\\\"\\\";display:-webkit-box;display:flex;position:absolute;top:0;right:0;left:0;z-index:-1;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;max-width:100%;height:100%;pointer-events:none;border-style:solid;border-width:1px;-webkit-transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);background-color:transparent;background-color:var(--forge-chip-field-theme-background,transparent);text-align:left}.forge-field[dir=rtl]::before,[dir=rtl] .forge-field::before{text-align:right}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused)::before{border-color:rgba(0,0,0,.38);border-color:var(--mdc-theme-text-icon-on-background,rgba(0,0,0,.38))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused):hover::before{border-color:rgba(0,0,0,.87);border-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled)::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-field--invalid:not(.forge-field--disabled)::before{border-color:#b00020;border-color:var(--mdc-theme-error,#b00020)}.forge-field--invalid:not(.forge-field--disabled):not(.forge-field--focused):hover::before{border-color:#db8a98;border-color:var(--forge-theme-error-hover,#db8a98)}.forge-field--disabled::before{border-color:rgba(0,0,0,.12);border-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--shape-rounded){border-radius:4px}.forge-field:not(.forge-field--shape-rounded)::before{border-radius:4px}.forge-field--shape-rounded{border-radius:28px}.forge-field--shape-rounded::before{border-radius:28px}.forge-field--disabled::before{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5)}.forge-field--focused::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);border-width:2px}.forge-field__label-input-container{position:relative;-webkit-box-flex:1;flex:1 1 0.0001px;height:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;min-width:0}.forge-field ::slotted(label){color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65));pointer-events:none;right:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);font-size:var(--mdc-typography-subtitle1-font-size, 1rem);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.1rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;-webkit-transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field ::slotted(label[dir=rtl]),[dir=rtl] .forge-field ::slotted(label){right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.forge-field--dense:not(.forge-field--roomy) ::slotted(label){display:none}.forge-field--required ::slotted(label)::after{content:none}.forge-field--required ::slotted(label)::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:\\\"*\\\";margin-right:4px}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label){font-size:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(label){font-size:1rem}.forge-field--disabled ::slotted(label){color:rgba(0,0,0,.38);color:var(--forge-theme-label-disabled-on-background,rgba(0,0,0,.38))}.forge-field--invalid:not(.forge-field--disabled) ::slotted(label){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) ::slotted(label){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label){top:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(label){top:1.285rem}.forge-field:not(.forge-field--shape-rounded):not(.forge-field--leading) ::slotted(label){left:12px!important}.forge-field--shape-rounded:not(.forge-field--leading) ::slotted(label){left:32px!important}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end):not(.forge-field--shape-rounded) ::slotted(label){padding-right:12px}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end).forge-field--shape-rounded ::slotted(label){padding-right:32px}.forge-field ::slotted(label.forge-floating-label--float-above){color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65))}.forge-field--disabled ::slotted(label.forge-floating-label--float-above){color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6))}.forge-field--invalid:not(.forge-field--disabled) ::slotted(label.forge-floating-label--float-above){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) ::slotted(label.forge-floating-label--float-above){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--float-above){-webkit-transform:translateY(-.54rem) scale(.8125);transform:translateY(-.54rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--float-above){-webkit-transform:translateY(-.72rem) scale(.8125);transform:translateY(-.72rem) scale(.8125);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe){-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.62rem) scale(1);transform:translateY(-.62rem) scale(1);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe){-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.8rem) scale(1);transform:translateY(-.8rem) scale(1);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(label.forge-floating-label--unfloat-above-start-keyframe){-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.62rem) scale(.8125);transform:translateY(-.62rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) ::slotted(label.forge-floating-label--unfloat-above-start-keyframe){-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.8rem) scale(.8125);transform:translateY(-.8rem) scale(.8125);cursor:auto}.forge-field~::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-field:not(.forge-field--dense):not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field--roomy:not(.forge-field--dense)~::slotted([slot=helper-text]){font-size:.875rem}.forge-field--dense:not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field~::slotted([slot=helper-text]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled)~::slotted([slot=helper-text]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field:not(.forge-field--shape-rounded)~::slotted([slot=helper-text]){margin-left:12px}.forge-field--shape-rounded~::slotted([slot=helper-text]){margin-left:32px}.forge-field ::slotted([slot=leading]){display:-webkit-box;display:flex;align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=leading]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=leading]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=leading]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=leading]){margin:0 4px}.forge-field ::slotted([slot=leading]:not(forge-icon-button)){padding:6px}.forge-field ::slotted([slot=trailing]){align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=trailing]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=trailing]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=trailing]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=trailing]){margin:0 4px}.forge-field ::slotted([slot=trailing]:not(forge-icon-button)){padding:6px}.forge-field__addon-end-container{display:none}.forge-field--addon-end .forge-field__addon-end-container{height:100%;width:auto;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;padding:0 4px;border-left-width:1px;border-left-style:solid;-webkit-transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.54);border-left-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container:hover{border-left-color:rgba(0,0,0,.87);border-left-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#3f51b5;border-left-color:var(--mdc-theme-primary,#3f51b5)}.forge-field.forge-field--invalid:not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#b00020;border-left-color:var(--mdc-theme-error,#b00020)}.forge-field.forge-field--invalid:not(.forge-field--focused):not(.forge-field--disabled) .forge-field__addon-end-container:hover{border-left-color:#db8a98;border-left-color:var(--forge-theme-error-hover,#db8a98)}.forge-field.forge-field--disabled .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.12);border-left-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=addon-end]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=addon-end]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=addon-end]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-chip-field{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;position:relative;z-index:1;z-index:var(--forge-z-index-surface,1);margin-top:0;margin-top:var(--forge-chip-field-margin-top,0)}.forge-chip-field.forge-field--disabled{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5);cursor:not-allowed}.forge-chip-field .forge-chip-field{display:grid;grid-template-columns:[leading] -webkit-min-content [input] 1fr [trailing] -webkit-min-content [addon-end] -webkit-min-content [end];grid-template-columns:[leading] min-content [input] 1fr [trailing] min-content [addon-end] min-content [end]}.forge-chip-field .forge-chip-field:not(.forge-field--dense):not(.forge-field--roomy){height:auto;min-height:46px;min-height:var(--forge-chip-field-height,46px)}.forge-chip-field .forge-chip-field.forge-field--roomy:not(.forge-field--dense){height:auto;min-height:3.5rem;min-height:var(--forge-chip-field-height,3.5rem)}.forge-chip-field .forge-chip-field.forge-field--dense:not(.forge-field--roomy){height:auto;min-height:1.5rem;min-height:var(--forge-chip-field-height,1.5rem)}.forge-field__label-input-container{grid-column-start:input;grid-column-end:trailing}.forge-field__input-container{-webkit-box-flex:1;flex:1 1 0.0001px;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;flex-wrap:wrap;-webkit-box-align:start;align-items:flex-start;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-field__input-container{padding:2px 12px}.forge-field--label .forge-field__input-container{padding-top:22px}.forge-field--roomy.forge-field--label .forge-field__input-container{padding-top:22px}.forge-field--shape-rounded:not(.forge-field--leading) .forge-field__input-container{padding-left:32px}.forge-field--leading:not(.forge-field--shape-rounded) .forge-field__input-container{padding-left:0}.forge-field--shape-rounded.forge-field--leading .forge-field__input-container{padding-left:0}.forge-field--label .forge-field__input-container{padding-bottom:2px}.forge-field--roomy.forge-field--label .forge-field__input-container{padding-bottom:2px}.forge-field--shape-rounded:not(.forge-field--trailing):not(.forge-field--addon-end) .forge-field__input-container{padding-right:32px}.forge-field--addon-end:not(.forge-field--shape-rounded) .forge-field__input-container,.forge-field--trailing:not(.forge-field--shape-rounded) .forge-field__input-container{padding-right:0}.forge-field--shape-rounded.forge-field--addon-end .forge-field__input-container,.forge-field--shape-rounded.forge-field--trailing .forge-field__input-container{padding-right:0}.forge-field ::slotted([slot=member]){display:block}.forge-field--disabled ::slotted([slot=member]){--mdc-theme-primary:rgba(0, 0, 0, 0.38);--mdc-theme-primary:var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38));cursor:not-allowed;pointer-events:none}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=member]){margin:2px 8px 2px 0}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=member]){margin:6px 12px 6px 0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=member]){margin:2px 6px 2px 0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=member]){--forge-chip-min-height:20px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=member]){--forge-chip-min-height:16px}.forge-field ::slotted(input){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);align-self:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;-webkit-transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);border:none;background:0 0;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;line-height:normal;min-width:0}.forge-field ::slotted(input)::-webkit-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::-moz-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input):-ms-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::-ms-input-placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input)::placeholder{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field ::slotted(input):invalid{-webkit-box-shadow:none;box-shadow:none}.forge-field ::slotted(input):-webkit-autofill{z-index:auto!important}.forge-field:not(.forge-field--disabled) ::slotted(input){color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--disabled ::slotted(input){color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6));cursor:not-allowed}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){font-size:1rem;font-size:var(--forge-chip-field-font-size, 1rem)}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){font-size:1rem;font-size:var(--forge-chip-field-font-size, 1rem)}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){font-size:.875rem;font-size:var(--forge-chip-field-font-size, .875rem)}.forge-field ::slotted(input){-webkit-box-flex:1;flex:1 1 0.0001px;min-width:40px;display:block;align-self:flex-start;padding:0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){margin:4px 0}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){margin:6px 0}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){margin:2px 0}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted(input){height:1rem;line-height:1rem}.forge-field--roomy:not(.forge-field--dense) ::slotted(input){height:1.25rem;line-height:1.25rem}.forge-field--dense:not(.forge-field--roomy) ::slotted(input){height:1rem;line-height:1rem}.forge-field ::slotted([slot=leading]){grid-column-start:leading;grid-column-end:input;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=leading]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=leading]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=leading]){margin-top:0;margin-bottom:0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=leading]){padding-top:0;padding-bottom:0}.forge-field ::slotted([slot=trailing]){grid-column-start:trailing;grid-column-end:addon-end;display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=trailing]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=trailing]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=trailing]){margin-top:0;margin-bottom:0}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=trailing]){padding-top:0;padding-bottom:0}.forge-field--addon-end .forge-field__addon-end-container{grid-column-start:addon-end;grid-column-end:end;display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;align-self:flex-start}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) ::slotted([slot=addon-end]){margin-top:5px;margin-bottom:5px}.forge-field--roomy:not(.forge-field--dense) ::slotted([slot=addon-end]){margin-top:10px;margin-bottom:10px}.forge-field--dense:not(.forge-field--roomy) ::slotted([slot=addon-end]){margin-top:0;margin-bottom:0}.forge-field ::slotted(forge-icon-button){display:-webkit-inline-box!important;display:inline-flex!important}:host{display:block;contain:layout}:host([hidden]){display:none}';\n\nexport interface IChipFieldComponent extends IFieldComponent { }\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-chip-field': IChipFieldComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-chip-field-member-added': CustomEvent<string>;\n 'forge-chip-field-member-removed': CustomEvent<HTMLElement>;\n }\n}\n\n/**\n * The web component class behind the `<forge-chip-field>` custom element.\n * \n * @tag forge-chip-field\n */\n@CustomElement({\n name: CHIP_FIELD_CONSTANTS.elementName,\n dependencies: [ChipComponent]\n})\nexport class ChipFieldComponent extends FieldComponent<ChipFieldFoundation> implements IChipFieldComponent {\n constructor() {\n super();\n attachShadowTemplate(this, template, styles);\n this._foundation = new ChipFieldFoundation(new ChipFieldAdapter(this));\n }\n}\n", "import { IBaseComponentDelegateConfig } from '../core/delegates/base-component-delegate';\nimport { FormFieldComponentDelegate, IFormFieldComponentDelegateOptions } from '../core/delegates/form-field-component-delegate';\nimport { IChipFieldComponent } from './chip-field';\nimport { CHIP_FIELD_CONSTANTS } from './chip-field-constants';\n\nexport type ChipFieldComponentDelegateProps = Partial<IChipFieldComponent>;\nexport interface IChipFieldComponentDelegateOptions extends IFormFieldComponentDelegateOptions {\n id?: string;\n label?: string;\n type?: string;\n value?: string;\n helperText?: string;\n placeholder?: string;\n leadingElement?: HTMLElement;\n trailingElement?: HTMLElement;\n}\nexport interface IChipFieldComponentDelegateConfig extends IBaseComponentDelegateConfig<IChipFieldComponent, IChipFieldComponentDelegateOptions> {}\n\nexport class ChipFieldComponentDelegate extends FormFieldComponentDelegate<IChipFieldComponent, IChipFieldComponentDelegateOptions> {\n private _inputElement: HTMLInputElement;\n private _labelElement: HTMLLabelElement | undefined;\n private _helperTextElement: HTMLSpanElement | undefined;\n\n constructor(config?: IChipFieldComponentDelegateConfig) {\n super(config);\n }\n\n protected _build(): IChipFieldComponent {\n const chipField = document.createElement(CHIP_FIELD_CONSTANTS.elementName);\n\n this._inputElement = this._buildInputElement(chipField);\n\n if (this._config.options?.leadingElement) {\n this._config.options.leadingElement.slot = 'leading';\n chipField.appendChild(this._config.options.leadingElement);\n }\n if (this._config.options?.trailingElement) {\n this._config.options.trailingElement.slot = 'trailing';\n chipField.appendChild(this._config.options.trailingElement);\n }\n\n chipField.appendChild(this._inputElement);\n return chipField;\n }\n\n protected override _configure(): void {\n if (this._config.options?.helperText) {\n this.setHelperText(this._config.options.helperText);\n }\n if (typeof this._config.options?.label === 'string') {\n this._createLabel(this._config.options.label);\n }\n }\n\n public get value(): string {\n return this._inputElement.value;\n }\n public set value(value: string) {\n this._inputElement.value = value;\n }\n\n public get disabled(): boolean {\n return this._inputElement.disabled;\n }\n public set disabled(value: boolean) {\n this._inputElement.disabled = value;\n }\n\n public get invalid(): boolean {\n return this._element.invalid || false;\n }\n public set invalid(value: boolean) {\n this._element.invalid = value;\n }\n\n public get inputElement(): HTMLInputElement {\n return this._inputElement;\n }\n\n public get labelElement(): HTMLLabelElement | undefined {\n return this._labelElement;\n }\n\n public onChange(listener: (value: string) => void): void {\n this._inputElement.addEventListener('input', evt => listener((evt.target as HTMLInputElement).value));\n }\n\n public onFocus(listener: (evt: Event) => void): void {\n this._inputElement.addEventListener('focus', evt => listener(evt));\n }\n\n public onBlur(listener: (evt: Event) => void): void {\n this._inputElement.addEventListener('blur', evt => listener(evt));\n }\n\n public setLabel(text: string | null): void {\n if (text) {\n if (this._labelElement) {\n this._labelElement.textContent = text;\n } else {\n this._createLabel(text);\n }\n } else if (this._labelElement) {\n this._element.removeChild(this._labelElement);\n this._labelElement = undefined;\n }\n }\n\n public setHelperText(text: string | null): void {\n if (text) {\n if (!this._helperTextElement) {\n this._helperTextElement = document.createElement('span');\n this._helperTextElement.slot = 'helper-text';\n this._element.appendChild(this._helperTextElement);\n }\n this._helperTextElement.textContent = text;\n } else if (this._helperTextElement) {\n this._element.removeChild(this._helperTextElement);\n this._helperTextElement = undefined;\n }\n }\n\n public floatLabel(value: boolean): void {\n this._element.floatLabel(value);\n }\n\n private _createLabel(text: string): void {\n this._labelElement = document.createElement('label');\n this._labelElement.textContent = text;\n if (this._config.options?.id) {\n this._labelElement.setAttribute('for', this._config.options.id);\n }\n this._element.appendChild(this._labelElement);\n }\n\n private _buildInputElement(chipField: IChipFieldComponent): HTMLInputElement {\n const inputElement = document.createElement('input');\n inputElement.type = this._config.options?.type || 'text';\n\n if (this._config.options?.value !== undefined) {\n inputElement.value = this._config.options.value;\n }\n if (this._config.options?.id) {\n inputElement.id = this._config.options.id;\n }\n if (typeof this._config.options?.placeholder === 'string') {\n inputElement.placeholder = this._config.options?.placeholder;\n }\n\n chipField.appendChild(inputElement);\n return inputElement;\n }\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { ChipFieldComponent } from './chip-field';\n\nexport * from './chip-field-adapter';\nexport * from './chip-field-component-delegate';\nexport * from './chip-field-constants';\nexport * from './chip-field-foundation';\nexport * from './chip-field';\n\nexport function defineChipFieldComponent(): void {\n defineCustomElement(ChipFieldComponent);\n}\n"],
|
|
5
|
+
"mappings": "2TAEA,GAAM,GAA2C,GAAG,cAE9C,EAAU,CACd,KAAM,kBACR,EAEM,EAAQ,CACZ,MAAO,QACP,YAAa,cACb,OAAQ,QACV,EAEM,EAAY,CAChB,KAAM,IAAI,EAAQ,OAClB,gBAAiB,gCACjB,MAAO,QACP,MAAO,SAAS,EAAM,SACtB,YAAa,SAAS,EAAM,eAC5B,OAAQ,SAAS,EAAM,UACvB,WAAY,aAAa,EAAM,SAC/B,YAAa,aAAa,EAAM,SAClC,EAEM,EAAS,CACb,aAAc,GAAG,iBACjB,eAAgB,GAAG,kBACrB,EAEa,EAAuB,CAClC,cACA,UACA,QACA,YACA,QACF,ECZO,GAAM,GAAN,aAA+B,EAA0C,CAI9E,YAAY,EAAgC,CAC1C,MAAM,CAAS,CACjB,CAEA,AAAO,YAAmB,CACxB,MAAM,WAAW,EAAqB,UAAU,IAAI,EACpD,KAAK,YAAc,EAAi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kD,CAvI/E,cAwII,GAAM,GAAe,SAAS,cAAc,OAAO,EACnD,SAAa,KAAO,SAAK,QAAQ,UAAb,cAAsB,OAAQ,OAE9C,SAAK,QAAQ,UAAb,cAAsB,SAAU,QAClC,GAAa,MAAQ,KAAK,QAAQ,QAAQ,OAExC,QAAK,QAAQ,UAAb,QAAsB,IACxB,GAAa,GAAK,KAAK,QAAQ,QAAQ,IAErC,MAAO,SAAK,QAAQ,UAAb,cAAsB,cAAgB,UAC/C,GAAa,YAAc,QAAK,QAAQ,UAAb,cAAsB,aAGnD,EAAU,YAAY,CAAY,EAC3B,CACT,CACF,EC9IO,aAA0C,CAC/C,EAAoB,CAAkB,CACxC",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2022 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a,b,c,d,e,f}from"../chunks/chunk.4T5TGQFG.js";import"../chunks/chunk.RKKJB3EE.js";import"../chunks/chunk.JB2N65SR.js";import"../chunks/chunk.J3NHIF6W.js";import"../chunks/chunk.DGDT4UQT.js";import"../chunks/chunk.E43TT4RI.js";import"../chunks/chunk.
|
|
6
|
+
import{a,b,c,d,e,f}from"../chunks/chunk.4T5TGQFG.js";import"../chunks/chunk.RKKJB3EE.js";import"../chunks/chunk.JB2N65SR.js";import"../chunks/chunk.J3NHIF6W.js";import"../chunks/chunk.DGDT4UQT.js";import"../chunks/chunk.E43TT4RI.js";import"../chunks/chunk.HSJQA42U.js";import"../chunks/chunk.IMK2LFWR.js";import"../chunks/chunk.RPPBBBYG.js";import"../chunks/chunk.AWCBH5KW.js";import"../chunks/chunk.F5I55MXD.js";import"../chunks/chunk.Y6FFG7XO.js";import"../chunks/chunk.AMFXGOSA.js";import"../chunks/chunk.EC6JSIQW.js";import"../chunks/chunk.OAKTW64X.js";import"../chunks/chunk.3UMBCR4P.js";import"../chunks/chunk.BOENNFXE.js";import"../chunks/chunk.QXLPBYMX.js";import"../chunks/chunk.PYG4YVBA.js";import"../chunks/chunk.QZHEP4X2.js";import"../chunks/chunk.LZMYHIO2.js";import"../chunks/chunk.OUEF6VQ6.js";import"../chunks/chunk.VLTJFKGZ.js";import"../chunks/chunk.D4SNVKDA.js";import"../chunks/chunk.UUX4QJ4D.js";import"../chunks/chunk.YAJT3P6V.js";import"../chunks/chunk.6KTLOA7V.js";import"../chunks/chunk.SKLCDWYQ.js";import"../chunks/chunk.24D46RLZ.js";import"../chunks/chunk.7ZS4N2FT.js";import"../chunks/chunk.U6FJJGO3.js";import"../chunks/chunk.KYCC3C3M.js";import"../chunks/chunk.GVQVA7P3.js";import"../chunks/chunk.MIYZJUXH.js";import"../chunks/chunk.A23NSEWA.js";import"../chunks/chunk.B3IJU6XJ.js";import"../chunks/chunk.BSZ2LBJX.js";import"../chunks/chunk.3E5QKMHL.js";import"../chunks/chunk.HN4PXH3D.js";import"../chunks/chunk.R4NDFXVA.js";import"../chunks/chunk.G76HB2FK.js";import"../chunks/chunk.MCIQXNKY.js";export{a as DATE_PICKER_CONSTANTS,b as DatePickerAdapter,d as DatePickerComponent,e as DatePickerComponentDelegate,c as DatePickerFoundation,f as defineDatePickerComponent};
|
|
7
7
|
//# sourceMappingURL=index.js.map
|