@aquera/nile-elements 0.1.36-beta-1.2 → 0.1.36-beta-1.4
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 +12 -72
- package/demo/index.css +4 -7
- package/demo/index.html +38 -20
- package/demo/variables.css +0 -13
- package/demo/variables_v2.css +0 -13
- package/dist/fixture-178ed8d2.esm.js +569 -0
- package/dist/{fixture-d5b55278.cjs.js → fixture-bb486165.cjs.js} +2 -2
- package/dist/{fixture-d5b55278.cjs.js.map → fixture-bb486165.cjs.js.map} +1 -1
- package/dist/{fixture-df8b52d7.esm.js → fixture-c4e75e04.esm.js} +1 -1
- package/dist/fixture-d7bf42eb.cjs.js +395 -0
- package/dist/fixture-d7bf42eb.cjs.js.map +1 -0
- 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-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 +8 -17
- 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.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
- package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
- package/dist/nile-error-message/nile-error-message.css.esm.js +4 -6
- package/dist/nile-error-message/nile-error-message.esm.js +4 -4
- 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-error-notification/nile-error-notification.css.cjs.js +1 -1
- package/dist/nile-error-notification/nile-error-notification.css.cjs.js.map +1 -1
- package/dist/nile-error-notification/nile-error-notification.css.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 +17 -40
- package/dist/nile-filter-chip/nile-filter-chip.esm.js +8 -17
- 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 +12 -12
- 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.css.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.css.cjs.js.map +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.css.esm.js +0 -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.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.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-table/nile-table.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 +45 -78
- package/dist/nile-tooltip/nile-tooltip.esm.js +28 -23
- package/dist/nile-tooltip/nile-tooltip.test.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.test.esm.js +1 -1
- 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-chip/nile-chip.js +0 -9
- package/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.css.js +4 -6
- package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.d.ts +0 -4
- package/dist/src/nile-error-message/nile-error-message.js +0 -20
- package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
- package/dist/src/nile-error-notification/nile-error-notification.css.js +1 -1
- package/dist/src/nile-error-notification/nile-error-notification.css.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.css.js +17 -40
- 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 +2 -3
- package/dist/src/nile-filter-chip/nile-filter-chip.js +10 -23
- package/dist/src/nile-filter-chip/nile-filter-chip.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js +7 -7
- 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/src/nile-new-error/index.d.ts +1 -0
- package/dist/src/nile-new-error/index.js +2 -0
- package/dist/src/nile-new-error/index.js.map +1 -0
- package/dist/src/nile-new-error/nile-new-error.css.d.ts +12 -0
- package/dist/src/nile-new-error/nile-new-error.css.js +38 -0
- package/dist/src/nile-new-error/nile-new-error.css.js.map +1 -0
- package/dist/src/nile-new-error/nile-new-error.d.ts +36 -0
- package/dist/src/nile-new-error/nile-new-error.js +74 -0
- package/dist/src/nile-new-error/nile-new-error.js.map +1 -0
- package/dist/src/nile-progress-bar/nile-progress-bar.css.js +0 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.css.js.map +1 -1
- package/dist/src/nile-select/nile-select.js +1 -1
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-table/nile-table.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js +43 -76
- package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.d.ts +46 -24
- package/dist/src/nile-tooltip/nile-tooltip.js +232 -235
- package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
- package/dist/src/nile-virtual-list/index.d.ts +1 -0
- package/dist/src/nile-virtual-list/index.js +2 -0
- package/dist/src/nile-virtual-list/index.js.map +1 -0
- package/dist/src/nile-virtual-list/nile-virtual-list.css.d.ts +12 -0
- package/dist/src/nile-virtual-list/nile-virtual-list.css.js +25 -0
- package/dist/src/nile-virtual-list/nile-virtual-list.css.js.map +1 -0
- package/dist/src/nile-virtual-list/nile-virtual-list.d.ts +28 -0
- package/dist/src/nile-virtual-list/nile-virtual-list.js +69 -0
- package/dist/src/nile-virtual-list/nile-virtual-list.js.map +1 -0
- package/dist/src/nile-virtual-scroll/index.d.ts +1 -0
- package/dist/src/nile-virtual-scroll/index.js +2 -0
- package/dist/src/nile-virtual-scroll/index.js.map +1 -0
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.css.d.ts +12 -0
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.css.js +17 -0
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.css.js.map +1 -0
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.d.ts +54 -0
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.js +196 -0
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.js.map +1 -0
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.utils.d.ts +23 -0
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.utils.js +48 -0
- package/dist/src/nile-virtual-scroll/nile-virtual-scroll.utils.js.map +1 -0
- package/dist/src/nile-virtual-select/event-handlers.d.ts +19 -0
- package/dist/src/nile-virtual-select/event-handlers.js +153 -0
- package/dist/src/nile-virtual-select/event-handlers.js.map +1 -0
- package/dist/src/nile-virtual-select/index.d.ts +1 -0
- package/dist/src/nile-virtual-select/index.js +2 -0
- package/dist/src/nile-virtual-select/index.js.map +1 -0
- package/dist/src/nile-virtual-select/models.d.ts +33 -0
- package/dist/src/nile-virtual-select/models.js +5 -0
- package/dist/src/nile-virtual-select/models.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.css.d.ts +12 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js +463 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +239 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.js +1287 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +2 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -0
- 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 +2 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.utils.js.map +1 -0
- package/dist/src/nile-virtual-select/option-utils.d.ts +15 -0
- package/dist/src/nile-virtual-select/option-utils.js +59 -0
- package/dist/src/nile-virtual-select/option-utils.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/plop-templates/lit/index.ts.hbs +1 -1
- package/plop-templates/lit/lit.css.ts.hbs +1 -1
- package/plop-templates/lit/lit.ts.hbs +3 -7
- package/plopfile.js +1 -32
- package/src/index.ts +1 -2
- package/src/nile-chip/nile-chip.ts +0 -9
- package/src/nile-error-message/nile-error-message.css.ts +4 -6
- package/src/nile-error-message/nile-error-message.ts +0 -18
- package/src/nile-error-notification/nile-error-notification.css.ts +1 -1
- package/src/nile-icon/icons/svg/accessreview.ts +1 -1
- package/src/nile-progress-bar/nile-progress-bar.css.ts +0 -1
- package/src/nile-select/nile-select.ts +1 -1
- package/src/nile-table/nile-table.ts +2 -2
- package/src/nile-tooltip/nile-tooltip.css.ts +44 -77
- package/src/nile-tooltip/nile-tooltip.ts +230 -268
- package/vscode-html-custom-data.json +95 -144
- package/plop-templates/lit/lit.template.ts.hbs +0 -3
- package/plop-templates/lit/lit.test.ts.hbs +0 -38
- package/plop-templates/lit/sub-components/index.ts.hbs +0 -4
- package/plop-templates/lit/types/type.ts.hbs +0 -3
- package/plop-templates/lit/utils/lit.utils.ts.hbs +0 -4
- package/src/nile-filter-chip/index.ts +0 -1
- package/src/nile-filter-chip/nile-filter-chip.css.ts +0 -138
- package/src/nile-filter-chip/nile-filter-chip.test.ts +0 -92
- package/src/nile-filter-chip/nile-filter-chip.ts +0 -136
- package/src/nile-tooltip/nile-tooltip-utils.ts +0 -271
- package/src/nile-tooltip/nile-tooltip.test.ts +0 -168
- /package/{plop-templates/lit/types/index.ts.hbs → dist/src/nile-virtual-select/nile-virtual-select.test.d.ts} +0 -0
@@ -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,89 +1,56 @@
|
|
1
|
-
import{css as
|
1
|
+
import{css as o}from"lit";const t=o`
|
2
|
+
:host {
|
3
|
+
--max-width: 20rem;
|
4
|
+
--hide-delay: 0ms;
|
5
|
+
--show-delay: 150ms;
|
2
6
|
|
3
|
-
|
4
|
-
:host {
|
5
|
-
position: relative;
|
6
|
-
display: inline-block;
|
7
|
-
}
|
8
|
-
.tooltip {
|
9
|
-
position: fixed;
|
10
|
-
z-index: 1000;
|
11
|
-
background-color: var(--nile-tooltip-color-background, #333);
|
12
|
-
color: var(--nile-colors-white-base, #fff);
|
13
|
-
padding: 6px 10px;
|
14
|
-
border-radius: 4px;
|
15
|
-
font-size: var(--nile-tooltip-font-size-sm, 14px);
|
16
|
-
line-height: var(--nile-tooltip-line-height-sm, 1.5);
|
17
|
-
opacity: 0;
|
18
|
-
transition: opacity 0.2s, transform 0.2s;
|
19
|
-
pointer-events: none;
|
20
|
-
white-space: normal;
|
21
|
-
visibility: hidden;
|
22
|
-
overflow: visible;
|
23
|
-
|
24
|
-
}
|
25
|
-
:host([open]) .tooltip {
|
26
|
-
opacity: 1;
|
27
|
-
visibility: visible;
|
28
|
-
pointer-events: auto;
|
29
|
-
}
|
30
|
-
.tooltip-content {
|
31
|
-
overflow: auto;
|
32
|
-
max-width: 250px;
|
33
|
-
max-height: 116px;
|
34
|
-
}
|
35
|
-
.tooltip-caret {
|
36
|
-
position: absolute;
|
37
|
-
width: calc(2 * var(--caret-size, 6px));
|
38
|
-
height: calc(2 * var(--caret-size, 6px));
|
39
|
-
background-color: inherit;
|
40
|
-
transform: rotate(45deg);
|
41
|
-
z-index: -1;
|
42
|
-
}
|
43
|
-
.trigger-container {
|
44
|
-
display: inline-block;
|
45
|
-
}
|
46
|
-
|
47
|
-
|
48
|
-
:host([open]) .tooltip {
|
49
|
-
visibility: visible;
|
50
|
-
pointer-events: auto;
|
51
|
-
animation: fadeIn 150ms forwards;
|
52
|
-
}
|
53
|
-
|
54
|
-
|
55
|
-
.tooltip.hide {
|
56
|
-
animation: fadeOut 100ms forwards;
|
57
|
-
}
|
58
|
-
|
59
|
-
|
60
|
-
@keyframes fadeIn {
|
61
|
-
from {
|
62
|
-
opacity: 0;
|
63
|
-
transform: translateY(5px);
|
7
|
+
display: contents;
|
64
8
|
}
|
65
|
-
to {
|
66
|
-
opacity: 1;
|
67
|
-
transform: translateY(0);
|
68
|
-
}
|
69
|
-
}
|
70
9
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
opacity: 1;
|
75
|
-
transform: translateY(0);
|
10
|
+
.tooltip {
|
11
|
+
--arrow-size: 6px;
|
12
|
+
--arrow-color: var(--nile-tooltip-color-background);
|
76
13
|
}
|
77
|
-
|
78
|
-
|
79
|
-
|
14
|
+
|
15
|
+
.tooltip::part(popup) {
|
16
|
+
pointer-events: none;
|
17
|
+
z-index: 1000;
|
80
18
|
}
|
81
|
-
}
|
82
19
|
|
20
|
+
.tooltip[placement^='top']::part(popup) {
|
21
|
+
transform-origin: bottom;
|
22
|
+
}
|
83
23
|
|
24
|
+
.tooltip[placement^='bottom']::part(popup) {
|
25
|
+
transform-origin: top;
|
26
|
+
}
|
84
27
|
|
28
|
+
.tooltip[placement^='left']::part(popup) {
|
29
|
+
transform-origin: right;
|
30
|
+
}
|
85
31
|
|
32
|
+
.tooltip[placement^='right']::part(popup) {
|
33
|
+
transform-origin: left;
|
34
|
+
}
|
86
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
|
+
}
|
87
50
|
|
88
|
-
|
89
|
-
|
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,25 +1,30 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{
|
2
|
-
<
|
3
|
-
|
4
|
-
|
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
|
5
16
|
>
|
6
|
-
<
|
7
|
-
<slot name="content" @slotchange=${this.handleTooltipSlotChange}></slot>
|
8
|
-
${this.hasTooltipSlot?null:i`${this.content}`}
|
9
|
-
</div>
|
10
|
-
<div class="tooltip-caret" style="--caret-size: ${this.caretSize}px;"></div>
|
11
|
-
</div>
|
17
|
+
<slot slot="anchor" aria-describedby="tooltip"></slot>
|
12
18
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
`}};t([s({type:String})],c.prototype,"content",void 0),t([s({type:String})],c.prototype,"placement",void 0),t([s({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([s({type:Boolean,reflect:!0})],c.prototype,"open",void 0),t([s()],c.prototype,"trigger",void 0),t([s({type:Number})],c.prototype,"distance",void 0),t([s({type:Number})],c.prototype,"skidding",void 0),t([s({type:Boolean,reflect:!0})],c.prototype,"hoist",void 0),t([o(".tooltip")],c.prototype,"tooltip",void 0),t([o(".trigger-container")],c.prototype,"triggerContainer",void 0),t([o(".tooltip-caret")],c.prototype,"caret",void 0),t([o('slot[name="content"]')],c.prototype,"tooltipSlot",void 0),c=t([e("nile-tooltip")],c);export{c as N};
|
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(["../fixture-d5b55278.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);})));});}};});
|
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
2
|
//# sourceMappingURL=nile-tooltip.test.cjs.js.map
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import{f as t,h as o,w as e,o as i}from"../fixture-
|
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
2
|
<nile-tooltip>
|
3
3
|
<div slot="content">Slot Content</div>
|
4
4
|
<button>Trigger</button>
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
@@ -76,5 +76,4 @@ export { NileSectionMessage } from './nile-section-message';
|
|
76
76
|
export { NileToolbar } from './nile-toolbar';
|
77
77
|
export { NileInlineEdit } from './nile-inline-edit';
|
78
78
|
export { NileTable } from './nile-table';
|
79
|
-
export { NileFilterChip } from './nile-filter-chip';
|
80
79
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","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AO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { NileButton } from './nile-button';\nexport { NileHeading } from './nile-heading';\nexport { NileIcon } from './nile-icon';\nexport { NileInput } from './nile-input';\nexport { NileSidebar } from './nile-sidebar';\nexport { NileMenu } from './nile-menu';\nexport { NileBadge } from './nile-badge';\nexport { NileDrawer } from './nile-drawer';\nexport { NileCheckbox } from './nile-checkbox';\nexport { NileRadio } from './nile-radio';\nexport { NileRadioGroup } from './nile-radio-group';\nexport { NilePopup } from './nile-popup';\nexport { NileTooltip } from './nile-tooltip';\nexport { NileSlideToggle } from './nile-slide-toggle';\nexport { NileLoader } from './nile-loader';\nexport { NileProgressBar } from './nile-progress-bar';\nexport { NileSpinner } from './nile-spinner';\nexport { NileSelect } from './nile-select';\nexport { NileOption } from './nile-option';\nexport { NileTag } from './nile-tag';\nexport { NileIconButton } from './nile-icon-button';\nexport { NileMenuItem } from './nile-menu-item';\nexport { NileDropdown } from './nile-dropdown';\nexport { NileAutoComplete } from './nile-auto-complete';\nexport { NileChip } from './nile-chip';\nexport { NileTextarea } from './nile-textarea';\nexport { NileDatePicker } from './nile-date-picker';\nexport { NileErrorMessage } from './nile-error-message';\nexport { NileFormErrorMessage } from './nile-form-error-message';\nexport { NileFormHelpText } from './nile-form-help-text';\nexport { NileCalendar } from './nile-calendar';\nexport { NileLink } from './nile-link';\nexport { NileButtonToggleGroup } from './nile-button-toggle-group';\nexport { NileButtonToggle } from './nile-button-toggle';\nexport { NileSwitcher } from './nile-switcher';\nexport { NileContentEditor } from './nile-content-editor';\nexport { NileDialog } from './nile-dialog';\nexport { NileErrorNotification } from './nile-error-notification';\nexport { NileTabGroup } from './nile-tab-group';\nexport { NileTab } from './nile-tab';\nexport { NileTabPanel } from './nile-tab-panel';\nexport { NileCodeEditor } from './nile-code-editor';\nexport { NileToast } from './nile-toast';\nexport { NileBreadcrumb } from './nile-breadcrumb';\nexport { NileBreadcrumbItem } from './nile-breadcrumb-item';\nexport { NileFormGroup } from './nile-form-group';\nexport { NileCard } from './nile-card';\nexport { NilePopover } from './nile-popover';\nexport { NileButtonFilter } from './nile-button-filter';\nexport { NileCircularProgressbar } from './nile-circular-progressbar';\nexport { NileSidebarMenu } from './nile-sidebar-menu';\nexport { NileSidebarMenuItems } from './nile-sidebar-menu-items';\nexport { NileSidebarWrapper } from './nile-sidebar-wrapper';\nexport { NileTableCellItem } from './nile-table-cell-item';\nexport { NileTableRow } from './nile-table-row';\nexport { NileTableBody } from './nile-table-body';\nexport { NileTableHeaderItem } from './nile-table-header-item';\nexport { NileAvatar } from './nile-avatar';\nexport { NilePageHeader } from './nile-page-header';\nexport { NileEmptyState } from './nile-empty-state';\nexport { NileHero } from './nile-hero';\nexport { NileStepperItem } from './nile-stepper-item';\nexport { NileStepper } from './nile-stepper';\nexport { NileHeroHeader } from './nile-hero-header';\nexport { NileVerticalStepperItem } from './nile-vertical-stepper-item';\nexport { NileFormatDate } from './nile-format-date';\nexport { NileSplitPanel } from './nile-split-panel';\nexport { NileTree } from './nile-tree';\nexport { NileTreeItem } from './nile-tree-item';\nexport { NileListItem } from './nile-list-item';\nexport { NileList } from './nile-list';\nexport { NileAccordion } from './nile-accordion';\nexport { NileDivider } from './nile-divider';\nexport { NileTitle } from './nile-title';\nexport { NileSectionMessage } from './nile-section-message';\nexport { NileToolbar } from './nile-toolbar';\nexport { NileInlineEdit } from './nile-inline-edit';\nexport { NileTable } from './nile-table';"]}
|
@@ -153,15 +153,6 @@ let NileChip = class NileChip extends NileElement {
|
|
153
153
|
@nile-complete=${this.handleSelect}
|
154
154
|
></nile-auto-complete>
|
155
155
|
</div>
|
156
|
-
<slot
|
157
|
-
name="help-text"
|
158
|
-
part="form-control-help-text"
|
159
|
-
id="help-text"
|
160
|
-
class="form-control__help-text"
|
161
|
-
aria-hidden=${hasHelpText ? 'false' : 'true'}
|
162
|
-
>
|
163
|
-
${this.helpText}
|
164
|
-
</slot>
|
165
156
|
</div>
|
166
157
|
${hasHelpText
|
167
158
|
? html `
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-chip.js","sourceRoot":"","sources":["../../../src/nile-chip/nile-chip.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,GAIL,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,WAAgC,MAAM,0BAA0B,CAAC;AAOjE,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,WAAW;IAAlC;;QAKY,sBAAiB,GAAG,IAAI,iBAAiB,CACxD,IAAI,EACJ,WAAW,EACX,OAAO,CACR,CAAC;QAEO,SAAI,GAAa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A2D;AAxE7E,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAgSpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-chip.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HasSlotController } from '../internal/slot';\nimport NileElement, { NileFormControl } from '../internal/nile-element';\n\ninterface CustomEventDetail {\n value: string;\n}\n\n@customElement('nile-chip')\nexport class NileChip extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'help-text',\n 'label'\n );\n\n @state() tags: string[] = [];\n\n @state() inputValue: string = '';\n\n @state() isDropdownOpen: boolean = false;\n\n @query('nile-auto-complete') autoComplete!: any;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Disables the duplicate entries. */\n @property({ type: Boolean }) noDuplicates = false;\n\n /** The input's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) acceptUserInput = false;\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = 'type here...';\n\n /** Makes the input readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Disables the input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n // AUTO-COMPLETE-OPTIONS\n\n /** Virtual scroll in dropdown options. */\n @property({ type: Boolean }) enableVirtualScroll = false;\n\n @property({ type: Array }) autoCompleteOptions: any[] = [];\n\n @property({ type: Array }) filteredAutoCompleteOptions: any[] = [];\n\n @property({ type: Array }) value: any[] = [];\n\n @property({ type: Boolean }) noWrap: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ type: Array }) errorIndexes: number[] = [];\n\n @property({ attribute: 'help-text', reflect: true }) helpText = '';\n\n @property({ attribute: 'error-message', reflect: true }) errorMessage = '';\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean = (item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('autoCompleteOptions')) {\n this.filteredAutoCompleteOptions = [...this.autoCompleteOptions];\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n }\n if (changedProperties.has('value')){\n this.tags = [...this.value];\n this.onTagsChanged();\n }\n if (changedProperties.has('tags')){\n this.onTagsChanged();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n render() {\n // Check if slots are present\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n\n // Check if label and help text are present\n const hasLabel = this.label ? true : !!hasLabelSlot;\n\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'nile-chip--disabled': this.disabled,\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div\n class=${classMap({\n 'nile-chip': true,\n 'nile-chip--warning': this.warning,\n 'nile-chip--error': this.error,\n 'nile-chip--success': this.success,\n 'nile-chip--no-wrap': this.noWrap,\n })}\n >\n ${this.tags.map(\n (tag, index) => html`\n <nile-tag\n class=${classMap({\n 'nile-chip__tags': true,\n })}\n .variant=${this.errorIndexes.includes(index) ? 'error' : 'normal'}\n @nile-remove=${() => this.handleRemove(tag)}\n removable\n pill\n >\n ${tag}\n </nile-tag>\n `\n )}\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .enableVirtualScroll=${this.enableVirtualScroll}\n .allMenuItems=${this.filteredAutoCompleteOptions}\n .filterFunction=${this.filterFunction}\n .renderItemFunction=${this.renderItemFunction}\n .loading=\"${this.loading}\"\n .value=${this.inputValue}\n ?isDropdownOpen=${this.isDropdownOpen}\n .noBorder=${true}\n openOnFocus\n exportparts=\"options__wrapper\"\n .placeholder=${this.placeholder}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @nile-focus=${this.handleFocus}\n @nile-complete=${this.handleSelect}\n ></nile-auto-complete>\n </div>\n <slot\n name=\"help-text\"\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=${hasHelpText ? 'false' : 'true'}\n >\n ${this.helpText}\n </slot>\n </div>\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n </div>\n `;\n }\n\n private handleSelect(event: CustomEvent<CustomEventDetail>) {\n // Add the selected value to the tags array only if it doesn't already exist\n if (!this.noDuplicates || !this.tags.includes(event.detail.value)) {\n this.tags = [...this.tags, event.detail.value];\n this.emit('nile-chip-change', { value: this.tags });\n this.resetInput();\n }\n }\n\n private handleRemove(value: string) {\n // Remove the tag from the tags array\n this.tags = this.tags.filter(tag => tag !== value);\n\n if (this.noDuplicates && this.autoCompleteOptions.includes(value)) {\n this.filteredAutoCompleteOptions = [\n ...this.filteredAutoCompleteOptions,\n value,\n ];\n }\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n private handleInputChange(event: CustomEvent<CustomEventDetail>) {\n // Update the input value\n this.inputValue = event.detail.value;\n }\n\n private handleInputKeydown(event: KeyboardEvent) {\n if (!this.acceptUserInput) {\n return;\n }\n\n if(event.key === 'Tab'){\n event.preventDefault()\n }\n \n if (\n (event.key === 'Enter' || event.key === 'Tab' ) \n && this.inputValue \n && (!this.noDuplicates || !this.tags.includes(this.inputValue))\n ) {\n event.preventDefault()\n this.tags = [...this.tags, this.inputValue];\n this.resetInput();\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n if(\n (event.key === 'Enter'|| event.key === 'Tab' ) \n && this.inputValue \n && (this.noDuplicates || this.tags.includes(this.inputValue))\n ){\n this.emit('nile-duplicates-blocked');\n }\n }\n\n private handleFocus() {\n this.isDropdownOpen = true;\n }\n\n onTagsChanged() {\n if (this.noDuplicates)\n this.filteredAutoCompleteOptions = this.filteredAutoCompleteOptions.filter(option => !this.tags.includes(option));\n }\n\n\n private resetInput() {\n // Reset the input-related properties\n this.inputValue = '';\n this.isDropdownOpen = false;\n this.autoComplete.value = '';\n this.autoComplete.handleFocus();\n }\n}\n\nexport default NileChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-chip': NileChip;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"nile-chip.js","sourceRoot":"","sources":["../../../src/nile-chip/nile-chip.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,GAIL,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,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,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAAe;AAEV;IAAxD,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAmB;AAE7C;IAA7B,QAAQ,CAAC,EAAE,SAAS,EAAC,KAAK,EAAC,CAAC;gDAA4J;AAE3J;IAA7B,QAAQ,CAAC,EAAE,SAAS,EAAC,KAAK,EAAC,CAAC;oDAA2D;AAxE7E,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAuRpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-chip.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HasSlotController } from '../internal/slot';\nimport NileElement, { NileFormControl } from '../internal/nile-element';\n\ninterface CustomEventDetail {\n value: string;\n}\n\n@customElement('nile-chip')\nexport class NileChip extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'help-text',\n 'label'\n );\n\n @state() tags: string[] = [];\n\n @state() inputValue: string = '';\n\n @state() isDropdownOpen: boolean = false;\n\n @query('nile-auto-complete') autoComplete!: any;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Disables the duplicate entries. */\n @property({ type: Boolean }) noDuplicates = false;\n\n /** The input's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) acceptUserInput = false;\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = 'type here...';\n\n /** Makes the input readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Disables the input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n // AUTO-COMPLETE-OPTIONS\n\n /** Virtual scroll in dropdown options. */\n @property({ type: Boolean }) enableVirtualScroll = false;\n\n @property({ type: Array }) autoCompleteOptions: any[] = [];\n\n @property({ type: Array }) filteredAutoCompleteOptions: any[] = [];\n\n @property({ type: Array }) value: any[] = [];\n\n @property({ type: Boolean }) noWrap: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ type: Array }) errorIndexes: number[] = [];\n\n @property({ attribute: 'help-text', reflect: true }) helpText = '';\n\n @property({ attribute: 'error-message', reflect: true }) errorMessage = '';\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean = (item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('autoCompleteOptions')) {\n this.filteredAutoCompleteOptions = [...this.autoCompleteOptions];\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n }\n if (changedProperties.has('value')){\n this.tags = [...this.value];\n this.onTagsChanged();\n }\n if (changedProperties.has('tags')){\n this.onTagsChanged();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n render() {\n // Check if slots are present\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n\n // Check if label and help text are present\n const hasLabel = this.label ? true : !!hasLabelSlot;\n\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'nile-chip--disabled': this.disabled,\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div\n class=${classMap({\n 'nile-chip': true,\n 'nile-chip--warning': this.warning,\n 'nile-chip--error': this.error,\n 'nile-chip--success': this.success,\n 'nile-chip--no-wrap': this.noWrap,\n })}\n >\n ${this.tags.map(\n (tag, index) => html`\n <nile-tag\n class=${classMap({\n 'nile-chip__tags': true,\n })}\n .variant=${this.errorIndexes.includes(index) ? 'error' : 'normal'}\n @nile-remove=${() => this.handleRemove(tag)}\n removable\n pill\n >\n ${tag}\n </nile-tag>\n `\n )}\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .enableVirtualScroll=${this.enableVirtualScroll}\n .allMenuItems=${this.filteredAutoCompleteOptions}\n .filterFunction=${this.filterFunction}\n .renderItemFunction=${this.renderItemFunction}\n .loading=\"${this.loading}\"\n .value=${this.inputValue}\n ?isDropdownOpen=${this.isDropdownOpen}\n .noBorder=${true}\n openOnFocus\n exportparts=\"options__wrapper\"\n .placeholder=${this.placeholder}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @nile-focus=${this.handleFocus}\n @nile-complete=${this.handleSelect}\n ></nile-auto-complete>\n </div>\n </div>\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n </div>\n `;\n }\n\n private handleSelect(event: CustomEvent<CustomEventDetail>) {\n // Add the selected value to the tags array only if it doesn't already exist\n if (!this.noDuplicates || !this.tags.includes(event.detail.value)) {\n this.tags = [...this.tags, event.detail.value];\n this.emit('nile-chip-change', { value: this.tags });\n this.resetInput();\n }\n }\n\n private handleRemove(value: string) {\n // Remove the tag from the tags array\n this.tags = this.tags.filter(tag => tag !== value);\n\n if (this.noDuplicates && this.autoCompleteOptions.includes(value)) {\n this.filteredAutoCompleteOptions = [\n ...this.filteredAutoCompleteOptions,\n value,\n ];\n }\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n private handleInputChange(event: CustomEvent<CustomEventDetail>) {\n // Update the input value\n this.inputValue = event.detail.value;\n }\n\n private handleInputKeydown(event: KeyboardEvent) {\n if (!this.acceptUserInput) {\n return;\n }\n\n if(event.key === 'Tab'){\n event.preventDefault()\n }\n \n if (\n (event.key === 'Enter' || event.key === 'Tab' ) \n && this.inputValue \n && (!this.noDuplicates || !this.tags.includes(this.inputValue))\n ) {\n event.preventDefault()\n this.tags = [...this.tags, this.inputValue];\n this.resetInput();\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n if(\n (event.key === 'Enter'|| event.key === 'Tab' ) \n && this.inputValue \n && (this.noDuplicates || this.tags.includes(this.inputValue))\n ){\n this.emit('nile-duplicates-blocked');\n }\n }\n\n private handleFocus() {\n this.isDropdownOpen = true;\n }\n\n onTagsChanged() {\n if (this.noDuplicates)\n this.filteredAutoCompleteOptions = this.filteredAutoCompleteOptions.filter(option => !this.tags.includes(option));\n }\n\n\n private resetInput() {\n // Reset the input-related properties\n this.inputValue = '';\n this.isDropdownOpen = false;\n this.autoComplete.value = '';\n this.autoComplete.handleFocus();\n }\n}\n\nexport default NileChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-chip': NileChip;\n }\n}\n"]}
|
@@ -14,11 +14,11 @@ export const styles = css `
|
|
14
14
|
|
15
15
|
.nile-error-message {
|
16
16
|
width: 100%;
|
17
|
+
word-break: break-all;
|
17
18
|
font-size: var(--nile-font-size-small);
|
18
19
|
letter-spacing: 0.2px;
|
19
20
|
font-weight: var(--nile-font-weight-regular);
|
20
21
|
line-height: var(--nile-font-size-small);
|
21
|
-
max-width: var(--nile-error-max-width, 535px);
|
22
22
|
}
|
23
23
|
|
24
24
|
.nile-error-message__error {
|
@@ -30,8 +30,6 @@ export const styles = css `
|
|
30
30
|
color: var(--nile-colors-dark-500);
|
31
31
|
margin-top:6px;
|
32
32
|
line-height: 16px;
|
33
|
-
max-height: var(--nile-error-max-height, 48px);
|
34
|
-
overflow-x: auto;
|
35
33
|
}
|
36
34
|
|
37
35
|
.nile-error-message__icon {
|
@@ -54,7 +52,7 @@ export const styles = css `
|
|
54
52
|
border: 1px solid var(--nile-colors-red-500);
|
55
53
|
border-left: 6px solid var(--nile-colors-red-500);
|
56
54
|
border-radius: 4px;
|
57
|
-
margin-top:
|
55
|
+
margin-top: 12px;
|
58
56
|
padding: 12px;
|
59
57
|
background: var(--nile-colors-neutral-100);
|
60
58
|
}
|
@@ -81,10 +79,10 @@ export const styles = css `
|
|
81
79
|
}
|
82
80
|
|
83
81
|
.nile-error-message__response-expanded.expanded {
|
84
|
-
max-height:
|
82
|
+
max-height: 100px;
|
85
83
|
transition: max-height 0.3s ease-in-out;
|
86
84
|
visibility: visible;
|
87
|
-
padding:
|
85
|
+
padding: 12px;
|
88
86
|
}
|
89
87
|
`;
|
90
88
|
export default [styles];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-error-message.css.js","sourceRoot":"","sources":["../../../src/nile-error-message/nile-error-message.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
1
|
+
{"version":3,"file":"nile-error-message.css.js","sourceRoot":"","sources":["../../../src/nile-error-message/nile-error-message.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ExB,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 * ErrorMessage CSS\n */\nexport const styles = css`\n :host {\n }\n\n .nile-error-message {\n width: 100%;\n word-break: break-all;\n font-size: var(--nile-font-size-small);\n letter-spacing: 0.2px;\n font-weight: var(--nile-font-weight-regular);\n line-height: var(--nile-font-size-small);\n }\n\n .nile-error-message__error {\n color: var(--nile-colors-red-700);\n word-break: break-word;\n }\n\n .nile-error-message__response {\n color: var(--nile-colors-dark-500);\n margin-top:6px;\n line-height: 16px;\n }\n\n .nile-error-message__icon {\n vertical-align: middle;\n margin-right:2px;\n }\n\n .nile-error-message__more-button {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n white-space: nowrap;\n display: inline-flex;\n gap: 4px;\n align-items: center\n }\n\n .nile-error-message__response-expanded {\n line-height: 18px;\n height: auto;\n border: 1px solid var(--nile-colors-red-500);\n border-left: 6px solid var(--nile-colors-red-500);\n border-radius: 4px;\n margin-top: 12px;\n padding: 12px;\n background: var(--nile-colors-neutral-100);\n }\n\n .nile-error-message__response-expanded {\n max-height: 100px;\n overflow-y: auto;\n border: 1px solid var(--nile-colors-red-500);\n border-left: 6px solid var(--nile-colors-red-500);\n border-radius: 4px;\n margin-top: 12px;\n padding: 12px;\n background: var(--nile-colors-neutral-100);\n transition: max-height 0.3s ease-in-out;\n flex-shrink: 0;\n }\n\n .nile-error-message__response-expanded.collapsed {\n max-height: 0;\n overflow: hidden;\n transition: max-height 0.3s ease-in-out;\n visibility: hidden;\n padding: 0 12px;\n }\n\n .nile-error-message__response-expanded.expanded {\n max-height: 100px;\n transition: max-height 0.3s ease-in-out;\n visibility: visible;\n padding: 12px;\n }\n`;\n\nexport default [styles];\n"]}
|
@@ -9,16 +9,12 @@ export declare class NileErrorMessage extends LitElement {
|
|
9
9
|
errorResponse: string;
|
10
10
|
errorResponseLong: string;
|
11
11
|
isExpanded: boolean;
|
12
|
-
maxWidth: string;
|
13
|
-
maxHeight: string;
|
14
|
-
maxDialogHeight: string;
|
15
12
|
private readonly MAX_LENGTH;
|
16
13
|
/**
|
17
14
|
* Get a truncated version of the errorResponse if it's too long.
|
18
15
|
* @returns {string}
|
19
16
|
*/
|
20
17
|
getTruncatedResponse(): string;
|
21
|
-
updated(changedProperties: Map<string, any>): void;
|
22
18
|
/**
|
23
19
|
* Toggle the expanded state of the error response.
|
24
20
|
*/
|