@nuralyui/select 0.0.4 → 0.1.0

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.
@@ -1,132 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { expect, fixture, html } from '@open-wc/testing';
11
- import '../select.component';
12
- import { OptionSelectionMode, OptionSize, OptionStatus, OptionType } from '../select.types';
13
- const options = [
14
- { value: 'abuja', label: 'Abuja' },
15
- { value: 'duplin', label: 'Duplin' },
16
- { value: 'nairobi', label: 'Nairobi' },
17
- { value: 'beirut', label: 'Beirut' },
18
- { value: 'prague', label: 'Prague' },
19
- ];
20
- suite('Hy-select', () => {
21
- test('init select', () => __awaiter(void 0, void 0, void 0, function* () {
22
- const el = yield fixture(html `<hy-select .options=${options}></hy-select>`);
23
- expect(el.show).to.be.false;
24
- expect(el.placeholder).to.equal('Select an option');
25
- expect(el.disabled).to.be.false;
26
- expect(el.selectionMode).to.equal(OptionSelectionMode.Single);
27
- expect(el.type).to.equal(OptionType.Default);
28
- expect(el.status).to.equal(OptionStatus.Default);
29
- expect(el.size).to.equal(OptionSize.Medium);
30
- expect(el.selected).to.deep.equal([]);
31
- expect(el.defaultSelected).to.deep.equal([]);
32
- }));
33
- test('should hide/show options', () => __awaiter(void 0, void 0, void 0, function* () {
34
- const el = yield fixture(html `<hy-select .options=${options}></hy-select>`);
35
- const wrapper = el.shadowRoot.querySelector('.wrapper');
36
- let displayedOptions = el.shadowRoot.querySelector('.options');
37
- let displayedStyle = window.getComputedStyle(displayedOptions).display;
38
- expect(el.show).to.equal(false);
39
- expect(displayedStyle).to.equal('none');
40
- wrapper.click();
41
- yield el.updateComplete;
42
- displayedOptions = el.shadowRoot.querySelector('.options');
43
- displayedStyle = window.getComputedStyle(displayedOptions).display;
44
- expect(el.show).to.be.true;
45
- expect(displayedStyle).to.equal('flex');
46
- expect(displayedOptions.children.length).to.equal(options.length);
47
- }));
48
- test('should not toggle show when select disabled', () => __awaiter(void 0, void 0, void 0, function* () {
49
- const el = yield fixture(html `<hy-select .options=${options} .disabled=${true}></hy-select>`);
50
- const wrapper = el.shadowRoot.querySelector('.wrapper');
51
- expect(el.show).to.equal(false);
52
- wrapper.click();
53
- yield el.updateComplete;
54
- expect(el.show).to.be.false;
55
- }));
56
- test('should dispatch change events', () => __awaiter(void 0, void 0, void 0, function* () {
57
- const el = yield fixture(html `<hy-select .options=${options} .show=${true}></hy-select>`);
58
- const wrapper = el.shadowRoot.querySelector('.wrapper');
59
- let dispatchChangeEvent = false;
60
- el.addEventListener('changed', () => {
61
- dispatchChangeEvent = true;
62
- });
63
- const displayedOption = wrapper.querySelector('.option');
64
- displayedOption.click();
65
- yield el.updateComplete;
66
- expect(dispatchChangeEvent).to.be.true;
67
- }));
68
- test('should select multiple options', () => __awaiter(void 0, void 0, void 0, function* () {
69
- const el = yield fixture(html `<hy-select
70
- .options=${options}
71
- .show=${true}
72
- selectionMode="multiple"
73
- ></hy-select>`);
74
- const wrapper = el.shadowRoot.querySelector('.wrapper');
75
- const displayedOption = wrapper.querySelectorAll('.option');
76
- expect(el.selected).to.deep.equal([]);
77
- displayedOption[0].click();
78
- yield el.updateComplete;
79
- expect(el.selected).to.deep.equal([options[0]]);
80
- displayedOption[2].click();
81
- expect(el.selected).to.deep.equal([options[0], options[2]]);
82
- }));
83
- test('should select one option', () => __awaiter(void 0, void 0, void 0, function* () {
84
- const el = yield fixture(html `<hy-select .options=${options} .show=${true}></hy-select>`);
85
- const wrapper = el.shadowRoot.querySelector('.wrapper');
86
- const displayedOption = wrapper.querySelectorAll('.option');
87
- expect(el.selected).to.deep.equal([]);
88
- displayedOption[0].click();
89
- yield el.updateComplete;
90
- expect(el.selected).to.deep.equal([options[0]]);
91
- displayedOption[2].click();
92
- expect(el.selected).to.deep.equal([options[2]]);
93
- }));
94
- suite('display default values', () => {
95
- test('should display default value when single default value provided in single selection mode', () => __awaiter(void 0, void 0, void 0, function* () {
96
- const defaultSelected = ['Abuja'];
97
- const el = yield fixture(html `<hy-select
98
- .options=${options}
99
- .show=${true}
100
- .defaultSelected="${defaultSelected}"
101
- ></hy-select>`);
102
- const option = options.find((option) => option.label == defaultSelected[0]);
103
- expect(el.selected).to.deep.equal([option]);
104
- }));
105
- test('should display first default option when multiple default values provided in single selection mode', () => __awaiter(void 0, void 0, void 0, function* () {
106
- const defaultSelected = ['Abuja', 'Nairobi'];
107
- const el = yield fixture(html `<hy-select
108
- .options=${options}
109
- .show=${true}
110
- .defaultSelected="${defaultSelected}"
111
- ></hy-select>`);
112
- const option = options.find((option) => option.label == defaultSelected[0]);
113
- expect(el.selected).to.deep.equal([option]);
114
- }));
115
- test('should display default option values when multiple default values provided in multiple selection mode', () => __awaiter(void 0, void 0, void 0, function* () {
116
- const defaultSelected = ['Abuja', 'Nairobi'];
117
- const el = yield fixture(html `<hy-select
118
- .options=${options}
119
- .show=${true}
120
- .defaultSelected="${defaultSelected}"
121
- selectionMode="multiple"
122
- ></hy-select>`);
123
- const selectedOptions = [];
124
- defaultSelected.forEach((label) => {
125
- const option = options.find((option) => option.label == label);
126
- selectedOptions.push(option);
127
- });
128
- expect(el.selected).to.deep.equal(selectedOptions);
129
- }));
130
- });
131
- });
132
- //# sourceMappingURL=select_test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"select_test.js","sourceRoot":"","sources":["../../../../src/components/select/test/select_test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EA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AAM,OAAO,CAAC,IAAI,CAAA;mBACnC,OAAO;gBACV,IAAI;4BACQ,eAAe;oBACvB,CAAC,CAAC;YAChB,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;YAE5E,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAA,CAAC,CAAC;QACH,IAAI,CAAC,uGAAuG,EAAE,GAAS,EAAE;YACvH,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAC7C,MAAM,EAAE,GAAsB,MAAM,OAAO,CAAC,IAAI,CAAA;mBACnC,OAAO;gBACV,IAAI;4BACQ,eAAe;;oBAEvB,CAAC,CAAC;YAChB,MAAM,eAAe,GAAc,EAAE,CAAC;YACtC,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBAChC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,IAAI,KAAK,CAAE,CAAC;gBAChE,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACrD,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {expect, fixture, html} from '@open-wc/testing';\nimport '../select.component';\nimport {HySelectComponent} from '../select.component';\nimport {IOption, OptionSelectionMode, OptionSize, OptionStatus, OptionType} from '../select.types';\nconst options = [\n {value: 'abuja', label: 'Abuja'},\n {value: 'duplin', label: 'Duplin'},\n {value: 'nairobi', label: 'Nairobi'},\n {value: 'beirut', label: 'Beirut'},\n {value: 'prague', label: 'Prague'},\n];\nsuite('Hy-select', () => {\n test('init select', async () => {\n const el: HySelectComponent = await fixture(html`<hy-select .options=${options}></hy-select>`);\n expect(el.show).to.be.false;\n expect(el.placeholder).to.equal('Select an option');\n expect(el.disabled).to.be.false;\n expect(el.selectionMode).to.equal(OptionSelectionMode.Single);\n expect(el.type).to.equal(OptionType.Default);\n expect(el.status).to.equal(OptionStatus.Default);\n expect(el.size).to.equal(OptionSize.Medium);\n expect(el.selected).to.deep.equal([]);\n expect(el.defaultSelected).to.deep.equal([]);\n });\n test('should hide/show options', async () => {\n const el: HySelectComponent = await fixture(html`<hy-select .options=${options}></hy-select>`);\n const wrapper: HTMLElement = el.shadowRoot!.querySelector('.wrapper')!;\n let displayedOptions: HTMLElement = el.shadowRoot!.querySelector('.options')!;\n let displayedStyle = window.getComputedStyle(displayedOptions).display;\n expect(el.show).to.equal(false);\n expect(displayedStyle).to.equal('none');\n wrapper.click();\n await el.updateComplete;\n displayedOptions = el.shadowRoot!.querySelector('.options')!;\n displayedStyle = window.getComputedStyle(displayedOptions).display;\n expect(el.show).to.be.true;\n expect(displayedStyle).to.equal('flex');\n expect(displayedOptions.children.length).to.equal(options.length);\n });\n test('should not toggle show when select disabled', async () => {\n const el: HySelectComponent = await fixture(html`<hy-select .options=${options} .disabled=${true}></hy-select>`);\n const wrapper: HTMLElement = el.shadowRoot!.querySelector('.wrapper')!;\n expect(el.show).to.equal(false);\n wrapper.click();\n await el.updateComplete;\n expect(el.show).to.be.false;\n });\n test('should dispatch change events', async () => {\n const el: HySelectComponent = await fixture(html`<hy-select .options=${options} .show=${true}></hy-select>`);\n const wrapper: HTMLElement = el.shadowRoot!.querySelector('.wrapper')!;\n let dispatchChangeEvent = false;\n el.addEventListener('changed', () => {\n dispatchChangeEvent = true;\n });\n const displayedOption: HTMLElement = wrapper.querySelector('.option')!;\n displayedOption.click();\n await el.updateComplete;\n expect(dispatchChangeEvent).to.be.true;\n });\n test('should select multiple options', async () => {\n const el: HySelectComponent = await fixture(html`<hy-select\n .options=${options}\n .show=${true}\n selectionMode=\"multiple\"\n ></hy-select>`);\n const wrapper: HTMLElement = el.shadowRoot!.querySelector('.wrapper')!;\n const displayedOption: NodeListOf<HTMLElement> = wrapper.querySelectorAll('.option')!;\n expect(el.selected).to.deep.equal([]);\n displayedOption[0].click();\n await el.updateComplete;\n expect(el.selected).to.deep.equal([options[0]]);\n displayedOption[2].click();\n expect(el.selected).to.deep.equal([options[0], options[2]]);\n });\n test('should select one option', async () => {\n const el: HySelectComponent = await fixture(html`<hy-select .options=${options} .show=${true}></hy-select>`);\n const wrapper: HTMLElement = el.shadowRoot!.querySelector('.wrapper')!;\n const displayedOption: NodeListOf<HTMLElement> = wrapper.querySelectorAll('.option')!;\n expect(el.selected).to.deep.equal([]);\n displayedOption[0].click();\n await el.updateComplete;\n expect(el.selected).to.deep.equal([options[0]]);\n displayedOption[2].click();\n expect(el.selected).to.deep.equal([options[2]]);\n });\n suite('display default values', () => {\n test('should display default value when single default value provided in single selection mode', async () => {\n const defaultSelected = ['Abuja'];\n const el: HySelectComponent = await fixture(html`<hy-select\n .options=${options}\n .show=${true}\n .defaultSelected=\"${defaultSelected}\"\n ></hy-select>`);\n const option = options.find((option) => option.label == defaultSelected[0]);\n expect(el.selected).to.deep.equal([option]);\n });\n test('should display first default option when multiple default values provided in single selection mode', async () => {\n const defaultSelected = ['Abuja', 'Nairobi'];\n const el: HySelectComponent = await fixture(html`<hy-select\n .options=${options}\n .show=${true}\n .defaultSelected=\"${defaultSelected}\"\n ></hy-select>`);\n const option = options.find((option) => option.label == defaultSelected[0]);\n\n expect(el.selected).to.deep.equal([option]);\n });\n test('should display default option values when multiple default values provided in multiple selection mode', async () => {\n const defaultSelected = ['Abuja', 'Nairobi'];\n const el: HySelectComponent = await fixture(html`<hy-select\n .options=${options}\n .show=${true}\n .defaultSelected=\"${defaultSelected}\"\n selectionMode=\"multiple\"\n ></hy-select>`);\n const selectedOptions: IOption[] = [];\n defaultSelected.forEach((label) => {\n const option = options.find((option) => option.label == label)!;\n selectedOptions.push(option);\n });\n\n expect(el.selected).to.deep.equal(selectedOptions);\n });\n });\n});\n"]}