@aquera/nile-elements 0.0.4-5 → 0.0.4-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +1 -0
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +1 -0
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js +1 -1
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/index.d.ts +1 -0
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/index.js +2 -0
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/index.js.map +1 -0
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.css.d.ts +12 -0
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.css.js +66 -0
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.css.js.map +1 -0
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.d.ts +39 -0
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.js +87 -0
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.js.map +1 -0
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  16. package/dist/index.cjs.js +1 -1
  17. package/dist/index.esm.js +1 -1
  18. package/dist/index.iife.js +81 -13
  19. package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
  20. package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
  21. package/dist/nile-date-picker/nile-date-picker.esm.js +1 -1
  22. package/dist/nile-link/index.cjs.js +2 -0
  23. package/dist/nile-link/index.cjs.js.map +1 -0
  24. package/dist/nile-link/index.esm.js +1 -0
  25. package/dist/nile-link/nile-link.cjs.js +2 -0
  26. package/dist/nile-link/nile-link.cjs.js.map +1 -0
  27. package/dist/nile-link/nile-link.css.cjs.js +2 -0
  28. package/dist/nile-link/nile-link.css.cjs.js.map +1 -0
  29. package/dist/nile-link/nile-link.css.esm.js +54 -0
  30. package/dist/nile-link/nile-link.esm.js +16 -0
  31. package/dist/slot.cjs.js +1 -1
  32. package/dist/slot.cjs.js.map +1 -1
  33. package/dist/slot.esm.js +1 -1
  34. package/dist/src/index.d.ts +1 -0
  35. package/dist/src/index.js +1 -0
  36. package/dist/src/index.js.map +1 -1
  37. package/dist/src/nile-date-picker/nile-date-picker.js +1 -1
  38. package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  39. package/dist/src/nile-link/index.d.ts +1 -0
  40. package/dist/src/nile-link/index.js +2 -0
  41. package/dist/src/nile-link/index.js.map +1 -0
  42. package/dist/src/nile-link/nile-link.css.d.ts +12 -0
  43. package/dist/src/nile-link/nile-link.css.js +66 -0
  44. package/dist/src/nile-link/nile-link.css.js.map +1 -0
  45. package/dist/src/nile-link/nile-link.d.ts +39 -0
  46. package/dist/src/nile-link/nile-link.js +87 -0
  47. package/dist/src/nile-link/nile-link.js.map +1 -0
  48. package/dist/tsconfig.tsbuildinfo +1 -1
  49. package/package.json +1 -1
  50. package/src/index.ts +1 -0
  51. package/src/nile-date-picker/nile-date-picker.ts +1 -1
  52. package/src/nile-link/index.ts +1 -0
  53. package/src/nile-link/nile-link.css.ts +68 -0
  54. package/src/nile-link/nile-link.ts +91 -0
