@sme.up/ketchup 9.6.3 → 9.6.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/dist/cjs/{f-button-9a0eba42.js → f-button-89de2403.js} +1 -1
- package/dist/cjs/{f-cell-1ad41071.js → f-cell-75dbd6eb.js} +9 -29
- package/dist/cjs/{f-chip-48851b4f.js → f-chip-08857345.js} +2 -2
- package/dist/cjs/{f-image-541e5f4d.js → f-image-a41d7f1e.js} +1 -1
- package/dist/cjs/{f-paginator-utils-8ff2a9b4.js → f-paginator-utils-ff07301e.js} +3 -3
- package/dist/cjs/{f-text-field-ac5d6497.js → f-text-field-eb207a83.js} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +47 -47
- package/dist/cjs/kup-box.cjs.entry.js +8 -8
- package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
- package/dist/cjs/kup-card-list.cjs.entry.js +2 -2
- package/dist/cjs/kup-cell.cjs.entry.js +7 -7
- package/dist/cjs/kup-custom-task-list-header_4.cjs.entry.js +8 -8
- package/dist/cjs/kup-dashboard.cjs.entry.js +5 -5
- package/dist/cjs/{kup-dates-b7d53b4d.js → kup-dates-e22ee32c.js} +21 -0
- package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
- package/dist/cjs/kup-echart.cjs.entry.js +2 -2
- package/dist/cjs/kup-editor.cjs.entry.js +2 -2
- package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
- package/dist/cjs/kup-gantt_10.cjs.entry.js +21 -21
- package/dist/cjs/kup-grid.cjs.entry.js +2 -2
- package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
- package/dist/cjs/kup-image-list.cjs.entry.js +7 -7
- package/dist/cjs/kup-input-panel.cjs.entry.js +298 -0
- package/dist/cjs/kup-lazy.cjs.entry.js +13 -13
- package/dist/cjs/kup-magic-box.cjs.entry.js +6 -6
- package/dist/cjs/{kup-manager-26a9154b.js → kup-manager-abfe4ddd.js} +9 -1
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +4 -4
- package/dist/cjs/kup-pdf.cjs.entry.js +76600 -0
- package/dist/cjs/kup-photo-frame.cjs.entry.js +4 -4
- package/dist/cjs/{kup-planner-renderer-helper-680bbd5a.js → kup-planner-renderer-helper-9f776d6e.js} +1 -1
- package/dist/cjs/kup-planner-renderer.cjs.entry.js +3 -3
- package/dist/cjs/kup-planner.cjs.entry.js +4 -4
- package/dist/cjs/kup-probe.cjs.entry.js +3 -3
- package/dist/cjs/kup-qlik.cjs.entry.js +3 -3
- package/dist/cjs/kup-snackbar.cjs.entry.js +5 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/index.js +8 -0
- package/dist/collection/assets/input-panel.js +249 -0
- package/dist/collection/assets/pdf.js +15 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel-declarations.js +8 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.css +132 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.e2e.js +305 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.js +522 -0
- package/dist/collection/components/kup-lazy/kup-lazy.js +11 -11
- package/dist/collection/components/kup-list/kup-list.js +1 -1
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +3 -3
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +1 -1
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +1 -1
- package/dist/collection/components/kup-pdf/kup-pdf-declarations.js +8 -0
- package/dist/collection/components/kup-pdf/kup-pdf.css +169 -0
- package/dist/collection/components/kup-pdf/kup-pdf.js +262 -0
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +2 -2
- package/dist/collection/components/kup-planner/kup-planner.js +1 -1
- package/dist/collection/components/kup-planner/utils/custom-task-list-header.js +2 -2
- package/dist/collection/components/kup-planner/utils/custom-task-list-table.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-gantt/kup-gantt.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-gantt-calendar/kup-gantt-calendar.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.js +2 -2
- package/dist/collection/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.js +2 -2
- package/dist/collection/components/kup-planner/utils/kup-planner-renderer.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-switcher/kup-switcher.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-task-gantt/kup-task-gantt.js +2 -2
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list-header.js +7 -7
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list-table.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-tooltip/kup-standard-tooltip.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-tooltip/kup-tooltip.js +1 -1
- package/dist/collection/components/kup-planner/utils/kup-vertical-scroll/kup-vertical-scroll.js +2 -2
- package/dist/collection/components/kup-probe/kup-probe.js +1 -1
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +1 -1
- package/dist/collection/components/kup-qlik/kup-qlik.js +1 -1
- package/dist/collection/components/kup-rating/kup-rating.js +1 -1
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +1 -1
- package/dist/collection/components/kup-spinner/kup-spinner.js +34 -34
- package/dist/collection/components/kup-switch/kup-switch.js +1 -1
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +1 -1
- package/dist/collection/f-components/f-cell/f-cell.js +5 -24
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +7 -0
- package/dist/collection/types/GenericTypes.js +1 -0
- package/dist/components/custom-task-list-header.js +2 -2
- package/dist/components/custom-task-list-table.js +1 -1
- package/dist/components/kup-autocomplete2.js +44 -64
- package/dist/components/kup-box2.js +1 -1
- package/dist/components/kup-calendar.js +1 -1
- package/dist/components/kup-cell.js +1 -1
- package/dist/components/kup-dashboard.js +1 -1
- package/dist/components/kup-dates.js +20 -1
- package/dist/components/kup-echart2.js +1 -1
- package/dist/components/kup-gantt-calendar2.js +1 -1
- package/dist/components/kup-gantt2.js +1 -1
- package/dist/components/kup-grid-renderer2.js +2 -2
- package/dist/components/kup-grid2.js +1 -1
- package/dist/components/kup-horizontal-scroll2.js +2 -2
- package/dist/components/kup-iframe.js +1 -1
- package/dist/components/kup-image-list.js +1 -1
- package/dist/components/kup-input-panel.d.ts +11 -0
- package/dist/components/kup-input-panel.js +449 -0
- package/dist/components/kup-lazy.js +11 -11
- package/dist/components/kup-magic-box.js +4 -4
- package/dist/components/kup-manager.js +9 -1
- package/dist/components/kup-nav-bar.js +1 -1
- package/dist/components/kup-numeric-picker.js +2 -2
- package/dist/components/kup-pdf.d.ts +11 -0
- package/dist/components/kup-pdf.js +76756 -0
- package/dist/components/kup-photo-frame.js +2 -2
- package/dist/components/kup-planner-renderer2.js +1 -1
- package/dist/components/kup-planner.js +1 -1
- package/dist/components/kup-probe.js +1 -1
- package/dist/components/kup-qlik.js +1 -1
- package/dist/components/kup-snackbar.js +1 -1
- package/dist/components/kup-standard-tooltip2.js +1 -1
- package/dist/components/kup-switcher2.js +1 -1
- package/dist/components/kup-task-gantt2.js +2 -2
- package/dist/components/kup-task-list-header2.js +7 -7
- package/dist/components/kup-task-list-table2.js +1 -1
- package/dist/components/kup-task-list2.js +1 -1
- package/dist/components/kup-tooltip2.js +1 -1
- package/dist/components/kup-vertical-scroll2.js +2 -2
- package/dist/esm/{f-button-45d690a5.js → f-button-1eebd42e.js} +1 -1
- package/dist/esm/{f-cell-63db06db.js → f-cell-af19d5c7.js} +9 -29
- package/dist/esm/{f-chip-f1ab6c5e.js → f-chip-9e5fdb25.js} +2 -2
- package/dist/esm/{f-image-8b382cc5.js → f-image-1e1ed567.js} +1 -1
- package/dist/esm/{f-paginator-utils-ae563cd5.js → f-paginator-utils-dede029b.js} +3 -3
- package/dist/esm/{f-text-field-b5fcb598.js → f-text-field-802b45fb.js} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-accordion.entry.js +3 -3
- package/dist/esm/kup-autocomplete_27.entry.js +47 -47
- package/dist/esm/kup-box.entry.js +8 -8
- package/dist/esm/kup-calendar.entry.js +5 -5
- package/dist/esm/kup-card-list.entry.js +2 -2
- package/dist/esm/kup-cell.entry.js +7 -7
- package/dist/esm/kup-custom-task-list-header_4.entry.js +8 -8
- package/dist/esm/kup-dashboard.entry.js +5 -5
- package/dist/esm/{kup-dates-4ad48be7.js → kup-dates-26a56bf7.js} +20 -1
- package/dist/esm/kup-drawer.entry.js +2 -2
- package/dist/esm/kup-echart.entry.js +2 -2
- package/dist/esm/kup-editor.entry.js +2 -2
- package/dist/esm/kup-family-tree.entry.js +4 -4
- package/dist/esm/kup-gantt_10.entry.js +21 -21
- package/dist/esm/kup-grid.entry.js +2 -2
- package/dist/esm/kup-iframe.entry.js +2 -2
- package/dist/esm/kup-image-list.entry.js +7 -7
- package/dist/esm/kup-input-panel.entry.js +294 -0
- package/dist/esm/kup-lazy.entry.js +13 -13
- package/dist/esm/kup-magic-box.entry.js +6 -6
- package/dist/esm/{kup-manager-cdb4f21a.js → kup-manager-dd24fb5a.js} +9 -1
- package/dist/esm/kup-nav-bar.entry.js +3 -3
- package/dist/esm/kup-numeric-picker.entry.js +4 -4
- package/dist/esm/kup-pdf.entry.js +76596 -0
- package/dist/esm/kup-photo-frame.entry.js +4 -4
- package/dist/esm/{kup-planner-renderer-helper-da0518be.js → kup-planner-renderer-helper-b4727e44.js} +1 -1
- package/dist/esm/kup-planner-renderer.entry.js +3 -3
- package/dist/esm/kup-planner.entry.js +4 -4
- package/dist/esm/kup-probe.entry.js +3 -3
- package/dist/esm/kup-qlik.entry.js +3 -3
- package/dist/esm/kup-snackbar.entry.js +5 -5
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-14943de9.entry.js +1 -0
- package/dist/ketchup/{p-c6b34763.entry.js → p-158076de.entry.js} +1 -1
- package/dist/ketchup/{p-670354ef.entry.js → p-180cd7ab.entry.js} +1 -1
- package/dist/ketchup/{p-b6a21b6a.entry.js → p-19a13672.entry.js} +1 -1
- package/dist/ketchup/{p-d9284d98.entry.js → p-201f8d7b.entry.js} +1 -1
- package/dist/ketchup/{p-41e8402e.entry.js → p-26d42b88.entry.js} +1 -1
- package/dist/ketchup/{p-590c34bc.js → p-2d4a9235.js} +1 -1
- package/dist/ketchup/{p-090e5097.entry.js → p-2e04042b.entry.js} +1 -1
- package/dist/ketchup/{p-e508b2fd.entry.js → p-34d70475.entry.js} +1 -1
- package/dist/ketchup/{p-e0a1fbe7.entry.js → p-3b544027.entry.js} +1 -1
- package/dist/ketchup/{p-4c100286.entry.js → p-43ce397b.entry.js} +1 -1
- package/dist/ketchup/{p-31c0cfc0.entry.js → p-489af77f.entry.js} +1 -1
- package/dist/ketchup/{p-ca8a1f53.entry.js → p-4f69f6f9.entry.js} +1 -1
- package/dist/ketchup/{p-ba0f28b7.js → p-61e8d573.js} +1 -1
- package/dist/ketchup/{p-ca42a421.entry.js → p-636be6f1.entry.js} +2 -2
- package/dist/ketchup/{p-ec4050e1.entry.js → p-63c141d9.entry.js} +1 -1
- package/dist/ketchup/{p-4dfc5927.entry.js → p-6972fa0c.entry.js} +1 -1
- package/dist/ketchup/{p-a5074ce4.js → p-6c888179.js} +1 -1
- package/dist/ketchup/{p-1474852d.entry.js → p-79f4dc5b.entry.js} +1 -1
- package/dist/ketchup/{p-2b40d9b9.entry.js → p-818e61d5.entry.js} +1 -1
- package/dist/ketchup/{p-9a856951.js → p-8229b97a.js} +1 -1
- package/dist/ketchup/p-8f3d400a.entry.js +44 -0
- package/dist/ketchup/{p-bedabdb5.js → p-8fcdf454.js} +1 -1
- package/dist/ketchup/{p-ad6a3c2a.entry.js → p-a2e14d8b.entry.js} +1 -1
- package/dist/ketchup/{p-d839ce21.entry.js → p-a2e691b8.entry.js} +2 -2
- package/dist/ketchup/p-a46f99d4.js +1 -0
- package/dist/ketchup/{p-1cd48eea.entry.js → p-b238cde7.entry.js} +1 -1
- package/dist/ketchup/{p-837bd0a6.entry.js → p-b3b50bb5.entry.js} +1 -1
- package/dist/ketchup/{p-d50515f7.js → p-c0f660d6.js} +1 -1
- package/dist/ketchup/{p-157f0e89.entry.js → p-cd7fec02.entry.js} +1 -1
- package/dist/ketchup/{p-cbe42afd.entry.js → p-dcf7e9b6.entry.js} +1 -1
- package/dist/ketchup/{p-e0c10de2.entry.js → p-e0e47ca9.entry.js} +1 -1
- package/dist/ketchup/{p-9852b1e9.js → p-e4c63684.js} +1 -1
- package/dist/ketchup/{p-cc7352a8.entry.js → p-e7507dd6.entry.js} +1 -1
- package/dist/ketchup/p-eb8ea3a6.js +1 -0
- package/dist/ketchup/{p-d608f866.entry.js → p-f998ff28.entry.js} +1 -1
- package/dist/ketchup/{p-21351b19.entry.js → p-f9a7c21c.entry.js} +1 -1
- package/dist/types/components/kup-input-panel/kup-input-panel-declarations.d.ts +79 -0
- package/dist/types/components/kup-input-panel/kup-input-panel.d.ts +67 -0
- package/dist/types/components/kup-pdf/kup-pdf-declarations.d.ts +7 -0
- package/dist/types/components/kup-pdf/kup-pdf.d.ts +42 -0
- package/dist/types/components.d.ts +158 -0
- package/dist/types/types/GenericTypes.d.ts +1 -0
- package/package.json +2 -1
- package/dist/ketchup/p-5c79cb74.js +0 -1
- package/dist/ketchup/p-935f58fc.js +0 -1
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
+
describe('kup-input-panel', () => {
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<kup-input-panel></kup-input-panel>');
|
|
6
|
+
const element = await page.find('kup-input-panel');
|
|
7
|
+
expect(element).toHaveClass('hydrated');
|
|
8
|
+
});
|
|
9
|
+
it('renders 2 text field with labels', async () => {
|
|
10
|
+
const page = await newE2EPage();
|
|
11
|
+
await page.setContent('<kup-input-panel></kup-input-panel>');
|
|
12
|
+
const inputPanel = await page.find('kup-input-panel');
|
|
13
|
+
const data = {
|
|
14
|
+
columns: [
|
|
15
|
+
{
|
|
16
|
+
name: 'NAM',
|
|
17
|
+
title: 'Name',
|
|
18
|
+
visible: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'SUR',
|
|
22
|
+
title: 'Surname',
|
|
23
|
+
visible: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
rows: [
|
|
27
|
+
{
|
|
28
|
+
cells: {
|
|
29
|
+
NAM: {
|
|
30
|
+
value: '',
|
|
31
|
+
editable: true,
|
|
32
|
+
shape: 'ITX',
|
|
33
|
+
},
|
|
34
|
+
SUR: {
|
|
35
|
+
value: '',
|
|
36
|
+
editable: true,
|
|
37
|
+
shape: 'ITX',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
inputPanel.setProperty('data', data);
|
|
44
|
+
await page.waitForChanges();
|
|
45
|
+
const inputPanelContent = await page.find('kup-input-panel >>> form.input-panel');
|
|
46
|
+
expect(inputPanelContent).not.toBeNull();
|
|
47
|
+
const textFields = await inputPanelContent.findAll('.f-cell.string-cell .f-text-field');
|
|
48
|
+
expect(textFields).toHaveLength(data.columns.length);
|
|
49
|
+
for (const [i, textField] of textFields.entries()) {
|
|
50
|
+
const label = await textField.find('label');
|
|
51
|
+
expect(label).not.toBeNull();
|
|
52
|
+
expect(label).toHaveClass('mdc-floating-label');
|
|
53
|
+
expect(label).toEqualText(data.columns[i].title);
|
|
54
|
+
const input = await textField.find('input');
|
|
55
|
+
expect(input).not.toBeNull();
|
|
56
|
+
const value = await input.getProperty('value');
|
|
57
|
+
expect(value).toBe('');
|
|
58
|
+
await input.press('KeyS');
|
|
59
|
+
await input.press('KeyT');
|
|
60
|
+
await input.press('KeyR');
|
|
61
|
+
await input.press('KeyI');
|
|
62
|
+
await input.press('KeyN');
|
|
63
|
+
await input.press('KeyG');
|
|
64
|
+
const updatedValue = await input.getProperty('value');
|
|
65
|
+
expect(updatedValue).toBe('string');
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
it('renders autocomplete', async () => {
|
|
69
|
+
const page = await newE2EPage();
|
|
70
|
+
await page.setContent('<kup-input-panel></kup-input-panel> <div kup-dynamic-position></div>');
|
|
71
|
+
const inputPanel = await page.find('kup-input-panel');
|
|
72
|
+
const data = {
|
|
73
|
+
columns: [
|
|
74
|
+
{
|
|
75
|
+
name: 'CIT',
|
|
76
|
+
title: 'City',
|
|
77
|
+
visible: true,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
rows: [
|
|
81
|
+
{
|
|
82
|
+
cells: {
|
|
83
|
+
CIT: {
|
|
84
|
+
value: '',
|
|
85
|
+
obj: {
|
|
86
|
+
t: '',
|
|
87
|
+
p: '',
|
|
88
|
+
k: '',
|
|
89
|
+
},
|
|
90
|
+
editable: true,
|
|
91
|
+
mandatory: true,
|
|
92
|
+
options: [
|
|
93
|
+
'Florence',
|
|
94
|
+
'Venice',
|
|
95
|
+
'Rome',
|
|
96
|
+
'Madrid',
|
|
97
|
+
'Barcelona',
|
|
98
|
+
'Seville',
|
|
99
|
+
'Berlin',
|
|
100
|
+
'Munich',
|
|
101
|
+
'Hamburg',
|
|
102
|
+
'Paris',
|
|
103
|
+
'Marseille',
|
|
104
|
+
'Lyon',
|
|
105
|
+
'Lisbon',
|
|
106
|
+
'Porto',
|
|
107
|
+
'Faro',
|
|
108
|
+
'London',
|
|
109
|
+
'Manchester',
|
|
110
|
+
'Liverpool',
|
|
111
|
+
],
|
|
112
|
+
shape: 'ACP',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
inputPanel.setProperty('data', data);
|
|
119
|
+
await page.waitForChanges();
|
|
120
|
+
const inputPanelContent = await page.find('kup-input-panel >>> form.input-panel');
|
|
121
|
+
expect(inputPanelContent).not.toBeNull();
|
|
122
|
+
const autocompleteCell = await inputPanelContent.find('.f-cell.autocomplete-cell');
|
|
123
|
+
expect(autocompleteCell).not.toBeNull();
|
|
124
|
+
const autocompleteTextfield = await autocompleteCell.find('kup-autocomplete >>> div.f-text-field');
|
|
125
|
+
expect(autocompleteTextfield).not.toBeNull();
|
|
126
|
+
const label = await autocompleteTextfield.find('label');
|
|
127
|
+
expect(label).not.toBeNull();
|
|
128
|
+
expect(label).toEqualText(data.columns[0].title);
|
|
129
|
+
const input = await autocompleteTextfield.find('input');
|
|
130
|
+
expect(input).not.toBeNull();
|
|
131
|
+
await input.focus();
|
|
132
|
+
await input.press('KeyR');
|
|
133
|
+
await input.press('KeyO');
|
|
134
|
+
const updatedValue1 = await input.getProperty('value');
|
|
135
|
+
expect(updatedValue1).toBe('ro');
|
|
136
|
+
await page.waitForChanges();
|
|
137
|
+
await page.waitForChanges();
|
|
138
|
+
const list = await page.find('div[kup-dynamic-position] kup-list');
|
|
139
|
+
expect(list).not.toBeNull();
|
|
140
|
+
const listOptions = await page.findAll('kup-list >>> ul.list li');
|
|
141
|
+
expect(listOptions).not.toBeNull();
|
|
142
|
+
expect(listOptions).toHaveLength(2);
|
|
143
|
+
const firstOptionValue = await listOptions[0].find('span');
|
|
144
|
+
expect(firstOptionValue).toEqualText('Rome');
|
|
145
|
+
await firstOptionValue.click();
|
|
146
|
+
const updatedValue = await input.getProperty('value');
|
|
147
|
+
expect(updatedValue).toBe('Rome');
|
|
148
|
+
});
|
|
149
|
+
it('renders combobox', async () => {
|
|
150
|
+
const page = await newE2EPage();
|
|
151
|
+
await page.setContent('<kup-input-panel></kup-input-panel> <div kup-dynamic-position></div>');
|
|
152
|
+
const inputPanel = await page.find('kup-input-panel');
|
|
153
|
+
const data = {
|
|
154
|
+
columns: [
|
|
155
|
+
{
|
|
156
|
+
name: 'NAT',
|
|
157
|
+
title: 'Nation',
|
|
158
|
+
visible: true,
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
rows: [
|
|
162
|
+
{
|
|
163
|
+
cells: {
|
|
164
|
+
NAT: {
|
|
165
|
+
value: '',
|
|
166
|
+
options: [
|
|
167
|
+
'Italy',
|
|
168
|
+
'Spain',
|
|
169
|
+
'Germany',
|
|
170
|
+
'France',
|
|
171
|
+
'Portugal',
|
|
172
|
+
'England',
|
|
173
|
+
],
|
|
174
|
+
editable: true,
|
|
175
|
+
shape: 'CMB',
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
};
|
|
181
|
+
inputPanel.setProperty('data', data);
|
|
182
|
+
await page.waitForChanges();
|
|
183
|
+
const inputPanelContent = await page.find('kup-input-panel >>> form.input-panel');
|
|
184
|
+
expect(inputPanelContent).not.toBeNull();
|
|
185
|
+
const comboCell = await inputPanelContent.find('.f-cell.combobox-cell');
|
|
186
|
+
expect(comboCell).not.toBeNull();
|
|
187
|
+
const comboTextfield = await comboCell.find('kup-combobox >>> div.f-text-field');
|
|
188
|
+
expect(comboTextfield).not.toBeNull();
|
|
189
|
+
const label = await comboTextfield.find('label');
|
|
190
|
+
expect(label).not.toBeNull();
|
|
191
|
+
expect(label).toEqualText(data.columns[0].title);
|
|
192
|
+
const input = await comboTextfield.find('input');
|
|
193
|
+
expect(input).not.toBeNull();
|
|
194
|
+
const icon = await comboTextfield.find('span.kup-icon.kup-dropdown-icon');
|
|
195
|
+
expect(icon).not.toBeNull();
|
|
196
|
+
await icon.click();
|
|
197
|
+
await page.waitForChanges();
|
|
198
|
+
await page.waitForChanges();
|
|
199
|
+
const list = await page.find('div[kup-dynamic-position] kup-list');
|
|
200
|
+
expect(list).not.toBeNull();
|
|
201
|
+
const listOptions = await page.findAll('kup-list >>> ul.list li');
|
|
202
|
+
expect(listOptions).not.toBeNull();
|
|
203
|
+
expect(listOptions).toHaveLength(data.rows[0].cells.NAT.options.length);
|
|
204
|
+
const firstOptionValue = await listOptions[0].find('span');
|
|
205
|
+
expect(firstOptionValue).toEqualText('Italy');
|
|
206
|
+
await firstOptionValue.click();
|
|
207
|
+
const updatedValue = await input.getProperty('value');
|
|
208
|
+
expect(updatedValue).toBe('Italy');
|
|
209
|
+
});
|
|
210
|
+
it('renders checkbox', async () => {
|
|
211
|
+
const page = await newE2EPage();
|
|
212
|
+
await page.setContent('<kup-input-panel></kup-input-panel>');
|
|
213
|
+
const inputPanel = await page.find('kup-input-panel');
|
|
214
|
+
const data = {
|
|
215
|
+
columns: [
|
|
216
|
+
{
|
|
217
|
+
name: 'CHK',
|
|
218
|
+
title: 'Checkbox',
|
|
219
|
+
visible: true,
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
rows: [
|
|
223
|
+
{
|
|
224
|
+
cells: {
|
|
225
|
+
CHK: {
|
|
226
|
+
value: 'off',
|
|
227
|
+
editable: true,
|
|
228
|
+
shape: 'CHK',
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
],
|
|
233
|
+
};
|
|
234
|
+
inputPanel.setProperty('data', data);
|
|
235
|
+
await page.waitForChanges();
|
|
236
|
+
const inputPanelContent = await page.find('kup-input-panel >>> form.input-panel');
|
|
237
|
+
expect(inputPanelContent).not.toBeNull();
|
|
238
|
+
const checkboxCell = await inputPanelContent.find('.f-cell.checkbox-cell');
|
|
239
|
+
expect(checkboxCell).not.toBeNull();
|
|
240
|
+
const label = await checkboxCell.find('label');
|
|
241
|
+
expect(label).not.toBeNull();
|
|
242
|
+
expect(label).toEqualText(data.columns[0].title);
|
|
243
|
+
const input = await checkboxCell.find('input');
|
|
244
|
+
expect(input).not.toBeNull();
|
|
245
|
+
const value = await input.getProperty('value');
|
|
246
|
+
expect(value).toBe('off');
|
|
247
|
+
await input.click();
|
|
248
|
+
const updatedValue = await input.getProperty('value');
|
|
249
|
+
expect(updatedValue).toBe('on');
|
|
250
|
+
});
|
|
251
|
+
it('renders radio buttons', async () => {
|
|
252
|
+
const page = await newE2EPage();
|
|
253
|
+
await page.setContent('<kup-input-panel></kup-input-panel>');
|
|
254
|
+
const inputPanel = await page.find('kup-input-panel');
|
|
255
|
+
const data = {
|
|
256
|
+
columns: [
|
|
257
|
+
{
|
|
258
|
+
name: 'RAD',
|
|
259
|
+
title: 'Radio Buttons',
|
|
260
|
+
visible: true,
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
rows: [
|
|
264
|
+
{
|
|
265
|
+
cells: {
|
|
266
|
+
RAD: {
|
|
267
|
+
value: '1',
|
|
268
|
+
options: ['1', '2', '3', '4'],
|
|
269
|
+
editable: true,
|
|
270
|
+
shape: 'RAD',
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
};
|
|
276
|
+
inputPanel.setProperty('data', data);
|
|
277
|
+
await page.waitForChanges();
|
|
278
|
+
const inputPanelContent = await page.find('kup-input-panel >>> form.input-panel');
|
|
279
|
+
expect(inputPanelContent).not.toBeNull();
|
|
280
|
+
const radioButtonsCell = await inputPanelContent.find('.f-cell.radio-cell');
|
|
281
|
+
expect(radioButtonsCell).not.toBeNull();
|
|
282
|
+
const radioOptions = data.rows[0].cells.RAD.options;
|
|
283
|
+
const radioButtons = await radioButtonsCell.findAll('div.form-field');
|
|
284
|
+
expect(radioButtons).toHaveLength(radioOptions.length);
|
|
285
|
+
for (const [i, radioButton] of radioButtons.entries()) {
|
|
286
|
+
const label = await radioButton.find('label');
|
|
287
|
+
expect(label).not.toBeNull();
|
|
288
|
+
expect(label).toEqualText(radioOptions[i]);
|
|
289
|
+
const input = await radioButton.find('input');
|
|
290
|
+
expect(input).not.toBeNull();
|
|
291
|
+
const value = await input.getProperty('value');
|
|
292
|
+
expect(value).toBe(radioOptions[i]);
|
|
293
|
+
if (data.rows[0].cells.RAD.value === value) {
|
|
294
|
+
const radioButtonCircle = await radioButton.find('div.radio');
|
|
295
|
+
expect(radioButtonCircle).toHaveClass('radio--checked');
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
const newRadioButtonChecked = await radioButtons[2].find('div.radio');
|
|
299
|
+
await newRadioButtonChecked.click();
|
|
300
|
+
await page.waitForChanges();
|
|
301
|
+
const updatedRadioButtons = await radioButtonsCell.findAll('div.form-field');
|
|
302
|
+
const updateRadioButtonChecked = await updatedRadioButtons[2].find('div.radio ');
|
|
303
|
+
expect(updateRadioButtonChecked).toHaveClass('radio--checked');
|
|
304
|
+
});
|
|
305
|
+
});
|