@aquera/nile-elements 0.1.36-beta-1.4 → 0.1.37
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 +4 -0
- package/demo/index.html +9 -11
- package/demo/variables.css +13 -0
- package/dist/{fixture-d7bf42eb.cjs.js → fixture-161dee0b.cjs.js} +2 -2
- package/dist/{fixture-d7bf42eb.cjs.js.map → fixture-161dee0b.cjs.js.map} +1 -1
- package/dist/{fixture-178ed8d2.esm.js → fixture-372df3b0.esm.js} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.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-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.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.esm.js +17 -8
- 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-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-filter-chip/nile-filter-chip.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.cjs.js.map +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js.map +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.css.esm.js +40 -17
- package/dist/nile-filter-chip/nile-filter-chip.esm.js +24 -15
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js.map +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +16 -16
- 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/icons/svg/accessreview.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/accessreview.cjs.js.map +1 -1
- package/dist/nile-icon/icons/svg/accessreview.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-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-textarea/nile-textarea.test.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.js +9 -0
- package/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.css.js +40 -17
- package/dist/src/nile-filter-chip/nile-filter-chip.css.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.d.ts +4 -3
- package/dist/src/nile-filter-chip/nile-filter-chip.js +25 -12
- package/dist/src/nile-filter-chip/nile-filter-chip.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js +12 -12
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/accessreview.d.ts +1 -1
- package/dist/src/nile-icon/icons/svg/accessreview.js +1 -1
- package/dist/src/nile-icon/icons/svg/accessreview.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/nile-chip/nile-chip.ts +9 -0
- package/src/nile-filter-chip/index.ts +1 -0
- package/src/nile-filter-chip/nile-filter-chip.css.ts +138 -0
- package/src/nile-filter-chip/nile-filter-chip.test.ts +92 -0
- package/src/nile-filter-chip/nile-filter-chip.ts +136 -0
- package/src/nile-icon/icons/svg/accessreview.ts +1 -1
- package/vscode-html-custom-data.json +49 -0
- package/dist/fixture-bb486165.cjs.js +0 -395
- package/dist/fixture-bb486165.cjs.js.map +0 -1
- package/dist/fixture-c4e75e04.esm.js +0 -569
- package/dist/nile-tooltip/nile-tooltip-utils.cjs.js +0 -2
- package/dist/nile-tooltip/nile-tooltip-utils.cjs.js.map +0 -1
- package/dist/nile-tooltip/nile-tooltip-utils.esm.js +0 -1
- package/dist/nile-tooltip/nile-tooltip.test.cjs.js +0 -2
- package/dist/nile-tooltip/nile-tooltip.test.cjs.js.map +0 -1
- package/dist/nile-tooltip/nile-tooltip.test.esm.js +0 -47
- package/dist/src/nile-new-error/index.d.ts +0 -1
- package/dist/src/nile-new-error/index.js +0 -2
- package/dist/src/nile-new-error/index.js.map +0 -1
- package/dist/src/nile-new-error/nile-new-error.css.d.ts +0 -12
- package/dist/src/nile-new-error/nile-new-error.css.js +0 -38
- package/dist/src/nile-new-error/nile-new-error.css.js.map +0 -1
- package/dist/src/nile-new-error/nile-new-error.d.ts +0 -36
- package/dist/src/nile-new-error/nile-new-error.js +0 -74
- package/dist/src/nile-new-error/nile-new-error.js.map +0 -1
- package/dist/src/nile-tooltip/nile-tooltip-utils.d.ts +0 -18
- package/dist/src/nile-tooltip/nile-tooltip-utils.js +0 -216
- package/dist/src/nile-tooltip/nile-tooltip-utils.js.map +0 -1
- package/dist/src/nile-tooltip/nile-tooltip.test.d.ts +0 -1
- package/dist/src/nile-tooltip/nile-tooltip.test.js +0 -148
- package/dist/src/nile-tooltip/nile-tooltip.test.js.map +0 -1
- package/dist/src/nile-virtual-list/index.d.ts +0 -1
- package/dist/src/nile-virtual-list/index.js +0 -2
- package/dist/src/nile-virtual-list/index.js.map +0 -1
- package/dist/src/nile-virtual-list/nile-virtual-list.css.d.ts +0 -12
- package/dist/src/nile-virtual-list/nile-virtual-list.css.js +0 -25
- package/dist/src/nile-virtual-list/nile-virtual-list.css.js.map +0 -1
- package/dist/src/nile-virtual-list/nile-virtual-list.d.ts +0 -28
- package/dist/src/nile-virtual-list/nile-virtual-list.js +0 -69
- package/dist/src/nile-virtual-list/nile-virtual-list.js.map +0 -1
- package/dist/src/nile-virtual-scroll/index.d.ts +0 -1
- package/dist/src/nile-virtual-scroll/index.js +0 -2
- package/dist/src/nile-virtual-scroll/index.js.map +0 -1
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.css.d.ts +0 -12
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.css.js +0 -17
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.css.js.map +0 -1
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.d.ts +0 -54
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.js +0 -196
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.js.map +0 -1
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.utils.d.ts +0 -23
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.utils.js +0 -48
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.utils.js.map +0 -1
- package/dist/src/nile-virtual-select/event-handlers.d.ts +0 -19
- package/dist/src/nile-virtual-select/event-handlers.js +0 -153
- package/dist/src/nile-virtual-select/event-handlers.js.map +0 -1
- package/dist/src/nile-virtual-select/index.d.ts +0 -1
- package/dist/src/nile-virtual-select/index.js +0 -2
- package/dist/src/nile-virtual-select/index.js.map +0 -1
- package/dist/src/nile-virtual-select/models.d.ts +0 -33
- package/dist/src/nile-virtual-select/models.js +0 -5
- package/dist/src/nile-virtual-select/models.js.map +0 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.css.d.ts +0 -12
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js +0 -463
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +0 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +0 -239
- package/dist/src/nile-virtual-select/nile-virtual-select.js +0 -1287
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +0 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +0 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +0 -2
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +0 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.utils.d.ts +0 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.utils.js +0 -2
- package/dist/src/nile-virtual-select/nile-virtual-select.utils.js.map +0 -1
- package/dist/src/nile-virtual-select/option-utils.d.ts +0 -15
- package/dist/src/nile-virtual-select/option-utils.js +0 -59
- package/dist/src/nile-virtual-select/option-utils.js.map +0 -1
@@ -1,2 +0,0 @@
|
|
1
|
-
System.register([],function(_export,_context){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,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 t(t){var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth);}function e(t,e,a,o,r,s,c,n){t.left,t.width;var i=function i(a){var s=0,c=0;switch(a){case"top":default:s=t.top-e.height-o,c=t.left+(t.width-e.width)/2+r;break;case"top-start":{s=t.top-e.height-o;var _a=t.left+t.width/2-e.width/2+r;c=Math.max(t.left+r,_a);break;}case"top-end":{s=t.top-e.height-o;var _a2=t.left+t.width/2-e.width/2+r,_n=t.right-e.width+r;c=Math.min(_a2,_n);break;}case"bottom":s=t.bottom+o,c=t.left+(t.width-e.width)/2+r;break;case"bottom-start":{s=t.bottom+o;var _a3=t.left+t.width/2-e.width/2+r;c=Math.max(t.left+r,_a3);break;}case"bottom-end":{s=t.bottom+o;var _a4=t.left+t.width/2-e.width/2+r,_n2=t.right-e.width+r;c=Math.min(_a4,_n2);break;}case"left":s=t.top+(t.height-e.height)/2+r,c=t.left-e.width-o;break;case"left-start":s=t.top+t.height/2-e.height/2,c=t.left-e.width-o,s<t.top&&(s=t.top);break;case"left-end":s=t.top+t.height/2-e.height/2,c=t.left-e.width-o,s+e.height>t.bottom&&(s=t.bottom-e.height);break;case"right":s=t.top+(t.height-e.height)/2+r,c=t.right+o;break;case"right-start":s=t.top+t.height/2-e.height/2,c=t.right+o,s<t.top&&(s=t.top);break;case"right-end":s=t.top+t.height/2-e.height/2,c=t.right+o,s+e.height>t.bottom&&(s=t.bottom-e.height);break;}return{top:s,left:c};},h=function h(t,a){return t>=0&&a>=0&&t+e.height<=n&&a+e.width<=c;};var b=a,l=i(b);if(!h(l.top,l.left)){["top","top-start","top-end"].includes(a)?b="bottom":["bottom","bottom-start","bottom-end"].includes(a)?b="top":["right","right-start","right-end"].includes(a)?b="left":["left","left-start","left-end"].includes(a)&&(b="right"),l=i(b);var _t=i("left"),_e=i("bottom"),_o=i("top");if(h(_t.top,_t.left)||h(_e.top,_e.left)||h(_o.top,_o.left)){var _t2=i("right");h(_t2.top,_t2.left)||h(_e.top,_e.left)||h(_o.top,_o.left)||(b="left",l=i(b));}else b="right",l=i(b);}return l.left<0?l.left=5:l.left+e.width>c&&(l.left=c-e.width-5),l.top<0?l.top=5:l.top+e.height>n&&(l.top=n-e.height-5),_objectSpread(_objectSpread({},l),{},{placement:b});}function a(_ref){var t=_ref.placement,e=_ref.tooltipRect,a=_ref.triggerRect,o=_ref.caretSize,r=_ref.left,s=_ref.top;var c=a.left+a.width/2,n=a.top+a.height/2,_t$split=t.split("-"),_t$split2=_slicedToArray(_t$split,2),i=_t$split2[0],h=_t$split2[1];var b=0,l=0;switch(i){case"top":l=e.height-o,b=c-r-o,"top-end"===t||"start"===h?b=c-r-o:"end"===h&&(b=e.width-2*o+8),b=Math.max(o,Math.min(b,e.width-2*o));break;case"bottom":l=-o,b=c-r-o;break;case"left":if(b=e.width-o,"start"===h){var _t3=n-s-o,_e2=a.top-s;l=Math.max(_t3,_e2);}else if("end"===h){var _t4=n-s-o,_e3=a.bottom-s-2*o;l=Math.min(_t4,_e3);}else l=n-s-o;l=Math.max(o,Math.min(l,e.height-2*o));break;case"right":if(b=-o,"start"===h){var _t5=n-s-o,_e4=a.top-s;l=Math.max(_t5,_e4);}else if("end"===h){var _t6=n-s-o,_e5=a.bottom-s-2*o;l=Math.min(_t6,_e5);}else l=n-s-o;l=Math.max(o,Math.min(l,e.height-2*o));break;default:b=e.width/2-o,l=e.height/2-o;}return{caretLeft:b,caretTop:l};}_export({a:a,g:e,i:t});return{setters:[],execute:function execute(){}};});
|
2
|
-
//# sourceMappingURL=nile-tooltip-utils.cjs.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"nile-tooltip-utils.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip-utils.ts"],"sourcesContent":["export function isInViewport(element: HTMLElement): boolean {\n const rect = element.getBoundingClientRect();\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth)\n );\n}\n\n\nexport function getValidTooltipPosition(\n triggerRect: DOMRect,\n tooltipRect: DOMRect,\n originalPlacement: string,\n distance: number,\n skidding: number,\n caretSize: number,\n viewportWidth: number,\n viewportHeight: number\n): { top: number; left: number; placement: string } {\n const triggerCenterX = triggerRect.left + triggerRect.width / 2;\n\n const getCandidatePosition = (placement: string) => {\n let top = 0;\n let left = 0;\n\n switch (placement) {\n case 'top':\n top = triggerRect.top - tooltipRect.height - distance;\n left = triggerRect.left + (triggerRect.width - tooltipRect.width) / 2 + skidding;\n break;\n case 'top-start': {\n top = triggerRect.top - tooltipRect.height - distance;\n const centeredLeft = triggerRect.left + (triggerRect.width / 2) - (tooltipRect.width / 2) + skidding;\n left = Math.max(triggerRect.left + skidding, centeredLeft);\n break;\n }\n case 'top-end': {\n top = triggerRect.top - tooltipRect.height - distance;\n const centeredLeft = triggerRect.left + (triggerRect.width / 2) - (tooltipRect.width / 2) + skidding;\n const maxLeft = triggerRect.right - tooltipRect.width + skidding;\n left = Math.min(centeredLeft, maxLeft);\n break;\n }\n\n case 'bottom':\n top = triggerRect.bottom + distance;\n left = triggerRect.left + (triggerRect.width - tooltipRect.width) / 2 + skidding;\n break;\n case 'bottom-start': {\n top = triggerRect.bottom + distance;\n const centeredLeft = triggerRect.left + (triggerRect.width / 2) - (tooltipRect.width / 2) + skidding;\n left = Math.max(triggerRect.left + skidding, centeredLeft);\n\n break;\n }\n\n case 'bottom-end': {\n top = triggerRect.bottom + distance;\n const centeredLeft = triggerRect.left + (triggerRect.width / 2) - (tooltipRect.width / 2) + skidding;\n const maxLeft = triggerRect.right - tooltipRect.width + skidding;\n left = Math.min(centeredLeft, maxLeft);\n break;\n }\n\n case 'left':\n top = triggerRect.top + (triggerRect.height - tooltipRect.height) / 2 + skidding;\n left = triggerRect.left - tooltipRect.width - distance;\n break;\n case 'left-start': {\n const triggerCenterY = triggerRect.top + triggerRect.height / 2;\n top = triggerCenterY - tooltipRect.height / 2;\n left = triggerRect.left - tooltipRect.width - distance;\n if (top < triggerRect.top) {\n top = triggerRect.top;\n }\n break;\n }\n\n case 'left-end': {\n const triggerCenterY = triggerRect.top + triggerRect.height / 2;\n top = triggerCenterY - tooltipRect.height / 2;\n left = triggerRect.left - tooltipRect.width - distance;\n if (top + tooltipRect.height > triggerRect.bottom) {\n top = triggerRect.bottom - tooltipRect.height;\n }\n\n break;\n }\n\n case 'right':\n top = triggerRect.top + (triggerRect.height - tooltipRect.height) / 2 + skidding;\n left = triggerRect.right + distance;\n break;\n case 'right-start': {\n const triggerCenterY = triggerRect.top + triggerRect.height / 2;\n top = triggerCenterY - tooltipRect.height / 2;\n left = triggerRect.right + distance;\n if (top < triggerRect.top) {\n top = triggerRect.top;\n }\n\n break;\n }\n\n case 'right-end': {\n const triggerCenterY = triggerRect.top + triggerRect.height / 2;\n top = triggerCenterY - tooltipRect.height / 2;\n left = triggerRect.right + distance;\n if (top + tooltipRect.height > triggerRect.bottom) {\n top = triggerRect.bottom - tooltipRect.height;\n }\n\n break;\n }\n\n default:\n top = triggerRect.top - tooltipRect.height - distance;\n left = triggerRect.left + (triggerRect.width - tooltipRect.width) / 2 + skidding;\n }\n\n return { top, left };\n };\n\n const candidateFits = (top: number, left: number) =>\n top >= 0 &&\n left >= 0 &&\n top + tooltipRect.height <= viewportHeight &&\n left + tooltipRect.width <= viewportWidth;\n\n let placement = originalPlacement;\n let candidate = getCandidatePosition(placement);\n\n if (!candidateFits(candidate.top, candidate.left)) {\n if (['top', 'top-start', 'top-end'].includes(originalPlacement)) {\n placement = 'bottom';\n } else if (['bottom', 'bottom-start', 'bottom-end'].includes(originalPlacement)) {\n placement = 'top';\n } else if (['right', 'right-start', 'right-end'].includes(originalPlacement)) {\n placement = 'left';\n } else if (['left', 'left-start', 'left-end'].includes(originalPlacement)) {\n placement = 'right';\n }\n candidate = getCandidatePosition(placement);\n const leftCandidate = getCandidatePosition('left');\n const bottomCandidate = getCandidatePosition('bottom');\n const topCandidate = getCandidatePosition('top');\n if (\n !candidateFits(leftCandidate.top, leftCandidate.left) &&\n !candidateFits(bottomCandidate.top, bottomCandidate.left) &&\n !candidateFits(topCandidate.top, topCandidate.left)\n ) {\n placement = 'right';\n candidate = getCandidatePosition(placement);\n }\n else {\n const rightCandidate = getCandidatePosition('right');\n if (\n !candidateFits(rightCandidate.top, rightCandidate.left) &&\n !candidateFits(bottomCandidate.top, bottomCandidate.left) &&\n !candidateFits(topCandidate.top, topCandidate.left)\n ) {\n placement = 'left';\n candidate = getCandidatePosition(placement);\n }\n }\n }\n\n if (candidate.left < 0) {\n candidate.left = 5;\n } else if (candidate.left + tooltipRect.width > viewportWidth) {\n candidate.left = viewportWidth - tooltipRect.width - 5;\n }\n\n if (candidate.top < 0) {\n candidate.top = 5;\n } else if (candidate.top + tooltipRect.height > viewportHeight) {\n candidate.top = viewportHeight - tooltipRect.height - 5;\n }\n\n return { ...candidate, placement };\n}\n\n\n\nexport interface CaretPositionInput {\n placement: string;\n tooltipRect: DOMRect;\n triggerRect: DOMRect;\n caretSize: number;\n left: number;\n top: number;\n}\n\nexport function getCaretPosition({\n placement,\n tooltipRect,\n triggerRect,\n caretSize,\n left,\n top\n}: CaretPositionInput): { caretLeft: number; caretTop: number } {\n const triggerCenterX = triggerRect.left + triggerRect.width / 2;\n const triggerCenterY = triggerRect.top + triggerRect.height / 2;\n\n const [primaryPlacement, secondaryPlacement] = placement.split('-');\n\n let caretLeft = 0;\n let caretTop = 0;\n\n switch (primaryPlacement) {\n case 'top':\n caretTop = tooltipRect.height - caretSize;\n caretLeft = triggerCenterX - left - caretSize;\n if (placement === 'top-end') {\n caretLeft = triggerCenterX - left - caretSize;\n } else if (secondaryPlacement === 'start') {\n caretLeft = triggerCenterX - left - caretSize;\n } else if (secondaryPlacement === 'end') {\n caretLeft = tooltipRect.width - 2 * caretSize + 8;\n }\n caretLeft = Math.max(caretSize, Math.min(caretLeft, tooltipRect.width - 2 * caretSize));\n break;\n\n case 'bottom':\n caretTop = -caretSize;\n caretLeft = triggerCenterX - left - caretSize;\n break;\n\n case 'left':\n caretLeft = tooltipRect.width - caretSize;\n if (secondaryPlacement === 'start') {\n const computedCaretTop = triggerCenterY - top - caretSize;\n const minCaretTop = triggerRect.top - top;\n caretTop = Math.max(computedCaretTop, minCaretTop);\n } else if (secondaryPlacement === 'end') {\n const computedCaretTop = triggerCenterY - top - caretSize;\n const maxCaretTop = triggerRect.bottom - top - 2 * caretSize;\n caretTop = Math.min(computedCaretTop, maxCaretTop);\n } else {\n caretTop = triggerCenterY - top - caretSize;\n }\n caretTop = Math.max(caretSize, Math.min(caretTop, tooltipRect.height - 2 * caretSize));\n break;\n\n\n case 'right':\n caretLeft = -caretSize;\n if (secondaryPlacement === 'start') {\n const computedCaretTop = triggerCenterY - top - caretSize;\n const minCaretTop = triggerRect.top - top;\n caretTop = Math.max(computedCaretTop, minCaretTop);\n } else if (secondaryPlacement === 'end') {\n const computedCaretTop = triggerCenterY - top - caretSize;\n const maxCaretTop = triggerRect.bottom - top - 2 * caretSize;\n caretTop = Math.min(computedCaretTop, maxCaretTop);\n } else {\n caretTop = triggerCenterY - top - caretSize;\n }\n caretTop = Math.max(caretSize, Math.min(caretTop, tooltipRect.height - 2 * caretSize));\n break;\n\n\n default:\n caretLeft = tooltipRect.width / 2 - caretSize;\n caretTop = tooltipRect.height / 2 - caretSize;\n }\n\n return { caretLeft, caretTop };\n}\n"],"names":["isInViewport","element","rect","getBoundingClientRect","top","left","bottom","window","innerHeight","document","documentElement","clientHeight","right","innerWidth","clientWidth","getValidTooltipPosition","triggerRect","tooltipRect","originalPlacement","distance","skidding","caretSize","viewportWidth","viewportHeight","width","getCandidatePosition","placement","height","centeredLeft","Math","max","maxLeft","min","candidateFits","h","candidate","includes","leftCandidate","bottomCandidate","topCandidate","rightCandidate","_objectSpread","getCaretPosition","triggerCenterX","triggerCenterY","primaryPlacement","split","secondaryPlacement","caretLeft","caretTop","computedCaretTop","minCaretTop","maxCaretTop","l","_export","a"],"mappings":"srFAAM,QAAUA,CAAAA,EAAaC,CAC3B,CAAA,CAAA,GAAMC,CAAAA,EAAOD,CAAQE,CAAAA,qBAAAA,CAAAA,CAAAA,CACrB,MACED,CAAAA,CAAKE,CAAAA,GAAAA,EAAO,CACZF,EAAAA,CAAAA,CAAKG,MAAQ,CACbH,EAAAA,CAAAA,CAAKI,SAAWC,MAAOC,CAAAA,WAAAA,EAAeC,SAASC,eAAgBC,CAAAA,YAAAA,CAAAA,EAC/DT,CAAKU,CAAAA,KAAAA,GAAUL,OAAOM,UAAcJ,EAAAA,QAAAA,CAASC,gBAAgBI,WAEjE,CAAA,UAGgBC,CAAAA,CACdC,CAAAA,CAAAA,CACAC,EACAC,CACAC,CAAAA,CAAAA,CACAC,EACAC,CACAC,CAAAA,CAAAA,CACAC,GAEuBP,CAAYX,CAAAA,IAAAA,CAAOW,EAAYQ,KAEtD,CAAA,GAAMC,CAAAA,CAAwBC,CAAAA,QAAxBD,CAAAA,CAAwBC,CAAAA,CAAAA,CAAAA,CAC5B,GAAItB,CAAAA,CAAM,CAAA,CAAA,CACNC,EAAO,CAEX,CAAA,OAAQqB,GACN,IAAK,KAAA,CAyFL,QACEtB,CAAMY,CAAAA,CAAAA,CAAYZ,IAAMa,CAAYU,CAAAA,MAAAA,CAASR,EAC7Cd,CAAOW,CAAAA,CAAAA,CAAYX,MAAQW,CAAYQ,CAAAA,KAAAA,CAAQP,CAAYO,CAAAA,KAAAA,EAAS,EAAIJ,CAvF1E,CAAA,MAAA,IAAK,YAAa,CAChBhB,CAAAA,CAAMY,EAAYZ,GAAMa,CAAAA,CA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B,EAC1C8B,GAAcnC,CAAAA,CAAAA,CAAYZ,IAAMA,CACtC6C,CAAAA,CAAAA,CAAWpB,KAAKC,GAAIoB,CAAAA,GAAAA,CAAkBC,IACvC,EAAM,IAAA,IAA2B,QAAvBJ,CAA8B,CAAA,CACvC,GAAMG,CAAAA,GAAmBN,CAAAA,CAAAA,CAAiBxC,EAAMiB,CAC1C+B,CAAAA,GAAAA,CAAcpC,CAAYV,CAAAA,MAAAA,CAASF,EAAM,CAAIiB,CAAAA,CAAAA,CACnD4B,EAAWpB,IAAKG,CAAAA,GAAAA,CAAIkB,IAAkBE,GACvC,CAAA,EAAA,IACCH,CAAAA,EAAWL,CAAiBxC,CAAAA,CAAAA,CAAMiB,EAEpC4B,CAAWpB,CAAAA,IAAAA,CAAKC,IAAIT,CAAWQ,CAAAA,IAAAA,CAAKG,IAAIiB,CAAUhC,CAAAA,CAAAA,CAAYU,MAAS,CAAA,CAAA,CAAIN,IAC3E,MAGF,QACE2B,EAAY/B,CAAYO,CAAAA,KAAAA,CAAQ,EAAIH,CACpC4B,CAAAA,CAAAA,CAAWhC,EAAYU,MAAS,CAAA,CAAA,CAAIN,GAGxC,MAAO,CAAE2B,YAAWC,QACtB,CAAAI,CAAA,CAAA,EAAAC,OAAA,EAAAC,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
function t(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function e(t,e,a,o,r,s,c,n){t.left,t.width;const i=a=>{let s=0,c=0;switch(a){case"top":default:s=t.top-e.height-o,c=t.left+(t.width-e.width)/2+r;break;case"top-start":{s=t.top-e.height-o;const a=t.left+t.width/2-e.width/2+r;c=Math.max(t.left+r,a);break}case"top-end":{s=t.top-e.height-o;const a=t.left+t.width/2-e.width/2+r,n=t.right-e.width+r;c=Math.min(a,n);break}case"bottom":s=t.bottom+o,c=t.left+(t.width-e.width)/2+r;break;case"bottom-start":{s=t.bottom+o;const a=t.left+t.width/2-e.width/2+r;c=Math.max(t.left+r,a);break}case"bottom-end":{s=t.bottom+o;const a=t.left+t.width/2-e.width/2+r,n=t.right-e.width+r;c=Math.min(a,n);break}case"left":s=t.top+(t.height-e.height)/2+r,c=t.left-e.width-o;break;case"left-start":s=t.top+t.height/2-e.height/2,c=t.left-e.width-o,s<t.top&&(s=t.top);break;case"left-end":s=t.top+t.height/2-e.height/2,c=t.left-e.width-o,s+e.height>t.bottom&&(s=t.bottom-e.height);break;case"right":s=t.top+(t.height-e.height)/2+r,c=t.right+o;break;case"right-start":s=t.top+t.height/2-e.height/2,c=t.right+o,s<t.top&&(s=t.top);break;case"right-end":s=t.top+t.height/2-e.height/2,c=t.right+o,s+e.height>t.bottom&&(s=t.bottom-e.height);break}return{top:s,left:c}},h=(t,a)=>t>=0&&a>=0&&t+e.height<=n&&a+e.width<=c;let b=a,l=i(b);if(!h(l.top,l.left)){["top","top-start","top-end"].includes(a)?b="bottom":["bottom","bottom-start","bottom-end"].includes(a)?b="top":["right","right-start","right-end"].includes(a)?b="left":["left","left-start","left-end"].includes(a)&&(b="right"),l=i(b);const t=i("left"),e=i("bottom"),o=i("top");if(h(t.top,t.left)||h(e.top,e.left)||h(o.top,o.left)){const t=i("right");h(t.top,t.left)||h(e.top,e.left)||h(o.top,o.left)||(b="left",l=i(b))}else b="right",l=i(b)}return l.left<0?l.left=5:l.left+e.width>c&&(l.left=c-e.width-5),l.top<0?l.top=5:l.top+e.height>n&&(l.top=n-e.height-5),{...l,placement:b}}function a({placement:t,tooltipRect:e,triggerRect:a,caretSize:o,left:r,top:s}){const c=a.left+a.width/2,n=a.top+a.height/2,[i,h]=t.split("-");let b=0,l=0;switch(i){case"top":l=e.height-o,b=c-r-o,"top-end"===t||"start"===h?b=c-r-o:"end"===h&&(b=e.width-2*o+8),b=Math.max(o,Math.min(b,e.width-2*o));break;case"bottom":l=-o,b=c-r-o;break;case"left":if(b=e.width-o,"start"===h){const t=n-s-o,e=a.top-s;l=Math.max(t,e)}else if("end"===h){const t=n-s-o,e=a.bottom-s-2*o;l=Math.min(t,e)}else l=n-s-o;l=Math.max(o,Math.min(l,e.height-2*o));break;case"right":if(b=-o,"start"===h){const t=n-s-o,e=a.top-s;l=Math.max(t,e)}else if("end"===h){const t=n-s-o,e=a.bottom-s-2*o;l=Math.min(t,e)}else l=n-s-o;l=Math.max(o,Math.min(l,e.height-2*o));break;default:b=e.width/2-o,l=e.height/2-o}return{caretLeft:b,caretTop:l}}export{a,e as g,t as i};
|
@@ -1,2 +0,0 @@
|
|
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(["../fixture-bb486165.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-tooltip.cjs.js","tslib","lit/decorators.js","./nile-tooltip.css.cjs.js","../internal/nile-element.cjs.js","./nile-tooltip-utils.cjs.js"],function(_export,_context){"use strict";var t,o,i,e,n,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13;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 _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}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);});};}return{setters:[function(_fixture001CjsJs){t=_fixture001CjsJs.f;o=_fixture001CjsJs.h;i=_fixture001CjsJs.w;e=_fixture001CjsJs.o;},function(_litStaticHtmlJs){n=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileTooltipCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_nileTooltipCssCjsJs){},function(_internalNileElementCjsJs){},function(_nileTooltipUtilsCjsJs){}],execute:function execute(){describe("NileTooltip",function(){it("renders with default properties",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return t(n(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-tooltip content=\"Hello\"><button>Hover me</button></nile-tooltip>"]))));case 2:i=_context2.sent;o.equal(i.content,"Hello"),o.equal(i.placement,"top"),o.equal(i.disabled,!1),o.equal(i.open,!1);case 4:case"end":return _context2.stop();}},_callee);}))),it("renders text content when no slot is used",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return t(n(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-tooltip content=\"Fallback\"><button>Trigger</button></nile-tooltip>"]))));case 2:i=_context3.sent.shadowRoot.querySelector(".tooltip-content");o.include(i.textContent,"Fallback");case 4:case"end":return _context3.stop();}},_callee2);}))),it("uses slotted content when provided",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _i$0$textContent;var i;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return t(n(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-tooltip>\n <div slot=\"content\">Slot Content</div>\n <button>Trigger</button>\n </nile-tooltip>\n "]))));case 2:i=_context4.sent.shadowRoot.querySelector('slot[name="content"]').assignedNodes({flatten:!0});o.isAbove(i.length,0),o.include((_i$0$textContent=i[0].textContent)!==null&&_i$0$textContent!==void 0?_i$0$textContent:"","Slot Content");case 4:case"end":return _context4.stop();}},_callee3);}))),it('shows tooltip on hover when trigger includes "hover"',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var e;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return t(n(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-tooltip content=\"Tooltip\" trigger=\"hover\">\n <button>Hover me</button>\n </nile-tooltip>\n "]))));case 2:e=_context5.sent;e.shadowRoot.querySelector(".trigger-container").dispatchEvent(new Event("mouseover",{bubbles:!0}));_context5.next=6;return i(function(){return!0===e.open;});case 6:o.isTrue(e.open);case 7:case"end":return _context5.stop();}},_callee4);}))),it('hides tooltip on mouseout when trigger includes "hover"',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var o,e;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return t(n(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-tooltip content=\"Tooltip\" trigger=\"hover\">\n <button>Hover me</button>\n </nile-tooltip>\n "]))));case 2:o=_context6.sent;e=o.shadowRoot.querySelector(".trigger-container");e.dispatchEvent(new Event("mouseover",{bubbles:!0}));_context6.next=7;return i(function(){return!0===o.open;});case 7:e.dispatchEvent(new Event("mouseout",{bubbles:!0}));_context6.next=10;return i(function(){return!1===o.open;});case 10:case"end":return _context6.stop();}},_callee5);}))),it('toggles tooltip on click when trigger includes "click"',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var o,e;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return t(n(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-tooltip content=\"Click me\" trigger=\"click\">\n <button>Click</button>\n </nile-tooltip>\n "]))));case 2:o=_context7.sent;e=o.shadowRoot.querySelector(".trigger-container");e.click();_context7.next=7;return i(function(){return!0===o.open;});case 7:e.click();_context7.next=10;return i(function(){return!1===o.open;});case 10:case"end":return _context7.stop();}},_callee6);}))),it('shows and hides tooltip on focus/blur when trigger includes "focus"',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var o,e;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return t(n(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-tooltip content=\"Focus\" trigger=\"focus\">\n <button>Focus</button>\n </nile-tooltip>\n "]))));case 2:o=_context8.sent;e=o.shadowRoot.querySelector(".trigger-container");e.dispatchEvent(new Event("focusin"));_context8.next=7;return i(function(){return!0===o.open;});case 7:e.dispatchEvent(new Event("focusout"));_context8.next=10;return i(function(){return!1===o.open;});case 10:case"end":return _context8.stop();}},_callee7);}))),it("does not show tooltip when disabled",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var i;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return t(n(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <nile-tooltip content=\"Disabled\" disabled trigger=\"hover\">\n <button>Hover me</button>\n </nile-tooltip>\n "]))));case 2:i=_context9.sent;i.shadowRoot.querySelector(".trigger-container").dispatchEvent(new Event("mouseover"));_context9.next=6;return new Promise(function(t){return setTimeout(t,200);});case 6:o.isFalse(i.open);case 7:case"end":return _context9.stop();}},_callee8);}))),it("emits nile-show and nile-after-show events",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var i,l,s,a;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return t(n(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <nile-tooltip content=\"Event test\" trigger=\"click\">\n <button>Click</button>\n </nile-tooltip>\n "]))));case 2:i=_context10.sent;l=i.shadowRoot.querySelector(".trigger-container");setTimeout(function(){return l.click();});_context10.next=7;return e(i,"nile-show");case 7:s=_context10.sent;o.ok(s);_context10.next=11;return e(i,"nile-after-show");case 11:a=_context10.sent;o.ok(a);case 13:case"end":return _context10.stop();}},_callee9);}))),it("emits nile-hide and nile-after-hide events",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var l,s,a,c;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return t(n(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n <nile-tooltip content=\"Event test\" trigger=\"click\">\n <button>Click</button>\n </nile-tooltip>\n "]))));case 2:l=_context11.sent;s=l.shadowRoot.querySelector(".trigger-container");s.click();_context11.next=7;return i(function(){return!0===l.open;});case 7:setTimeout(function(){return s.click();});_context11.next=10;return e(l,"nile-hide");case 10:a=_context11.sent;o.ok(a);_context11.next=14;return e(l,"nile-after-hide");case 14:c=_context11.sent;o.ok(c);case 16:case"end":return _context11.stop();}},_callee10);}))),it('defaults to "bottom" placement when given invalid value',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(){var i;return _regeneratorRuntime().wrap(function _callee11$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_context12.next=2;return t(n(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n <nile-tooltip content=\"Fallback\" placement="," >\n <button>Trigger</button>\n </nile-tooltip>\n "])),"invalid"));case 2:i=_context12.sent;_context12.next=5;return i.updateComplete;case 5:o.equal(i.placement,"top");case 6:case"end":return _context12.stop();}},_callee11);}))),it("updates hasTooltipSlot on slot change",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(){var i,e,l;return _regeneratorRuntime().wrap(function _callee12$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:_context13.next=2;return t(n(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <nile-tooltip>\n <div slot=\"content\">Initial slot</div>\n <button>Trigger</button>\n </nile-tooltip>\n "]))));case 2:i=_context13.sent;e=i.shadowRoot.querySelector('slot[name="content"]');l=document.createElement("div");l.slot="content";l.textContent="Updated slot";i.appendChild(l);e.dispatchEvent(new Event("slotchange"));_context13.next=11;return i.updateComplete;case 11:o.isTrue(i.hasTooltipSlot);case 12:case"end":return _context13.stop();}},_callee12);}))),it("respects hoist attribute",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(){var i;return _regeneratorRuntime().wrap(function _callee13$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_context14.next=2;return t(n(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n <nile-tooltip hoist content=\"Hoisted\">\n <button>Hoist</button>\n </nile-tooltip>\n "]))));case 2:i=_context14.sent;o.isTrue(i.hoist);case 4:case"end":return _context14.stop();}},_callee13);})));});}};});
|
2
|
-
//# sourceMappingURL=nile-tooltip.test.cjs.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"nile-tooltip.test.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.test.ts"],"sourcesContent":["import { fixture, html, assert, oneEvent, waitUntil } from '@open-wc/testing';\nimport './nile-tooltip';\nimport { NileTooltip } from './nile-tooltip';\n\ndescribe('NileTooltip', () => {\n\n it('renders with default properties', async () => {\n const el = await fixture<NileTooltip>(html`<nile-tooltip content=\"Hello\"><button>Hover me</button></nile-tooltip>`);\n assert.equal(el.content, 'Hello');\n assert.equal(el.placement, 'top');\n assert.equal(el.disabled, false);\n assert.equal(el.open, false);\n });\n\n it('renders text content when no slot is used', async () => {\n const el = await fixture<NileTooltip>(html`<nile-tooltip content=\"Fallback\"><button>Trigger</button></nile-tooltip>`);\n const content = el.shadowRoot!.querySelector('.tooltip-content')!;\n assert.include(content.textContent!, 'Fallback');\n });\n\n it('uses slotted content when provided', async () => {\n const el = await fixture<NileTooltip>(html`\n <nile-tooltip>\n <div slot=\"content\">Slot Content</div>\n <button>Trigger</button>\n </nile-tooltip>\n `);\n\n const slot = el.shadowRoot!.querySelector('slot[name=\"content\"]') as HTMLSlotElement;\n const assigned = slot.assignedNodes({ flatten: true });\n assert.isAbove(assigned.length, 0);\n assert.include(assigned[0].textContent ?? '', 'Slot Content');\n });\n\n it('shows tooltip on hover when trigger includes \"hover\"', async () => {\n const el = await fixture<NileTooltip>(html`\n <nile-tooltip content=\"Tooltip\" trigger=\"hover\">\n <button>Hover me</button>\n </nile-tooltip>\n `);\n const trigger = el.shadowRoot!.querySelector('.trigger-container')!;\n trigger.dispatchEvent(new Event('mouseover', { bubbles: true }));\n await waitUntil(() => el.open === true);\n assert.isTrue(el.open);\n });\n\n it('hides tooltip on mouseout when trigger includes \"hover\"', async () => {\n const el = await fixture<NileTooltip>(html`\n <nile-tooltip content=\"Tooltip\" trigger=\"hover\">\n <button>Hover me</button>\n </nile-tooltip>\n `);\n const trigger = el.shadowRoot!.querySelector('.trigger-container')!;\n trigger.dispatchEvent(new Event('mouseover', { bubbles: true }));\n await waitUntil(() => el.open === true);\n trigger.dispatchEvent(new Event('mouseout', { bubbles: true }));\n await waitUntil(() => el.open === false);\n });\n\n it('toggles tooltip on click when trigger includes \"click\"', async () => {\n const el = await fixture<NileTooltip>(html`\n <nile-tooltip content=\"Click me\" trigger=\"click\">\n <button>Click</button>\n </nile-tooltip>\n `);\n const trigger = el.shadowRoot!.querySelector('.trigger-container') as HTMLElement;\n trigger.click();\n await waitUntil(() => el.open === true);\n trigger.click();\n await waitUntil(() => el.open === false);\n });\n\n it('shows and hides tooltip on focus/blur when trigger includes \"focus\"', async () => {\n const el = await fixture<NileTooltip>(html`\n <nile-tooltip content=\"Focus\" trigger=\"focus\">\n <button>Focus</button>\n </nile-tooltip>\n `);\n const trigger = el.shadowRoot!.querySelector('.trigger-container')!;\n trigger.dispatchEvent(new Event('focusin'));\n await waitUntil(() => el.open === true);\n trigger.dispatchEvent(new Event('focusout'));\n await waitUntil(() => el.open === false);\n });\n\n it('does not show tooltip when disabled', async () => {\n const el = await fixture<NileTooltip>(html`\n <nile-tooltip content=\"Disabled\" disabled trigger=\"hover\">\n <button>Hover me</button>\n </nile-tooltip>\n `);\n const trigger = el.shadowRoot!.querySelector('.trigger-container')!;\n trigger.dispatchEvent(new Event('mouseover'));\n await new Promise(resolve => setTimeout(resolve, 200));\n assert.isFalse(el.open);\n });\n\n\n it('emits nile-show and nile-after-show events', async () => {\n const el = await fixture<NileTooltip>(html`\n <nile-tooltip content=\"Event test\" trigger=\"click\">\n <button>Click</button>\n </nile-tooltip>\n `);\n const trigger = el.shadowRoot!.querySelector('.trigger-container') as HTMLElement;\n setTimeout(() => trigger.click());\n const showEvent = await oneEvent(el, 'nile-show');\n assert.ok(showEvent);\n const afterShow = await oneEvent(el, 'nile-after-show');\n assert.ok(afterShow);\n });\n\n it('emits nile-hide and nile-after-hide events', async () => {\n const el = await fixture<NileTooltip>(html`\n <nile-tooltip content=\"Event test\" trigger=\"click\">\n <button>Click</button>\n </nile-tooltip>\n `);\n const trigger = el.shadowRoot!.querySelector('.trigger-container') as HTMLElement;\n trigger.click();\n await waitUntil(() => el.open === true);\n setTimeout(() => trigger.click());\n const hideEvent = await oneEvent(el, 'nile-hide');\n assert.ok(hideEvent);\n const afterHide = await oneEvent(el, 'nile-after-hide');\n assert.ok(afterHide);\n });\n\n it('defaults to \"bottom\" placement when given invalid value', async () => {\n const el = await fixture<NileTooltip>(html`\n <nile-tooltip content=\"Fallback\" placement=${'invalid' as unknown as NileTooltip['placement']} >\n <button>Trigger</button>\n </nile-tooltip>\n `);\n await el.updateComplete;\n assert.equal(el.placement, 'top');\n });\n\n\n it('updates hasTooltipSlot on slot change', async () => {\n const el = await fixture<NileTooltip>(html`\n <nile-tooltip>\n <div slot=\"content\">Initial slot</div>\n <button>Trigger</button>\n </nile-tooltip>\n `);\n\n const slot = el.shadowRoot!.querySelector('slot[name=\"content\"]') as HTMLSlotElement;\n const newSlotNode = document.createElement('div');\n newSlotNode.slot = 'content';\n newSlotNode.textContent = 'Updated slot';\n el.appendChild(newSlotNode);\n\n slot.dispatchEvent(new Event('slotchange'));\n await el.updateComplete;\n\n assert.isTrue((el as any).hasTooltipSlot);\n });\n\n it('respects hoist attribute', async () => {\n const el = await fixture<NileTooltip>(html`\n <nile-tooltip hoist content=\"Hoisted\">\n <button>Hoist</button>\n </nile-tooltip>\n `);\n assert.isTrue(el.hoist);\n });\n});\n"],"names":["describe","it","async","fixture","html","_templateObject","_taggedTemplateLiteral","el","assert","equal","content","placement","disabled","open","_context2","stop","_callee","_templateObject2","shadowRoot","querySelector","include","textContent","_context3","_callee2","_templateObject3","assigned","assignedNodes","flatten","isAbove","length","_i$0$textContent","_context4","_callee3","_asyncToGenerator","_regeneratorRuntime","mark","_templateObject4","dispatchEvent","Event","bubbles","waitUntil","isTrue","_context5","_callee4","_templateObject5","trigger","_context6","next","_callee5","_templateObject6","click","_context7","_callee6","_templateObject7","_context8","_callee7","_templateObject8","_context9","Promise","resolve","setTimeout","isFalse","_callee8","_templateObject9","_context10","oneEvent","showEvent","ok","afterShow","_callee9","_templateObject10","_context11","hideEvent","afterHide","_callee10","_templateObject11","updateComplete","_context12","_callee11","_templateObject12","slot","newSlotNode","document","createElement","appendChild","_context13","hasTooltipSlot","_callee12","_templateObject13","hoist","_context14","_callee13"],"mappings":"88SAIAA,QAAS,CAAA,aAAA,CAAe,UAEtBC,CAAAA,EAAAA,CAAG,iCAAmCC,cAAAA,iBAAAA,cAAAA,mBAAAA,GAAAA,IAAAA,CAAAA,SAAAA,QAAAA,MAAAA,CAAAA,QAAAA,mBAAAA,GAAAA,IAAAA,UAAAA,SAAAA,SAAAA,iBAAAA,SAAAA,CAAAA,IAAAA,CAAAA,SAAAA,CAAAA,IAAAA,SAAAA,SAAAA,CAAAA,IAAAA,SACnBC,CAAAA,CAAAA,CAAqBC,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAA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,IAAAA,CAKNC,CAAOiC,CAAAA,MAAAA,CAAOlC,CAAGkF,CAAAA,KAAAA,CAAM,yBAAAC,UAAA,CAAA3E,IAAA,MAAA4E,SAAA,GACvB,EAAA,CAAA,EAAA,CAAA,CAAA"}
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import{f as t,h as o,w as e,o as i}from"../fixture-c4e75e04.esm.js";import{html as n}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-tooltip.esm.js";import"tslib";import"lit/decorators.js";import"./nile-tooltip.css.esm.js";import"../internal/nile-element.esm.js";import"./nile-tooltip-utils.esm.js";describe("NileTooltip",(()=>{it("renders with default properties",(async()=>{const e=await t(n`<nile-tooltip content="Hello"><button>Hover me</button></nile-tooltip>`);o.equal(e.content,"Hello"),o.equal(e.placement,"top"),o.equal(e.disabled,!1),o.equal(e.open,!1)})),it("renders text content when no slot is used",(async()=>{const e=(await t(n`<nile-tooltip content="Fallback"><button>Trigger</button></nile-tooltip>`)).shadowRoot.querySelector(".tooltip-content");o.include(e.textContent,"Fallback")})),it("uses slotted content when provided",(async()=>{const e=(await t(n`
|
2
|
-
<nile-tooltip>
|
3
|
-
<div slot="content">Slot Content</div>
|
4
|
-
<button>Trigger</button>
|
5
|
-
</nile-tooltip>
|
6
|
-
`)).shadowRoot.querySelector('slot[name="content"]').assignedNodes({flatten:!0});o.isAbove(e.length,0),o.include(e[0].textContent??"","Slot Content")})),it('shows tooltip on hover when trigger includes "hover"',(async()=>{const i=await t(n`
|
7
|
-
<nile-tooltip content="Tooltip" trigger="hover">
|
8
|
-
<button>Hover me</button>
|
9
|
-
</nile-tooltip>
|
10
|
-
`);i.shadowRoot.querySelector(".trigger-container").dispatchEvent(new Event("mouseover",{bubbles:!0})),await e((()=>!0===i.open)),o.isTrue(i.open)})),it('hides tooltip on mouseout when trigger includes "hover"',(async()=>{const o=await t(n`
|
11
|
-
<nile-tooltip content="Tooltip" trigger="hover">
|
12
|
-
<button>Hover me</button>
|
13
|
-
</nile-tooltip>
|
14
|
-
`),i=o.shadowRoot.querySelector(".trigger-container");i.dispatchEvent(new Event("mouseover",{bubbles:!0})),await e((()=>!0===o.open)),i.dispatchEvent(new Event("mouseout",{bubbles:!0})),await e((()=>!1===o.open))})),it('toggles tooltip on click when trigger includes "click"',(async()=>{const o=await t(n`
|
15
|
-
<nile-tooltip content="Click me" trigger="click">
|
16
|
-
<button>Click</button>
|
17
|
-
</nile-tooltip>
|
18
|
-
`),i=o.shadowRoot.querySelector(".trigger-container");i.click(),await e((()=>!0===o.open)),i.click(),await e((()=>!1===o.open))})),it('shows and hides tooltip on focus/blur when trigger includes "focus"',(async()=>{const o=await t(n`
|
19
|
-
<nile-tooltip content="Focus" trigger="focus">
|
20
|
-
<button>Focus</button>
|
21
|
-
</nile-tooltip>
|
22
|
-
`),i=o.shadowRoot.querySelector(".trigger-container");i.dispatchEvent(new Event("focusin")),await e((()=>!0===o.open)),i.dispatchEvent(new Event("focusout")),await e((()=>!1===o.open))})),it("does not show tooltip when disabled",(async()=>{const e=await t(n`
|
23
|
-
<nile-tooltip content="Disabled" disabled trigger="hover">
|
24
|
-
<button>Hover me</button>
|
25
|
-
</nile-tooltip>
|
26
|
-
`);e.shadowRoot.querySelector(".trigger-container").dispatchEvent(new Event("mouseover")),await new Promise((t=>setTimeout(t,200))),o.isFalse(e.open)})),it("emits nile-show and nile-after-show events",(async()=>{const e=await t(n`
|
27
|
-
<nile-tooltip content="Event test" trigger="click">
|
28
|
-
<button>Click</button>
|
29
|
-
</nile-tooltip>
|
30
|
-
`),l=e.shadowRoot.querySelector(".trigger-container");setTimeout((()=>l.click()));const s=await i(e,"nile-show");o.ok(s);const a=await i(e,"nile-after-show");o.ok(a)})),it("emits nile-hide and nile-after-hide events",(async()=>{const l=await t(n`
|
31
|
-
<nile-tooltip content="Event test" trigger="click">
|
32
|
-
<button>Click</button>
|
33
|
-
</nile-tooltip>
|
34
|
-
`),s=l.shadowRoot.querySelector(".trigger-container");s.click(),await e((()=>!0===l.open)),setTimeout((()=>s.click()));const a=await i(l,"nile-hide");o.ok(a);const r=await i(l,"nile-after-hide");o.ok(r)})),it('defaults to "bottom" placement when given invalid value',(async()=>{const e=await t(n`
|
35
|
-
<nile-tooltip content="Fallback" placement=${"invalid"} >
|
36
|
-
<button>Trigger</button>
|
37
|
-
</nile-tooltip>
|
38
|
-
`);await e.updateComplete,o.equal(e.placement,"top")})),it("updates hasTooltipSlot on slot change",(async()=>{const e=await t(n`
|
39
|
-
<nile-tooltip>
|
40
|
-
<div slot="content">Initial slot</div>
|
41
|
-
<button>Trigger</button>
|
42
|
-
</nile-tooltip>
|
43
|
-
`),i=e.shadowRoot.querySelector('slot[name="content"]'),l=document.createElement("div");l.slot="content",l.textContent="Updated slot",e.appendChild(l),i.dispatchEvent(new Event("slotchange")),await e.updateComplete,o.isTrue(e.hasTooltipSlot)})),it("respects hoist attribute",(async()=>{const e=await t(n`
|
44
|
-
<nile-tooltip hoist content="Hoisted">
|
45
|
-
<button>Hoist</button>
|
46
|
-
</nile-tooltip>
|
47
|
-
`);o.isTrue(e.hoist)}))}));
|
@@ -1 +0,0 @@
|
|
1
|
-
export { NileNewError } from './nile-new-error';
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-new-error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { NileNewError } from './nile-new-error';"]}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright Aquera Inc 2023
|
3
|
-
*
|
4
|
-
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
/**
|
8
|
-
* NewError CSS
|
9
|
-
*/
|
10
|
-
export declare const styles: import("lit").CSSResult;
|
11
|
-
declare const _default: import("lit").CSSResult[];
|
12
|
-
export default _default;
|
@@ -1,38 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright Aquera Inc 2023
|
3
|
-
*
|
4
|
-
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
import { css } from 'lit';
|
8
|
-
/**
|
9
|
-
* NewError CSS
|
10
|
-
*/
|
11
|
-
export const styles = css `
|
12
|
-
:host {
|
13
|
-
--indication-color: var(--nile-colors-red-500);
|
14
|
-
}
|
15
|
-
|
16
|
-
.nile-error-notification {
|
17
|
-
font-family: var(--nile-font-family-serif);
|
18
|
-
font-size: 12px;
|
19
|
-
font-style: normal;
|
20
|
-
font-weight: 400;
|
21
|
-
line-height: 12px;
|
22
|
-
letter-spacing: 0.2px;
|
23
|
-
border: 1px solid var(--indication-color);
|
24
|
-
border-left: 6px solid var(--indication-color);
|
25
|
-
border-radius: 4px;
|
26
|
-
padding: 8px;
|
27
|
-
background: var(--nile-colors-neutral-100);
|
28
|
-
color: var(--indication-color);
|
29
|
-
box-sizing: border-box;
|
30
|
-
}
|
31
|
-
|
32
|
-
.nile-error-notification__icon {
|
33
|
-
vertical-align: middle;
|
34
|
-
margin-right: 4px;
|
35
|
-
}
|
36
|
-
`;
|
37
|
-
export default [styles];
|
38
|
-
//# sourceMappingURL=nile-new-error.css.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"nile-new-error.css.js","sourceRoot":"","sources":["../../../src/nile-new-error/nile-new-error.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;CAyBxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit';\n\n/**\n * NewError CSS\n */\nexport const styles = css`\n\t :host {\n --indication-color: var(--nile-colors-red-500);\n }\n\n .nile-error-notification {\n font-family: var(--nile-font-family-serif);\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 12px;\n letter-spacing: 0.2px;\n border: 1px solid var(--indication-color);\n border-left: 6px solid var(--indication-color);\n border-radius: 4px;\n padding: 8px;\n background: var(--nile-colors-neutral-100);\n color: var(--indication-color);\n box-sizing: border-box;\n }\n\n .nile-error-notification__icon {\n vertical-align: middle;\n margin-right: 4px;\n }\n`;\n\nexport default [styles];\n"]}
|
@@ -1,36 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright Aquera Inc 2023
|
3
|
-
*
|
4
|
-
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
import { CSSResultArray, TemplateResult, PropertyValues } from 'lit';
|
8
|
-
import NileElement from '../internal/nile-element';
|
9
|
-
/**
|
10
|
-
* Nile new-error component.
|
11
|
-
*
|
12
|
-
* @tag nile-new-error
|
13
|
-
*
|
14
|
-
*/
|
15
|
-
export declare class NileNewError extends NileElement {
|
16
|
-
errorMessage: string;
|
17
|
-
newProp: string;
|
18
|
-
color: string;
|
19
|
-
protected updated(_changedProperties: PropertyValues): void;
|
20
|
-
/**
|
21
|
-
* The styles for nile-new-error
|
22
|
-
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
23
|
-
*/
|
24
|
-
static get styles(): CSSResultArray;
|
25
|
-
/**
|
26
|
-
* Render method
|
27
|
-
* @slot This is a slot test
|
28
|
-
*/
|
29
|
-
render(): TemplateResult;
|
30
|
-
}
|
31
|
-
export default NileNewError;
|
32
|
-
declare global {
|
33
|
-
interface HTMLElementTagNameMap {
|
34
|
-
'nile-new-error': NileNewError;
|
35
|
-
}
|
36
|
-
}
|
@@ -1,74 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright Aquera Inc 2023
|
3
|
-
*
|
4
|
-
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
import { __decorate } from "tslib";
|
8
|
-
import { html } from 'lit';
|
9
|
-
import { customElement, property } from 'lit/decorators.js';
|
10
|
-
import { styles } from './nile-new-error.css';
|
11
|
-
import NileElement from '../internal/nile-element';
|
12
|
-
/**
|
13
|
-
* Nile new-error component.
|
14
|
-
*
|
15
|
-
* @tag nile-new-error
|
16
|
-
*
|
17
|
-
*/
|
18
|
-
let NileNewError = class NileNewError extends NileElement {
|
19
|
-
constructor() {
|
20
|
-
super(...arguments);
|
21
|
-
this.errorMessage = '';
|
22
|
-
this.newProp = '';
|
23
|
-
this.color = '';
|
24
|
-
/* #endregion */
|
25
|
-
}
|
26
|
-
updated(_changedProperties) {
|
27
|
-
if (_changedProperties.has('color')) {
|
28
|
-
this.style.setProperty('--indication-color', this.color);
|
29
|
-
}
|
30
|
-
}
|
31
|
-
/**
|
32
|
-
* The styles for nile-new-error
|
33
|
-
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
34
|
-
*/
|
35
|
-
static get styles() {
|
36
|
-
return [styles];
|
37
|
-
}
|
38
|
-
/* #endregion */
|
39
|
-
/* #region Methods */
|
40
|
-
/**
|
41
|
-
* Render method
|
42
|
-
* @slot This is a slot test
|
43
|
-
*/
|
44
|
-
render() {
|
45
|
-
return html `
|
46
|
-
${this.newProp}
|
47
|
-
<div class="nile-error-notification">
|
48
|
-
<nile-icon
|
49
|
-
name="info2"
|
50
|
-
size="24"
|
51
|
-
class="nile-error-notification__icon"
|
52
|
-
part="icon"
|
53
|
-
color="var(--indication-color)"
|
54
|
-
></nile-icon>
|
55
|
-
${this.errorMessage}
|
56
|
-
</div>
|
57
|
-
`;
|
58
|
-
}
|
59
|
-
};
|
60
|
-
__decorate([
|
61
|
-
property({ type: String, reflect: true })
|
62
|
-
], NileNewError.prototype, "errorMessage", void 0);
|
63
|
-
__decorate([
|
64
|
-
property({ type: String, reflect: true })
|
65
|
-
], NileNewError.prototype, "newProp", void 0);
|
66
|
-
__decorate([
|
67
|
-
property({ type: String, reflect: true })
|
68
|
-
], NileNewError.prototype, "color", void 0);
|
69
|
-
NileNewError = __decorate([
|
70
|
-
customElement('nile-new-error')
|
71
|
-
], NileNewError);
|
72
|
-
export { NileNewError };
|
73
|
-
export default NileNewError;
|
74
|
-
//# sourceMappingURL=nile-new-error.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"nile-new-error.js","sourceRoot":"","sources":["../../../src/nile-new-error/nile-new-error.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAiD,MAAM,KAAK,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;;;;GAKG;AAEI,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,WAAW;IAAtC;;QAEuC,iBAAY,GAAW,EAAE,CAAC;QAE1B,YAAO,GAAW,EAAE,CAAC;QAGrB,UAAK,GAAW,EAAE,CAAC;QAyChE,gBAAgB;IACjB,CAAC;IAvCW,OAAO,CAAC,kBAAkC;QACnD,IAAG,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAC,CAAC;YACrC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,oBAAoB,EAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACtD,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,MAAM,KAAK,MAAM;QACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;IAED,gBAAgB;IAEhB,qBAAqB;IAErB;;;OAGG;IACI,MAAM;QACZ,OAAO,IAAI,CAAA;KACR,IAAI,CAAC,OAAO;;;;;;;;;UASP,IAAI,CAAC,YAAY;;IAEvB,CAAC;IACJ,CAAC;CAGD,CAAA;AA/C6C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAG,CAAC;kDAA2B;AAE1B;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAG,CAAC;6CAAsB;AAGrB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAG,CAAC;2CAAoB;AAPpD,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAiDxB;;AAED,eAAe,YAAY,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, CSSResultArray, TemplateResult, PropertyValues} from 'lit';\nimport { customElement, property} from 'lit/decorators.js';\nimport {styles} from './nile-new-error.css';\nimport NileElement from '../internal/nile-element';\n\n\n/**\n * Nile new-error component.\n *\n * @tag nile-new-error\n *\n */\n@customElement('nile-new-error')\nexport class NileNewError extends NileElement {\n\n @property({ type: String, reflect: true }) errorMessage: string = '';\n\n @property({ type: String, reflect: true }) newProp: string = '';\n\n\n @property({ type: String, reflect: true }) color: string = '';\n\n\n protected updated(_changedProperties: PropertyValues): void {\n\t if(_changedProperties.has('color')){\n\t\tthis.style.setProperty('--indication-color',this.color)\n\t }\n\t}\n\n\t/**\n\t * The styles for nile-new-error\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\treturn html`\n\t\t\t${this.newProp}\n\t\t\t <div class=\"nile-error-notification\">\n <nile-icon\n name=\"info2\"\n size=\"24\"\n class=\"nile-error-notification__icon\"\n part=\"icon\"\n color=\"var(--indication-color)\"\n ></nile-icon>\n ${this.errorMessage}\n </div>\n\t\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileNewError;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-new-error': NileNewError;\n }\n}\n"]}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
export declare function isInViewport(element: HTMLElement): boolean;
|
2
|
-
export declare function getValidTooltipPosition(triggerRect: DOMRect, tooltipRect: DOMRect, originalPlacement: string, distance: number, skidding: number, caretSize: number, viewportWidth: number, viewportHeight: number): {
|
3
|
-
top: number;
|
4
|
-
left: number;
|
5
|
-
placement: string;
|
6
|
-
};
|
7
|
-
export interface CaretPositionInput {
|
8
|
-
placement: string;
|
9
|
-
tooltipRect: DOMRect;
|
10
|
-
triggerRect: DOMRect;
|
11
|
-
caretSize: number;
|
12
|
-
left: number;
|
13
|
-
top: number;
|
14
|
-
}
|
15
|
-
export declare function getCaretPosition({ placement, tooltipRect, triggerRect, caretSize, left, top }: CaretPositionInput): {
|
16
|
-
caretLeft: number;
|
17
|
-
caretTop: number;
|
18
|
-
};
|