@@ -1,2 +1,2 @@
1
- System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-date-picker.css.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.cjs.js","../property-0f6a51ec.cjs.js","lit","lit/directives/class-map.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";var t,e,i,s,n,a,r,l,_templateObject,h;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){e=_index001CjsJs.x;},function(_litDecoratorsJs){i=_litDecoratorsJs.query;s=_litDecoratorsJs.customElement;},function(_nileDatePickerCssCjsJs){n=_nileDatePickerCssCjsJs.s;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_nilePopupNilePopupCjsJs){},function(_property002CjsJs){l=_property002CjsJs.n;},function(_lit){},function(_litDirectivesClassMapJs){},function(_nilePopupNilePopupCssCjsJs){}],execute:function(){_export("N",h=/*#__PURE__*/function(_r){_inherits(h,_r);var _super=_createSuper(h);function h(){var _this;_classCallCheck(this,h);_this=_super.apply(this,arguments),_this.currentMonth=new Date().getMonth(),_this.currentYear=new Date().getFullYear(),_this.dropDownOpened=!1,_this.valueAttribute=null,_this.formattedDate=null,_this.startDate=null,_this.endDate=null,_this.isSelectingStart=!0,_this.range=!1;return _this;}_createClass(h,[{key:"valueChanged",value:function valueChanged(){if(this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){var _t=this.value.getTimezoneOffset(),_e=new Date(this.value.getTime()-60*_t*1e3);isNaN(_e.getTime())||(this.valueAttribute=_e.toISOString().split("T")[0],this.formattedDate="".concat(String(_e.getDate()).padStart(2,"0"),"/").concat(String(_e.getMonth()+1).padStart(2,"0"),"/").concat(_e.getFullYear()));}}},{key:"updated",value:function updated(t){if(_get(_getPrototypeOf(h.prototype),"updated",this).call(this,t),t.has("valueAttribute")){var _t2=new Date(this.valueAttribute||"");if(!isNaN(_t2.getTime())){var _e2=_t2.getTimezoneOffset();this.value=new Date(_t2.getTime()-60*_e2*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear();}}}},{key:"attributeChangedCallback",value:function attributeChangedCallback(t,e,i){"value"===t?(this.valueAttribute=i,this.initializeValue()):"range"===t&&(this.range=null!==i);}},{key:"initializeValue",value:function initializeValue(){if(this.range)try{var _t3=JSON.parse(this.valueAttribute||"");this.startDate=new Date(_t3.startDate),this.endDate=new Date(_t3.endDate),this.startDate=new Date(this.startDate.getTime()),this.endDate=new Date(this.endDate.getTime()),this.rangeValue={startDate:this.startDate,endDate:this.endDate},this.value=null;}catch(t){console.error("Invalid range value");}else if(this.valueAttribute){var _t4;_t4=new Date(this.valueAttribute),_t4=new Date(_t4.getTime()-6e4*_t4.getTimezoneOffset()),isNaN(_t4.getTime())||(this.value=_t4,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null);}this.requestUpdate();}},{key:"handleChanged",value:function handleChanged(t){this.emit("nile-changed",{value:t.detail.value}),this.dropdown&&this.dropdown.hide();}},{key:"connectedCallback",value:function connectedCallback(){if(_get(_getPrototypeOf(h.prototype),"connectedCallback",this).call(this),this.initializeValue(),this.valueAttribute){var _t5=new Date(this.valueAttribute);isNaN(_t5.getTime())||(this.value=_t5,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear());}}},{key:"render",value:function render(){return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown .hoist=\"","\">\n <slot\n slot=\"trigger\"\n part=\"trigger\"\n name=\"trigger\"\n ></slot>\n\n<nile-calendar .value=\"","\" .range=\"","\" @nile-changed=\"","\"> </nile-calendar>\n </nile-dropdown>\n "])),!0,this.range,this.range,this.handleChanged);}}],[{key:"styles",get:function get(){return[n];}},{key:"observedAttributes",get:function get(){return["value","range"];}}]);return h;}(r));t([i("nile-dropdown")],h.prototype,"dropdown",void 0),t([l({type:Boolean,reflect:!0})],h.prototype,"dropDownOpened",void 0),t([l({type:Object})],h.prototype,"value",void 0),t([l({type:Object})],h.prototype,"rangeValue",void 0),t([l({type:String,attribute:"value"})],h.prototype,"valueAttribute",void 0),t([l({type:String,attribute:"value"})],h.prototype,"formattedDate",void 0),t([l({type:Object})],h.prototype,"startDate",void 0),t([l({type:Object})],h.prototype,"endDate",void 0),t([l({type:Boolean})],h.prototype,"isSelectingStart",void 0),t([l({type:Boolean})],h.prototype,"range",void 0),t([a("value")],h.prototype,"valueChanged",null),_export("N",h=t([s("nile-date-picker")],h));}};});
1
+ System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-date-picker.css.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.cjs.js","../property-0f6a51ec.cjs.js","lit","lit/directives/class-map.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";var t,e,i,s,n,a,r,l,_templateObject,h;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){e=_index001CjsJs.x;},function(_litDecoratorsJs){i=_litDecoratorsJs.query;s=_litDecoratorsJs.customElement;},function(_nileDatePickerCssCjsJs){n=_nileDatePickerCssCjsJs.s;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_nilePopupNilePopupCjsJs){},function(_property002CjsJs){l=_property002CjsJs.n;},function(_lit){},function(_litDirectivesClassMapJs){},function(_nilePopupNilePopupCssCjsJs){}],execute:function(){_export("N",h=/*#__PURE__*/function(_r){_inherits(h,_r);var _super=_createSuper(h);function h(){var _this;_classCallCheck(this,h);_this=_super.apply(this,arguments),_this.currentMonth=new Date().getMonth(),_this.currentYear=new Date().getFullYear(),_this.dropDownOpened=!1,_this.valueAttribute=null,_this.formattedDate=null,_this.startDate=null,_this.endDate=null,_this.isSelectingStart=!0,_this.range=!1;return _this;}_createClass(h,[{key:"valueChanged",value:function valueChanged(){if(this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){var _t=this.value.getTimezoneOffset(),_e=new Date(this.value.getTime()-60*_t*1e3);isNaN(_e.getTime())||(this.valueAttribute=_e.toISOString().split("T")[0],this.formattedDate="".concat(String(_e.getDate()).padStart(2,"0"),"/").concat(String(_e.getMonth()+1).padStart(2,"0"),"/").concat(_e.getFullYear()));}}},{key:"updated",value:function updated(t){if(_get(_getPrototypeOf(h.prototype),"updated",this).call(this,t),t.has("valueAttribute")){var _t2=new Date(this.valueAttribute||"");if(!isNaN(_t2.getTime())){var _e2=_t2.getTimezoneOffset();this.value=new Date(_t2.getTime()-60*_e2*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear();}}}},{key:"attributeChangedCallback",value:function attributeChangedCallback(t,e,i){"value"===t?(this.valueAttribute=i,this.initializeValue()):"range"===t&&(this.range=null!==i);}},{key:"initializeValue",value:function initializeValue(){if(this.range)try{var _t3=JSON.parse(this.valueAttribute||"");this.startDate=new Date(_t3.startDate),this.endDate=new Date(_t3.endDate),this.startDate=new Date(this.startDate.getTime()),this.endDate=new Date(this.endDate.getTime()),this.rangeValue={startDate:this.startDate,endDate:this.endDate},this.value=null;}catch(t){}else if(this.valueAttribute){var _t4;_t4=new Date(this.valueAttribute),_t4=new Date(_t4.getTime()-6e4*_t4.getTimezoneOffset()),isNaN(_t4.getTime())||(this.value=_t4,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null);}this.requestUpdate();}},{key:"handleChanged",value:function handleChanged(t){this.emit("nile-changed",{value:t.detail.value}),this.dropdown&&this.dropdown.hide();}},{key:"connectedCallback",value:function connectedCallback(){if(_get(_getPrototypeOf(h.prototype),"connectedCallback",this).call(this),this.initializeValue(),this.valueAttribute){var _t5=new Date(this.valueAttribute);isNaN(_t5.getTime())||(this.value=_t5,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear());}}},{key:"render",value:function render(){return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown .hoist=\"","\">\n <slot\n slot=\"trigger\"\n part=\"trigger\"\n name=\"trigger\"\n ></slot>\n\n<nile-calendar .value=\"","\" .range=\"","\" @nile-changed=\"","\"> </nile-calendar>\n </nile-dropdown>\n "])),!0,this.range,this.range,this.handleChanged);}}],[{key:"styles",get:function get(){return[n];}},{key:"observedAttributes",get:function get(){return["value","range"];}}]);return h;}(r));t([i("nile-dropdown")],h.prototype,"dropdown",void 0),t([l({type:Boolean,reflect:!0})],h.prototype,"dropDownOpened",void 0),t([l({type:Object})],h.prototype,"value",void 0),t([l({type:Object})],h.prototype,"rangeValue",void 0),t([l({type:String,attribute:"value"})],h.prototype,"valueAttribute",void 0),t([l({type:String,attribute:"value"})],h.prototype,"formattedDate",void 0),t([l({type:Object})],h.prototype,"startDate",void 0),t([l({type:Object})],h.prototype,"endDate",void 0),t([l({type:Boolean})],h.prototype,"isSelectingStart",void 0),t([l({type:Boolean})],h.prototype,"range",void 0),t([a("value")],h.prototype,"valueChanged",null),_export("N",h=t([s("nile-date-picker")],h));}};});
2
2
  //# sourceMappingURL=nile-date-picker.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-date-picker.cjs.js","sources":["../../../src/nile-date-picker/nile-date-picker.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-date-picker.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\nimport { NileDropdown } from '../nile-dropdown';\n\n/**\n * Nile icon component.\n *\n * @tag nile-date-picker\n *\n */\n@customElement('nile-date-picker')\nexport class NileDatePicker extends NileElement {\n /**\n * The styles for DatePicker\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private currentMonth: number = new Date().getMonth();\n private currentYear: number = new Date().getFullYear();\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n @property({ type: Boolean, reflect: true }) dropDownOpened = false;\n\n @property({ type: Object }) value : any;\n\n @property({ type: Object }) rangeValue : any;\n\n @property({ type: String, attribute: 'value' }) valueAttribute:\n | string\n | null = null;\n\n @property({ type: String, attribute: 'value' }) formattedDate: string | null =\n null;\n\n @property({ type: Object }) startDate: Date | null = null;\n @property({ type: Object }) endDate: Date | null = null;\n @property({ type: Boolean }) isSelectingStart = true; // flag to indicate what we're selecting\n\n @property({ type: Boolean }) range = false;\n\n @watch('value')\n valueChanged() {\n\n if (this.range && this.value) {\n this.rangeValue = this.value;\n this.value = null;\n return;\n }\n\n if (this.value && !isNaN(this.value.getTime())) {\n const offset = this.value.getTimezoneOffset();\n const localDate = new Date(this.value.getTime() - offset * 60 * 1000);\n if (!isNaN(localDate.getTime())) {\n this.valueAttribute = localDate.toISOString().split('T')[0];\n this.formattedDate = `${String(localDate.getDate()).padStart(\n 2,\n '0'\n )}/${String(localDate.getMonth() + 1).padStart(\n 2,\n '0'\n )}/${localDate.getFullYear()}`;\n }\n }\n }\n\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n if (changedProperties.has('valueAttribute')) {\n const date = new Date(this.valueAttribute || '');\n if (!isNaN(date.getTime())) {\n const offset = date.getTimezoneOffset();\n this.value = new Date(date.getTime() - offset * 60 * 1000);\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n static get observedAttributes() {\n return ['value', 'range'];\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (name === 'value') {\n this.valueAttribute = newValue;\n this.initializeValue();\n } else if (name === 'range') {\n this.range = newValue !== null;\n }\n }\n\n initializeValue() {\n if (this.range) {\n try {\n const rangeValue = JSON.parse(this.valueAttribute || '');\n this.startDate = new Date(rangeValue.startDate);\n this.endDate = new Date(rangeValue.endDate);\n\n // Convert to local time\n this.startDate = new Date(this.startDate.getTime());\n this.endDate = new Date(this.endDate.getTime());\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n this.value = null;\n } catch (e) {\n console.error('Invalid range value');\n }\n } else {\n if (this.valueAttribute) {\n let date: Date;\n\n date = new Date(this.valueAttribute);\n\n date = new Date(date.getTime() - date.getTimezoneOffset() * 60000);\n\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n this.rangeValue = null;\n }\n }\n }\n this.requestUpdate();\n }\n\n handleChanged(event:any) {\n this.emit('nile-changed', { value: event.detail.value });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n\n if (this.valueAttribute) {\n const date = new Date(this.valueAttribute);\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n\n\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n render(): TemplateResult {\n\n return html`\n <nile-dropdown .hoist=\"${true}\">\n <slot\n slot=\"trigger\"\n part=\"trigger\"\n name=\"trigger\"\n ></slot>\n\n<nile-calendar .value=\"${this.range}\" .range=\"${this.range}\" @nile-changed=\"${this.handleChanged}\"> </nile-calendar>\n </nile-dropdown>\n `;\n }\n}\n\nexport default NileDatePicker;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-date-picker': NileDatePicker;\n }\n}\n"],"names":["NileDatePicker","h","this","currentMonth","Date","getMonth","currentYear","getFullYear","dropDownOpened","valueAttribute","formattedDate","startDate","endDate","isSelectingStart","range","_this","_createClass","key","value","valueChanged","rangeValue","isNaN","getTime","offset","getTimezoneOffset","localDate","toISOString","split","String","getDate","padStart","updated","changedProperties","super","has","date","attributeChangedCallback","name","oldValue","newValue","initializeValue","JSON","parse","e","console","error","requestUpdate","handleChanged","event","emit","detail","dropdown","hide","connectedCallback","render","html","_templateObject","_taggedTemplateLiteral","__decorate","get","styles","observedAttributes","NileElement","query","prototype","property","type","Boolean","reflect","Object","attribute","watch","customElement"],"mappings":"uoJA0CaA,CAAAA,uBAAAA,EAAAA,EAAAA,SAAAA,CAAAA,CAAAA,CAAAA,EAAAA,MAAAA,MAAAA,CAAAA,YAAAA,CAAAA,CAAAA,EAAN,SAAAC,EAAA,uEASGC,KAAAA,CAAAC,YAAAA,CAAuB,GAAIC,CAAAA,IAAOC,CAAAA,CAAAA,CAAAA,QAAAA,CAAAA,CAAAA,CAClCH,KAAAA,CAAAI,WAAsB,CAAA,GAAIF,CAAAA,OAAOG,WAIGL,CAAAA,CAAAA,CAAAA,KAAAA,CAAcM,gBAAG,CAMbN,CAAAA,KAAAA,CAAcO,eAEnD,IAEqCP,CAAAA,KAAAA,CAAaQ,aAC3D,CAAA,IAAA,CAE0BR,KAAAA,CAASS,SAAgB,CAAA,IAAA,CACzBT,KAAAA,CAAOU,OAAgB,CAAA,IAAA,CACtBV,KAAAA,CAAAW,gBAAmB,CAAA,CAAA,CAAA,C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AAyBnE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAgE,SAAA,CAAA,OAAA,CAAA,IAAA,EAG3CN,CAAAA,CAAAA,CAAAA,CAAA,CADCa,CAAAA,CAAM,OAuBNvE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAgE,SAAA,CAAA,cAAA,CAAA,IAxDUhE,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAc0D,CAAA,CAAA,CAD1Bc,CAAc,CAAA,kBAAA,CAAA,CAAA,CACFxE"}
