@aquera/nile-elements 0.1.31-beta-1.0 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -24
- package/demo/index.html +9 -5
- package/dist/axe.min-2b379f29.cjs.js +12 -0
- package/dist/axe.min-2b379f29.cjs.js.map +1 -0
- package/dist/axe.min-c2cd8733.esm.js +12 -0
- package/dist/{fixture-3acb409b.cjs.js → fixture-161dee0b.cjs.js} +2 -2
- package/dist/{fixture-3acb409b.cjs.js.map → fixture-161dee0b.cjs.js.map} +1 -1
- package/dist/{fixture-db35a8ae.esm.js → fixture-372df3b0.esm.js} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/internal/animate.cjs.js +1 -1
- package/dist/internal/animate.cjs.js.map +1 -1
- package/dist/internal/animate.esm.js +1 -1
- package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
- package/dist/nile-accordion/nile-accordion.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordion.cjs.js.map +1 -1
- package/dist/nile-accordion/nile-accordion.css.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordion.css.cjs.js.map +1 -1
- package/dist/nile-accordion/nile-accordion.css.esm.js +1 -1
- package/dist/nile-accordion/nile-accordion.esm.js +4 -4
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
- package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.test.esm.js +1 -1
- package/dist/nile-button/nile-button.test.cjs.js +1 -1
- package/dist/nile-button/nile-button.test.esm.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
- package/dist/nile-card/nile-card.test.cjs.js +1 -1
- package/dist/nile-card/nile-card.test.esm.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-circular-progressbar/nile-circular-progressbar.css.cjs.js +1 -1
- package/dist/nile-circular-progressbar/nile-circular-progressbar.css.cjs.js.map +1 -1
- package/dist/nile-circular-progressbar/nile-circular-progressbar.css.esm.js +49 -49
- package/dist/nile-code-editor/extensionSetup.cjs.js +7 -7
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.esm.js +2 -2
- package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.test.esm.js +1 -1
- package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
- package/dist/nile-icon/nile-icon.test.esm.js +1 -1
- package/dist/nile-input/nile-input.test.cjs.js +1 -1
- package/dist/nile-input/nile-input.test.esm.js +1 -1
- package/dist/nile-link/nile-link.test.cjs.js +1 -1
- package/dist/nile-link/nile-link.test.esm.js +1 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.test.esm.js +1 -1
- package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.test.esm.js +1 -1
- package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.test.esm.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.test.esm.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
- package/dist/nile-select/nile-select.test.cjs.js +1 -1
- package/dist/nile-select/nile-select.test.esm.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
- package/dist/nile-stepper/nile-stepper.cjs.js +1 -1
- package/dist/nile-stepper/nile-stepper.cjs.js.map +1 -1
- package/dist/nile-stepper/nile-stepper.esm.js +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.cjs.js +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.cjs.js.map +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.cjs.js +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.cjs.js.map +1 -1
- package/dist/nile-stepper-item/nile-stepper-item.css.esm.js +21 -18
- package/dist/nile-stepper-item/nile-stepper-item.esm.js +13 -13
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
- package/dist/nile-table-body/nile-table-body.cjs.js +1 -1
- package/dist/nile-table-body/nile-table-body.cjs.js.map +1 -1
- package/dist/nile-table-body/nile-table-body.esm.js +2 -2
- package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js.map +1 -1
- package/dist/nile-table-cell-item/nile-table-cell-item.css.esm.js +2 -4
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.cjs.js.map +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.css.esm.js +0 -2
- package/dist/nile-table-row/nile-table-row.cjs.js.map +1 -1
- package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
- package/dist/nile-tooltip/index.cjs.js +1 -1
- package/dist/nile-tooltip/index.esm.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.esm.js +56 -115
- package/dist/nile-tooltip/nile-tooltip.esm.js +30 -13
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.cjs.js +1 -1
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.cjs.js.map +1 -1
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.css.cjs.js +1 -1
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.css.cjs.js.map +1 -1
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.css.esm.js +23 -15
- package/dist/nile-vertical-stepper-item/nile-vertical-stepper-item.esm.js +7 -7
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-accordion/nile-accordion.css.js +1 -1
- package/dist/src/nile-accordion/nile-accordion.css.js.map +1 -1
- package/dist/src/nile-accordion/nile-accordion.d.ts +5 -6
- package/dist/src/nile-accordion/nile-accordion.js +8 -21
- package/dist/src/nile-accordion/nile-accordion.js.map +1 -1
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.css.js +49 -49
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.css.js.map +1 -1
- package/dist/src/nile-stepper/nile-stepper.d.ts +1 -1
- package/dist/src/nile-stepper/nile-stepper.js +1 -1
- package/dist/src/nile-stepper/nile-stepper.js.map +1 -1
- package/dist/src/nile-stepper-item/nile-stepper-item.css.js +19 -16
- package/dist/src/nile-stepper-item/nile-stepper-item.css.js.map +1 -1
- package/dist/src/nile-stepper-item/nile-stepper-item.js +4 -5
- package/dist/src/nile-stepper-item/nile-stepper-item.js.map +1 -1
- package/dist/src/nile-table-body/nile-table-body.d.ts +1 -3
- package/dist/src/nile-table-body/nile-table-body.js +1 -9
- package/dist/src/nile-table-body/nile-table-body.js.map +1 -1
- package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js +2 -4
- package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js.map +1 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js +0 -2
- package/dist/src/nile-table-header-item/nile-table-header-item.css.js.map +1 -1
- package/dist/src/nile-table-row/nile-table-row.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js +54 -113
- package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.d.ts +62 -22
- package/dist/src/nile-tooltip/nile-tooltip.js +244 -180
- package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.css.js +23 -15
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.css.js.map +1 -1
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.js +5 -6
- package/dist/src/nile-vertical-stepper-item/nile-vertical-stepper-item.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -2
- package/src/nile-accordion/nile-accordion.css.ts +1 -1
- package/src/nile-accordion/nile-accordion.ts +4 -15
- package/src/nile-circular-progressbar/nile-circular-progressbar.css.ts +56 -55
- package/src/nile-stepper/nile-stepper.ts +1 -1
- package/src/nile-stepper-item/nile-stepper-item.css.ts +19 -16
- package/src/nile-stepper-item/nile-stepper-item.ts +4 -5
- package/src/nile-table-body/nile-table-body.ts +2 -8
- package/src/nile-table-cell-item/nile-table-cell-item.css.ts +2 -4
- package/src/nile-table-header-item/nile-table-header-item.css.ts +0 -2
- package/src/nile-table-row/nile-table-row.ts +2 -1
- package/src/nile-tooltip/nile-tooltip.css.ts +54 -113
- package/src/nile-tooltip/nile-tooltip.ts +269 -207
- package/src/nile-vertical-stepper-item/nile-vertical-stepper-item.css.ts +23 -15
- package/src/nile-vertical-stepper-item/nile-vertical-stepper-item.ts +5 -6
- package/vscode-html-custom-data.json +22 -43
- package/dist/axe.min-5bf06036.esm.js +0 -12
- package/dist/axe.min-ff35bfba.cjs.js +0 -12
- package/dist/axe.min-ff35bfba.cjs.js.map +0 -1
- package/dist/nile-table/index.cjs.js +0 -2
- package/dist/nile-table/index.cjs.js.map +0 -1
- package/dist/nile-table/index.esm.js +0 -1
- package/dist/nile-table/nile-table.cjs.js +0 -2
- package/dist/nile-table/nile-table.cjs.js.map +0 -1
- package/dist/nile-table/nile-table.css.cjs.js +0 -2
- package/dist/nile-table/nile-table.css.cjs.js.map +0 -1
- package/dist/nile-table/nile-table.css.esm.js +0 -5
- package/dist/nile-table/nile-table.esm.js +0 -3
- package/dist/src/nile-table/index.d.ts +0 -1
- package/dist/src/nile-table/index.js +0 -2
- package/dist/src/nile-table/index.js.map +0 -1
- package/dist/src/nile-table/nile-table.css.d.ts +0 -12
- package/dist/src/nile-table/nile-table.css.js +0 -17
- package/dist/src/nile-table/nile-table.css.js.map +0 -1
- package/dist/src/nile-table/nile-table.d.ts +0 -43
- package/dist/src/nile-table/nile-table.js +0 -118
- package/dist/src/nile-table/nile-table.js.map +0 -1
- package/src/nile-table/index.ts +0 -1
- package/src/nile-table/nile-table.css.ts +0 -19
- package/src/nile-table/nile-table.ts +0 -132
@@ -1,2 +1,2 @@
|
|
1
|
-
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);}System.register(["tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-tooltip.css.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,o,h,r,l,_templateObject,n;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;e=_litDecoratorsJs.query;o=_litDecoratorsJs.customElement;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_nileTooltipCssCjsJs){r=_nileTooltipCssCjsJs.s;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",n=/*#__PURE__*/function(_l){function n(){var _this;_classCallCheck(this,n);_this=_callSuper(this,n,arguments),_this.content="",_this.size="small",_this.placement="top",_this.disabled=!1,_this.open=!1,_this.trigger="hover focus",_this.distance=8,_this.skidding=0,_this.hoist=!1,_this.updateTooltipPosition=function(){if(!_this.tooltip||!_this.open)return;var t=_this.slotElement.assignedElements()[0];if(!t)return;var i=t.getBoundingClientRect(),s=_this.tooltip.getBoundingClientRect(),e=window.innerWidth,o=window.innerHeight;var h=0,r=0,l=_this.placement;var _n=_this.getBasePlacement(_this.placement),c=_this.getAlignmentModifier(_this.placement),a=i.left-s.width-_this.distance>0,d=i.right+s.width+_this.distance<e,p=i.bottom+s.height+_this.distance<o,m=i.top-s.height-_this.distance>0;var u=_n;"left"===_n&&!a||"right"===_n&&!d?u=p?"bottom":m?"top":"bottom":"top"!==_n||m?"bottom"!==_n||p||(u=m?"top":a?"left":"right"):u=p?"bottom":a?"left":"right";var f=c;switch("left"!==_n&&"right"!==_n||"top"!==u&&"bottom"!==u||("start"===c?f="start":"end"===c&&(f="end")),u){case"left":h=i.top+(i.height-s.height)/2+_this.skidding,r=i.left-s.width-_this.distance;break;case"right":h=i.top+(i.height-s.height)/2+_this.skidding,r=i.right+_this.distance;break;case"top":h=i.top-s.height-_this.distance,r=i.left+(i.width-s.width)/2+_this.skidding;break;case"bottom":h=i.bottom+_this.distance,r=i.left+(i.width-s.width)/2+_this.skidding;}"top"!==u&&"bottom"!==u||!f||("start"===f?r=i.left+_this.skidding:"end"===f&&(r=i.right-s.width+_this.skidding)),"left"!==u&&"right"!==u||!f||("start"===f?h=i.top+_this.skidding:"end"===f&&(h=i.bottom-s.height+_this.skidding)),l=f?"".concat(u,"-").concat(f):u,r<0&&(r=5),r+s.width>e&&(r=e-s.width-5),h<0&&(h=5),h+s.height>o&&(h=o-s.height-5),_this.tooltip.style.top="".concat(h,"px"),_this.tooltip.style.left="".concat(r,"px"),_this.tooltip.setAttribute("data-placement",l);},_this.showTooltip=function(){_this.disabled||""===_this.content.trim()||(_this.open=!0,_this.emit("nile-show"),_this.updateComplete.then(function(){_this.updateTooltipPosition(),_this.tooltip.addEventListener("transitionend",_this.handleAfterShow,{once:!0});}));},_this.handleAfterShow=function(){_this.emit("nile-after-show");},_this.hideTooltip=function(){_this.open&&(_this.emit("nile-hide"),_this.open=!1,_this.tooltip.addEventListener("transitionend",_this.handleAfterHide,{once:!0}));},_this.handleAfterHide=function(){_this.emit("nile-after-hide");},_this.handleMouseOver=function(){_this.trigger.includes("hover")&&(clearTimeout(_this.hoverTimeout),_this.hoverTimeout=window.setTimeout(function(){return _this.showTooltip();},150));},_this.handleMouseOut=function(){_this.trigger.includes("hover")&&(clearTimeout(_this.hoverTimeout),_this.hoverTimeout=window.setTimeout(function(){return _this.hideTooltip();},0));},_this.handleClick=function(){_this.trigger.includes("click")&&(_this.open=!_this.open,_this.emit("nile-show"),_this.updateComplete.then(function(){return _this.updateTooltipPosition();}));},_this.handleFocus=function(){_this.trigger.includes("focus")&&_this.showTooltip();},_this.handleBlur=function(){_this.trigger.includes("focus")&&_this.hideTooltip();};return _this;}_inherits(n,_l);return _createClass(n,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(n,"connectedCallback",this,3)([]),window.addEventListener("resize",this.updateTooltipPosition),window.addEventListener("scroll",this.updateTooltipPosition,!0);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(n,"disconnectedCallback",this,3)([]),window.removeEventListener("resize",this.updateTooltipPosition),window.removeEventListener("scroll",this.updateTooltipPosition,!0);}},{key:"getBasePlacement",value:function getBasePlacement(t){return t.split("-")[0];}},{key:"getAlignmentModifier",value:function getAlignmentModifier(t){var i=t.split("-");return i.length>1?i[1]:null;}},{key:"updated",value:function updated(t){_superPropGet(n,"updated",this,3)([t]),(t.has("open")||t.has("hoist"))&&this.open&&this.hoist;}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=",">\n ","\n </div>\n <slot\n @mouseover=","\n @mouseout=","\n @click=","\n @focus=","\n @blur=","\n aria-describedby=\"tooltip\"\n ></slot>\n "])),h({tooltip:!0,"tooltip__body--large":"large"===this.size}),this.content,this.handleMouseOver,this.handleMouseOut,this.handleClick,this.handleFocus,this.handleBlur);}}],[{key:"styles",get:function get(){return[r];}}]);}(l));t([s({type:String})],n.prototype,"content",void 0),t([s({reflect:!0})],n.prototype,"size",void 0),t([s({type:String})],n.prototype,"placement",void 0),t([s({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),t([s({type:Boolean,reflect:!0})],n.prototype,"open",void 0),t([s()],n.prototype,"trigger",void 0),t([s({type:Number})],n.prototype,"distance",void 0),t([s({type:Number})],n.prototype,"skidding",void 0),t([s({type:Boolean})],n.prototype,"hoist",void 0),t([e(".tooltip")],n.prototype,"tooltip",void 0),t([e("slot")],n.prototype,"slotElement",void 0),_export("N",n=t([o("nile-tooltip")],n));}};});
|
1
|
+
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);}System.register(["tslib","./nile-tooltip.css.cjs.js","../nile-popup/nile-popup.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","lit/decorators.js","../utilities/animation-registry.cjs.js","lit","../internal/event.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,o,h,a,l,n,r,p,d,c,u,m,_templateObject,f;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_nileTooltipCssCjsJs){i=_nileTooltipCssCjsJs.s;},function(_nilePopupNilePopupCjsJs){},function(_internalAnimateCjsJs){s=_internalAnimateCjsJs.p;e=_internalAnimateCjsJs.s;o=_internalAnimateCjsJs.a;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){a=_litDecoratorsJs.query;l=_litDecoratorsJs.property;n=_litDecoratorsJs.customElement;},function(_utilitiesAnimationRegistryCjsJs){r=_utilitiesAnimationRegistryCjsJs.s;p=_utilitiesAnimationRegistryCjsJs.g;},function(_lit){d=_lit.html;},function(_internalEventCjsJs){c=_internalEventCjsJs.w;},function(_internalWatchCjsJs){u=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){m=_internalNileElementCjsJs.N;},function(_nilePopupNilePopupCssCjsJs){}],execute:function execute(){_export("N",f=/*#__PURE__*/function(_m){function f(){var _this;_classCallCheck(this,f);_this=_callSuper(this,f,arguments),_this.content="",_this.size="small",_this.placement="top",_this.disabled=!1,_this.distance=8,_this.open=!1,_this.skidding=0,_this.trigger="hover focus",_this.hoist=!1;return _this;}_inherits(f,_m);return _createClass(f,[{key:"connectedCallback",value:function connectedCallback(){var _this2=this;_superPropGet(f,"connectedCallback",this,3)([]),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),this.updateComplete.then(function(){_this2.addEventListener("blur",_this2.handleBlur,!0),_this2.addEventListener("focus",_this2.handleFocus,!0),_this2.addEventListener("click",_this2.handleClick),_this2.addEventListener("keydown",_this2.handleKeyDown),_this2.addEventListener("mouseover",_this2.handleMouseOver),_this2.addEventListener("mouseout",_this2.handleMouseOut);});}},{key:"firstUpdated",value:function firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition());}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(f,"disconnectedCallback",this,3)([]),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut);}},{key:"handleBlur",value:function handleBlur(){this.hasTrigger("focus")&&this.hide();}},{key:"handleClick",value:function handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show());}},{key:"handleFocus",value:function handleFocus(){this.hasTrigger("focus")&&this.show();}},{key:"handleKeyDown",value:function handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide());}},{key:"handleMouseOver",value:function handleMouseOver(){var _this3=this;if(this.hasTrigger("hover")){var _t=s(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this3.show();},_t);}}},{key:"handleMouseOut",value:function handleMouseOut(){var _this4=this;if(this.hasTrigger("hover")){var _t2=s(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this4.hide();},_t2);}}},{key:"hasTrigger",value:function hasTrigger(t){return this.trigger.split(" ").includes(t);}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _p,_t3,_i,_p2,_t4,_i2;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!this.open){_context2.next=14;break;}if(!this.disabled){_context2.next=3;break;}return _context2.abrupt("return");case 3:this.emit("nile-show");_context2.next=6;return e(this.body);case 6:this.body.hidden=!1;this.popup.active=!0;_p=p(this,"tooltip.show",{dir:""}),_t3=_p.keyframes,_i=_p.options;_context2.next=11;return o(this.popup.popup,_t3,_i);case 11:this.emit("nile-after-show");_context2.next=23;break;case 14:this.emit("nile-hide");_context2.next=17;return e(this.body);case 17:_p2=p(this,"tooltip.hide",{dir:""}),_t4=_p2.keyframes,_i2=_p2.options;_context2.next=20;return o(this.popup.popup,_t4,_i2);case 20:this.popup.active=!1;this.body.hidden=!0;this.emit("nile-after-hide");case 23:case"end":return _context2.stop();}},_callee,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"handleOptionsChange",value:function(){var _handleOptionsChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.t0=this.hasUpdated;if(!_context3.t0){_context3.next=5;break;}_context3.next=4;return this.updateComplete;case 4:this.popup.reposition();case 5:case"end":return _context3.stop();}},_callee2,this);}));function handleOptionsChange(){return _handleOptionsChange.apply(this,arguments);}return handleOptionsChange;}()},{key:"handleDisabledChange",value:function handleDisabledChange(){this.disabled&&this.open&&this.hide();}},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _this$content;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!(!this.open&&(_this$content=this.content)!==null&&_this$content!==void 0&&_this$content.trim().length)){_context4.next=2;break;}return _context4.abrupt("return",(this.open=!0,c(this,"nile-after-show")));case 2:case"end":return _context4.stop();}},_callee3,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!this.open){_context5.next=2;break;}return _context5.abrupt("return",(this.open=!1,c(this,"nile-after-hide")));case 2:case"end":return _context5.stop();}},_callee4,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"render",value:function render(){return d(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popup\n part=\"base\"\n exportparts=\"\n popup:base__popup,\n arrow:base__arrow\n \"\n class=","\n placement=","\n distance=","\n skidding=","\n strategy=","\n flip\n shift\n arrow\n >\n <slot slot=\"anchor\" aria-describedby=\"tooltip\"></slot>\n\n <slot\n name=\"content\"\n part=\"body\"\n id=\"tooltip\"\n class=","\n role=\"tooltip\"\n aria-live=","\n >\n ","\n </slot>\n </nile-popup>\n "])),h({tooltip:!0,"tooltip--open":this.open}),this.placement,this.distance,this.skidding,this.hoist?"fixed":"absolute",h({tooltip__body:!0,"tooltip__body--large":"large"===this.size}),this.open?"polite":"off",this.content);}}],[{key:"styles",get:function get(){return[i];}}]);}(m));t([a("slot:not([name])")],f.prototype,"defaultSlot",void 0),t([a(".tooltip__body")],f.prototype,"body",void 0),t([a("nile-popup")],f.prototype,"popup",void 0),t([l({type:String,reflect:!0})],f.prototype,"content",void 0),t([l({reflect:!0})],f.prototype,"size",void 0),t([l()],f.prototype,"placement",void 0),t([l({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),t([l({type:Number})],f.prototype,"distance",void 0),t([l({type:Boolean,reflect:!0})],f.prototype,"open",void 0),t([l({type:Number})],f.prototype,"skidding",void 0),t([l()],f.prototype,"trigger",void 0),t([l({type:Boolean})],f.prototype,"hoist",void 0),t([u("open",{waitUntilFirstUpdate:!0})],f.prototype,"handleOpenChange",null),t([u(["content","distance","hoist","placement","skidding"])],f.prototype,"handleOptionsChange",null),t([u("disabled")],f.prototype,"handleDisabledChange",null),_export("N",f=t([n("nile-tooltip")],f)),r("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),r("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});}};});
|
2
2
|
//# sourceMappingURL=nile-tooltip.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-tooltip.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.ts"],"sourcesContent":["import { LitElement, html, css, CSSResultArray } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './nile-tooltip.css';\nimport NileElement from '../internal/nile-element';\n\ntype TooltipPlacement = \n | 'top' | 'top-start' | 'top-end' \n | 'right' | 'right-start' | 'right-end' \n | 'bottom' | 'bottom-start' | 'bottom-end' \n | 'left' | 'left-start' | 'left-end';\n\n// CSS Anchor positiong\n@customElement('nile-tooltip')\nexport class NileTooltip extends NileElement {\n @property({ type: String }) content = '';\n @property({ reflect: true }) size: 'small' | 'large' = 'small';\n @property({ type: String }) placement: TooltipPlacement = 'top';\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: Boolean, reflect: true }) open = false;\n @property() trigger = 'hover focus';\n @property({ type: Number }) distance = 8;\n @property({ type: Number }) skidding = 0;\n @property({ type: Boolean }) hoist = false;\n\n @query('.tooltip') tooltip!: HTMLElement;\n @query('slot') slotElement!: HTMLSlotElement;\n\n private hoverTimeout: number;\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n \n\n \n \n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('resize', this.updateTooltipPosition);\n window.addEventListener('scroll', this.updateTooltipPosition, true);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener('resize', this.updateTooltipPosition);\n window.removeEventListener('scroll', this.updateTooltipPosition, true);\n }\n\n private getBasePlacement(placement: TooltipPlacement): 'top' | 'right' | 'bottom' | 'left' {\n return placement.split('-')[0] as 'top' | 'right' | 'bottom' | 'left';\n }\n\n private getAlignmentModifier(placement: TooltipPlacement): 'start' | 'end' | null {\n const parts = placement.split('-');\n return parts.length > 1 ? parts[1] as 'start' | 'end' : null;\n }\n\n private updateTooltipPosition = () => {\n if (!this.tooltip || !this.open) return;\n\n const triggerEl = this.slotElement.assignedElements()[0] as HTMLElement;\n if (!triggerEl) return;\n\n \n \n const triggerRect = triggerEl.getBoundingClientRect();\n const tooltipRect = this.tooltip.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n \n let top = 0, left = 0;\n let finalPlacement = this.placement;\n const basePlacement = this.getBasePlacement(this.placement);\n const alignment = this.getAlignmentModifier(this.placement);\n\n \n const fitsLeft = triggerRect.left - tooltipRect.width - this.distance > 0;\n const fitsRight = triggerRect.right + tooltipRect.width + this.distance < viewportWidth;\n const fitsBottom = triggerRect.bottom + tooltipRect.height + this.distance < viewportHeight;\n const fitsTop = triggerRect.top - tooltipRect.height - this.distance > 0;\n\n \n let finalBasePlacement = basePlacement;\n \n \n if ((basePlacement === 'left' && !fitsLeft) || (basePlacement === 'right' && !fitsRight)) {\n finalBasePlacement = fitsBottom ? 'bottom' : (fitsTop ? 'top' : 'bottom');\n } \n \n else if (basePlacement === 'top' && !fitsTop) {\n finalBasePlacement = fitsBottom ? 'bottom' : (fitsLeft ? 'left' : 'right');\n } else if (basePlacement === 'bottom' && !fitsBottom) {\n finalBasePlacement = fitsTop ? 'top' : (fitsLeft ? 'left' : 'right');\n }\n\n \n let finalAlignment = alignment;\n \n \n if ((basePlacement === 'left' || basePlacement === 'right') && \n (finalBasePlacement === 'top' || finalBasePlacement === 'bottom')) {\n \n if (alignment === 'start') {\n finalAlignment = 'start';\n } else if (alignment === 'end') {\n finalAlignment = 'end';\n }\n }\n\n \n switch (finalBasePlacement) {\n case 'left':\n top = triggerRect.top + (triggerRect.height - tooltipRect.height) / 2 + this.skidding;\n left = triggerRect.left - tooltipRect.width - this.distance;\n break;\n case 'right':\n top = triggerRect.top + (triggerRect.height - tooltipRect.height) / 2 + this.skidding;\n left = triggerRect.right + this.distance;\n break;\n case 'top':\n top = triggerRect.top - tooltipRect.height - this.distance;\n left = triggerRect.left + (triggerRect.width - tooltipRect.width) / 2 + this.skidding;\n break;\n case 'bottom':\n top = triggerRect.bottom + this.distance;\n left = triggerRect.left + (triggerRect.width - tooltipRect.width) / 2 + this.skidding;\n break;\n }\n\n \n if ((finalBasePlacement === 'top' || finalBasePlacement === 'bottom') && finalAlignment) {\n if (finalAlignment === 'start') {\n left = triggerRect.left + this.skidding;\n } else if (finalAlignment === 'end') {\n left = triggerRect.right - tooltipRect.width + this.skidding;\n }\n }\n \n \n if ((finalBasePlacement === 'left' || finalBasePlacement === 'right') && finalAlignment) {\n if (finalAlignment === 'start') {\n top = triggerRect.top + this.skidding;\n } else if (finalAlignment === 'end') {\n top = triggerRect.bottom - tooltipRect.height + this.skidding;\n }\n }\n\n \n finalPlacement = finalAlignment ? `${finalBasePlacement}-${finalAlignment}` : finalBasePlacement;\n\n \n if (left < 0) left = 5;\n if (left + tooltipRect.width > viewportWidth) left = viewportWidth - tooltipRect.width - 5;\n if (top < 0) top = 5;\n if (top + tooltipRect.height > viewportHeight) top = viewportHeight - tooltipRect.height - 5;\n\n \n this.tooltip.style.top = `${top}px`;\n this.tooltip.style.left = `${left}px`;\n this.tooltip.setAttribute('data-placement', finalPlacement as string);\n };\n\n private showTooltip = () => {\n if (!this.disabled && \n this.content.trim() !== '') {\n this.open = true;\n this.emit('nile-show');\n this.updateComplete.then(() => {\n this.updateTooltipPosition();\n \n \n this.tooltip.addEventListener('transitionend', this.handleAfterShow, { once: true });\n });\n }\n };\n \n private handleAfterShow = () => {\n this.emit('nile-after-show');\n };\n \n\n private hideTooltip = () => {\n if (!this.open) return;\n \n this.emit('nile-hide');\n this.open = false;\n \n this.tooltip.addEventListener('transitionend', this.handleAfterHide, { once: true });\n };\n \n private handleAfterHide = () => {\n this.emit('nile-after-hide');\n };\n \n private handleMouseOver = () => {\n if (this.trigger.includes('hover')) {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.showTooltip(), 150);\n }\n };\n\n private handleMouseOut = () => {\n if (this.trigger.includes('hover')) {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.hideTooltip(), 0);\n }\n };\n\n private handleClick = () => {\n if (this.trigger.includes('click')) {\n this.open = !this.open;\n this.emit('nile-show');\n this.updateComplete.then(() => this.updateTooltipPosition());\n }\n };\n\n updated(changedProperties: Map<string, any>) {\n super.updated(changedProperties);\n \n \n if (changedProperties.has('open') || changedProperties.has('hoist')) {\n if (this.open && this.hoist) {\n \n }\n }\n }\n\n private handleFocus = () => {\n if (this.trigger.includes('focus')) {\n this.showTooltip();\n }\n };\n\n private handleBlur = () => {\n if (this.trigger.includes('focus')) {\n this.hideTooltip();\n }\n };\n\n render() {\n return html`\n <div class=${classMap({ tooltip: true, 'tooltip__body--large': this.size === 'large' })}>\n ${this.content}\n </div>\n <slot\n @mouseover=${this.handleMouseOver}\n @mouseout=${this.handleMouseOut}\n @click=${this.handleClick}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n aria-describedby=\"tooltip\"\n ></slot>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-tooltip': NileTooltip;\n }\n}"],"names":["NileTooltip","_l","n","this","content","size","placement","disabled","open","trigger","distance","skidding","hoist","updateTooltipPosition","tooltip","triggerEl","slotElement","assignedElements","triggerRect","getBoundingClientRect","tooltipRect","viewportWidth","window","innerWidth","viewportHeight","innerHeight","top","left","finalPlacement","basePlacement","getBasePlacement","alignment","getAlignmentModifier","fitsLeft","width","fitsRight","right","fitsBottom","bottom","height","fitsTop","finalBasePlacement","finalAlignment","style","concat","setAttribute","showTooltip","trim","emit","updateComplete","then","addEventListener","handleAfterShow","once","hideTooltip","handleAfterHide","handleMouseOver","includes","clearTimeout","hoverTimeout","setTimeout","handleMouseOut","handleClick","handleFocus","handleBlur","_this","_inherits","_createClass","key","value","connectedCallback","super","disconnectedCallback","removeEventListener","split","parts","length","updated","changedProperties","has","render","html","_templateObject","_taggedTemplateLiteral","classMap","__decorate","get","styles","NileElement","property","type","String","prototype","reflect","Boolean","Number","query","customElement"],"mappings":"+wHAcaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,qEACuBC,EAAAA,KAAAA,CAAOC,QAAG,EACTD,CAAAA,KAAAA,CAAIE,IAAsB,CAAA,OAAA,CAC3BF,KAAAA,CAASG,SAAAA,CAAqB,KACdH,CAAAA,KAAAA,CAAQI,UAAG,CACXJ,CAAAA,KAAAA,CAAIK,IAAG,CAAA,CAAA,CAAA,CACvCL,KAAAA,CAAOM,OAAAA,CAAG,aACMN,CAAAA,KAAAA,CAAQO,SAAG,CACXP,CAAAA,KAAAA,CAAQQ,QAAG,CAAA,CAAA,CACVR,KAAAA,CAAKS,KAAAA,CAAAA,CAAG,CAmC7BT,CAAAA,KAAAA,CAAqBU,sBAAG,UAC9B,CAAA,GAAA,CAAKV,KAAAA,CAAKW,OAAAA,EAAAA,CAAYX,KAAAA,CAAKK,IAAAA,CAAM,OAEjC,GAAMO,CAAAA,EAAYZ,KAAAA,CAAKa,WAAAA,CAAYC,gBAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CACtD,IAAKF,CAAW,CAAA,OAIhB,GAAMG,CAAAA,CAAAA,CAAcH,EAAUI,qBACxBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAcjB,KAAAA,CAAKW,OAAAA,CAAQK,qBAC3BE,CAAAA,CAAAA,CAAAA,CAAAA,CAAgBC,M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CAAA,CAAA,CAA3CI,CAAS,CAAA,CAAEC,IAAMI,CAAAA,OAAAA,CAASD,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB7F,CAAA4F,CAAAA,SAAAA,CAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CAC7CP,CAAA,CAAA,CAAXI,KAAmCzF,CAAA4F,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CACRP,CAAA,CAAA,CAA3BI,EAAS,CAAEC,IAAAA,CAAMK,MAAuB/F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4F,SAAA,CAAA,UAAA,CAAA,IAAA,IACbP,CAAA,CAAA,CAA3BI,CAAS,CAAA,CAAEC,IAAMK,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAuB/F,CAAA4F,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CACZP,CAAA,CAAA,CAA5BI,CAAS,CAAA,CAAEC,KAAMI,OAAyB9F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4F,SAAA,CAAA,OAAA,CAAA,IAAA,EAExBP,CAAAA,CAAAA,CAAAA,CAAA,CAAlBW,CAAM,CAAA,UAAA,CAAA,CAAA,CAAkChG,CAAA4F,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAC1BP,EAAA,CAAdW,CAAAA,CAAM,MAAsChG,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4F,SAAA,CAAA,aAAA,CAAA,IAAA,EAZlC5F,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAWqF,CAAA,CAAA,CADvBY,CAAc,CAAA,cAAA,CAAA,CAAA,CACFjG"}
|
1
|
+
{"version":3,"file":"nile-tooltip.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.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, CSSResultArray, TemplateResult } from 'lit';\nimport { styles } from './nile-tooltip.css';\nimport '../nile-popup/nile-popup';\nimport { animateTo, parseDuration, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { html } from 'lit';\n// import { LocalizeController } from '../utilities/localize';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\nimport type NilePopup from '../nile-popup/nile-popup';\n/**\n * Nile icon component.\n *\n * @tag nile-tooltip\n *\n */\n@customElement('nile-tooltip')\nexport class NileTooltip extends NileElement {\n /**\n * The styles for Tooltip\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 hoverTimeout: number;\n // private readonly localize = new LocalizeController(this);\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n @query('.tooltip__body') body: HTMLElement;\n @query('nile-popup') popup: NilePopup;\n\n /** The tooltip's content. If you need to display HTML, use the `content` slot instead. */\n @property({ type: String, reflect: true }) content = '';\n\n /** Size Property to decide the tool tip size */\n @property({ reflect: true }) size: 'small' | 'large' = 'small';\n\n /**\n * The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip\n * inside of the viewport.\n */\n @property() placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /** Disables the tooltip so it won't show when triggered. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The distance in pixels from which to offset the tooltip away from its target. */\n @property({ type: Number }) distance = 8;\n\n /** Indicates whether or not the tooltip is open. You can use this in lieu of the show/hide methods. */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** The distance in pixels from which to offset the tooltip along its target. */\n @property({ type: Number }) skidding = 0;\n\n /**\n * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple\n * options can be passed by separating them with a space. When manual is used, the tooltip must be activated\n * programmatically.\n */\n @property() trigger = 'hover focus';\n\n /**\n * Enable this option to prevent the tooltip from being clipped when the component is placed inside a container with\n * `overflow: auto|hidden|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all,\n * scenarios.\n */\n @property({ type: Boolean }) hoist = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleBlur = this.handleBlur.bind(this);\n this.handleClick = this.handleClick.bind(this);\n this.handleFocus = this.handleFocus.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.handleMouseOver = this.handleMouseOver.bind(this);\n this.handleMouseOut = this.handleMouseOut.bind(this);\n\n this.updateComplete.then(() => {\n this.addEventListener('blur', this.handleBlur, true);\n this.addEventListener('focus', this.handleFocus, true);\n this.addEventListener('click', this.handleClick);\n this.addEventListener('keydown', this.handleKeyDown);\n this.addEventListener('mouseover', this.handleMouseOver);\n this.addEventListener('mouseout', this.handleMouseOut);\n });\n }\n\n firstUpdated() {\n this.body.hidden = !this.open;\n\n // If the tooltip is visible on init, update its position\n if (this.open) {\n this.popup.active = true;\n this.popup.reposition();\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('blur', this.handleBlur, true);\n this.removeEventListener('focus', this.handleFocus, true);\n this.removeEventListener('click', this.handleClick);\n this.removeEventListener('keydown', this.handleKeyDown);\n this.removeEventListener('mouseover', this.handleMouseOver);\n this.removeEventListener('mouseout', this.handleMouseOut);\n }\n\n private handleBlur() {\n if (this.hasTrigger('focus')) {\n this.hide();\n }\n }\n\n private handleClick() {\n if (this.hasTrigger('click')) {\n if (this.open) {\n this.hide();\n } else {\n this.show();\n }\n }\n }\n\n private handleFocus() {\n if (this.hasTrigger('focus')) {\n this.show();\n }\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n // Pressing escape when the target element has focus should dismiss the tooltip\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n }\n }\n\n private handleMouseOver() {\n if (this.hasTrigger('hover')) {\n const delay = parseDuration(\n getComputedStyle(this).getPropertyValue('--show-delay')\n );\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.show(), delay);\n }\n }\n\n private handleMouseOut() {\n if (this.hasTrigger('hover')) {\n const delay = parseDuration(\n getComputedStyle(this).getPropertyValue('--hide-delay')\n );\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.hide(), delay);\n }\n }\n\n private hasTrigger(triggerType: string) {\n const triggers = this.trigger.split(' ');\n return triggers.includes(triggerType);\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n if (this.disabled) {\n return;\n }\n\n // Show\n this.emit('nile-show');\n\n await stopAnimations(this.body);\n this.body.hidden = false;\n this.popup.active = true;\n const { keyframes, options } = getAnimation(this, 'tooltip.show', {\n dir: '',\n });\n await animateTo(this.popup.popup, keyframes, options);\n\n this.emit('nile-after-show');\n } else {\n // Hide\n this.emit('nile-hide');\n\n await stopAnimations(this.body);\n const { keyframes, options } = getAnimation(this, 'tooltip.hide', {\n dir: '',\n });\n await animateTo(this.popup.popup, keyframes, options);\n this.popup.active = false;\n this.body.hidden = true;\n\n this.emit('nile-after-hide');\n }\n }\n\n @watch(['content', 'distance', 'hoist', 'placement', 'skidding'])\n async handleOptionsChange() {\n if (this.hasUpdated) {\n await this.updateComplete;\n this.popup.reposition();\n }\n }\n\n @watch('disabled')\n handleDisabledChange() {\n if (this.disabled && this.open) {\n this.hide();\n }\n }\n\n /** Shows the tooltip. */\n async show() {\n if (this.open || !this.content?.trim().length) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'nile-after-show');\n }\n\n /** Hides the tooltip */\n async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'nile-after-hide');\n }\n\n render() {\n return html`\n <nile-popup\n part=\"base\"\n exportparts=\"\n popup:base__popup,\n arrow:base__arrow\n \"\n class=${classMap({\n tooltip: true,\n 'tooltip--open': this.open,\n })}\n placement=${this.placement}\n distance=${this.distance}\n skidding=${this.skidding}\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n flip\n shift\n arrow\n >\n <slot slot=\"anchor\" aria-describedby=\"tooltip\"></slot>\n\n <slot\n name=\"content\"\n part=\"body\"\n id=\"tooltip\"\n class=${classMap({\n tooltip__body: true,\n 'tooltip__body--large': this.size === 'large',\n })}\n role=\"tooltip\"\n aria-live=${this.open ? 'polite' : 'off'}\n >\n ${this.content}\n </slot>\n </nile-popup>\n `;\n }\n}\n\nsetDefaultAnimation('tooltip.show', {\n keyframes: [\n { opacity: 0, scale: 0.8 },\n { opacity: 1, scale: 1 },\n ],\n options: { duration: 150, easing: 'ease' },\n});\n\nsetDefaultAnimation('tooltip.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.8 },\n ],\n options: { duration: 150, easing: 'ease' },\n});\n\nexport default NileTooltip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-tooltip': NileTooltip;\n }\n}\n"],"names":["NileTooltip","f","constructor","this","content","size","placement","disabled","distance","open","skidding","trigger","hoist","_this","_inherits","_m","_createClass","key","value","connectedCallback","super","handleBlur","bind","handleClick","handleFocus","handleKeyDown","handleMouseOver","handleMouseOut","updateComplete","then","addEventListener","firstUpdated","body","hidden","popup","active","reposition","disconnectedCallback","removeEventListener","hasTrigger","hide","show","event","stopPropagation","delay","parseDuration","getComputedStyle","getPropertyValue","clearTimeout","hoverTimeout","window","setTimeout","_this4","triggerType","split","includes","_handleOpenChange","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_p","_t3","_i","_p2","_t4","_i2","wrap","_callee$","_context2","prev","next","emit","stopAnimations","getAnimation","dir","animateTo","keyframes","options","stop","handleOpenChange","_callee2","_callee2$","_context3","t0","hasUpdated","handleOptionsChange","handleDisabledChange","_show","_callee3","_this$content","_callee3$","_context4","trim","length","abrupt","waitForEvent","_callee4","_callee4$","_context5","render","html","_templateObject","_taggedTemplateLiteral","classMap","tooltip","tooltip__body","__decorate","get","styles","NileElement","query","prototype","property","type","String","reflect","Boolean","Number","watch","waitUntilFirstUpdate","customElement","setDefaultAnimation","opacity","scale","duration","easing"],"mappings":"i4YA+BaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCAiBsCC,EAAAA,KAAAA,CAAOC,OAAG,CAAA,EAAA,CAGxBD,KAAAA,CAAIE,IAAAA,CAAsB,QAM3CF,KAAAA,CAASG,SAAAA,CAYJ,KAG2BH,CAAAA,KAAAA,CAAQI,QAAG,CAAA,CAAA,CAAA,CAG3BJ,KAAAA,CAAQK,QAAG,CAAA,CAAA,CAGKL,KAAAA,CAAIM,IAAAA,CAAAA,CAAG,CAGvBN,CAAAA,KAAAA,CAAQO,SAAG,CAO3BP,CAAAA,KAAAA,CAAOQ,OAAG,CAAA,aAAA,CAOOR,KAAAA,CAAKS,KAAAA,CAAAA,CAAG,CA4MtC,QAAAC,KAAA,EAvQQC,SAAA,CAAAb,CAAA,CAAAc,EAAA,SAAAC,YAAA,CAAAf,CAAA,GAAAgB,GAAA,qBAAAC,KAAA,CA6DP,SAAAC,iBAAAA,CAAAA,CAAAA,KAAAA,MAAAA,MACEC,aAAAA,CAAAA,CAAAA,iCACAjB,IAAKkB,CAAAA,UAAAA,CAAalB,KAAKkB,UAAWC,CAAAA,IAAAA,CAAKnB,IACvCA,CAAAA,CAAAA,IAAAA,CAAKoB,WAAcpB,CAAAA,IAAAA,CAAKoB,YAAYD,IAAKnB,CAAAA,IAAAA,CAAAA,CACzCA,IAAKqB,CAAAA,WAAAA,CAAcrB,IAAKqB,CAAAA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A,cAAA,CAAA,CAAA,CACFzH,IA8Qb0H,CAAoB,CAAA,cAAA,CAAgB,CAClC7C,SAAW,CAAA,CACT,CAAE8C,OAAS,CAAA,CAAA,CAAGC,MAAO,EACrB,CAAA,CAAA,CAAED,QAAS,CAAGC,CAAAA,KAAAA,CAAO,CAEvB9C,CAAAA,CAAAA,CAAAA,OAAAA,CAAS,CAAE+C,QAAAA,CAAU,IAAKC,MAAQ,CAAA,MAAA,CAAA,CAAA,CAAA,CAGpCJ,EAAoB,cAAgB,CAAA,CAClC7C,UAAW,CACT,CAAE8C,QAAS,CAAGC,CAAAA,KAAAA,CAAO,GACrB,CAAED,OAAAA,CAAS,EAAGC,KAAO,CAAA,EAAA,CAAA,CAAA,CAEvB9C,QAAS,CAAE+C,QAAAA,CAAU,GAAKC,CAAAA,MAAAA,CAAQ"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var o,_templateObject,t;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){o=_lit.css;}],execute:function execute(){_export("s",t=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n --max-width: 20rem;\n --hide-delay: 0ms;\n --show-delay: 150ms;\n\n display: contents;\n }\n\n .tooltip {\n --arrow-size: 6px;\n --arrow-color: var(--nile-tooltip-color-background);\n }\n\n .tooltip::part(popup) {\n pointer-events: none;\n z-index: 1000;\n }\n\n .tooltip[placement^='top']::part(popup) {\n transform-origin: bottom;\n }\n\n .tooltip[placement^='bottom']::part(popup) {\n transform-origin: top;\n }\n\n .tooltip[placement^='left']::part(popup) {\n transform-origin: right;\n }\n\n .tooltip[placement^='right']::part(popup) {\n transform-origin: left;\n }\n\n .tooltip__body {\n display: block;\n width: max-content;\n max-width: var(--max-width);\n border-radius: 4px;\n background-color: var(--nile-tooltip-color-background);\n font-size: var(--nile-tooltip-font-size-sm);\n font-weight: var(--nile-tooltip-font-weight-sm);\n line-height: var(--nile-tooltip-line-height-sm);\n padding: var(--nile-tooltip-padding-y) var(--nile-tooltip-padding-x);\n color: var(--nile-colors-white-base);\n pointer-events: none;\n word-break: break-word;\n }\n\n .tooltip__body--large {\n font-size: var(--nile-tooltip-font-size-lg);\n line-height: var(--nile-tooltip-line-height-lg);\n font-weight: var(--nile-tooltip-font-weight-lg);\n }\n"]))));}};});
|
2
2
|
//# sourceMappingURL=nile-tooltip.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-tooltip.css.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.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';\n\n/**\n * Tooltip CSS\n */\nexport const styles = css`\n
|
1
|
+
{"version":3,"file":"nile-tooltip.css.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.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';\n\n/**\n * Tooltip CSS\n */\nexport const styles = css`\n :host {\n --max-width: 20rem;\n --hide-delay: 0ms;\n --show-delay: 150ms;\n\n display: contents;\n }\n\n .tooltip {\n --arrow-size: 6px;\n --arrow-color: var(--nile-tooltip-color-background);\n }\n\n .tooltip::part(popup) {\n pointer-events: none;\n z-index: 1000;\n }\n\n .tooltip[placement^='top']::part(popup) {\n transform-origin: bottom;\n }\n\n .tooltip[placement^='bottom']::part(popup) {\n transform-origin: top;\n }\n\n .tooltip[placement^='left']::part(popup) {\n transform-origin: right;\n }\n\n .tooltip[placement^='right']::part(popup) {\n transform-origin: left;\n }\n\n .tooltip__body {\n display: block;\n width: max-content;\n max-width: var(--max-width);\n border-radius: 4px;\n background-color: var(--nile-tooltip-color-background);\n font-size: var(--nile-tooltip-font-size-sm);\n font-weight: var(--nile-tooltip-font-weight-sm);\n line-height: var(--nile-tooltip-line-height-sm);\n padding: var(--nile-tooltip-padding-y) var(--nile-tooltip-padding-x);\n color: var(--nile-colors-white-base);\n pointer-events: none;\n word-break: break-word;\n }\n\n .tooltip__body--large {\n font-size: var(--nile-tooltip-font-size-lg);\n line-height: var(--nile-tooltip-line-height-lg);\n font-weight: var(--nile-tooltip-font-weight-lg);\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
@@ -1,115 +1,56 @@
|
|
1
|
-
import{css as
|
2
|
-
|
3
|
-
|
4
|
-
:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
}
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
}
|
58
|
-
|
59
|
-
.tooltip[data-placement^="bottom"]::after {
|
60
|
-
top: -6px;
|
61
|
-
border-width: 0 6px 6px 6px;
|
62
|
-
border-color: transparent transparent var(--nile-tooltip-color-background, #333) transparent;
|
63
|
-
}
|
64
|
-
|
65
|
-
.tooltip[data-placement^="left"]::after {
|
66
|
-
right: -6px;
|
67
|
-
border-width: 6px 0 6px 6px;
|
68
|
-
border-color: transparent transparent transparent var(--nile-tooltip-color-background, #333);
|
69
|
-
}
|
70
|
-
|
71
|
-
.tooltip[data-placement^="right"]::after {
|
72
|
-
left: -6px;
|
73
|
-
border-width: 6px 6px 6px 0;
|
74
|
-
border-color: transparent var(--nile-tooltip-color-background, #333) transparent transparent;
|
75
|
-
}
|
76
|
-
|
77
|
-
/* Arrow Horizontal Alignment for top/bottom placements */
|
78
|
-
.tooltip[data-placement="top"]::after,
|
79
|
-
.tooltip[data-placement="bottom"]::after {
|
80
|
-
left: 50%;
|
81
|
-
transform: translateX(-50%);
|
82
|
-
}
|
83
|
-
|
84
|
-
.tooltip[data-placement="top-start"]::after,
|
85
|
-
.tooltip[data-placement="bottom-start"]::after {
|
86
|
-
left: 12px;
|
87
|
-
}
|
88
|
-
|
89
|
-
.tooltip[data-placement="top-end"]::after,
|
90
|
-
.tooltip[data-placement="bottom-end"]::after {
|
91
|
-
right: 12px;
|
92
|
-
left: auto;
|
93
|
-
}
|
94
|
-
|
95
|
-
/* Arrow Vertical Alignment for left/right placements */
|
96
|
-
.tooltip[data-placement="left"]::after,
|
97
|
-
.tooltip[data-placement="right"]::after {
|
98
|
-
top: 50%;
|
99
|
-
transform: translateY(-50%);
|
100
|
-
}
|
101
|
-
|
102
|
-
.tooltip[data-placement="left-start"]::after,
|
103
|
-
.tooltip[data-placement="right-start"]::after {
|
104
|
-
top: 12px;
|
105
|
-
transform: none;
|
106
|
-
}
|
107
|
-
|
108
|
-
.tooltip[data-placement="left-end"]::after,
|
109
|
-
.tooltip[data-placement="right-end"]::after {
|
110
|
-
bottom: 12px;
|
111
|
-
top: auto;
|
112
|
-
transform: none;
|
113
|
-
}
|
114
|
-
|
115
|
-
`;export{o as s};
|
1
|
+
import{css as o}from"lit";const t=o`
|
2
|
+
:host {
|
3
|
+
--max-width: 20rem;
|
4
|
+
--hide-delay: 0ms;
|
5
|
+
--show-delay: 150ms;
|
6
|
+
|
7
|
+
display: contents;
|
8
|
+
}
|
9
|
+
|
10
|
+
.tooltip {
|
11
|
+
--arrow-size: 6px;
|
12
|
+
--arrow-color: var(--nile-tooltip-color-background);
|
13
|
+
}
|
14
|
+
|
15
|
+
.tooltip::part(popup) {
|
16
|
+
pointer-events: none;
|
17
|
+
z-index: 1000;
|
18
|
+
}
|
19
|
+
|
20
|
+
.tooltip[placement^='top']::part(popup) {
|
21
|
+
transform-origin: bottom;
|
22
|
+
}
|
23
|
+
|
24
|
+
.tooltip[placement^='bottom']::part(popup) {
|
25
|
+
transform-origin: top;
|
26
|
+
}
|
27
|
+
|
28
|
+
.tooltip[placement^='left']::part(popup) {
|
29
|
+
transform-origin: right;
|
30
|
+
}
|
31
|
+
|
32
|
+
.tooltip[placement^='right']::part(popup) {
|
33
|
+
transform-origin: left;
|
34
|
+
}
|
35
|
+
|
36
|
+
.tooltip__body {
|
37
|
+
display: block;
|
38
|
+
width: max-content;
|
39
|
+
max-width: var(--max-width);
|
40
|
+
border-radius: 4px;
|
41
|
+
background-color: var(--nile-tooltip-color-background);
|
42
|
+
font-size: var(--nile-tooltip-font-size-sm);
|
43
|
+
font-weight: var(--nile-tooltip-font-weight-sm);
|
44
|
+
line-height: var(--nile-tooltip-line-height-sm);
|
45
|
+
padding: var(--nile-tooltip-padding-y) var(--nile-tooltip-padding-x);
|
46
|
+
color: var(--nile-colors-white-base);
|
47
|
+
pointer-events: none;
|
48
|
+
word-break: break-word;
|
49
|
+
}
|
50
|
+
|
51
|
+
.tooltip__body--large {
|
52
|
+
font-size: var(--nile-tooltip-font-size-lg);
|
53
|
+
line-height: var(--nile-tooltip-line-height-lg);
|
54
|
+
font-weight: var(--nile-tooltip-font-weight-lg);
|
55
|
+
}
|
56
|
+
`;export{t as s};
|
@@ -1,13 +1,30 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
import{__decorate as t}from"tslib";import{s as i}from"./nile-tooltip.css.esm.js";import"../nile-popup/nile-popup.esm.js";import{p as s,s as e,a as o}from"../internal/animate.esm.js";import{classMap as h}from"lit/directives/class-map.js";import{query as a,property as l,customElement as n}from"lit/decorators.js";import{s as r,g as p}from"../utilities/animation-registry.esm.js";import{html as d}from"lit";import{w as c}from"../internal/event.esm.js";import{w as m}from"../internal/watch.esm.js";import{N as u}from"../internal/nile-element.esm.js";import"../nile-popup/nile-popup.css.esm.js";let f=class extends u{constructor(){super(...arguments),this.content="",this.size="small",this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.trigger="hover focus",this.hoist=!1}static get styles(){return[i]}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),this.updateComplete.then((()=>{this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}))}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut)}handleBlur(){this.hasTrigger("focus")&&this.hide()}handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show())}handleFocus(){this.hasTrigger("focus")&&this.show()}handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide())}handleMouseOver(){if(this.hasTrigger("hover")){const t=s(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),t)}}handleMouseOut(){if(this.hasTrigger("hover")){const t=s(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),t)}}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){if(this.open){if(this.disabled)return;this.emit("nile-show"),await e(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:t,options:i}=p(this,"tooltip.show",{dir:""});await o(this.popup.popup,t,i),this.emit("nile-after-show")}else{this.emit("nile-hide"),await e(this.body);const{keyframes:t,options:i}=p(this,"tooltip.hide",{dir:""});await o(this.popup.popup,t,i),this.popup.active=!1,this.body.hidden=!0,this.emit("nile-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open&&this.content?.trim().length)return this.open=!0,c(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,c(this,"nile-after-hide")}render(){return d`
|
2
|
+
<nile-popup
|
3
|
+
part="base"
|
4
|
+
exportparts="
|
5
|
+
popup:base__popup,
|
6
|
+
arrow:base__arrow
|
7
|
+
"
|
8
|
+
class=${h({tooltip:!0,"tooltip--open":this.open})}
|
9
|
+
placement=${this.placement}
|
10
|
+
distance=${this.distance}
|
11
|
+
skidding=${this.skidding}
|
12
|
+
strategy=${this.hoist?"fixed":"absolute"}
|
13
|
+
flip
|
14
|
+
shift
|
15
|
+
arrow
|
16
|
+
>
|
17
|
+
<slot slot="anchor" aria-describedby="tooltip"></slot>
|
18
|
+
|
19
|
+
<slot
|
20
|
+
name="content"
|
21
|
+
part="body"
|
22
|
+
id="tooltip"
|
23
|
+
class=${h({tooltip__body:!0,"tooltip__body--large":"large"===this.size})}
|
24
|
+
role="tooltip"
|
25
|
+
aria-live=${this.open?"polite":"off"}
|
26
|
+
>
|
27
|
+
${this.content}
|
28
|
+
</slot>
|
29
|
+
</nile-popup>
|
30
|
+
`}};t([a("slot:not([name])")],f.prototype,"defaultSlot",void 0),t([a(".tooltip__body")],f.prototype,"body",void 0),t([a("nile-popup")],f.prototype,"popup",void 0),t([l({type:String,reflect:!0})],f.prototype,"content",void 0),t([l({reflect:!0})],f.prototype,"size",void 0),t([l()],f.prototype,"placement",void 0),t([l({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),t([l({type:Number})],f.prototype,"distance",void 0),t([l({type:Boolean,reflect:!0})],f.prototype,"open",void 0),t([l({type:Number})],f.prototype,"skidding",void 0),t([l()],f.prototype,"trigger",void 0),t([l({type:Boolean})],f.prototype,"hoist",void 0),t([m("open",{waitUntilFirstUpdate:!0})],f.prototype,"handleOpenChange",null),t([m(["content","distance","hoist","placement","skidding"])],f.prototype,"handleOptionsChange",null),t([m("disabled")],f.prototype,"handleDisabledChange",null),f=t([n("nile-tooltip")],f),r("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),r("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});export{f as N};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
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);}System.register(["tslib","lit","lit/decorators.js","./nile-vertical-stepper-item.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/class-map.js"],function(_export,_context){"use strict";var t,e,i,s,l,p,r,
|
1
|
+
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);}System.register(["tslib","lit","lit/decorators.js","./nile-vertical-stepper-item.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/class-map.js"],function(_export,_context){"use strict";var t,e,i,s,l,_,p,r,o,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,n;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){e=_lit.html;i=_lit.nothing;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;l=_litDecoratorsJs.state;_=_litDecoratorsJs.customElement;},function(_nileVerticalStepperItemCssCjsJs){p=_nileVerticalStepperItemCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_litDirectivesClassMapJs){o=_litDirectivesClassMapJs.classMap;}],execute:function execute(){_export("N",n=/*#__PURE__*/function(_r){function n(){var _this;_classCallCheck(this,n);_this=_callSuper(this,n,arguments),_this.title="",_this.subtitle="",_this.contentBelow=!1,_this.size="lg",_this.icon="tick",_this.isFirst=!1,_this.isLast=!1,_this.isComplete=!1,_this.isCurrent=!1,_this.haveFlex=!0;return _this;}_inherits(n,_r);return _createClass(n,[{key:"render",value:function render(){this.isLast&&this.style.setProperty("--vertical-stepper-flex-val","0");var t=this.isCurrent,s=this.isComplete;var l=!1;(s&&!t||this.completedStepValue==this.value)&&(l=!0);var _=!1;return s&&(_=!0,this.calculatedCompletedStepValue==this.value&&(_=!1)),"sm"==this.size||this.size,e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t\t\t<div class=\"","\">\n\t\t\t\t<div class=\"stepper-item__connector-content\">\n\t\t\t\t\t<div class=\"stepper__item__bulletin\">\n\t\t\t\t\t\t","\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"stepper__item__line__container\">\n\t\t\t\t\t\t","\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"stepper__item__content\">\n\t\t\t\t\t<div class=\"","\">","</div>\n\t\t\t\t\t<div class=\"","\">","</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t"])),o({stepper__item:!0,"stepper__item--selected":t,"stepper__item--default":!t,"stepper__item--sm":"sm"==this.size,"stepper__item--lg":"lg"==this.size}),l?e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<div class=\"","\">","</div>"])),o({"stepper__bulletin--icon":!0,"stepper__bulletin__icon--active":t}),this.getSvg()):e(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<div class=\"","\"></div>"])),o({"stepper__bulletin--dot":!0,"stepper__bulletin__dot--active":t})),this.isLast?i:e(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<div class=\"","\"></div>"])),o({stepper__item__line:!0,"stepper__item__line--active":_})),o({stepper__content__title:!0,"stepper__content__title--alone":!this.subtitle,"stepper__content__title--active":t}),this.title,o({stepper__content__subtitle:!0,"stepper__content__subtitle--alone":!this.title,"stepper__content__subtitle--active":t}),this.subtitle);}},{key:"getSvg",value:function getSvg(){var t="sm"==this.size?20:"lg"==this.size?24:28;return e(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n\t\t<svg width=\"","\" height=\"","\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M22.7953 9.85334L13.2487 19.0667L10.7153 16.36C10.2487 15.92 9.51534 15.8933 8.982 16.2667C8.462 16.6533 8.31534 17.3333 8.63534 17.88L11.6353 22.76C11.9287 23.2133 12.4353 23.4933 13.0087 23.4933C13.5553 23.4933 14.0753 23.2133 14.3687 22.76C14.8487 22.1333 24.0087 11.2133 24.0087 11.2133C25.2087 9.98668 23.7553 8.90668 22.7953 9.84001V9.85334Z\" fill=\"white\"/>\n\t\t</svg>\n\t\t"])),t,t);}}],[{key:"styles",get:function get(){return[p];}}]);}(r));t([s()],n.prototype,"title",void 0),t([s()],n.prototype,"subtitle",void 0),t([l()],n.prototype,"contentBelow",void 0),t([l()],n.prototype,"size",void 0),t([l()],n.prototype,"icon",void 0),t([l()],n.prototype,"isFirst",void 0),t([l()],n.prototype,"isLast",void 0),t([l()],n.prototype,"isComplete",void 0),t([l()],n.prototype,"isCurrent",void 0),t([l()],n.prototype,"currentStepValue",void 0),t([l()],n.prototype,"completedStepValue",void 0),t([l()],n.prototype,"calculatedCompletedStepValue",void 0),t([l()],n.prototype,"value",void 0),t([l()],n.prototype,"haveFlex",void 0),_export("N",n=t([_("nile-vertical-stepper-item")],n));}};});
|
2
2
|
//# sourceMappingURL=nile-vertical-stepper-item.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-vertical-stepper-item.cjs.js","sources":["../../../src/nile-vertical-stepper-item/nile-vertical-stepper-item.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, nothing, html, CSSResultArray, TemplateResult} from 'lit';\nimport { customElement, state, property } from 'lit/decorators.js';\nimport {styles} from './nile-vertical-stepper-item.css';\nimport NileElement from '../internal/nile-element';\nimport { classMap } from 'lit/directives/class-map.js';\n\n\n/**\n * Nile vertical-stepper-item component.\n *\n * @tag nile-vertical-stepper-item\n *\n */\n@customElement('nile-vertical-stepper-item')\nexport class NileVerticalStepperItem extends NileElement {\n\t/* Properties passed directly */\n\t@property() title: string = '';\n\t@property() subtitle: string = '';\n\n\n\t/* Properties passed to parent component: NileStepper */\n\t@state() private contentBelow = false;\n\t@state() private size : 'sm' | '
|
1
|
+
{"version":3,"file":"nile-vertical-stepper-item.cjs.js","sources":["../../../src/nile-vertical-stepper-item/nile-vertical-stepper-item.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, nothing, html, CSSResultArray, TemplateResult} from 'lit';\nimport { customElement, state, property } from 'lit/decorators.js';\nimport {styles} from './nile-vertical-stepper-item.css';\nimport NileElement from '../internal/nile-element';\nimport { classMap } from 'lit/directives/class-map.js';\n\n\n/**\n * Nile vertical-stepper-item component.\n *\n * @tag nile-vertical-stepper-item\n *\n */\n@customElement('nile-vertical-stepper-item')\nexport class NileVerticalStepperItem extends NileElement {\n\t/* Properties passed directly */\n\t@property() title: string = '';\n\t@property() subtitle: string = '';\n\n\n\t/* Properties passed to parent component: NileStepper */\n\t@state() private contentBelow = false;\n\t@state() private size : 'sm' | 'lg' = 'lg';\n\t@state() private icon = 'tick';\n\n\n\t/* Properties Computed at parent level component NileStepper */\n\t@state() private isFirst = false;\n\t@state() private isLast = false;\n\n\t@state() private isComplete = false;\n\t@state() private isCurrent = false;\n\t@state() private currentStepValue :Number;\n\t@state() private completedStepValue :Number;\n\t@state() private calculatedCompletedStepValue :Number;\n\n\t@state() private value :Number;\n\t@state() private haveFlex :Boolean=true;\n\n\t/**\n\t * The styles for nile-vertical-stepper-item\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\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\tif (this.isLast) this.style.setProperty('--vertical-stepper-flex-val', `0`);\n\t\tconst isCurrent = this.isCurrent;\n\t\tconst isComplete = this.isComplete;\n\n\t\tlet showCompletedIcon=false;\n\t\tif(isComplete && !isCurrent || this.completedStepValue==this.value) showCompletedIcon=true;\n\n\t\tlet suffixStepperLineActive = false;\n\t\tif (isComplete) {\n\t\t\tsuffixStepperLineActive = true;\n\t\t\tif (this.calculatedCompletedStepValue == this.value) suffixStepperLineActive = false;\n\t\t}\n\n\t\tlet iconSize = this.size == 'sm'?14:this.size == 'lg'?16:20;\n\t\treturn html`\n\t\t\t<div class=\"${classMap({\n\t\t\t\t'stepper__item':true,\n\t\t\t\t'stepper__item--selected':isCurrent,\n\t\t\t\t'stepper__item--default':!isCurrent,\n\t\t\t\t'stepper__item--sm':this.size=='sm',\n\t\t\t\t'stepper__item--lg':this.size=='lg',\n\t\t\t})}\">\n\t\t\t\t<div class=\"stepper-item__connector-content\">\n\t\t\t\t\t<div class=\"stepper__item__bulletin\">\n\t\t\t\t\t\t${showCompletedIcon ? \n\t\t\t\t\t\t\thtml`<div class=\"${classMap({ 'stepper__bulletin--icon':true, 'stepper__bulletin__icon--active':isCurrent })}\">${this.getSvg()}</div>`\n\t\t\t\t\t\t\t: html`<div class=\"${classMap({ 'stepper__bulletin--dot':true, 'stepper__bulletin__dot--active':isCurrent })}\"></div>`\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"stepper__item__line__container\">\n\t\t\t\t\t\t${this.isLast?nothing : html`<div class=\"${classMap({ 'stepper__item__line':true, 'stepper__item__line--active':suffixStepperLineActive })}\"></div>`}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"stepper__item__content\">\n\t\t\t\t\t<div class=\"${classMap({ 'stepper__content__title':true, \"stepper__content__title--alone\": !this.subtitle, 'stepper__content__title--active':isCurrent })}\">${this.title}</div>\n\t\t\t\t\t<div class=\"${classMap({ 'stepper__content__subtitle':true, \"stepper__content__subtitle--alone\": !this.title, 'stepper__content__subtitle--active':isCurrent })}\">${this.subtitle}</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t`;\n\t}\n\n\tgetSvg():TemplateResult{\n\t\tlet iconSize = this.size == 'sm' ? 20 : this.size == 'lg' ? 24 : 28;\n\t\treturn html`\n\t\t<svg width=\"${iconSize}\" height=\"${iconSize}\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M22.7953 9.85334L13.2487 19.0667L10.7153 16.36C10.2487 15.92 9.51534 15.8933 8.982 16.2667C8.462 16.6533 8.31534 17.3333 8.63534 17.88L11.6353 22.76C11.9287 23.2133 12.4353 23.4933 13.0087 23.4933C13.5553 23.4933 14.0753 23.2133 14.3687 22.76C14.8487 22.1333 24.0087 11.2133 24.0087 11.2133C25.2087 9.98668 23.7553 8.90668 22.7953 9.84001V9.85334Z\" fill=\"white\"/>\n\t\t</svg>\n\t\t`\n\t}\n\n\n\t/* #endregion */\n}\n\nexport default NileVerticalStepperItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-vertical-stepper-item': NileVerticalStepperItem;\n }\n}"],"names":["NileVerticalStepperItem","n","this","title","subtitle","contentBelow","size","icon","isFirst","isLast","isComplete","isCurrent","haveFlex","_this","_inherits","_r","_createClass","key","value","render","style","setProperty","showCompletedIcon","completedStepValue","suffixStepperLineActive","calculatedCompletedStepValue","html","_templateObject","_taggedTemplateLiteral","classMap","stepper__item","_templateObject2","getSvg","_templateObject3","nothing","_templateObject4","stepper__item__line","stepper__content__title","stepper__content__subtitle","iconSize","_templateObject5","__decorate","get","styles","NileElement","property","prototype","state","_export","customElement"],"mappings":"63GAqBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEAEMC,EAAAA,KAAAA,CAAKC,KAAW,CAAA,EAAA,CAChBD,KAAAA,CAAQE,QAAW,CAAA,EAAA,CAIdF,KAAAA,CAAYG,YAAG,CAAA,CAAA,CAAA,CACfH,KAAAA,CAAII,IAAiB,CAAA,IAAA,CACrBJ,KAAAA,CAAIK,IAAAA,CAAG,MAIPL,CAAAA,KAAAA,CAAOM,SAAG,CACVN,CAAAA,KAAAA,CAAMO,MAAG,CAAA,CAAA,CAAA,CAETP,KAAAA,CAAUQ,UAAAA,CAAAA,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,CAAhBM,CAAqD/C,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA8C,UAAA,8BAAA,CAAA,IAAA,EAAA,CAAA,CAErCL,EAAA,CAAhBM,CAAAA,CAAAA,CAAAA,CAAAA,CAA8B/C,CAAA8C,CAAAA,SAAAA,CAAA,OAAA,CAAA,IAAA,EAAA,CAAA,CACdL,EAAA,CAAhBM,CAAAA,CAAAA,CAAAA,CAAAA,CAAuC/C,CAAA8C,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAAAE,OAAA,KAvB5BhD,EAAuByC,CAAA,CAAA,CADnCQ,CAAc,CAAA,4BAAA,CAAA,CAAA,CACFjD"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,t;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",t=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t:host {\n\t\t--vertical-stepper-flex-val:1;\n\t\tflex-grow:var(--vertical-stepper-flex-val);\n\t\t--bulletin--dot--seperation:30%;\n\t\t--min-line-container-height:25px;\n\t}\n\n\t.stepper__item {\n\t\tdisplay:flex;\n\t\tcolumn-gap:var(--item-spacing);\n\t\theight:100%;\n\t}\n\n\t.stepper__item--sm {\n\t\t--item-spacing: var(--nile-spacing-spacing-md);\n\t\t--stepper-item-title-size:12px;\n\t\t--stepper-item-
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,t;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",t=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t:host {\n\t\t--vertical-stepper-flex-val:1;\n\t\tflex-grow:var(--vertical-stepper-flex-val);\n\t\t--bulletin--dot--seperation:30%;\n\t\t--min-line-container-height:25px;\n\t\t--lines-thickness: 1px;\n\t}\n\n\t.stepper__item {\n\t\tdisplay:flex;\n\t\tcolumn-gap:var(--item-spacing);\n\t\theight: 100%;\n\t}\n\n\t.stepper__item--sm {\n\t\t--item-spacing: var(--nile-spacing-spacing-md);\n\t\t--stepper-item-title-size:12px;\n\t\t--stepper-item-subtitle-size:10.24px;\n\t\t--stepper-item-text-line-height:16px;\n\t\t--circle-height:18px;\n\t}\n\n\t.stepper__item--lg {\n\t\t--item-spacing: var(--nile-spacing-spacing-md);\n\t\t--stepper-item-title-size:14px;\n\t\t--stepper-item-subtitle-size:12px;\n\t\t--stepper-item-text-line-height:18px;\n\t\t--circle-height:22px;\n\t}\n\n\t.stepper__item--xl {\n\t\t--item-spacing: var(--nile-spacing-spacing-lg);\n\t\t--stepper-item-title-size:16px;\n\t\t--stepper-item-subtitle-size:14px;\n\t\t--stepper-item-text-line-height:24px;\n\t\t--circle-height:26px;\n\t}\n\t\n\t.stepper-item__connector-content{\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\n\t.stepper__item__bulletin {\n\t\tdisplay:grid;\n\t\tplace-content:center;\n\t}\n\n\t.stepper__item__bulletin {\n\t\tmargin-top:3px;\n\t\tmargin-bottom:3px;\n\t}\n\n\t.stepper__bulletin--dot {\n\t\twidth: var(--circle-height);\n\t\taspect-ratio: 1 / 1;\n\t\tborder-radius: 50%;\n\t\tbackground: radial-gradient(var(--nile-colors-neutral-500) var(--bulletin--dot--seperation), var(--nile-colors-dark-200) var(--bulletin--dot--seperation));\n\t\tborder: var(--lines-thickness) solid var(--nile-colors-neutral-500);\n\t}\n\n\t.stepper__bulletin__dot--active{\n\t\tbackground: radial-gradient(var(--nile-colors-white-base) var(--bulletin--dot--seperation), var(--nile-colors-primary-600) var(--bulletin--dot--seperation));\n\t\tborder: var(--lines-thickness) solid var(--nile-colors-primary-500);\n\t\twidth: calc( var(--circle-height) + calc( var(--lines-thickness) * 2 ) );\n\t}\n\n\t.stepper__bulletin--icon {\n\t\tdisplay:grid;\n\t\tplace-content:center;\n\t\twidth: var(--circle-height);\n\t\tborder: var(--lines-thickness) solid var(--nile-colors-primary-600);\n\t\taspect-ratio: 1 / 1;\n\t\tborder-radius: 50%;\n\t\tbackground-color:var(--nile-colors-primary-600);\n\t\toverflow:hidden;\n\t}\n\t\n\t.stepper__bulletin__icon--active {\n\t\tborder: var(--lines-thickness) solid var(--nile-colors-primary-500);\n\t\twidth: calc(var(--circle-height) + calc( var(--lines-thickness) * 2));\n\t}\n\n\t.stepper__item__line__container{\n\t\tflex-grow: 1;\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\tpadding: 2px;\n\t\tmin-height: var(--min-line-container-height);\n\t}\n\n\t.stepper__item__line{\n\t\theight:100%;\n\t\tborder-left: var(--lines-thickness) solid var(--nile-colors-neutral-500);\n\t}\n\t.stepper__item__line--active{\n\t\tborder-left: var(--lines-thickness) solid var(--nile-colors-primary-600);\n\t}\n\n\t.stepper__item__content{\n\t\tdisplay:flex;\n\t\tflex-direction:column;\n\t\tjustify-content:start;\n\t}\n\t.stepper__content__title {\n\t\tcolor:var(--nile-colors-dark-900);\n\t\tfont-size: var(--stepper-item-title-size);\n\t\tline-height: var(--stepper-item-text-line-height);\n\t\tfont-family: var(--nile-font-family-medium);\n\t\tfont-weight: 400;\n\t}\n\n\t.stepper__content__title--alone{\n\t\tmargin-top: 25%;\n\t}\n\n\t.stepper__content__subtitle--alone{\n\t\tmargin-top: 6.25%;\n\t}\n\n\t.stepper__content__title--active{\n\t\tcolor:var(--nile-colors-primary-600);\n\t\tfont-weight: 600;\n\t}\n\n\t.stepper__content__subtitle {\n\t\tcolor:var(--nile-colors-dark-500);\n\t\tfont-size: var(--stepper-item-subtitle-size);\n\t\tline-height: var(--stepper-item-text-line-height);\n\t\tfont-family: var( --nile-font-family-sans-serif);\n\t\tfont-weight: 400;\n\t}\n\n\t.stepper__content__subtitle--active{\n\t\tcolor:var(--nile-colors-primary-600);\n\t}\n"]))));}};});
|
2
2
|
//# sourceMappingURL=nile-vertical-stepper-item.css.cjs.js.map
|