@aquera/nile-elements 0.1.50-beta-1.0 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/demo/index.html +33 -150
- package/dist/axe.min-2720cd56.esm.js +1 -0
- package/dist/axe.min-69d47269.cjs.js +2 -0
- package/dist/axe.min-69d47269.cjs.js.map +1 -0
- package/dist/{fixture-372df3b0.esm.js → fixture-e7023246.esm.js} +1 -1
- package/dist/{fixture-161dee0b.cjs.js → fixture-fe6c932e.cjs.js} +2 -2
- package/dist/fixture-fe6c932e.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +10339 -0
- package/dist/internal/form.cjs.js +1 -1
- package/dist/internal/form.cjs.js.map +1 -1
- package/dist/internal/form.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/index.cjs.js +1 -1
- package/dist/nile-auto-complete/index.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +17 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +29 -8
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +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.cjs.js.map +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 +1 -0
- package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.test.esm.js +1 -1
- package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
- package/dist/nile-icon/nile-icon.test.esm.js +1 -1
- package/dist/nile-input/nile-input.test.cjs.js +1 -1
- package/dist/nile-input/nile-input.test.esm.js +1 -1
- package/dist/nile-link/nile-link.test.cjs.js +1 -1
- package/dist/nile-link/nile-link.test.esm.js +1 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.test.esm.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.cjs.js +1 -1
- package/dist/nile-option/nile-option.css.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.esm.js +1 -1
- package/dist/nile-option/nile-option.esm.js +2 -2
- package/dist/nile-pagination/nile-pagination.cjs.js +1 -1
- package/dist/nile-pagination/nile-pagination.cjs.js.map +1 -1
- package/dist/nile-pagination/nile-pagination.css.cjs.js +1 -1
- package/dist/nile-pagination/nile-pagination.css.cjs.js.map +1 -1
- package/dist/nile-pagination/nile-pagination.css.esm.js +152 -39
- package/dist/nile-pagination/nile-pagination.esm.js +118 -29
- package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.test.esm.js +1 -1
- package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.test.esm.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.test.esm.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/index.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 +2 -2
- package/dist/nile-select/nile-select.test.cjs.js +1 -1
- package/dist/nile-select/nile-select.test.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.test.esm.js +2 -2
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/form.js +2 -2
- package/dist/src/internal/form.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.js +1 -0
- package/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/dist/src/nile-option/nile-option.css.js +1 -1
- package/dist/src/nile-option/nile-option.css.js.map +1 -1
- package/dist/src/nile-option/nile-option.d.ts +1 -5
- package/dist/src/nile-option/nile-option.js +6 -21
- package/dist/src/nile-option/nile-option.js.map +1 -1
- package/dist/src/nile-pagination/nile-pagination.css.js +151 -38
- package/dist/src/nile-pagination/nile-pagination.css.js.map +1 -1
- package/dist/src/nile-pagination/nile-pagination.d.ts +3 -0
- package/dist/src/nile-pagination/nile-pagination.js +167 -40
- package/dist/src/nile-pagination/nile-pagination.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +2 -11
- package/dist/src/nile-select/nile-select.js +18 -37
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/rollup.config.js +27 -39
- package/src/index.ts +1 -3
- package/src/internal/form.ts +2 -2
- package/src/nile-chip/nile-chip.ts +1 -0
- package/src/nile-option/nile-option.css.ts +1 -1
- package/src/nile-option/nile-option.ts +3 -17
- package/src/nile-pagination/nile-pagination.css.ts +151 -38
- package/src/nile-pagination/nile-pagination.ts +188 -46
- package/src/nile-select/nile-select.ts +9 -35
- package/vscode-html-custom-data.json +3 -230
- package/dist/axe.min-2b379f29.cjs.js +0 -12
- package/dist/axe.min-2b379f29.cjs.js.map +0 -1
- package/dist/axe.min-c2cd8733.esm.js +0 -12
- package/dist/fixture-161dee0b.cjs.js.map +0 -1
- package/dist/nile-select/virtual-scroll-helper.cjs.js +0 -2
- package/dist/nile-select/virtual-scroll-helper.cjs.js.map +0 -1
- package/dist/nile-select/virtual-scroll-helper.esm.js +0 -38
- package/dist/nile-virtual-select/index.cjs.js +0 -2
- package/dist/nile-virtual-select/index.cjs.js.map +0 -1
- package/dist/nile-virtual-select/index.esm.js +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +0 -2
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js +0 -2
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js.map +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.css.esm.js +0 -467
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +0 -227
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +0 -2
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +0 -49
- package/dist/nile-virtual-select/renderer.cjs.js +0 -2
- package/dist/nile-virtual-select/renderer.cjs.js.map +0 -1
- package/dist/nile-virtual-select/renderer.esm.js +0 -18
- package/dist/nile-virtual-select/search-manager.cjs.js +0 -2
- package/dist/nile-virtual-select/search-manager.cjs.js.map +0 -1
- package/dist/nile-virtual-select/search-manager.esm.js +0 -1
- package/dist/nile-virtual-select/selection-manager.cjs.js +0 -2
- package/dist/nile-virtual-select/selection-manager.cjs.js.map +0 -1
- package/dist/nile-virtual-select/selection-manager.esm.js +0 -1
- package/dist/nile-virtual-select/types.cjs.js +0 -2
- package/dist/nile-virtual-select/types.cjs.js.map +0 -1
- package/dist/nile-virtual-select/types.esm.js +0 -1
- package/dist/src/nile-select/virtual-scroll-helper.d.ts +0 -9
- package/dist/src/nile-select/virtual-scroll-helper.js +0 -51
- package/dist/src/nile-select/virtual-scroll-helper.js.map +0 -1
- package/dist/src/nile-virtual-select/index.d.ts +0 -1
- package/dist/src/nile-virtual-select/index.js +0 -2
- package/dist/src/nile-virtual-select/index.js.map +0 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.css.d.ts +0 -12
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js +0 -479
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +0 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +0 -263
- package/dist/src/nile-virtual-select/nile-virtual-select.js +0 -1183
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +0 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +0 -7
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +0 -341
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +0 -1
- package/dist/src/nile-virtual-select/renderer.d.ts +0 -11
- package/dist/src/nile-virtual-select/renderer.js +0 -51
- package/dist/src/nile-virtual-select/renderer.js.map +0 -1
- package/dist/src/nile-virtual-select/search-manager.d.ts +0 -12
- package/dist/src/nile-virtual-select/search-manager.js +0 -40
- package/dist/src/nile-virtual-select/search-manager.js.map +0 -1
- package/dist/src/nile-virtual-select/selection-manager.d.ts +0 -12
- package/dist/src/nile-virtual-select/selection-manager.js +0 -64
- package/dist/src/nile-virtual-select/selection-manager.js.map +0 -1
- package/dist/src/nile-virtual-select/types.d.ts +0 -50
- package/dist/src/nile-virtual-select/types.js +0 -8
- package/dist/src/nile-virtual-select/types.js.map +0 -1
- package/dist/virtualize-a4a40d96.esm.js +0 -22
- package/dist/virtualize-b6a2fbe0.cjs.js +0 -18
- package/dist/virtualize-b6a2fbe0.cjs.js.map +0 -1
- package/src/nile-select/virtual-scroll-helper.ts +0 -56
- package/src/nile-virtual-select/index.ts +0 -1
- package/src/nile-virtual-select/nile-virtual-select.css.ts +0 -481
- package/src/nile-virtual-select/nile-virtual-select.test.ts +0 -414
- package/src/nile-virtual-select/nile-virtual-select.ts +0 -1268
- package/src/nile-virtual-select/renderer.ts +0 -73
- package/src/nile-virtual-select/search-manager.ts +0 -50
- package/src/nile-virtual-select/selection-manager.ts +0 -75
- package/src/nile-virtual-select/types.ts +0 -54
@@ -1,4 +1,4 @@
|
|
1
|
-
import{css as
|
1
|
+
import{css as a}from"lit";const n=a`
|
2
2
|
:host {
|
3
3
|
}
|
4
4
|
|
@@ -6,14 +6,10 @@ import{css as i}from"lit";const n=i`
|
|
6
6
|
display: flex;
|
7
7
|
align-items: center;
|
8
8
|
justify-content: space-between;
|
9
|
-
padding: var(--nile-spacing-spacing-md) var(--nile-spacing-spacing-lg);
|
10
|
-
}
|
11
|
-
|
12
|
-
.pagination-wrapper.v2 {
|
13
|
-
justify-content: flex-start;
|
14
|
-
gap: var(--nile-spacing-spacing-lg);
|
9
|
+
padding: var(--nile-spacing-spacing-md) var(--nile-spacing-spacing-lg) ;
|
15
10
|
}
|
16
11
|
|
12
|
+
|
17
13
|
.pagination-wrapper.v2 .pager-container {
|
18
14
|
flex-direction: row;
|
19
15
|
align-items: center;
|
@@ -29,12 +25,79 @@ import{css as i}from"lit";const n=i`
|
|
29
25
|
font-weight: var(--nile-font-weight-regular);
|
30
26
|
}
|
31
27
|
|
28
|
+
|
29
|
+
.pagination-wrapper.compact {
|
30
|
+
min-width: 324px;
|
31
|
+
justify-content: space-between;
|
32
|
+
}
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
.pagination-wrapper.compact .range-text {
|
37
|
+
margin-right: var(--nile-spacing-spacing-md);
|
38
|
+
white-space: nowrap;
|
39
|
+
}
|
40
|
+
|
41
|
+
|
42
|
+
.pagination-wrapper.compact .pager-container {
|
43
|
+
gap: var(--nile-spacing-spacing-md);
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
.pagination-wrapper.compact .pager-container {
|
48
|
+
display: flex;
|
49
|
+
align-items: center;
|
50
|
+
gap: var(--nile-spacing-spacing-md);
|
51
|
+
}
|
52
|
+
|
53
|
+
.pagination-wrapper.compact .page-size-dropdown ::part(base) {
|
54
|
+
min-width: 32px;
|
55
|
+
height: 32px;
|
56
|
+
padding: 0 6px;
|
57
|
+
}
|
58
|
+
|
59
|
+
.pagination-wrapper.compact .page-size-dropdown .chevron {
|
60
|
+
transition: transform 0.2s;
|
61
|
+
}
|
62
|
+
.pagination-wrapper.compact .page-size-dropdown .open .chevron {
|
63
|
+
transform: rotate(180deg);
|
64
|
+
}
|
65
|
+
|
66
|
+
.pagination-wrapper.compact ul.pagination:not(.compact-pagination) {
|
67
|
+
display: none;
|
68
|
+
}
|
69
|
+
|
70
|
+
.compact-pagination {
|
71
|
+
display: flex;
|
72
|
+
align-items: center;
|
73
|
+
gap: var(--nile-spacing-spacing-xs);
|
74
|
+
list-style: none;
|
75
|
+
margin: 0;
|
76
|
+
padding: 0;
|
77
|
+
}
|
78
|
+
.page-dropdown .current-page-btn {
|
79
|
+
padding: 2px;
|
80
|
+
font-size: var(--nile-font-size-small);
|
81
|
+
}
|
82
|
+
|
83
|
+
nile-button.current-page-btn::part(base){
|
84
|
+
min-width: 51px;
|
85
|
+
}
|
86
|
+
|
87
|
+
nile-button.current-page-btn::part(base):active {
|
88
|
+
min-width: 51px;
|
89
|
+
}
|
90
|
+
|
32
91
|
.pager-container {
|
33
92
|
display: flex;
|
34
93
|
align-items: center;
|
35
94
|
gap: var(--nile-spacing-spacing-3xl);
|
36
95
|
}
|
37
96
|
|
97
|
+
.pagination-wrapper.compact .pager-container {
|
98
|
+
gap: var(--nile-spacing-xxs) !important;
|
99
|
+
}
|
100
|
+
|
38
101
|
.range-text {
|
39
102
|
font-size: var(--nile-font-size-small);
|
40
103
|
color: var(--nile-colors-dark-900);
|
@@ -63,63 +126,113 @@ import{css as i}from"lit";const n=i`
|
|
63
126
|
overflow-y: auto;
|
64
127
|
width: 66px;
|
65
128
|
}
|
129
|
+
.down-scroll-wrapper {
|
130
|
+
max-height: 150px;
|
131
|
+
overflow-y: auto;
|
132
|
+
width: 60px;
|
133
|
+
}
|
66
134
|
|
67
|
-
|
135
|
+
|
136
|
+
.compact-scroll-wrapper {
|
137
|
+
max-height: 160px;
|
138
|
+
overflow-y: auto;
|
139
|
+
width: 60px;
|
140
|
+
}
|
141
|
+
.compact-dropdown nile-menu {
|
142
|
+
overflow-y: auto;
|
143
|
+
padding: var(--nile-spacing-spacing-lg) var(--nile-spacing-spacing-none);
|
144
|
+
box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
|
145
|
+
}
|
146
|
+
|
147
|
+
.page-size-dropdown nile-menu {
|
68
148
|
overflow-y: auto;
|
69
149
|
padding: var(--nile-spacing-spacing-lg) var(--nile-spacing-spacing-none);
|
70
150
|
box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
|
71
151
|
}
|
72
152
|
|
73
|
-
|
153
|
+
.compact-scroll-wrapper1 {
|
154
|
+
max-height: 164px;
|
155
|
+
overflow-y: auto;
|
156
|
+
width: 60px;
|
157
|
+
}
|
74
158
|
|
75
|
-
.
|
76
|
-
max-height: 144px;
|
159
|
+
.compact-dropdown1 nile-menu {
|
77
160
|
overflow-y: auto;
|
161
|
+
padding: var(--nile-spacing-spacing-lg) var(--nile-spacing-spacing-none);
|
162
|
+
box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
|
163
|
+
}
|
164
|
+
|
165
|
+
.compact-dropdown1 nile-menu {
|
166
|
+
overflow-y: auto;
|
167
|
+
padding: var(--nile-spacing-spacing-lg) var(--nile-spacing-spacing-none);
|
168
|
+
box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
|
78
169
|
}
|
79
170
|
|
80
|
-
|
81
|
-
|
171
|
+
|
172
|
+
.ellipsis-dropdown nile-menu {
|
173
|
+
overflow-y: auto;
|
174
|
+
padding: var(--nile-spacing-spacing-lg) var(--nile-spacing-spacing-none);
|
175
|
+
box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
|
82
176
|
}
|
83
|
-
|
84
|
-
|
177
|
+
|
178
|
+
.page-size-menu {
|
179
|
+
max-height: 144px;
|
180
|
+
overflow-y: auto;
|
85
181
|
}
|
86
182
|
|
183
|
+
.pagination-wrapper.fluid ul.pagination li:first-child {
|
184
|
+
margin-right: var(--nile-spacing-spacing-xs);
|
185
|
+
}
|
186
|
+
.pagination-wrapper.fluid ul.pagination li:last-child {
|
187
|
+
margin-left: var(--nile-spacing-spacing-md);
|
188
|
+
}
|
189
|
+
|
190
|
+
|
87
191
|
.page-size-label {
|
88
192
|
font-size: var(--nile-type-scale-3);
|
89
193
|
color: var(--nile-colors-dark-500);
|
90
194
|
margin-left: var(--nile-spacing-spacing-md);
|
91
195
|
font-feature-settings: 'liga' off, 'clig' off;
|
92
|
-
font-weight: var(--nile-font-weight-regular);
|
196
|
+
font-weight: var(--nile-font-weight-regular);
|
93
197
|
}
|
94
198
|
|
95
199
|
nile-button::part(base) {
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
}
|
200
|
+
min-width: 32px;
|
201
|
+
height: 32px;
|
202
|
+
padding: 0px 6px;
|
203
|
+
box-shadow: none;
|
204
|
+
}
|
101
205
|
|
102
206
|
nile-button::part(base):active {
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
}
|
109
|
-
|
110
|
-
nile-button.down::part(base){
|
111
|
-
min-width: 62px;
|
112
|
-
|
113
|
-
}
|
114
|
-
.page-size-dropdown .chevron {
|
115
|
-
transition: transform 0.2s;
|
116
|
-
}
|
117
|
-
.page-size-dropdown .open .chevron {
|
118
|
-
transform: rotate(180deg);
|
119
|
-
}
|
120
|
-
|
207
|
+
min-width: 32px;
|
208
|
+
height: 32px;
|
209
|
+
padding: 0px 6px;
|
210
|
+
box-shadow: none;
|
211
|
+
border: none;
|
212
|
+
}
|
121
213
|
|
214
|
+
nile-button.down::part(base) {
|
215
|
+
min-width: 62px;
|
216
|
+
}
|
122
217
|
|
218
|
+
nile-button.compactbtn:part(base){
|
219
|
+
background-color: red;
|
220
|
+
}
|
221
|
+
.page-size-dropdown .chevron {
|
222
|
+
transition: transform 0.2s;
|
223
|
+
}
|
224
|
+
.page-size-dropdown .open .chevron {
|
225
|
+
transform: rotate(180deg);
|
226
|
+
}
|
227
|
+
|
228
|
+
.pagination-wrapper.compact .compact-dropdown .chevron,
|
229
|
+
.pagination-wrapper.compact .compact-dropdown1 .chevron {
|
230
|
+
transition: transform 0.2s;
|
231
|
+
}
|
232
|
+
.pagination-wrapper.compact .compact-dropdown .down.open .chevron,
|
233
|
+
.pagination-wrapper.compact .compact-dropdown1 .current-page-btn.open .chevron {
|
234
|
+
transform: rotate(180deg);
|
235
|
+
}
|
123
236
|
|
124
237
|
|
125
238
|
`;export{n as s};
|
@@ -1,27 +1,74 @@
|
|
1
|
-
import{__decorate as i}from"tslib";import{html as
|
2
|
-
|
3
|
-
|
1
|
+
import{__decorate as i}from"tslib";import{html as e}from"lit";import{property as t,state as n,query as s,customElement as r}from"lit/decorators.js";import{s as a}from"./nile-pagination.css.esm.js";import{N as l}from"../internal/nile-element.esm.js";import{c as o,g as h,a as d,b as c}from"./nile-pagination-utils.esm.js";let p=class extends l{constructor(){super(...arguments),this.totalItems=0,this.currentPage=1,this.pageSize=50,this.pageSizeOptions=[10,25,50,100],this.variant="fluid",this.disabled=!1,this.showTitle=!0,this._pageSizeOpen=!1,this._pageOpen=!1}static get styles(){return[a]}firstUpdated(){this._pageSizeDropdown&&(this._pageSizeDropdown.addEventListener("nile-show",(()=>{this._pageSizeOpen=!0})),this._pageSizeDropdown.addEventListener("nile-after-hide",(()=>{this._pageSizeOpen=!1})))}get totalPages(){return Math.max(1,o(this.totalItems,this.pageSize))}goToPage(i){if(this.disabled)return;const e=this.currentPage;this.currentPage=i,this.emit("nile-change",{page:i,previousPage:e,pageSize:this.pageSize})}onPageSizeSelect(i){if(this.disabled||this.pageSize===i)return;const e=this.currentPage;this.pageSize=i,this.currentPage=1,this.emit("nile-change",{page:1,previousPage:e,pageSize:i})}renderCompactRangeText(){const i=h(this.totalItems,this.pageSize,this.currentPage).replace(/^Showing\s*/,"");return e`<div class="range-text">${i}</div>`}renderRangeText(){return 0===this.totalItems?e`<div class="range-text">Showing 0 of 0</div>`:e`
|
2
|
+
<div part="range-text" class="range-text">
|
3
|
+
${h(this.totalItems,this.pageSize,this.currentPage)}
|
4
|
+
</div>
|
5
|
+
`}renderPageSizeSelect(){return"fluid"!==this.variant?null:e`
|
4
6
|
<div class="page-size-select">
|
5
7
|
<nile-dropdown class="page-size-dropdown" ?disabled=${this.disabled}>
|
6
|
-
<nile-button
|
8
|
+
<nile-button
|
9
|
+
slot="trigger"
|
10
|
+
variant="tertiary"
|
11
|
+
class="down ${this._pageSizeOpen?"open":""}"
|
7
12
|
?disabled=${this.disabled}
|
8
13
|
>
|
9
14
|
${this.pageSize}
|
10
|
-
<nile-icon
|
15
|
+
<nile-icon
|
16
|
+
name="chevrondown"
|
17
|
+
size="14"
|
18
|
+
color="var(--nile-colors-dark-500)"
|
19
|
+
class="chevron"
|
20
|
+
></nile-icon>
|
11
21
|
</nile-button>
|
12
|
-
<nile-menu
|
13
|
-
|
22
|
+
<nile-menu>
|
23
|
+
<div class="down-scroll-wrapper">
|
24
|
+
${this.pageSizeOptions.map((i=>e`
|
25
|
+
<nile-menu-item
|
26
|
+
?disabled=${this.disabled}
|
27
|
+
@click=${()=>this.onPageSizeSelect(i)}
|
28
|
+
>
|
29
|
+
${i}
|
30
|
+
</nile-menu-item>
|
31
|
+
`))}
|
32
|
+
</div>
|
33
|
+
</nile-menu>
|
34
|
+
</nile-dropdown>
|
35
|
+
<span part="pagesize-label" class="page-size-label">Items per page</span>
|
36
|
+
</div>
|
37
|
+
`}renderCompactPageSize(){return e`
|
38
|
+
<nile-dropdown
|
39
|
+
class="compact-dropdown"
|
40
|
+
?disabled=${this.disabled}
|
41
|
+
@nile-show=${()=>this._pageSizeOpen=!0}
|
42
|
+
@nile-after-hide=${()=>this._pageSizeOpen=!1}
|
43
|
+
>
|
44
|
+
<nile-button
|
45
|
+
slot="trigger"
|
46
|
+
variant="tertiary"
|
47
|
+
class="down ${this._pageSizeOpen?"open":""}"
|
48
|
+
?disabled=${this.disabled}
|
49
|
+
>
|
50
|
+
${this.pageSize}
|
51
|
+
<nile-icon
|
52
|
+
name="chevrondown"
|
53
|
+
size="14"
|
54
|
+
color="var(--nile-colors-dark-500)"
|
55
|
+
class="chevron"
|
56
|
+
></nile-icon>
|
57
|
+
</nile-button>
|
58
|
+
<nile-menu>
|
59
|
+
<div class="compact-scroll-wrapper">
|
60
|
+
${this.pageSizeOptions.map((i=>e`
|
14
61
|
<nile-menu-item
|
15
62
|
?disabled=${this.disabled}
|
16
63
|
@click=${()=>this.onPageSizeSelect(i)}
|
17
64
|
>
|
18
65
|
${i}
|
19
|
-
</nile-menu-item
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
</
|
24
|
-
`}renderPrevButton(){return
|
66
|
+
</nile-menu-item>
|
67
|
+
`))}
|
68
|
+
</div>
|
69
|
+
</nile-menu>
|
70
|
+
</nile-dropdown>
|
71
|
+
`}renderPrevButton(){return e`
|
25
72
|
<li>
|
26
73
|
<nile-button
|
27
74
|
variant="tertiary"
|
@@ -31,7 +78,7 @@ import{__decorate as i}from"tslib";import{html as t}from"lit";import{property as
|
|
31
78
|
<nile-icon name="arrowleft" size="14"></nile-icon>
|
32
79
|
</nile-button>
|
33
80
|
</li>
|
34
|
-
`}renderNextButton(){return
|
81
|
+
`}renderNextButton(){return e`
|
35
82
|
<li>
|
36
83
|
<nile-button
|
37
84
|
variant="tertiary"
|
@@ -41,7 +88,7 @@ import{__decorate as i}from"tslib";import{html as t}from"lit";import{property as
|
|
41
88
|
<nile-icon name="arrowright" size="14"></nile-icon>
|
42
89
|
</nile-button>
|
43
90
|
</li>
|
44
|
-
`}renderPageItem(i,
|
91
|
+
`}renderPageItem(i,t,n){return"…"===i?e`
|
45
92
|
<li>
|
46
93
|
<nile-dropdown class="ellipsis-dropdown" ?disabled=${this.disabled}>
|
47
94
|
<nile-button slot="trigger" variant="ghost" ?disabled=${this.disabled}>
|
@@ -49,18 +96,19 @@ import{__decorate as i}from"tslib";import{html as t}from"lit";import{property as
|
|
49
96
|
</nile-button>
|
50
97
|
<nile-menu>
|
51
98
|
<div class="ellipsis-scroll-wrapper">
|
52
|
-
${d(this.totalPages,
|
99
|
+
${d(this.totalPages,n,this.currentPage,t<n.indexOf(this.currentPage)?"left":"right").map((i=>e`
|
53
100
|
<nile-menu-item
|
54
101
|
?disabled=${this.disabled}
|
55
102
|
@click=${()=>this.goToPage(i)}
|
56
103
|
>
|
57
104
|
${i}
|
58
|
-
</nile-menu-item
|
105
|
+
</nile-menu-item>
|
106
|
+
`))}
|
59
107
|
</div>
|
60
108
|
</nile-menu>
|
61
109
|
</nile-dropdown>
|
62
110
|
</li>
|
63
|
-
`:
|
111
|
+
`:e`
|
64
112
|
<li>
|
65
113
|
<nile-button
|
66
114
|
variant=${i===this.currentPage?"primary":"ghost"}
|
@@ -70,20 +118,61 @@ import{__decorate as i}from"tslib";import{html as t}from"lit";import{property as
|
|
70
118
|
${i}
|
71
119
|
</nile-button>
|
72
120
|
</li>
|
73
|
-
`}renderPageList(){
|
121
|
+
`}renderPageList(){if("compact"===this.variant)return e`
|
122
|
+
<nav aria-label="Pagination">
|
123
|
+
<ul class="pagination compact-pagination">
|
124
|
+
${this.renderPrevButton()}
|
125
|
+
<li>
|
126
|
+
<nile-dropdown
|
127
|
+
class="compact-dropdown1"
|
128
|
+
?disabled=${this.disabled}
|
129
|
+
@nile-show=${()=>this._pageOpen=!0}
|
130
|
+
@nile-after-hide=${()=>this._pageOpen=!1}
|
131
|
+
>
|
132
|
+
<nile-button
|
133
|
+
slot="trigger"
|
134
|
+
variant="tertiary"
|
135
|
+
class="current-page-btn ${this._pageOpen?"open":""}"
|
136
|
+
?disabled=${this.disabled}
|
137
|
+
>
|
138
|
+
${this.currentPage}
|
139
|
+
<nile-icon
|
140
|
+
name="chevrondown"
|
141
|
+
size="14"
|
142
|
+
class="chevron"
|
143
|
+
></nile-icon>
|
144
|
+
</nile-button>
|
145
|
+
<nile-menu>
|
146
|
+
<div class="compact-scroll-wrapper1">
|
147
|
+
${Array.from({length:this.totalPages},((i,e)=>e+1)).map((i=>e`
|
148
|
+
<nile-menu-item
|
149
|
+
?disabled=${this.disabled}
|
150
|
+
@click=${()=>this.goToPage(i)}
|
151
|
+
>
|
152
|
+
${i}
|
153
|
+
</nile-menu-item>
|
154
|
+
`))}
|
155
|
+
</div>
|
156
|
+
</nile-menu>
|
157
|
+
</nile-dropdown>
|
158
|
+
</li>
|
159
|
+
${this.renderNextButton()}
|
160
|
+
</ul>
|
161
|
+
</nav>
|
162
|
+
`;const i=c(this.totalPages,this.currentPage);return e`
|
74
163
|
<nav aria-label="Pagination">
|
75
|
-
<ul class="pagination">
|
164
|
+
<ul part="page-list" class="pagination">
|
76
165
|
${this.renderPrevButton()}
|
77
|
-
${i.map(((t
|
166
|
+
${i.map(((e,t)=>this.renderPageItem(e,t,i)))}
|
78
167
|
${this.renderNextButton()}
|
79
168
|
</ul>
|
80
169
|
</nav>
|
81
|
-
`}render(){return
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
</div>
|
87
|
-
${this.renderPageList()}
|
170
|
+
`}render(){return e`
|
171
|
+
<div part="wrapper" class="pagination-wrapper ${this.variant}">
|
172
|
+
<div part="pager-container" class="pager-container">
|
173
|
+
${"fluid"===this.variant&&this.showTitle?this.renderRangeText():"compact"===this.variant?this.renderCompactRangeText():null}
|
174
|
+
${"fluid"===this.variant?this.renderPageSizeSelect():this.renderCompactPageSize()}
|
88
175
|
</div>
|
89
|
-
|
176
|
+
${this.renderPageList()}
|
177
|
+
</div>
|
178
|
+
`}};i([t({attribute:"totalitems",reflect:!0,converter:{fromAttribute:i=>{const e=Number(i);return Number.isFinite(e)&&e>=0?Math.floor(e):0}}})],p.prototype,"totalItems",void 0),i([t({attribute:"currentpage",reflect:!0,converter:{fromAttribute:i=>{const e=Number(i);return Number.isFinite(e)&&e>=1?Math.floor(e):1}}})],p.prototype,"currentPage",void 0),i([t({attribute:"pagesize",reflect:!0,converter:{fromAttribute:i=>{const e=Number(i);return Number.isFinite(e)&&e>=1?Math.floor(e):50}}})],p.prototype,"pageSize",void 0),i([t({attribute:"pagesizeoptions",reflect:!1,converter:{fromAttribute:i=>{try{const e=JSON.parse(i);if(Array.isArray(e)&&e.every((i=>"number"==typeof i)))return e}catch{}return[10,25,50,100]}}})],p.prototype,"pageSizeOptions",void 0),i([t({type:String})],p.prototype,"variant",void 0),i([t({type:Boolean})],p.prototype,"disabled",void 0),i([t({type:Boolean})],p.prototype,"showTitle",void 0),i([n()],p.prototype,"_pageSizeOpen",void 0),i([n()],p.prototype,"_pageOpen",void 0),i([s(".page-size-dropdown")],p.prototype,"_pageSizeDropdown",void 0),p=i([r("nile-pagination")],p);export{p 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-161dee0b.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-popover.cjs.js","tslib","lit/decorators.js","./nile-popover.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js"],function(_export,_context){"use strict";var o,t,e,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5;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(_fixture002CjsJs){o=_fixture002CjsJs.f;t=_fixture002CjsJs.a;},function(_litStaticHtmlJs){e=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nilePopoverCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_nilePopoverCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalWatchCjsJs){}],execute:function execute(){describe("NilePopover",function(){it("renders correctly",/*#__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 o(e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popover title=\"Test Popover\">\n <button slot=\"anchor\">Click me</button>\n <div>Popover Content</div>\n </nile-popover>\n "]))));case 2:i=_context2.sent;t(i).shadowDom.to.equalSnapshot();case 4:case"end":return _context2.stop();}},_callee);}))),it("has default properties",/*#__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 o(e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-popover></nile-popover>"]))));case 2:i=_context3.sent;t(i.placement).to.equal("top"),t(i.distance).to.equal(18),t(i.title).to.equal(""),t(i.arrowPlacement).to.equal("anchor"),t(i.hoist).to.be["false"],t(i.flip).to.be["false"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("displays title when popover is shown",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var i,p,n;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return o(e(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-popover title=\"Test Popover\">\n <button slot=\"anchor\">Click me</button>\n <div>Popover Content</div>\n </nile-popover>\n "]))));case 2:i=_context4.sent;i.querySelector("button").click();_context4.next=6;return i.updateComplete;case 6:p=i.shadowRoot.querySelector(".popover__box");t(p).to.exist;n=i.shadowRoot.querySelector('slot[name="title"]');t(n).to.exist,t(n.textContent).to.equal("Test Popover");case 10:case"end":return _context4.stop();}},_callee3);}))),it("toggles isShow state on anchor click",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var i,p,n,r;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return o(e(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-popover title=\"Test Popover\">\n <button slot=\"anchor\">Click me</button>\n <div>Popover Content</div>\n </nile-popover>\n "]))));case 2:i=_context5.sent;p=i.querySelector("button");p.click();_context5.next=7;return i.updateComplete;case 7:n=i.shadowRoot.querySelector('div[part="popover"]');t(n).to.exist;p.click();_context5.next=12;return i.updateComplete;case 12:r=i.shadowRoot.querySelector('div[part="popover"]');t(r).to["null"];case 14:case"end":return _context5.stop();}},_callee4);}))),it("hides popover on document click",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var i,p;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return o(e(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-popover title=\"Test Popover\">\n <button slot=\"anchor\">Click me</button>\n <div>Popover Content</div>\n </nile-popover>\n "]))));case 2:i=_context6.sent;i.querySelector("button").click();_context6.next=6;return i.updateComplete;case 6:p=i.shadowRoot.querySelector(".popover__box");t(p).to.exist;document.body.click();_context6.next=11;return i.updateComplete;case 11:p=i.shadowRoot.querySelector(".popover__box");t(p).to.not.exist;case 13:case"end":return _context6.stop();}},_callee5);})));});}};});
|
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-fe6c932e.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-popover.cjs.js","tslib","lit/decorators.js","./nile-popover.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js"],function(_export,_context){"use strict";var o,t,e,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5;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){o=_fixture001CjsJs.f;t=_fixture001CjsJs.a;},function(_litStaticHtmlJs){e=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nilePopoverCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_nilePopoverCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalWatchCjsJs){}],execute:function execute(){describe("NilePopover",function(){it("renders correctly",/*#__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 o(e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popover title=\"Test Popover\">\n <button slot=\"anchor\">Click me</button>\n <div>Popover Content</div>\n </nile-popover>\n "]))));case 2:i=_context2.sent;t(i).shadowDom.to.equalSnapshot();case 4:case"end":return _context2.stop();}},_callee);}))),it("has default properties",/*#__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 o(e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-popover></nile-popover>"]))));case 2:i=_context3.sent;t(i.placement).to.equal("top"),t(i.distance).to.equal(18),t(i.title).to.equal(""),t(i.arrowPlacement).to.equal("anchor"),t(i.hoist).to.be["false"],t(i.flip).to.be["false"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("displays title when popover is shown",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var i,p,n;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return o(e(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-popover title=\"Test Popover\">\n <button slot=\"anchor\">Click me</button>\n <div>Popover Content</div>\n </nile-popover>\n "]))));case 2:i=_context4.sent;i.querySelector("button").click();_context4.next=6;return i.updateComplete;case 6:p=i.shadowRoot.querySelector(".popover__box");t(p).to.exist;n=i.shadowRoot.querySelector('slot[name="title"]');t(n).to.exist,t(n.textContent).to.equal("Test Popover");case 10:case"end":return _context4.stop();}},_callee3);}))),it("toggles isShow state on anchor click",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var i,p,n,r;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return o(e(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-popover title=\"Test Popover\">\n <button slot=\"anchor\">Click me</button>\n <div>Popover Content</div>\n </nile-popover>\n "]))));case 2:i=_context5.sent;p=i.querySelector("button");p.click();_context5.next=7;return i.updateComplete;case 7:n=i.shadowRoot.querySelector('div[part="popover"]');t(n).to.exist;p.click();_context5.next=12;return i.updateComplete;case 12:r=i.shadowRoot.querySelector('div[part="popover"]');t(r).to["null"];case 14:case"end":return _context5.stop();}},_callee4);}))),it("hides popover on document click",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var i,p;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return o(e(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-popover title=\"Test Popover\">\n <button slot=\"anchor\">Click me</button>\n <div>Popover Content</div>\n </nile-popover>\n "]))));case 2:i=_context6.sent;i.querySelector("button").click();_context6.next=6;return i.updateComplete;case 6:p=i.shadowRoot.querySelector(".popover__box");t(p).to.exist;document.body.click();_context6.next=11;return i.updateComplete;case 11:p=i.shadowRoot.querySelector(".popover__box");t(p).to.not.exist;case 13:case"end":return _context6.stop();}},_callee5);})));});}};});
|
2
2
|
//# sourceMappingURL=nile-popover.test.cjs.js.map
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import{f as o,a as t}from"../fixture-
|
1
|
+
import{f as o,a as t}from"../fixture-e7023246.esm.js";import{html as e}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-popover.esm.js";import"tslib";import"lit/decorators.js";import"./nile-popover.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/watch.esm.js";describe("NilePopover",(()=>{it("renders correctly",(async()=>{const i=await o(e`
|
2
2
|
<nile-popover title="Test Popover">
|
3
3
|
<button slot="anchor">Click me</button>
|
4
4
|
<div>Popover Content</div>
|
@@ -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-161dee0b.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-popup.cjs.js","tslib","lit/directives/class-map.js","lit/decorators.js","../internal/nile-element.cjs.js","./nile-popup.css.cjs.js"],function(_export,_context){"use strict";var p,t,o,i,e,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8;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(_fixture002CjsJs){p=_fixture002CjsJs.f;t=_fixture002CjsJs.a;o=_fixture002CjsJs.e;},function(_litStaticHtmlJs){i=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nilePopupCjsJs){e=_nilePopupCjsJs.N;},function(_tslib){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){},function(_nilePopupCssCjsJs){}],execute:function execute(){describe("NilePopup",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var o;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return p(i(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-popup></nile-popup>"]))));case 2:o=_context2.sent;t(o).to.be.instanceOf(e),t(o.shadowRoot).not.to.be["null"];case 4:case"end":return _context2.stop();}},_callee);}))),it("should be inactive by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _o$shadowRoot;var o,e;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return p(i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-popup></nile-popup>"]))));case 2:o=_context3.sent;t(o.active).to.be["false"];e=(_o$shadowRoot=o.shadowRoot)===null||_o$shadowRoot===void 0?void 0:_o$shadowRoot.querySelector(".popup");t(e===null||e===void 0?void 0:e.classList.contains("popup--active")).to.be["false"];case 6:case"end":return _context3.stop();}},_callee2);}))),it("should show popup when active is set to true",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _e$shadowRoot;var e,s;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return p(i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-popup></nile-popup>"]))));case 2:e=_context4.sent;e.active=!0;_context4.next=6;return o(e);case 6:s=(_e$shadowRoot=e.shadowRoot)===null||_e$shadowRoot===void 0?void 0:_e$shadowRoot.querySelector(".popup");t(e.active).to.be["true"],t(s===null||s===void 0?void 0:s.classList.contains("popup--active")).to.be["true"];case 8:case"end":return _context4.stop();}},_callee3);}))),it("should hide popup when active is set to false",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _e$shadowRoot2;var e,s;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return p(i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-popup active></nile-popup>"]))));case 2:e=_context5.sent;e.active=!1;_context5.next=6;return o(e);case 6:s=(_e$shadowRoot2=e.shadowRoot)===null||_e$shadowRoot2===void 0?void 0:_e$shadowRoot2.querySelector(".popup");t(e.active).to.be["false"],t(s===null||s===void 0?void 0:s.classList.contains("popup--active")).to.be["false"];case 8:case"end":return _context5.stop();}},_callee4);}))),it('should set correct placement class based on "placement" property',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var e;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return p(i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-popup placement=\"bottom\"></nile-popup>"]))));case 2:e=_context6.sent;e.active=!0;_context6.next=6;return o(e);case 6:t(e.placement).to.equal("bottom");t(e.getAttribute("placement")).to.equal("bottom");case 8:case"end":return _context6.stop();}},_callee5);}))),it("should position correctly when anchor is provided",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _s$shadowRoot;var e,s,a,n;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:e=document.createElement("div");e.id="anchorEl",document.body.appendChild(e);_context7.next=4;return p(i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-popup anchor=\"anchorEl\" active></nile-popup>"]))));case 4:s=_context7.sent;_context7.next=7;return o(s);case 7:a=(_s$shadowRoot=s.shadowRoot)===null||_s$shadowRoot===void 0?void 0:_s$shadowRoot.querySelector(".popup");t(a===null||a===void 0?void 0:a.classList.contains("popup--active")).to.be["true"];n=document.getElementById("anchorEl");t(n).to.exist,document.body.removeChild(e);case 11:case"end":return _context7.stop();}},_callee6);}))),it('should display an arrow when the "arrow" property is true',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _e$shadowRoot3;var e,s;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return p(i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-popup arrow></nile-popup>"]))));case 2:e=_context8.sent;e.active=!0;_context8.next=6;return o(e);case 6:s=(_e$shadowRoot3=e.shadowRoot)===null||_e$shadowRoot3===void 0?void 0:_e$shadowRoot3.querySelector(".popup__arrow");t(s).to.exist;case 8:case"end":return _context8.stop();}},_callee7);}))),it('should apply correct strategy when "strategy" is set',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var _e$shadowRoot4;var e,s;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return p(i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-popup strategy=\"fixed\"></nile-popup>"]))));case 2:e=_context9.sent;e.active=!0;_context9.next=6;return o(e);case 6:s=(_e$shadowRoot4=e.shadowRoot)===null||_e$shadowRoot4===void 0?void 0:_e$shadowRoot4.querySelector(".popup");t(s===null||s===void 0?void 0:s.classList.contains("popup--fixed")).to.be["true"];case 8:case"end":return _context9.stop();}},_callee8);})));});}};});
|
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-fe6c932e.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-popup.cjs.js","tslib","lit/directives/class-map.js","lit/decorators.js","../internal/nile-element.cjs.js","./nile-popup.css.cjs.js"],function(_export,_context){"use strict";var p,t,o,i,e,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8;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){p=_fixture001CjsJs.f;t=_fixture001CjsJs.a;o=_fixture001CjsJs.e;},function(_litStaticHtmlJs){i=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nilePopupCjsJs){e=_nilePopupCjsJs.N;},function(_tslib){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){},function(_nilePopupCssCjsJs){}],execute:function execute(){describe("NilePopup",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var o;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return p(i(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-popup></nile-popup>"]))));case 2:o=_context2.sent;t(o).to.be.instanceOf(e),t(o.shadowRoot).not.to.be["null"];case 4:case"end":return _context2.stop();}},_callee);}))),it("should be inactive by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _o$shadowRoot;var o,e;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return p(i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-popup></nile-popup>"]))));case 2:o=_context3.sent;t(o.active).to.be["false"];e=(_o$shadowRoot=o.shadowRoot)===null||_o$shadowRoot===void 0?void 0:_o$shadowRoot.querySelector(".popup");t(e===null||e===void 0?void 0:e.classList.contains("popup--active")).to.be["false"];case 6:case"end":return _context3.stop();}},_callee2);}))),it("should show popup when active is set to true",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _e$shadowRoot;var e,s;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return p(i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-popup></nile-popup>"]))));case 2:e=_context4.sent;e.active=!0;_context4.next=6;return o(e);case 6:s=(_e$shadowRoot=e.shadowRoot)===null||_e$shadowRoot===void 0?void 0:_e$shadowRoot.querySelector(".popup");t(e.active).to.be["true"],t(s===null||s===void 0?void 0:s.classList.contains("popup--active")).to.be["true"];case 8:case"end":return _context4.stop();}},_callee3);}))),it("should hide popup when active is set to false",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _e$shadowRoot2;var e,s;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return p(i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-popup active></nile-popup>"]))));case 2:e=_context5.sent;e.active=!1;_context5.next=6;return o(e);case 6:s=(_e$shadowRoot2=e.shadowRoot)===null||_e$shadowRoot2===void 0?void 0:_e$shadowRoot2.querySelector(".popup");t(e.active).to.be["false"],t(s===null||s===void 0?void 0:s.classList.contains("popup--active")).to.be["false"];case 8:case"end":return _context5.stop();}},_callee4);}))),it('should set correct placement class based on "placement" property',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var e;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return p(i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-popup placement=\"bottom\"></nile-popup>"]))));case 2:e=_context6.sent;e.active=!0;_context6.next=6;return o(e);case 6:t(e.placement).to.equal("bottom");t(e.getAttribute("placement")).to.equal("bottom");case 8:case"end":return _context6.stop();}},_callee5);}))),it("should position correctly when anchor is provided",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _s$shadowRoot;var e,s,a,n;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:e=document.createElement("div");e.id="anchorEl",document.body.appendChild(e);_context7.next=4;return p(i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-popup anchor=\"anchorEl\" active></nile-popup>"]))));case 4:s=_context7.sent;_context7.next=7;return o(s);case 7:a=(_s$shadowRoot=s.shadowRoot)===null||_s$shadowRoot===void 0?void 0:_s$shadowRoot.querySelector(".popup");t(a===null||a===void 0?void 0:a.classList.contains("popup--active")).to.be["true"];n=document.getElementById("anchorEl");t(n).to.exist,document.body.removeChild(e);case 11:case"end":return _context7.stop();}},_callee6);}))),it('should display an arrow when the "arrow" property is true',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _e$shadowRoot3;var e,s;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return p(i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-popup arrow></nile-popup>"]))));case 2:e=_context8.sent;e.active=!0;_context8.next=6;return o(e);case 6:s=(_e$shadowRoot3=e.shadowRoot)===null||_e$shadowRoot3===void 0?void 0:_e$shadowRoot3.querySelector(".popup__arrow");t(s).to.exist;case 8:case"end":return _context8.stop();}},_callee7);}))),it('should apply correct strategy when "strategy" is set',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var _e$shadowRoot4;var e,s;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return p(i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-popup strategy=\"fixed\"></nile-popup>"]))));case 2:e=_context9.sent;e.active=!0;_context9.next=6;return o(e);case 6:s=(_e$shadowRoot4=e.shadowRoot)===null||_e$shadowRoot4===void 0?void 0:_e$shadowRoot4.querySelector(".popup");t(s===null||s===void 0?void 0:s.classList.contains("popup--fixed")).to.be["true"];case 8:case"end":return _context9.stop();}},_callee8);})));});}};});
|
2
2
|
//# sourceMappingURL=nile-popup.test.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
import{f as p,a as t,e as o}from"../fixture-
|
1
|
+
import{f as p,a as t,e as o}from"../fixture-e7023246.esm.js";import{html as i}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import{N as e}from"./nile-popup.esm.js";import"tslib";import"lit/directives/class-map.js";import"lit/decorators.js";import"../internal/nile-element.esm.js";import"./nile-popup.css.esm.js";describe("NilePopup",(()=>{it("should render correctly",(async()=>{const o=await p(i`<nile-popup></nile-popup>`);t(o).to.be.instanceOf(e),t(o.shadowRoot).not.to.be.null})),it("should be inactive by default",(async()=>{const o=await p(i`<nile-popup></nile-popup>`);t(o.active).to.be.false;const e=o.shadowRoot?.querySelector(".popup");t(e?.classList.contains("popup--active")).to.be.false})),it("should show popup when active is set to true",(async()=>{const e=await p(i`<nile-popup></nile-popup>`);e.active=!0,await o(e);const s=e.shadowRoot?.querySelector(".popup");t(e.active).to.be.true,t(s?.classList.contains("popup--active")).to.be.true})),it("should hide popup when active is set to false",(async()=>{const e=await p(i`<nile-popup active></nile-popup>`);e.active=!1,await o(e);const s=e.shadowRoot?.querySelector(".popup");t(e.active).to.be.false,t(s?.classList.contains("popup--active")).to.be.false})),it('should set correct placement class based on "placement" property',(async()=>{const e=await p(i`<nile-popup placement="bottom"></nile-popup>`);e.active=!0,await o(e),t(e.placement).to.equal("bottom"),t(e.getAttribute("placement")).to.equal("bottom")})),it("should position correctly when anchor is provided",(async()=>{const e=document.createElement("div");e.id="anchorEl",document.body.appendChild(e);const s=await p(i`<nile-popup anchor="anchorEl" active></nile-popup>`);await o(s);const a=s.shadowRoot?.querySelector(".popup");t(a?.classList.contains("popup--active")).to.be.true;const n=document.getElementById("anchorEl");t(n).to.exist,document.body.removeChild(e)})),it('should display an arrow when the "arrow" property is true',(async()=>{const e=await p(i`<nile-popup arrow></nile-popup>`);e.active=!0,await o(e);const s=e.shadowRoot?.querySelector(".popup__arrow");t(s).to.exist})),it('should apply correct strategy when "strategy" is set',(async()=>{const e=await p(i`<nile-popup strategy="fixed"></nile-popup>`);e.active=!0,await o(e);const s=e.shadowRoot?.querySelector(".popup");t(s?.classList.contains("popup--fixed")).to.be.true}))}));
|