1
+ {"version":3,"file":"nile-date-picker.cjs.js","sources":["../../../src/nile-date-picker/nile-date-picker.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-date-picker.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\nimport { NileDropdown } from '../nile-dropdown';\n\n/**\n * Nile icon component.\n *\n * @tag nile-date-picker\n *\n */\n@customElement('nile-date-picker')\nexport class NileDatePicker extends NileElement {\n /**\n * The styles for DatePicker\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private currentMonth: number = new Date().getMonth();\n private currentYear: number = new Date().getFullYear();\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n @property({ type: Boolean, reflect: true }) dropDownOpened = false;\n\n @property({ type: Object }) value : any;\n\n @property({ type: Object }) rangeValue : any;\n\n @property({ type: String, attribute: 'value' }) valueAttribute:\n | string\n | null = null;\n\n @property({ type: String, attribute: 'value' }) formattedDate: string | null =\n null;\n\n @property({ type: Object }) startDate: Date | null = null;\n @property({ type: Object }) endDate: Date | null = null;\n @property({ type: Boolean }) isSelectingStart = true; // flag to indicate what we're selecting\n\n @property({ type: Boolean }) range = false;\n\n @watch('value')\n valueChanged() {\n\n if (this.range && this.value) {\n this.rangeValue = this.value;\n this.value = null;\n return;\n }\n\n if (this.value && !isNaN(this.value.getTime())) {\n const offset = this.value.getTimezoneOffset();\n const localDate = new Date(this.value.getTime() - offset * 60 * 1000);\n if (!isNaN(localDate.getTime())) {\n this.valueAttribute = localDate.toISOString().split('T')[0];\n this.formattedDate = `${String(localDate.getDate()).padStart(\n 2,\n '0'\n )}/${String(localDate.getMonth() + 1).padStart(\n 2,\n '0'\n )}/${localDate.getFullYear()}`;\n }\n }\n }\n\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n if (changedProperties.has('valueAttribute')) {\n const date = new Date(this.valueAttribute || '');\n if (!isNaN(date.getTime())) {\n const offset = date.getTimezoneOffset();\n this.value = new Date(date.getTime() - offset * 60 * 1000);\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n static get observedAttributes() {\n return ['value', 'range'];\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (name === 'value') {\n this.valueAttribute = newValue;\n this.initializeValue();\n } else if (name === 'range') {\n this.range = newValue !== null;\n }\n }\n\n initializeValue() {\n if (this.range) {\n try {\n const rangeValue = JSON.parse(this.valueAttribute || '');\n this.startDate = new Date(rangeValue.startDate);\n this.endDate = new Date(rangeValue.endDate);\n\n // Convert to local time\n this.startDate = new Date(this.startDate.getTime());\n this.endDate = new Date(this.endDate.getTime());\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n this.value = null;\n } catch (e) {\n // console.error('Invalid range value');\n }\n } else {\n if (this.valueAttribute) {\n let date: Date;\n\n date = new Date(this.valueAttribute);\n\n date = new Date(date.getTime() - date.getTimezoneOffset() * 60000);\n\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n this.rangeValue = null;\n }\n }\n }\n this.requestUpdate();\n }\n\n handleChanged(event:any) {\n this.emit('nile-changed', { value: event.detail.value });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n\n if (this.valueAttribute) {\n const date = new Date(this.valueAttribute);\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n\n\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n render(): TemplateResult {\n\n return html`\n <nile-dropdown .hoist=\"${true}\">\n <slot\n slot=\"trigger\"\n part=\"trigger\"\n name=\"trigger\"\n ></slot>\n\n<nile-calendar .value=\"${this.range}\" .range=\"${this.range}\" @nile-changed=\"${this.handleChanged}\"> </nile-calendar>\n </nile-dropdown>\n `;\n }\n}\n\nexport default NileDatePicker;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-date-picker': NileDatePicker;\n }\n}\n"],"names":["NileDatePicker","h","this","currentMonth","Date","getMonth","currentYear","getFullYear","dropDownOpened","valueAttribute","formattedDate","startDate","endDate","isSelectingStart","range","_this","_createClass","key","value","valueChanged","rangeValue","isNaN","getTime","offset","getTimezoneOffset","localDate","toISOString","split","String","getDate","padStart","concat","updated","changedProperties","super","has","date","attributeChangedCallback","name","oldValue","newValue","initializeValue","JSON","parse","e","requestUpdate","handleChanged","event","emit","detail","dropdown","hide","connectedCallback","render","html","_templateObject","_taggedTemplateLiteral","__decorate","get","styles","NileElement","query","prototype","property","type","Boolean","reflect","Object","attribute","watch","customElement"],"mappings":"uoJA0CaA,CAAAA,uBAAAA,EAAAA,EAAAA,SAAAA,CAAAA,CAAAA,CAAAA,EAAAA,MAAAA,MAAAA,CAAAA,YAAAA,CAAAA,CAAAA,EAAN,SAAAC,EAAA,uEASGC,KAAAA,CAAAC,YAAAA,CAAuB,GAAIC,CAAAA,IAAOC,CAAAA,CAAAA,CAAAA,QAAAA,CAAAA,CAAAA,CAClCH,KAAAA,CAAAI,WAAsB,CAAA,GAAIF,CAAAA,OAAOG,WAIGL,CAAAA,CAAAA,CAAAA,KAAAA,CAAcM,gBAAG,CAMbN,CAAAA,KAAAA,CAAcO,eAEnD,IAEqCP,CAAAA,KAAAA,CAAaQ,aAC3D,CAAA,IAAA,CAE0BR,KAAAA,CAASS,SAAgB,CAAA,IAAA,CACzBT,KAAAA,CAAOU,OAAgB,CAAA,IAAA,CACtBV,KAAAA,CAAAW,gBAAmB,CAAA,CAAA,CAAA,CAEnBX,KAAAA,CAAKY,KAAAA,CAAAA,CAAG,CA2ItC,QAAAC,KAAA,EArKQC,YAAA,CAAAf,CAAA,GAAAgB,GAAA,gBAAAC,KAAA,CA6BP,SAAAC,aAAA,CAEE,CAAA,GAAIjB,KAAKY,KAASZ,EAAAA,IAAAA,CAAKgB,MAGrB,MAFAhB,KAAAA,CAAKkB,WAAalB,IAAKgB,CAAAA,KAAAA,CAAAA,KACvBhB,KAAKgB,KAAQ,CAAA,IAAA,CAAA,CAIf,GAAIhB,IAAKgB,CAAAA,KAAAA,EAAAA,CAAUG,MAAMnB,IAAKgB,CAAAA,KAAAA,CAAMI,WAAY,CAC9C,GAAMC,CAAAA,EAASrB,CAAAA,IAAAA,CAAKgB,MAAMM,iBACpBC,CAAAA,CAAAA,CAAAA,EAAAA,CAAY,GAAIrB,CAAAA,IAAKF,CAAAA,IAAAA,CAAKgB,M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AAQwC,UAAW,OAC9BpE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA8D,SAAA,CAAA,eAAA,CAAA,IAAA,EAEqBL,CAAAA,CAAAA,CAAAA,CAAA,CAA3BM,CAAAA,CAAS,CAAEC,IAAAA,CAAMG,MAAwCnE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA8D,SAAA,CAAA,WAAA,CAAA,IAAA,IAC9BL,CAAA,CAAA,CAA3BM,CAAS,CAAA,CAAEC,IAAMG,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAsCnE,CAAA8D,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAC3BL,CAAA,CAAA,CAA5BM,CAAS,CAAA,CAAEC,KAAMC,OAAmCjE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA8D,SAAA,CAAA,kBAAA,CAAA,IAAA,EAExBL,CAAAA,CAAAA,CAAAA,CAAA,CAA5BM,CAAAA,CAAS,CAAEC,IAAAA,CAAMC,OAAyBjE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA8D,SAAA,CAAA,OAAA,CAAA,IAAA,EAG3CL,CAAAA,CAAAA,CAAAA,CAAA,CADCY,CAAAA,CAAM,OAuBNrE,CAAAA,CAAAA,CAAAA,CAAAA,CAAA8D,SAAA,CAAA,cAAA,CAAA,IAxDU9D,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAcyD,CAAA,CAAA,CAD1Ba,CAAc,CAAA,kBAAA,CAAA,CAAA,CACFtE"}
@@ -1,4 +1,4 @@
1
- import{__decorate as t}from"tslib";import{x as e}from"../index-cd2f9c12.esm.js";import{query as i,customElement as s}from"lit/decorators.js";import{s as n}from"./nile-date-picker.css.esm.js";import{w as a}from"../internal/watch.esm.js";import{N as r}from"../internal/nile-element.esm.js";import"../nile-popup/nile-popup.esm.js";import{n as l}from"../property-09139d3c.esm.js";import"lit";import"lit/directives/class-map.js";import"../nile-popup/nile-popup.css.esm.js";let h=class extends r{constructor(){super(...arguments),this.currentMonth=(new Date).getMonth(),this.currentYear=(new Date).getFullYear(),this.dropDownOpened=!1,this.valueAttribute=null,this.formattedDate=null,this.startDate=null,this.endDate=null,this.isSelectingStart=!0,this.range=!1}static get styles(){return[n]}valueChanged(){if(this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){const t=this.value.getTimezoneOffset(),e=new Date(this.value.getTime()-60*t*1e3);isNaN(e.getTime())||(this.valueAttribute=e.toISOString().split("T")[0],this.formattedDate=`${String(e.getDate()).padStart(2,"0")}/${String(e.getMonth()+1).padStart(2,"0")}/${e.getFullYear()}`)}}updated(t){if(super.updated(t),t.has("valueAttribute")){const t=new Date(this.valueAttribute||"");if(!isNaN(t.getTime())){const e=t.getTimezoneOffset();this.value=new Date(t.getTime()-60*e*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear()}}}static get observedAttributes(){return["value","range"]}attributeChangedCallback(t,e,i){"value"===t?(this.valueAttribute=i,this.initializeValue()):"range"===t&&(this.range=null!==i)}initializeValue(){if(this.range)try{const t=JSON.parse(this.valueAttribute||"");this.startDate=new Date(t.startDate),this.endDate=new Date(t.endDate),this.startDate=new Date(this.startDate.getTime()),this.endDate=new Date(this.endDate.getTime()),this.rangeValue={startDate:this.startDate,endDate:this.endDate},this.value=null}catch(t){console.error("Invalid range value")}else if(this.valueAttribute){let t;t=new Date(this.valueAttribute),t=new Date(t.getTime()-6e4*t.getTimezoneOffset()),isNaN(t.getTime())||(this.value=t,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null)}this.requestUpdate()}handleChanged(t){this.emit("nile-changed",{value:t.detail.value}),this.dropdown&&this.dropdown.hide()}connectedCallback(){if(super.connectedCallback(),this.initializeValue(),this.valueAttribute){const t=new Date(this.valueAttribute);isNaN(t.getTime())||(this.value=t,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear())}}render(){return e`
1
+ import{__decorate as t}from"tslib";import{x as e}from"../index-cd2f9c12.esm.js";import{query as i,customElement as s}from"lit/decorators.js";import{s as n}from"./nile-date-picker.css.esm.js";import{w as a}from"../internal/watch.esm.js";import{N as r}from"../internal/nile-element.esm.js";import"../nile-popup/nile-popup.esm.js";import{n as l}from"../property-09139d3c.esm.js";import"lit";import"lit/directives/class-map.js";import"../nile-popup/nile-popup.css.esm.js";let h=class extends r{constructor(){super(...arguments),this.currentMonth=(new Date).getMonth(),this.currentYear=(new Date).getFullYear(),this.dropDownOpened=!1,this.valueAttribute=null,this.formattedDate=null,this.startDate=null,this.endDate=null,this.isSelectingStart=!0,this.range=!1}static get styles(){return[n]}valueChanged(){if(this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){const t=this.value.getTimezoneOffset(),e=new Date(this.value.getTime()-60*t*1e3);isNaN(e.getTime())||(this.valueAttribute=e.toISOString().split("T")[0],this.formattedDate=`${String(e.getDate()).padStart(2,"0")}/${String(e.getMonth()+1).padStart(2,"0")}/${e.getFullYear()}`)}}updated(t){if(super.updated(t),t.has("valueAttribute")){const t=new Date(this.valueAttribute||"");if(!isNaN(t.getTime())){const e=t.getTimezoneOffset();this.value=new Date(t.getTime()-60*e*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear()}}}static get observedAttributes(){return["value","range"]}attributeChangedCallback(t,e,i){"value"===t?(this.valueAttribute=i,this.initializeValue()):"range"===t&&(this.range=null!==i)}initializeValue(){if(this.range)try{const t=JSON.parse(this.valueAttribute||"");this.startDate=new Date(t.startDate),this.endDate=new Date(t.endDate),this.startDate=new Date(this.startDate.getTime()),this.endDate=new Date(this.endDate.getTime()),this.rangeValue={startDate:this.startDate,endDate:this.endDate},this.value=null}catch(t){}else if(this.valueAttribute){let t;t=new Date(this.valueAttribute),t=new Date(t.getTime()-6e4*t.getTimezoneOffset()),isNaN(t.getTime())||(this.value=t,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null)}this.requestUpdate()}handleChanged(t){this.emit("nile-changed",{value:t.detail.value}),this.dropdown&&this.dropdown.hide()}connectedCallback(){if(super.connectedCallback(),this.initializeValue(),this.valueAttribute){const t=new Date(this.valueAttribute);isNaN(t.getTime())||(this.value=t,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear())}}render(){return e`
2
2
  <nile-dropdown .hoist="${!0}">
3
3
  <slot
4
4
  slot="trigger"
@@ -0,0 +1,2 @@
1
+ System.register(["./nile-link.cjs.js","tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-link.css.cjs.js","../slot.cjs.js","lit/directives/if-defined.js","lit/directives/class-map.js","../internal/nile-element.cjs.js","lit","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileLinkCjsJs){_export("NileLink",_nileLinkCjsJs.N);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileLinkCssCjsJs){},function(_slotCjsJs){},function(_litDirectivesIfDefinedJs){},function(_litDirectivesClassMapJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_property002CjsJs){}],execute:function(){}};});
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export{N as NileLink}from"./nile-link.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-link.css.esm.js";import"../slot.esm.js";import"lit/directives/if-defined.js";import"lit/directives/class-map.js";import"../internal/nile-element.esm.js";import"lit";import"../property-09139d3c.esm.js";
@@ -0,0 +1,2 @@
1
+ System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-link.css.cjs.js","../slot.cjs.js","lit/directives/if-defined.js","lit/directives/class-map.js","../internal/nile-element.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var s,i,t,e,l,r,o,a,n,f,_templateObject,d;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){s=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){t=_litDecoratorsJs.state;e=_litDecoratorsJs.customElement;},function(_nileLinkCssCjsJs){l=_nileLinkCssCjsJs.s;},function(_slotCjsJs){r=_slotCjsJs.H;},function(_litDirectivesIfDefinedJs){o=_litDirectivesIfDefinedJs.ifDefined;},function(_litDirectivesClassMapJs){a=_litDirectivesClassMapJs.classMap;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_property002CjsJs){f=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("N",d=/*#__PURE__*/function(_n){_inherits(d,_n);var _super=_createSuper(d);function d(){var _this;_classCallCheck(this,d);_this=_super.apply(this,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"[default]","prefix","suffix"),_this.hasFocus=!1,_this.disabled=!1,_this.button=!1;return _this;}_createClass(d,[{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("nile-blur");}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("nile-focus");}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"base\"\n class=","\n ?disabled=","\n title=","\n aria-disabled=","\n tabindex=","\n @blur=","\n @focus=","\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"link__prefix\"></slot>\n <slot part=\"label\" class=\"link__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"link__suffix\"></slot>\n </div>\n "])),a({link:!0,"link--disabled":this.disabled,link__button:this.button}),o(this.disabled),this.title,this.disabled?"true":"false",this.disabled?"-1":"0",this.handleBlur,this.handleFocus);}}],[{key:"styles",get:function get(){return[l];}}]);return d;}(n));s([t()],d.prototype,"hasFocus",void 0),s([f({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),s([f({type:Boolean})],d.prototype,"button",void 0),_export("N",d=s([e("nile-link")],d));}};});
2
+ //# sourceMappingURL=nile-link.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-link.cjs.js","sources":["../../../src/nile-link/nile-link.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement, state } from 'lit/decorators.js';\nimport {styles} from './nile-link.css';\nimport { HasSlotController } from '../slot';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\n\n/**\n * Nile icon component.\n *\n * @tag nile-link\n *\n */\n@customElement('nile-link')\nexport class NileLink extends NileElement {\n\n\t/**\n\t * The styles for Link\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');\n\n @state() private hasFocus = false;\n\n /** Disables the button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ type: Boolean }) button = false;\n\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus');\n }\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n link: true,\n 'link--disabled': this.disabled,\n 'link__button': this.button\n })}\n ?disabled=${ifDefined(this.disabled)}\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? '-1' : '0'}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"link__prefix\"></slot>\n <slot part=\"label\" class=\"link__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"link__suffix\"></slot>\n </div>\n `;\n }\n\n\n\t/* #endregion */\n}\n\nexport default NileLink;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-link': NileLink;\n }\n }\n"],"names":["NileLink","d","this","hasSlotController","HasSlotController","hasFocus","disabled","button","_this","_createClass","key","value","handleBlur","emit","handleFocus","render","html","_templateObject","_taggedTemplateLiteral","classMap","link","link__button","ifDefined","title","get","styles","NileElement","__decorate","state","prototype","property","type","Boolean","reflect","customElement"],"mappings":"gjIAuBaA,CAAAA,uBAAAA,EAAAA,EAAAA,SAAAA,CAAAA,CAAAA,CAAAA,EAAAA,MAAAA,MAAAA,CAAAA,YAAAA,CAAAA,CAAAA,EAAN,SAAAC,EAAA,qEAUYC,EAAAA,KAAAA,CAAAC,kBAAoB,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAAwB,WAAA,CAAa,SAAU,QAEvEF,CAAAA,CAAAA,KAAAA,CAAQG,QAAG,CAAA,CAAA,CAAA,CAGgBH,KAAAA,CAAQI,QAAAA,CAAAA,CAAG,CAE1BJ,CAAAA,KAAAA,CAAMK,QAAG,CA0CvC,QAAAC,KAAA,EArDOC,YAAA,CAAAR,CAAA,GAAAS,GAAA,cAAAC,KAAA,CAcE,SAAAC,WAAA,E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A,CAAA6B,SAAA,CAAA,QAAA,CAAA,IAAA,gBAjBjC7B,CAAQ2B,CAAAA,CAAAA,CAAA,CADpBO,CAAAA,CAAc,cACFlC"}
@@ -0,0 +1,2 @@
1
+ System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var n,_templateObject,e;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){n=_index001CjsJs.i;}],execute:function(){_export("s",e=n(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n }\n\n .link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n user-select: none;\n white-space: nowrap;\n padding: 12px;\n gap: 8px;\n }\n\n .link__label {\n color: #005ea6;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .link--disabled {\n color: rgba(0, 94, 166, 0.5);\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n .link:not(.link--disabled):not(.link__button):hover {\n color: #005291;\n text-decoration-line: underline;\n }\n\n .link:not(.link--disabled):not(.link__button):active {\n color: #002f53;\n text-decoration-line: underline;\n }\n\n .link__button:hover {\n color: #005291;\n border-radius: 4px;\n background: #f5f7f7;\n }\n\n .link__button:active {\n color: #002f53;\n border-radius: 4px;\n background: rgba(0, 94, 166, 0.1);\n }\n"]))));}};});
2
+ //# sourceMappingURL=nile-link.css.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-link.css.cjs.js","sources":["../../../src/nile-link/nile-link.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Link CSS\n */\nexport const styles = css`\n :host {\n }\n\n .link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n user-select: none;\n white-space: nowrap;\n padding: 12px;\n gap: 8px;\n }\n\n .link__label {\n color: #005ea6;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .link--disabled {\n color: rgba(0, 94, 166, 0.5);\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n .link:not(.link--disabled):not(.link__button):hover {\n color: #005291;\n text-decoration-line: underline;\n }\n\n .link:not(.link--disabled):not(.link__button):active {\n color: #002f53;\n text-decoration-line: underline;\n }\n\n .link__button:hover {\n color: #005291;\n border-radius: 4px;\n background: #f5f7f7;\n }\n\n .link__button:active {\n color: #002f53;\n border-radius: 4px;\n background: rgba(0, 94, 166, 0.1);\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -0,0 +1,54 @@
1
+ import{i as n}from"../index-cd2f9c12.esm.js";const e=n`
2
+ :host {
3
+ }
4
+
5
+ .link {
6
+ display: inline-flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ text-align: center;
10
+ user-select: none;
11
+ white-space: nowrap;
12
+ padding: 12px;
13
+ gap: 8px;
14
+ }
15
+
16
+ .link__label {
17
+ color: #005ea6;
18
+ text-align: center;
19
+ font-family: Colfax-regular;
20
+ font-size: 14px;
21
+ font-style: normal;
22
+ font-weight: 400;
23
+ line-height: 14px;
24
+ letter-spacing: 0.2px;
25
+ }
26
+
27
+ .link--disabled {
28
+ color: rgba(0, 94, 166, 0.5);
29
+ cursor: not-allowed;
30
+ opacity: 0.6;
31
+ }
32
+
33
+ .link:not(.link--disabled):not(.link__button):hover {
34
+ color: #005291;
35
+ text-decoration-line: underline;
36
+ }
37
+
38
+ .link:not(.link--disabled):not(.link__button):active {
39
+ color: #002f53;
40
+ text-decoration-line: underline;
41
+ }
42
+
43
+ .link__button:hover {
44
+ color: #005291;
45
+ border-radius: 4px;
46
+ background: #f5f7f7;
47
+ }
48
+
49
+ .link__button:active {
50
+ color: #002f53;
51
+ border-radius: 4px;
52
+ background: rgba(0, 94, 166, 0.1);
53
+ }
54
+ `;export{e as s};
@@ -0,0 +1,16 @@
1
+ import{__decorate as s}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{state as t,customElement as e}from"lit/decorators.js";import{s as l}from"./nile-link.css.esm.js";import{H as r}from"../slot.esm.js";import{ifDefined as o}from"lit/directives/if-defined.js";import{classMap as a}from"lit/directives/class-map.js";import{N as n}from"../internal/nile-element.esm.js";import{n as f}from"../property-09139d3c.esm.js";import"lit";let m=class extends n{constructor(){super(...arguments),this.hasSlotController=new r(this,"[default]","prefix","suffix"),this.hasFocus=!1,this.disabled=!1,this.button=!1}static get styles(){return[l]}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}render(){return i`
2
+ <div
3
+ part="base"
4
+ class=${a({link:!0,"link--disabled":this.disabled,link__button:this.button})}
5
+ ?disabled=${o(this.disabled)}
6
+ title=${this.title}
7
+ aria-disabled=${this.disabled?"true":"false"}
8
+ tabindex=${this.disabled?"-1":"0"}
9
+ @blur=${this.handleBlur}
10
+ @focus=${this.handleFocus}
11
+ >
12
+ <slot name="prefix" part="prefix" class="link__prefix"></slot>
13
+ <slot part="label" class="link__label"></slot>
14
+ <slot name="suffix" part="suffix" class="link__suffix"></slot>
15
+ </div>
16
+ `}};s([t()],m.prototype,"hasFocus",void 0),s([f({type:Boolean,reflect:!0})],m.prototype,"disabled",void 0),s([f({type:Boolean})],m.prototype,"button",void 0),m=s([e("nile-link")],m);export{m as N};
package/dist/slot.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- System.register([],function(_export,_context){"use strict";return{setters:[],execute:function(){}};});
1
+ System.register([],function(_export,_context){"use strict";var t;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}return{setters:[],execute:function(){_export("H",t=/*#__PURE__*/function(){function t(_t){_classCallCheck(this,t);for(var _len=arguments.length,s=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){s[_key-1]=arguments[_key];}this.slotNames=[],(this.host=_t).addController(this),this.slotNames=s,this.handleSlotChange=this.handleSlotChange.bind(this);}_createClass(t,[{key:"hasDefaultSlot",value:function hasDefaultSlot(){return _toConsumableArray(this.host.childNodes).some(function(_t2){if(_t2.nodeType===_t2.TEXT_NODE&&""!==_t2.textContent.trim())return!0;if(_t2.nodeType===_t2.ELEMENT_NODE){var s=_t2;if("nile-visually-hidden"===s.tagName.toLowerCase())return!1;if(!s.hasAttribute("slot"))return!0;}return!1;});}},{key:"hasNamedSlot",value:function hasNamedSlot(_t3){return null!==this.host.querySelector(":scope > [slot=\"".concat(_t3,"\"]"));}},{key:"test",value:function test(_t4){return"[default]"===_t4?this.hasDefaultSlot():this.hasNamedSlot(_t4);}},{key:"hostConnected",value:function hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange);}},{key:"hostDisconnected",value:function hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange);}},{key:"handleSlotChange",value:function handleSlotChange(_t5){var s=_t5.target;(this.slotNames.includes("[default]")&&!s.name||s.name&&this.slotNames.includes(s.name))&&this.host.requestUpdate();}}]);return t;}());}};});
2
2
  //# sourceMappingURL=slot.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slot.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"slot.cjs.js","sources":["../../src/slot.ts"],"sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/** A reactive controller that determines when slots exist. */\nexport class HasSlotController implements ReactiveController {\n host: ReactiveControllerHost & Element;\n slotNames: string[] = [];\n\n constructor(host: ReactiveControllerHost & Element, ...slotNames: string[]) {\n (this.host = host).addController(this);\n this.slotNames = slotNames;\n this.handleSlotChange = this.handleSlotChange.bind(this);\n }\n\n private hasDefaultSlot() {\n return [...this.host.childNodes].some(node => {\n if (node.nodeType === node.TEXT_NODE && node.textContent!.trim() !== '') {\n return true;\n }\n\n if (node.nodeType === node.ELEMENT_NODE) {\n const el = node as HTMLElement;\n const tagName = el.tagName.toLowerCase();\n\n // Ignore visually hidden elements since they aren't rendered\n if (tagName === 'nile-visually-hidden') {\n return false;\n }\n\n // If it doesn't have a slot attribute, it's part of the default slot\n if (!el.hasAttribute('slot')) {\n return true;\n }\n }\n\n return false;\n });\n }\n\n private hasNamedSlot(name: string) {\n return this.host.querySelector(`:scope > [slot=\"${name}\"]`) !== null;\n }\n\n test(slotName: string) {\n return slotName === '[default]' ? this.hasDefaultSlot() : this.hasNamedSlot(slotName);\n }\n\n hostConnected() {\n this.host.shadowRoot!.addEventListener('slotchange', this.handleSlotChange);\n }\n\n hostDisconnected() {\n this.host.shadowRoot!.removeEventListener('slotchange', this.handleSlotChange);\n }\n\n handleSlotChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n\n if ((this.slotNames.includes('[default]') && !slot.name) || (slot.name && this.slotNames.includes(slot.name))) {\n this.host.requestUpdate();\n }\n }\n}\n\n/**\n * Given a slot, this function iterates over all of its assigned element and text nodes and returns the concatenated\n * HTML as a string. This is useful because we can't use slot.innerHTML as an alternative.\n */\nexport function getInnerHTML(slot: HTMLSlotElement): string {\n const nodes = slot.assignedNodes({ flatten: true });\n let html = '';\n\n [...nodes].forEach(node => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n html += (node as HTMLElement).outerHTML;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n html += node.textContent;\n }\n });\n\n return html;\n}\n\n/**\n * Given a slot, this function iterates over all of its assigned text nodes and returns the concatenated text as a\n * string. This is useful because we can't use slot.textContent as an alternative.\n */\nexport function getTextContent(slot: HTMLSlotElement | undefined | null): string {\n if (!slot) {\n return '';\n }\n const nodes = slot.assignedNodes({ flatten: true });\n let text = '';\n\n [...nodes].forEach(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent;\n }\n });\n\n return text;\n}\n"],"names":["HasSlotController","t","host","this","slotNames","addController","handleSlotChange","bind","_createClass","key","value","hasDefaultSlot","_toConsumableArray","childNodes","some","node","nodeType","TEXT_NODE","textContent","trim","ELEMENT_NODE","el","tagName","toLowerCase","hasAttribute","hasNamedSlot","name","querySelector","test","slotName","hostConnected","shadowRoot","addEventListener","hostDisconnected","removeEventListener","event","slot","target","includes","requestUpdate"],"mappings":"4kFAGaA,CAIX,yBAAA,SAAAC,EAAYC,EAAAA,CAFZC,CAAAA,eAAAA,MAAAA,CAAAA,UAAAA,IAAAA,CAAAA,SAAAA,CAAAA,MAAAA,CAEuDC,CAFvDD,KAAAA,KAAAA,CAAAA,IAAAA,GAAAA,IAAAA,MAAAA,IAAAA,GAAAA,IAAAA,CAAAA,IAAAA,CAAAA,IAAAA,IAEuDC,CAFvDD,CAAAA,IAAAA,IAAAA,SAAAA,CAAAA,IAAAA,GAAAA,IAAAA,CAASC,SAAa,CAAA,EAAA,CAAA,CAGnBD,IAAKD,CAAAA,IAAAA,CAAOA,EAAMG,EAAAA,aAAAA,CAAcF,MACjCA,IAAKC,CAAAA,SAAAA,CAAYA,CACjBD,CAAAA,IAAAA,CAAKG,gBAAmBH,CAAAA,IAAAA,CAAKG,gBAAiBC,CAAAA,IAAAA,CAAKJ,KACpD,EAEOK,YAAA,CAAAP,CAAA,GAAAQ,GAAA,kBAAAC,KAAA,UAAAC,eAAA,CACN,CAAA,MAAO,CAAAC,kBAAA,CAAIT,IAAAA,CAAKD,IAAKW,CAAAA,UAAAA,EAAYC,KAAKC,SAAAA,GACpC,CAAA,CAAA,GAAIA,GAAKC,CAAAA,QAAAA,GAAaD,GAAKE,CAAAA,SAAAA,EAA0C,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C,QAAS,CAAA,WAAA,CAAA,EAAA,CAAiBF,CAAKV,CAAAA,IAAAA,EAAUU,EAAKV,IAAQvB,EAAAA,IAAAA,CAAKC,SAAUkC,CAAAA,QAAAA,CAASF,CAAKV,CAAAA,IAAAA,CAAAA,GACrGvB,IAAKD,CAAAA,IAAAA,CAAKqC,eAEb"}
package/dist/slot.esm.js CHANGED
@@ -1 +1 @@
1
-
1
+ class t{constructor(t,...s){this.slotNames=[],(this.host=t).addController(this),this.slotNames=s,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some((t=>{if(t.nodeType===t.TEXT_NODE&&""!==t.textContent.trim())return!0;if(t.nodeType===t.ELEMENT_NODE){const s=t;if("nile-visually-hidden"===s.tagName.toLowerCase())return!1;if(!s.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(t){const s=t.target;(this.slotNames.includes("[default]")&&!s.name||s.name&&this.slotNames.includes(s.name))&&this.host.requestUpdate()}}export{t as H};
@@ -29,3 +29,4 @@ export { NileErrorMessage } from './nile-error-message';
29
29
  export { NileFormErrorMessage } from './nile-form-error-message';
30
30
  export { NileFormHelpText } from './nile-form-help-text';
31
31
  export { NileCalendar } from './nile-calendar';
32
+ export { NileLink } from './nile-link';
package/dist/src/index.js CHANGED
@@ -29,4 +29,5 @@ export { NileErrorMessage } from './nile-error-message';
29
29
  export { NileFormErrorMessage } from './nile-form-error-message';
30
30
  export { NileFormHelpText } from './nile-form-help-text';
31
31
  export { NileCalendar } from './nile-calendar';
32
+ export { NileLink } from './nile-link';
32
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":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C;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { NileButton } from './nile-button';\nexport { NileHeading } from './nile-heading';\nexport { NileIcon } from './nile-icon';\nexport { NileInput } from './nile-input';\nexport { NileSidebar } from './nile-sidebar';\nexport { NileMenu } from './nile-menu';\nexport { NileBadge } from './nile-badge';\nexport { NileDrawer } from './nile-drawer';\nexport { NileCheckbox } from './nile-checkbox';\nexport { NileRadio } from './nile-radio';\nexport { NileRadioGroup } from './nile-radio-group';\nexport { NilePopup } from './nile-popup';\nexport { NileTooltip } from './nile-tooltip';\nexport { NileSlideToggle } from './nile-slide-toggle';\nexport { NileLoader } from './nile-loader';\nexport { NileProgressBar } from './nile-progress-bar';\nexport { NileSpinner } from './nile-spinner';\nexport { NileSelect } from './nile-select';\nexport { NileOption } from './nile-option';\nexport { NileTag } from './nile-tag';\nexport { NileIconButton } from './nile-icon-button';\nexport { NileMenuItem } from './nile-menu-item';\nexport { NileDropdown } from './nile-dropdown';\nexport { NileAutoComplete } from './nile-auto-complete';\nexport { NileChip } from './nile-chip';\nexport { NileTextarea } from './nile-textarea';\nexport { NileDatePicker } from './nile-date-picker';\nexport { NileErrorMessage } from './nile-error-message';\nexport { NileFormErrorMessage } from './nile-form-error-message';\nexport { NileFormHelpText } from './nile-form-help-text';\nexport { NileCalendar } from './nile-calendar';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,O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aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAC,MAAM,aAAa,CAAC","sourcesContent":["export { NileButton } from './nile-button';\nexport { NileHeading } from './nile-heading';\nexport { NileIcon } from './nile-icon';\nexport { NileInput } from './nile-input';\nexport { NileSidebar } from './nile-sidebar';\nexport { NileMenu } from './nile-menu';\nexport { NileBadge } from './nile-badge';\nexport { NileDrawer } from './nile-drawer';\nexport { NileCheckbox } from './nile-checkbox';\nexport { NileRadio } from './nile-radio';\nexport { NileRadioGroup } from './nile-radio-group';\nexport { NilePopup } from './nile-popup';\nexport { NileTooltip } from './nile-tooltip';\nexport { NileSlideToggle } from './nile-slide-toggle';\nexport { NileLoader } from './nile-loader';\nexport { NileProgressBar } from './nile-progress-bar';\nexport { NileSpinner } from './nile-spinner';\nexport { NileSelect } from './nile-select';\nexport { NileOption } from './nile-option';\nexport { NileTag } from './nile-tag';\nexport { NileIconButton } from './nile-icon-button';\nexport { NileMenuItem } from './nile-menu-item';\nexport { NileDropdown } from './nile-dropdown';\nexport { NileAutoComplete } from './nile-auto-complete';\nexport { NileChip } from './nile-chip';\nexport { NileTextarea } from './nile-textarea';\nexport { NileDatePicker } from './nile-date-picker';\nexport { NileErrorMessage } from './nile-error-message';\nexport { NileFormErrorMessage } from './nile-form-error-message';\nexport { NileFormHelpText } from './nile-form-help-text';\nexport { NileCalendar } from './nile-calendar';\nexport { NileLink} from './nile-link';\n"]}
@@ -93,7 +93,7 @@ let NileDatePicker = class NileDatePicker extends NileElement {
93
93
  this.value = null;
94
94
  }
95
95
  catch (e) {
96
- console.error('Invalid range value');
96
+ // console.error('Invalid range value');
97
97
  }
98
98
  }
99
99
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"nile-date-picker.js","sourceRoot":"","sources":["../../../src/nile-date-picker/nile-date-picker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAO1C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAMnD,OAAO,eAAe,CAAC;AAGvB;;;;;GAKG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,WAAW;IAAxC;;QASG,iBAAY,GAAW,IAAI,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;QAC7C,gBAAW,GAAW,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAIX,mBAAc,GAAG,KAAK,CAAC;QAMnB,mBAAc,GAEnD,IAAI,CAAC;QAEgC,kBAAa,GAC3D,IAAI,CAAC;QAEqB,cAAS,GAAgB,IAAI,CAAC;QAC9B,YAAO,GAAgB,IAAI,CAAC;QAC3B,qBAAgB,GAAG,IAAI,CAAC,CAAC,wCAAwC;QAEjE,UAAK,GAAG,KAAK,CAAC;IA2I7C,CAAC;IAzKC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IA2BD,YAAY;QAEV,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE;YAC5B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CA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Ae;AAG3C;IADC,KAAK,CAAC,OAAO,CAAC;kDAuBd;AAxDU,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA0K1B;SA1KY,cAAc;AA4K3B,eAAe,cAAc,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-date-picker.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\nimport { NileDropdown } from '../nile-dropdown';\n\n/**\n * Nile icon component.\n *\n * @tag nile-date-picker\n *\n */\n@customElement('nile-date-picker')\nexport class NileDatePicker extends NileElement {\n /**\n * The styles for DatePicker\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private currentMonth: number = new Date().getMonth();\n private currentYear: number = new Date().getFullYear();\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n @property({ type: Boolean, reflect: true }) dropDownOpened = false;\n\n @property({ type: Object }) value : any;\n\n @property({ type: Object }) rangeValue : any;\n\n @property({ type: String, attribute: 'value' }) valueAttribute:\n | string\n | null = null;\n\n @property({ type: String, attribute: 'value' }) formattedDate: string | null =\n null;\n\n @property({ type: Object }) startDate: Date | null = null;\n @property({ type: Object }) endDate: Date | null = null;\n @property({ type: Boolean }) isSelectingStart = true; // flag to indicate what we're selecting\n\n @property({ type: Boolean }) range = false;\n\n @watch('value')\n valueChanged() {\n\n if (this.range && this.value) {\n this.rangeValue = this.value;\n this.value = null;\n return;\n }\n\n if (this.value && !isNaN(this.value.getTime())) {\n const offset = this.value.getTimezoneOffset();\n const localDate = new Date(this.value.getTime() - offset * 60 * 1000);\n if (!isNaN(localDate.getTime())) {\n this.valueAttribute = localDate.toISOString().split('T')[0];\n this.formattedDate = `${String(localDate.getDate()).padStart(\n 2,\n '0'\n )}/${String(localDate.getMonth() + 1).padStart(\n 2,\n '0'\n )}/${localDate.getFullYear()}`;\n }\n }\n }\n\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n if (changedProperties.has('valueAttribute')) {\n const date = new Date(this.valueAttribute || '');\n if (!isNaN(date.getTime())) {\n const offset = date.getTimezoneOffset();\n this.value = new Date(date.getTime() - offset * 60 * 1000);\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n static get observedAttributes() {\n return ['value', 'range'];\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (name === 'value') {\n this.valueAttribute = newValue;\n this.initializeValue();\n } else if (name === 'range') {\n this.range = newValue !== null;\n }\n }\n\n initializeValue() {\n if (this.range) {\n try {\n const rangeValue = JSON.parse(this.valueAttribute || '');\n this.startDate = new Date(rangeValue.startDate);\n this.endDate = new Date(rangeValue.endDate);\n\n // Convert to local time\n this.startDate = new Date(this.startDate.getTime());\n this.endDate = new Date(this.endDate.getTime());\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n this.value = null;\n } catch (e) {\n console.error('Invalid range value');\n }\n } else {\n if (this.valueAttribute) {\n let date: Date;\n\n date = new Date(this.valueAttribute);\n\n date = new Date(date.getTime() - date.getTimezoneOffset() * 60000);\n\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n this.rangeValue = null;\n }\n }\n }\n this.requestUpdate();\n }\n\n handleChanged(event:any) {\n this.emit('nile-changed', { value: event.detail.value });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n\n if (this.valueAttribute) {\n const date = new Date(this.valueAttribute);\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n\n\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n render(): TemplateResult {\n\n return html`\n <nile-dropdown .hoist=\"${true}\">\n <slot\n slot=\"trigger\"\n part=\"trigger\"\n name=\"trigger\"\n ></slot>\n\n<nile-calendar .value=\"${this.range}\" .range=\"${this.range}\" @nile-changed=\"${this.handleChanged}\"> </nile-calendar>\n </nile-dropdown>\n `;\n }\n}\n\nexport default NileDatePicker;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-date-picker': NileDatePicker;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-date-picker.js","sourceRoot":"","sources":["../../../src/nile-date-picker/nile-date-picker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAO1C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAMnD,OAAO,eAAe,CAAC;AAGvB;;;;;GAKG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,WAAW;I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EAAE,CAAC;6CAAa;AAEZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAkB;AAEG;IAA/C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;sDAE/B;AAEgC;IAA/C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;qDACxC;AAEqB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAA+B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAA6B;AAC3B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wDAAyB;AAExB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAe;AAG3C;IADC,KAAK,CAAC,OAAO,CAAC;kDAuBd;AAxDU,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA0K1B;SA1KY,cAAc;AA4K3B,eAAe,cAAc,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-date-picker.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\nimport { NileDropdown } from '../nile-dropdown';\n\n/**\n * Nile icon component.\n *\n * @tag nile-date-picker\n *\n */\n@customElement('nile-date-picker')\nexport class NileDatePicker extends NileElement {\n /**\n * The styles for DatePicker\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private currentMonth: number = new Date().getMonth();\n private currentYear: number = new Date().getFullYear();\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n @property({ type: Boolean, reflect: true }) dropDownOpened = false;\n\n @property({ type: Object }) value : any;\n\n @property({ type: Object }) rangeValue : any;\n\n @property({ type: String, attribute: 'value' }) valueAttribute:\n | string\n | null = null;\n\n @property({ type: String, attribute: 'value' }) formattedDate: string | null =\n null;\n\n @property({ type: Object }) startDate: Date | null = null;\n @property({ type: Object }) endDate: Date | null = null;\n @property({ type: Boolean }) isSelectingStart = true; // flag to indicate what we're selecting\n\n @property({ type: Boolean }) range = false;\n\n @watch('value')\n valueChanged() {\n\n if (this.range && this.value) {\n this.rangeValue = this.value;\n this.value = null;\n return;\n }\n\n if (this.value && !isNaN(this.value.getTime())) {\n const offset = this.value.getTimezoneOffset();\n const localDate = new Date(this.value.getTime() - offset * 60 * 1000);\n if (!isNaN(localDate.getTime())) {\n this.valueAttribute = localDate.toISOString().split('T')[0];\n this.formattedDate = `${String(localDate.getDate()).padStart(\n 2,\n '0'\n )}/${String(localDate.getMonth() + 1).padStart(\n 2,\n '0'\n )}/${localDate.getFullYear()}`;\n }\n }\n }\n\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n if (changedProperties.has('valueAttribute')) {\n const date = new Date(this.valueAttribute || '');\n if (!isNaN(date.getTime())) {\n const offset = date.getTimezoneOffset();\n this.value = new Date(date.getTime() - offset * 60 * 1000);\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n static get observedAttributes() {\n return ['value', 'range'];\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (name === 'value') {\n this.valueAttribute = newValue;\n this.initializeValue();\n } else if (name === 'range') {\n this.range = newValue !== null;\n }\n }\n\n initializeValue() {\n if (this.range) {\n try {\n const rangeValue = JSON.parse(this.valueAttribute || '');\n this.startDate = new Date(rangeValue.startDate);\n this.endDate = new Date(rangeValue.endDate);\n\n // Convert to local time\n this.startDate = new Date(this.startDate.getTime());\n this.endDate = new Date(this.endDate.getTime());\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n this.value = null;\n } catch (e) {\n // console.error('Invalid range value');\n }\n } else {\n if (this.valueAttribute) {\n let date: Date;\n\n date = new Date(this.valueAttribute);\n\n date = new Date(date.getTime() - date.getTimezoneOffset() * 60000);\n\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n this.rangeValue = null;\n }\n }\n }\n this.requestUpdate();\n }\n\n handleChanged(event:any) {\n this.emit('nile-changed', { value: event.detail.value });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n\n if (this.valueAttribute) {\n const date = new Date(this.valueAttribute);\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n\n\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n render(): TemplateResult {\n\n return html`\n <nile-dropdown .hoist=\"${true}\">\n <slot\n slot=\"trigger\"\n part=\"trigger\"\n name=\"trigger\"\n ></slot>\n\n<nile-calendar .value=\"${this.range}\" .range=\"${this.range}\" @nile-changed=\"${this.handleChanged}\"> </nile-calendar>\n </nile-dropdown>\n `;\n }\n}\n\nexport default NileDatePicker;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-date-picker': NileDatePicker;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export { NileLink } from './nile-link';
@@ -0,0 +1,2 @@
1
+ export { NileLink } from './nile-link';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAC,MAAM,aAAa,CAAC","sourcesContent":["export { NileLink} from './nile-link';\n"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /**
8
+ * Link CSS
9
+ */
10
+ export declare const styles: import("lit-element").CSSResult;
11
+ declare const _default: import("lit-element").CSSResult[];
12
+ export default _default;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { css } from 'lit-element';
8
+ /**
9
+ * Link CSS
10
+ */
11
+ export const styles = css `
12
+ :host {
13
+ }
14
+
15
+ .link {
16
+ display: inline-flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ text-align: center;
20
+ user-select: none;
21
+ white-space: nowrap;
22
+ padding: 12px;
23
+ gap: 8px;
24
+ }
25
+
26
+ .link__label {
27
+ color: #005ea6;
28
+ text-align: center;
29
+ font-family: Colfax-regular;
30
+ font-size: 14px;
31
+ font-style: normal;
32
+ font-weight: 400;
33
+ line-height: 14px;
34
+ letter-spacing: 0.2px;
35
+ }
36
+
37
+ .link--disabled {
38
+ color: rgba(0, 94, 166, 0.5);
39
+ cursor: not-allowed;
40
+ opacity: 0.6;
41
+ }
42
+
43
+ .link:not(.link--disabled):not(.link__button):hover {
44
+ color: #005291;
45
+ text-decoration-line: underline;
46
+ }
47
+
48
+ .link:not(.link--disabled):not(.link__button):active {
49
+ color: #002f53;
50
+ text-decoration-line: underline;
51
+ }
52
+
53
+ .link__button:hover {
54
+ color: #005291;
55
+ border-radius: 4px;
56
+ background: #f5f7f7;
57
+ }
58
+
59
+ .link__button:active {
60
+ color: #002f53;
61
+ border-radius: 4px;
62
+ background: rgba(0, 94, 166, 0.1);
63
+ }
64
+ `;
65
+ export default [styles];
66
+ //# sourceMappingURL=nile-link.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-link.css.js","sourceRoot":"","sources":["../../../src/nile-link/nile-link.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Link CSS\n */\nexport const styles = css`\n :host {\n }\n\n .link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n user-select: none;\n white-space: nowrap;\n padding: 12px;\n gap: 8px;\n }\n\n .link__label {\n color: #005ea6;\n text-align: center;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .link--disabled {\n color: rgba(0, 94, 166, 0.5);\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n .link:not(.link--disabled):not(.link__button):hover {\n color: #005291;\n text-decoration-line: underline;\n }\n\n .link:not(.link--disabled):not(.link__button):active {\n color: #002f53;\n text-decoration-line: underline;\n }\n\n .link__button:hover {\n color: #005291;\n border-radius: 4px;\n background: #f5f7f7;\n }\n\n .link__button:active {\n color: #002f53;\n border-radius: 4px;\n background: rgba(0, 94, 166, 0.1);\n }\n`;\n\nexport default [styles];\n"]}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { CSSResultArray, TemplateResult } from 'lit-element';
8
+ import NileElement from '../internal/nile-element';
9
+ /**
10
+ * Nile icon component.
11
+ *
12
+ * @tag nile-link
13
+ *
14
+ */
15
+ export declare class NileLink extends NileElement {
16
+ /**
17
+ * The styles for Link
18
+ * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
19
+ */
20
+ static get styles(): CSSResultArray;
21
+ private readonly hasSlotController;
22
+ private hasFocus;
23
+ /** Disables the button. */
24
+ disabled: boolean;
25
+ button: boolean;
26
+ private handleBlur;
27
+ private handleFocus;
28
+ /**
29
+ * Render method
30
+ * @slot This is a slot test
31
+ */
32
+ render(): TemplateResult;
33
+ }
34
+ export default NileLink;
35
+ declare global {
36
+ interface HTMLElementTagNameMap {
37
+ 'nile-link': NileLink;
38
+ }
39
+ }