@zanichelli/albe-web-components 13.3.0 → 13.3.1-rc
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/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +20 -5
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-combobox.cjs.entry.js +126 -40
- package/dist/cjs/z-combobox.cjs.entry.js.map +1 -1
- package/dist/collection/components/inputs/z-combobox/index.js +133 -51
- package/dist/collection/components/inputs/z-combobox/index.js.map +1 -1
- package/dist/collection/components/inputs/z-combobox/index.spec.js +191 -161
- package/dist/collection/components/inputs/z-combobox/index.spec.js.map +1 -1
- package/dist/collection/components/inputs/z-combobox/styles.css +10 -10
- package/dist/collection/components/inputs/z-input/index.js +46 -4
- package/dist/collection/components/inputs/z-input/index.js.map +1 -1
- package/dist/collection/components/list/z-list-element/index.js +20 -1
- package/dist/collection/components/list/z-list-element/index.js.map +1 -1
- package/dist/components/index10.js +18 -4
- package/dist/components/index10.js.map +1 -1
- package/dist/components/index13.js +3 -1
- package/dist/components/index13.js.map +1 -1
- package/dist/components/z-combobox.js +148 -53
- package/dist/components/z-combobox.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +20 -5
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-combobox.entry.js +129 -43
- package/dist/esm/z-combobox.entry.js.map +1 -1
- package/dist/types/components/inputs/z-combobox/index.d.ts +15 -1
- package/dist/types/components/inputs/z-input/index.d.ts +7 -0
- package/dist/types/components/list/z-list-element/index.d.ts +2 -0
- package/dist/types/components.d.ts +18 -0
- package/dist/web-components-library/p-2b6e04e5.entry.js +2 -0
- package/dist/web-components-library/p-2b6e04e5.entry.js.map +1 -0
- package/{www/build/p-aa0f32d7.entry.js → dist/web-components-library/p-f3c3448f.entry.js} +2 -2
- package/dist/web-components-library/p-f3c3448f.entry.js.map +1 -0
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/dist/web-components-library/web-components-library.esm.js.map +1 -1
- package/package.json +1 -1
- package/www/build/p-2b6e04e5.entry.js +2 -0
- package/www/build/p-2b6e04e5.entry.js.map +1 -0
- package/www/build/p-b7565b28.js +2 -0
- package/{dist/web-components-library/p-aa0f32d7.entry.js → www/build/p-f3c3448f.entry.js} +2 -2
- package/www/build/p-f3c3448f.entry.js.map +1 -0
- package/www/build/web-components-library.esm.js +1 -1
- package/www/build/web-components-library.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/web-components-library/p-9b52dea5.entry.js +0 -2
- package/dist/web-components-library/p-9b52dea5.entry.js.map +0 -1
- package/dist/web-components-library/p-aa0f32d7.entry.js.map +0 -1
- package/www/build/p-9b52dea5.entry.js +0 -2
- package/www/build/p-9b52dea5.entry.js.map +0 -1
- package/www/build/p-aa0f32d7.entry.js.map +0 -1
- package/www/build/p-ddd9a0ea.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../src/components/inputs/z-combobox/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAElC,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,IAAI,EAAE,sCAAsC;SAC7C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;KAW7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE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M,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;KA0B7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2EAA2E,EAAE,KAAK,IAAI,EAAE;QACzF,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,IAAI,EAAE,2QAA2Q;SAClR,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC;QAChC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;KA0B7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {newSpecPage} from \"@stencil/core/testing\";\n\nimport {ZCombobox} from \"./index\";\n\ndescribe(\"Suite test ZCombobox\", () => {\n it(\"Test render ZCombobox chiusa\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox items='[]'></z-combobox>`,\n });\n expect(page.root).toEqualHtml(`\n <z-combobox items='[]'>\n <mock:shadow-root>\n <div data-action=\"combo-undefined\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\"><span></span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox disabilitata\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox items='[]' disabled='true'></z-combobox>`,\n });\n expect(page.root).toEqualHtml(`\n <z-combobox disabled='' items='[]'>\n <mock:shadow-root>\n <div class=\"disabled\" data-action=\"combo-undefined\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\"><span></span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox chiusa con attributi\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox items='[]' inputid=\"combobox\" label=\"label\" isfixed></z-combobox>`,\n });\n expect(page.root).toEqualHtml(`\n <z-combobox items='[]' inputid=\"combobox\" label=\"label\" isfixed>\n <mock:shadow-root>\n <div class=\"fixed\" id=\"combobox\" data-action=\"combo-combobox\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">\n label\n <span></span>\n </p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox chiusa con attributi ed elemento selezionato\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]' inputid=\"combobox\" label=\"label\"></z-combobox>`,\n });\n expect(page.root).toEqualHtml(`\n <z-combobox items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]' inputid=\"combobox\" label=\"label\">\n <mock:shadow-root>\n <div data-action=\"combo-combobox\" id=\"combobox\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">\n label\n <span>(1)</span>\n </p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta vuota\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox items='[]' noresultslabel='non ci sono risultati'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox items='[]' noresultslabel='non ci sono risultati'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-undefined\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\"><span></span></p>\n <z-icon class=\"big\" name=\"caret-down\" ></z-icon>\n </div>\n <div class=\"open-combo-data\">\n <div tabindex=\"-1\">\n <ul></ul>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con elementi\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combo\" label=\"combo\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combo\" label=\"combo\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combo\" id=\"combo\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <div tabindex=\"-1\">\n <ul>\n <z-myz-list-item class=\"big\" id=\"item_1\" listitemid=\"item_1\" action=\"combo-li-combo\" underlined=\"\">\n <z-input disabled=\"0\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_1\" label=\"primo elemento\"></z-input>\n </z-myz-list-item>\n <z-myz-list-item class=\"big\" id=\"item_2\" listitemid=\"item_2\" action=\"combo-li-combo\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_2\" label=\"secondo elemento\" checked></z-input>\n </z-myz-list-item>\n </ul>\n </div\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con ricerca\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combo\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combo\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combo\" id=\"combo\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <z-input size=\"big\" htmlid=\"combo_search\" label=\"cerca\" placeholder=\"placeholder\" type=\"text\"></z-input>\n <div tabindex=\"-1\">\n <ul>\n <z-myz-list-item class=\"big\" id=\"item_1\" listitemid=\"item_1\" action=\"combo-li-combo\" underlined=\"\">\n <z-input disabled=\"0\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_1\" label=\"primo elemento\"></z-input>\n </z-myz-list-item>\n <z-myz-list-item class=\"big\" id=\"item_2\" listitemid=\"item_2\" action=\"combo-li-combo\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_2\" label=\"secondo elemento\" checked></z-input>\n </z-myz-list-item>\n </ul>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con ricerca attiva e risultati\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combo\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" closesearchtext=\"CHIUDI\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n page.rootInstance.searchValue = \"primo\";\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combo\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" closesearchtext=\"CHIUDI\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combo\" id=\"combo\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <z-input size=\"big\" htmlid=\"combo_search\" label=\"cerca\" placeholder=\"placeholder\" type=\"text\" value=\"primo\"></z-input>\n <div class=\"search\" tabindex=\"-1\">\n <ul>\n <z-myz-list-item class=\"big\" id=\"item_1\" listitemid=\"item_1\" action=\"combo-li-combo\">\n <z-input disabled=\"0\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_1\" label=\"<b>primo</b> elemento\"></z-input>\n </z-myz-list-item>\n </ul>\n <div>\n <a role=\"button\" tabindex=\"0\">CHIUDI</a>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con ricerca attiva senza testo di chiusura della ricerca testuale\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combo\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n page.rootInstance.searchValue = \"primo\";\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combo\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combo\" id=\"combo\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <z-input size=\"big\" htmlid=\"combo_search\" label=\"cerca\" placeholder=\"placeholder\" type=\"text\" value=\"primo\"></z-input>\n <div class=\"search\" tabindex=\"-1\">\n <ul>\n <z-myz-list-item class=\"big\" id=\"item_1\" listitemid=\"item_1\" action=\"combo-li-combo\">\n <z-input disabled=\"0\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_1\" label=\"<b>primo</b> elemento\"></z-input>\n </z-myz-list-item>\n </ul>\n <div>\n <a role=\"button\" tabindex=\"0\">Chiudi</a>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con ricerca attiva senza risultati\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combo\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" closesearchtext=\"CHIUDI\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]' noresultslabel='non ci sono risultati'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n page.rootInstance.searchValue = \"prova\";\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combo\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" closesearchtext=\"CHIUDI\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]' noresultslabel='non ci sono risultati'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combo\" id=\"combo\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <z-input size=\"big\" htmlid=\"combo_search\" label=\"cerca\" placeholder=\"placeholder\" type=\"text\" value=\"prova\"></z-input>\n <div class=\"search\" tabindex=\"-1\">\n <ul>\n <z-myz-list-item class=\"big\" id='no-results' text='non ci sono risultati' listitemid='no-results' icon='multiply-circle'></z-myz-list-item>\n </ul>\n <div>\n <a role=\"button\" tabindex=\"0\">CHIUDI</a>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con check all\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combo\" label=\"combo\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combo\" label=\"combo\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combo\" id=\"combo\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <div class=\"check-all-wrapper\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-check-all\" label=\"CHECK\" disabled=\"0\" />\n </div>\n <div tabindex=\"-1\">\n <ul>\n <z-myz-list-item class=\"big\" id=\"item_1\" listitemid=\"item_1\" action=\"combo-li-combo\" underlined=\"\">\n <z-input disabled=\"0\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_1\" label=\"primo elemento\"></z-input>\n </z-myz-list-item>\n <z-myz-list-item class=\"big\" id=\"item_2\" listitemid=\"item_2\" action=\"combo-li-combo\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_2\" label=\"secondo elemento\" checked></z-input>\n </z-myz-list-item>\n </ul>\n </div\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con uncheck all\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combo\" label=\"combo\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combo\" label=\"combo\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combo\" id=\"combo\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(2)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <div class=\"check-all-wrapper\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-check-all\" label=\"UNCHECK\" checked disabled=\"0\" />\n </div>\n <div tabindex=\"-1\">\n <ul>\n <z-myz-list-item class=\"big\" id=\"item_1\" listitemid=\"item_1\" action=\"combo-li-combo\" underlined=\"\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_1\" label=\"primo elemento\" checked></z-input>\n </z-myz-list-item>\n <z-myz-list-item class=\"big\" id=\"item_2\" listitemid=\"item_2\" action=\"combo-li-combo\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_2\" label=\"secondo elemento\" checked></z-input>\n </z-myz-list-item>\n </ul>\n </div\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con max checkable items\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combo\" label=\"combo\" maxcheckableitems=\"1\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combo\" label=\"combo\" maxcheckableitems=\"1\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combo\" id=\"combo\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <div tabindex=\"-1\">\n <ul>\n <z-myz-list-item class=\"big\" id=\"item_1\" listitemid=\"item_1\" action=\"combo-li-combo\" underlined=\"\">\n <z-input disabled=\"\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_1\" label=\"primo elemento\"></z-input>\n </z-myz-list-item>\n <z-myz-list-item class=\"big\" id=\"item_2\" listitemid=\"item_2\" action=\"combo-li-combo\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_2\" label=\"secondo elemento\" checked></z-input>\n </z-myz-list-item>\n </ul>\n </div\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con maxcheckableitems + check all\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combo\" label=\"combo\" maxcheckableitems=\"3\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":false}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combo\" label=\"combo\" maxcheckableitems=\"3\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":false}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combo\" id=\"combo\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <div class=\"check-all-wrapper\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-check-all\" label=\"CHECK\" />\n </div>\n <div tabindex=\"-1\">\n <ul>\n <z-myz-list-item id=\"item_1\" class=\"big\" listitemid=\"item_1\" action=\"combo-li-combo\" underlined=\"\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_1\" label=\"primo elemento\" checked></z-input>\n </z-myz-list-item>\n <z-myz-list-item id=\"item_2\" class=\"big\" listitemid=\"item_2\" action=\"combo-li-combo\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_2\" label=\"secondo elemento\"></z-input>\n </z-myz-list-item>\n </ul>\n </div\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con maxcheckableitems + check all (disabled)\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combo\" label=\"combo\" maxcheckableitems=\"1\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":false}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combo\" label=\"combo\" maxcheckableitems=\"1\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":false}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combo\" id=\"combo\">\n <div class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <div class=\"check-all-wrapper\">\n <z-input type=\"checkbox\" size=\"big\" disabled htmlid=\"combo-checkbox-combo-check-all\" label=\"CHECK\" />\n </div>\n <div tabindex=\"-1\">\n <ul>\n <z-myz-list-item id=\"item_1\" class=\"big\" listitemid=\"item_1\" action=\"combo-li-combo\" underlined=\"\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_1\" label=\"primo elemento\" checked></z-input>\n </z-myz-list-item>\n <z-myz-list-item id=\"item_2\" class=\"big\" listitemid=\"item_2\" action=\"combo-li-combo\">\n <z-input type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combo-item_2\" label=\"secondo elemento\" disabled></z-input>\n </z-myz-list-item>\n </ul>\n </div\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../src/components/inputs/z-combobox/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAElC,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,IAAI,EAAE,yDAAyD;SAChE,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;KAW7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,IAAI,EAAE,yEAAyE;SAChF,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;KAW7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,IAA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,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8B7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {newSpecPage} from \"@stencil/core/testing\";\n\nimport {ZCombobox} from \"./index\";\n\ndescribe(\"Suite test ZCombobox\", () => {\n it(\"Test render ZCombobox chiusa\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox items='[]' inputid=\"combobox\"></z-combobox>`,\n });\n expect(page.root).toEqualHtml(`\n <z-combobox items='[]' inputid=\"combobox\">\n <mock:shadow-root>\n <div data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"false\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\"><span></span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox disabilitata\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox items='[]' inputid=\"combobox\" disabled='true'></z-combobox>`,\n });\n expect(page.root).toEqualHtml(`\n <z-combobox disabled='' items='[]' inputid=\"combobox\">\n <mock:shadow-root>\n <div class=\"disabled\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"false\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\"><span></span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox chiusa con attributi\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox items='[]' inputid=\"combobox\" label=\"label\" isfixed></z-combobox>`,\n });\n expect(page.root).toEqualHtml(`\n <z-combobox items='[]' inputid=\"combobox\" label=\"label\" isfixed>\n <mock:shadow-root>\n <div class=\"fixed\" id=\"combobox\" data-action=\"combo-combobox\">\n <div aria-expanded=\"false\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">\n label\n <span></span>\n </p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox chiusa con attributi ed elemento selezionato\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]' inputid=\"combobox\" label=\"label\"></z-combobox>`,\n });\n expect(page.root).toEqualHtml(`\n <z-combobox items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]' inputid=\"combobox\" label=\"label\">\n <mock:shadow-root>\n <div data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"false\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">\n label\n <span>(1)</span>\n </p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta vuota\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox items='[]' inputid=\"combobox\" noresultslabel='non ci sono risultati'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox items='[]' inputid=\"combobox\" noresultslabel='non ci sono risultati'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"true\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\"><span></span></p>\n <z-icon class=\"big\" name=\"caret-down\" ></z-icon>\n </div>\n <div class=\"open-combo-data\">\n <span role=\"combobox\" aria-controls=\"combobox_list\" aria-expanded=\"true\"></span>\n <div aria-multiselectable=\"\" role=\"listbox\" id=\"combobox_list\" aria-owns=\"\">\n <div>\n <ul role=\"none\"></ul>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con elementi\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combobox\" label=\"combo\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combobox\" label=\"combo\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"true\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <span role=\"combobox\" aria-label=\"combo\" aria-controls=\"combobox_list\" aria-expanded=\"true\"></span>\n <div aria-multiselectable=\"\" role=\"listbox\" aria-label=\"combo\" id=\"combobox_list\" aria-owns=\"\">\n <div>\n <ul role=\"none\">\n <z-list-element dividertype=\"element\" id=\"6974656d5f31\" size=\"large\">\n <z-input role=\"option\" aria-selected=\"false\" disabled=\"0\" class=\"combo-item-checkbox-input-combobox\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f31\" label=\"primo elemento\"></z-input>\n </z-list-element>\n <z-list-element dividertype=\"none\" id=\"6974656d5f32\" size=\"large\">\n <z-input role=\"option\" aria-selected=\"true\" type=\"checkbox\" class=\"combo-item-checkbox-input-combobox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f32\" label=\"secondo elemento\" checked></z-input>\n </z-list-element>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con ricerca\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combobox\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combobox\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"true\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <z-input aria-autocomplete=\"list\" aria-controls=\"combobox_list\" aria-expanded=\"true\" htmlid=\"combobox_search\" label=\"cerca\" placeholder=\"placeholder\" role=\"combobox\" aria-label=\"combo\" size=\"big\" type=\"text\"></z-input>\n <div aria-multiselectable=\"\" role=\"listbox\" aria-label=\"combo\" id=\"combobox_list\" aria-owns=\"\">\n <div>\n <ul role=\"none\">\n <z-list-element dividertype=\"element\" id=\"6974656d5f31\" size=\"large\">\n <z-input role=\"option\" aria-selected=\"false\" disabled=\"0\" class=\"combo-item-checkbox-input-combobox\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f31\" label=\"primo elemento\"></z-input>\n </z-list-element>\n <z-list-element dividertype=\"none\" id=\"6974656d5f32\" size=\"large\">\n <z-input type=\"checkbox\" role=\"option\" aria-selected=\"true\" class=\"combo-item-checkbox-input-combobox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f32\" label=\"secondo elemento\" checked></z-input>\n </z-list-element>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con ricerca attiva e risultati\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combobox\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" closesearchtext=\"CHIUDI\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n page.rootInstance.searchValue = \"primo\";\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combobox\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" closesearchtext=\"CHIUDI\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"true\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <z-input aria-autocomplete=\"list\" aria-controls=\"combobox_list\" aria-expanded=\"true\" htmlid=\"combobox_search\" label=\"cerca\" placeholder=\"placeholder\" role=\"combobox\" aria-label=\"combo\" size=\"big\" type=\"text\" value=\"primo\"></z-input> \n <div aria-multiselectable=\"\" role=\"listbox\" aria-label=\"combo\" id=\"combobox_list\" aria-owns=\"\">\n <div class=\"search\">\n <ul role=\"none\">\n <z-list-element dividertype=\"none\" id=\"6974656d5f31\" size=\"large\">\n <z-input role=\"option\" aria-selected=\"false\" disabled=\"0\" class=\"combo-item-checkbox-input-combobox\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f31\" label=\"<strong>primo</strong> elemento\"></z-input>\n </z-list-element>\n </ul>\n <div>\n <a role=\"button\" tabindex=\"0\">CHIUDI</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con ricerca attiva senza testo di chiusura della ricerca testuale\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combobox\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n page.rootInstance.searchValue = \"primo\";\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combobox\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"true\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <z-input aria-autocomplete=\"list\" aria-controls=\"combobox_list\" aria-expanded=\"true\" htmlid=\"combobox_search\" label=\"cerca\" placeholder=\"placeholder\" role=\"combobox\" aria-label=\"combo\" size=\"big\" type=\"text\" value=\"primo\"></z-input> \n <div aria-multiselectable=\"\" role=\"listbox\" aria-label=\"combo\" id=\"combobox_list\" aria-owns=\"\">\n <div class=\"search\">\n <ul role=\"none\">\n <z-list-element dividertype=\"none\" id=\"6974656d5f31\" size=\"large\">\n <z-input role=\"option\" aria-selected=\"false\" disabled=\"0\" class=\"combo-item-checkbox-input-combobox\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f31\" label=\"<strong>primo</strong> elemento\"></z-input>\n </z-list-element>\n </ul>\n <div>\n <a role=\"button\" tabindex=\"0\">Chiudi</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con ricerca attiva senza risultati\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combobox\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" closesearchtext=\"CHIUDI\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]' noresultslabel='non ci sono risultati'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n page.rootInstance.searchValue = \"prova\";\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combobox\" label=\"combo\" hassearch=true searchlabel=\"cerca\" searchplaceholder=\"placeholder\" closesearchtext=\"CHIUDI\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]' noresultslabel='non ci sono risultati'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"true\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <z-input aria-autocomplete=\"list\" aria-controls=\"combobox_list\" aria-expanded=\"true\" htmlid=\"combobox_search\" label=\"cerca\" placeholder=\"placeholder\" role=\"combobox\" aria-label=\"combo\" size=\"big\" type=\"text\" value=\"prova\"></z-input>\n <div aria-multiselectable=\"\" role=\"listbox\" aria-label=\"combo\" id=\"combobox_list\" aria-owns=\"\">\n <div class=\"search\">\n <ul role=\"none\">\n <z-myz-list-item class=\"big\" id='no-results' text='non ci sono risultati' listitemid='no-results' icon='multiply-circle'></z-myz-list-item>\n </ul>\n <div>\n <a role=\"button\" tabindex=\"0\">CHIUDI</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con check all\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combobox\" label=\"combo\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combobox\" label=\"combo\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"true\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <span role=\"combobox\" aria-label=\"combo\" aria-controls=\"combobox_list\" aria-expanded=\"true\"></span>\n <div aria-multiselectable=\"\" role=\"listbox\" aria-label=\"combo\" id=\"combobox_list\" aria-owns=\"\">\n <div class=\"check-all-wrapper\">\n <z-input type=\"checkbox\" aria-selected=\"false\" role=\"option\" size=\"big\" htmlid=\"combo-checkbox-combobox-check-all\" class=\"combo-item-checkbox-input-combobox\" label=\"CHECK\" disabled=\"0\" />\n </div>\n <div>\n <ul role=\"none\">\n <z-list-element dividertype=\"element\" id=\"6974656d5f31\" size=\"large\">\n <z-input role=\"option\" aria-selected=\"false\" disabled=\"0\" class=\"combo-item-checkbox-input-combobox\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f31\" label=\"primo elemento\"></z-input>\n </z-list-element>\n <z-list-element dividertype=\"none\" id=\"6974656d5f32\" size=\"large\">\n <z-input role=\"option\" aria-selected=\"true\" type=\"checkbox\" class=\"combo-item-checkbox-input-combobox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f32\" label=\"secondo elemento\" checked></z-input>\n </z-list-element>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con uncheck all\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combobox\" label=\"combo\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combobox\" label=\"combo\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"true\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(2)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <span role=\"combobox\" aria-label=\"combo\" aria-controls=\"combobox_list\" aria-expanded=\"true\"></span>\n <div aria-multiselectable=\"\" role=\"listbox\" aria-label=\"combo\" id=\"combobox_list\" aria-owns=\"\">\n <div class=\"check-all-wrapper\">\n <z-input type=\"checkbox\" aria-selected=\"true\" role=\"option\" size=\"big\" htmlid=\"combo-checkbox-combobox-check-all\" class=\"combo-item-checkbox-input-combobox\" label=\"UNCHECK\" checked disabled=\"0\" />\n </div>\n <div>\n <ul role=\"none\">\n <z-list-element dividertype=\"element\" id=\"6974656d5f31\" size=\"large\"> \n <z-input type=\"checkbox\" role=\"option\" aria-selected=\"true\" class=\"combo-item-checkbox-input-combobox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f31\" label=\"primo elemento\" checked></z-input>\n </z-list-element>\n <z-list-element dividertype=\"none\" id=\"6974656d5f32\" size=\"large\">\n <z-input type=\"checkbox\" role=\"option\" aria-selected=\"true\" class=\"combo-item-checkbox-input-combobox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f32\" label=\"secondo elemento\" checked></z-input>\n </z-list-element>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con max checkable items\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combobox\" label=\"combo\" maxcheckableitems=\"1\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combobox\" label=\"combo\" maxcheckableitems=\"1\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":false},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":true}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"true\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <span role=\"combobox\" aria-label=\"combo\" aria-controls=\"combobox_list\" aria-expanded=\"true\"></span>\n <div aria-multiselectable=\"\" role=\"listbox\" aria-label=\"combo\" id=\"combobox_list\" aria-owns=\"\">\n <div>\n <ul role=\"none\">\n <z-list-element dividertype=\"element\" id=\"6974656d5f31\" size=\"large\">\n <z-input role=\"option\" aria-selected=\"false\" disabled=\"\" class=\"combo-item-checkbox-input-combobox\" type=\"checkbox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f31\" label=\"primo elemento\"></z-input>\n </z-list-element>\n <z-list-element dividertype=\"none\" id=\"6974656d5f32\" size=\"large\">\n <z-input type=\"checkbox\" role=\"option\" aria-selected=\"true\" class=\"combo-item-checkbox-input-combobox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f32\" label=\"secondo elemento\" checked></z-input>\n </z-list-element>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con maxcheckableitems + check all\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combobox\" label=\"combo\" maxcheckableitems=\"3\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":false}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combobox\" label=\"combo\" maxcheckableitems=\"3\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":false}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"true\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n <div class=\"open-combo-data\">\n <span role=\"combobox\" aria-label=\"combo\" aria-controls=\"combobox_list\" aria-expanded=\"true\"></span>\n <div aria-multiselectable=\"\" role=\"listbox\" aria-label=\"combo\" id=\"combobox_list\" aria-owns=\"\"> \n <div class=\"check-all-wrapper\">\n <z-input aria-selected=\"false\" type=\"checkbox\" role=\"option\" size=\"big\" htmlid=\"combo-checkbox-combobox-check-all\" class=\"combo-item-checkbox-input-combobox\" label=\"CHECK\" />\n </div>\n <div>\n <ul role=\"none\">\n <z-list-element dividertype=\"element\" id=\"6974656d5f31\" size=\"large\"> \n <z-input type=\"checkbox\" role=\"option\" aria-selected=\"true\" size=\"big\" class=\"combo-item-checkbox-input-combobox\" htmlid=\"combo-checkbox-combobox-6974656d5f31\" label=\"primo elemento\" checked></z-input>\n </z-list-element>\n <z-list-element dividertype=\"none\" id=\"6974656d5f32\" size=\"large\"> \n <z-input type=\"checkbox\" role=\"option\" aria-selected=\"false\" size=\"big\" class=\"combo-item-checkbox-input-combobox\" htmlid=\"combo-checkbox-combobox-6974656d5f32\" label=\"secondo elemento\"></z-input>\n </z-list-element>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n\n it(\"Test render ZCombobox aperta con maxcheckableitems + check all (disabled)\", async () => {\n const page = await newSpecPage({\n components: [ZCombobox],\n html: `<z-combobox inputid=\"combobox\" label=\"combo\" maxcheckableitems=\"1\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":false}]'></z-combobox>`,\n });\n page.rootInstance.isopen = true;\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <z-combobox inputid=\"combobox\" label=\"combo\" maxcheckableitems=\"1\" hascheckall=\"true\" checkalltext=\"CHECK\" uncheckalltext=\"UNCHECK\" items='[{\"id\":\"item_1\",\"name\":\"primo elemento\",\"checked\":true},{\"id\":\"item_2\",\"name\":\"secondo elemento\",\"checked\":false}]'>\n <mock:shadow-root>\n <div class=\"open\" data-action=\"combo-combobox\" id=\"combobox\">\n <div aria-expanded=\"true\" class=\"header\" role=\"button\" tabindex=\"0\">\n <p class=\"body-3\">combo<span>(1)</span></p>\n <z-icon class=\"big\" name=\"caret-down\" />\n </div>\n \n <div class=\"open-combo-data\"> \n <span role=\"combobox\" aria-label=\"combo\" aria-controls=\"combobox_list\" aria-expanded=\"true\"></span>\n <div aria-multiselectable=\"\" role=\"listbox\" aria-label=\"combo\" id=\"combobox_list\" aria-owns=\"\">\n <div class=\"check-all-wrapper\">\n <z-input type=\"checkbox\" aria-selected=\"false\" role=\"option\" size=\"big\" disabled htmlid=\"combo-checkbox-combobox-check-all\" class=\"combo-item-checkbox-input-combobox\" label=\"CHECK\" />\n </div>\n <div>\n <ul role=\"none\">\n <z-list-element dividertype=\"element\" id=\"6974656d5f31\" size=\"large\"> \n <z-input type=\"checkbox\" role=\"option\" aria-selected=\"true\" class=\"combo-item-checkbox-input-combobox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f31\" label=\"primo elemento\" checked></z-input>\n </z-list-element>\n <z-list-element dividertype=\"none\" id=\"6974656d5f32\" size=\"large\"> \n <z-input type=\"checkbox\" role=\"option\" aria-selected=\"false\" class=\"combo-item-checkbox-input-combobox\" size=\"big\" htmlid=\"combo-checkbox-combobox-6974656d5f32\" label=\"secondo elemento\" disabled></z-input>\n </z-list-element>\n </ul>\n </div\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </z-combobox>\n `);\n });\n});\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: block;
|
|
3
|
+
font-family: var(--font-family-sans);
|
|
3
4
|
}
|
|
4
5
|
|
|
5
6
|
:host > div.fixed {
|
|
@@ -109,7 +110,7 @@
|
|
|
109
110
|
border-radius: 0;
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
:host > div.open > div.open-combo-data > div {
|
|
113
|
+
:host > div.open > div.open-combo-data > div > div {
|
|
113
114
|
overflow: auto;
|
|
114
115
|
max-height: 235px;
|
|
115
116
|
padding: 0;
|
|
@@ -121,7 +122,7 @@
|
|
|
121
122
|
margin-bottom: calc(var(--space-unit) * 2);
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
:host > div.open > div.open-combo-data > div > ul {
|
|
125
|
+
:host > div.open > div.open-combo-data > div > div > ul {
|
|
125
126
|
max-height: 235px;
|
|
126
127
|
padding: 0 3px; /* needed for checkbox focus shadow */
|
|
127
128
|
margin: 0;
|
|
@@ -146,31 +147,30 @@
|
|
|
146
147
|
color: var(--color-primary01);
|
|
147
148
|
}
|
|
148
149
|
|
|
149
|
-
:host > div.open > div.open-combo-data > div.search {
|
|
150
|
+
:host > div.open > div.open-combo-data > div > div.search {
|
|
150
151
|
overflow: hidden;
|
|
151
152
|
max-height: auto;
|
|
152
153
|
margin-top: 0;
|
|
153
154
|
box-shadow: 1px 1px 4px 2px rgb(217 222 227 / 50%);
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
:host > div.open > div.open-combo-data > div.search > ul {
|
|
157
|
+
:host > div.open > div.open-combo-data > div > div.search > ul {
|
|
157
158
|
overflow: auto;
|
|
158
159
|
max-height: 180px;
|
|
159
160
|
padding: var(--space-unit) calc(var(--space-unit) * 2);
|
|
160
161
|
scrollbar-color: var(--color-primary01) transparent;
|
|
161
162
|
}
|
|
162
163
|
|
|
163
|
-
:host > div.open > div.open-combo-data > div.search > div {
|
|
164
|
+
:host > div.open > div.open-combo-data > div > div.search > div {
|
|
164
165
|
display: flex;
|
|
165
166
|
justify-content: center;
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
:host > div.open > div.open-combo-data > div.search > div > a {
|
|
169
|
+
:host > div.open > div.open-combo-data > div > div.search > div > a {
|
|
169
170
|
display: inline-block;
|
|
170
171
|
height: 44px;
|
|
171
172
|
color: var(--color-primary01);
|
|
172
173
|
cursor: pointer;
|
|
173
|
-
font-family: var(--font-family-sans);
|
|
174
174
|
font-size: 14px;
|
|
175
175
|
font-weight: var(--font-sb);
|
|
176
176
|
line-height: 44px;
|
|
@@ -178,17 +178,17 @@
|
|
|
178
178
|
text-transform: uppercase;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
:host > div.open > div.open-combo-data > div.check-all-wrapper {
|
|
181
|
+
:host > div.open > div.open-combo-data > div > div.check-all-wrapper {
|
|
182
182
|
padding: calc(var(--space-unit) * 2) calc(var(--space-unit) * 0.5);
|
|
183
183
|
border-bottom: var(--border-size-small) solid var(--gray800);
|
|
184
184
|
margin-bottom: var(--space-unit);
|
|
185
185
|
text-align: left;
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
:host([size="small"]) > div.open > div.open-combo-data > div.check-all-wrapper {
|
|
188
|
+
:host([size="small"]) > div.open > div.open-combo-data > div > div.check-all-wrapper {
|
|
189
189
|
padding: calc(var(--space-unit) * 1.5) calc(var(--space-unit) * 0.5);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
:host([size="x-small"]) > div.open > div.open-combo-data > div.check-all-wrapper {
|
|
192
|
+
:host([size="x-small"]) > div.open > div.open-combo-data > div > div.check-all-wrapper {
|
|
193
193
|
padding: var(--space-unit) calc(var(--space-unit) * 0.5);
|
|
194
194
|
}
|
|
@@ -98,6 +98,12 @@ export class ZInput {
|
|
|
98
98
|
validity: this.getValidity("input"),
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
+
emitInputFocus() {
|
|
102
|
+
this.inputFocus.emit({ id: this.htmlid });
|
|
103
|
+
}
|
|
104
|
+
emitInputBlur() {
|
|
105
|
+
this.inputBlur.emit({ id: this.htmlid });
|
|
106
|
+
}
|
|
101
107
|
getValidity(type) {
|
|
102
108
|
const input = this.hostElement.querySelector(type);
|
|
103
109
|
return input.validity;
|
|
@@ -156,9 +162,15 @@ export class ZInput {
|
|
|
156
162
|
const activedescendant = this.ariaActivedescendant ? { "aria-activedescendant": this.ariaActivedescendant } : {};
|
|
157
163
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, expanded), controls), autocomplete), activedescendant);
|
|
158
164
|
}
|
|
165
|
+
getFocusBlurAttributes() {
|
|
166
|
+
return {
|
|
167
|
+
onFocus: () => this.emitInputFocus(),
|
|
168
|
+
onBlur: () => this.emitInputBlur(),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
159
171
|
renderInputText(type = InputType.TEXT) {
|
|
160
172
|
const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
|
|
161
|
-
const attr = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.getTextAttributes()), this.getNumberAttributes(type)), this.getPatternAttribute(type)), ariaLabel), this.getRoleAttribute()), this.getAriaAttrubutes());
|
|
173
|
+
const attr = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.getTextAttributes()), this.getNumberAttributes(type)), this.getPatternAttribute(type)), ariaLabel), this.getRoleAttribute()), this.getAriaAttrubutes()), this.getFocusBlurAttributes());
|
|
162
174
|
if (this.icon || type === InputType.PASSWORD) {
|
|
163
175
|
Object.assign(attr.class, { "has-icon": true });
|
|
164
176
|
}
|
|
@@ -218,7 +230,7 @@ export class ZInput {
|
|
|
218
230
|
}
|
|
219
231
|
/* START checkbox */
|
|
220
232
|
renderCheckbox() {
|
|
221
|
-
return (h("div", { class: "checkbox-wrapper" }, h("input", Object.assign({ id: this.htmlid, type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, required: this.required, onChange: this.handleCheck.bind(this), value: this.value }, this.getRoleAttribute())), h("label", { htmlFor: this.htmlid, class: {
|
|
233
|
+
return (h("div", { class: "checkbox-wrapper" }, h("input", Object.assign({ id: this.htmlid, type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, required: this.required, onChange: this.handleCheck.bind(this), value: this.value }, this.getRoleAttribute(), this.getFocusBlurAttributes())), h("label", { htmlFor: this.htmlid, class: {
|
|
222
234
|
"checkbox-label": true,
|
|
223
235
|
"after": this.labelPosition === LabelPosition.RIGHT,
|
|
224
236
|
"before": this.labelPosition === LabelPosition.LEFT,
|
|
@@ -227,7 +239,7 @@ export class ZInput {
|
|
|
227
239
|
/* END checkbox */
|
|
228
240
|
/* START radio */
|
|
229
241
|
renderRadio() {
|
|
230
|
-
return (h("div", { class: "radio-wrapper" }, h("input", Object.assign({ id: this.htmlid, type: "radio", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, onChange: this.handleCheck.bind(this), value: this.value }, this.getRoleAttribute())), h("label", { htmlFor: this.htmlid, class: {
|
|
242
|
+
return (h("div", { class: "radio-wrapper" }, h("input", Object.assign({ id: this.htmlid, type: "radio", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, onChange: this.handleCheck.bind(this), value: this.value }, this.getRoleAttribute(), this.getFocusBlurAttributes())), h("label", { htmlFor: this.htmlid, class: {
|
|
231
243
|
"radio-label": true,
|
|
232
244
|
"after": this.labelPosition === LabelPosition.RIGHT,
|
|
233
245
|
"before": this.labelPosition === LabelPosition.LEFT,
|
|
@@ -249,7 +261,7 @@ export class ZInput {
|
|
|
249
261
|
default:
|
|
250
262
|
input = this.renderInputText(this.type);
|
|
251
263
|
}
|
|
252
|
-
return h(Host, { key: '
|
|
264
|
+
return h(Host, { key: '1a0cb1ef6eb16091c75e87f9761d1eee55a3d3f0' }, input);
|
|
253
265
|
}
|
|
254
266
|
static get is() { return "z-input"; }
|
|
255
267
|
static get encapsulation() { return "scoped"; }
|
|
@@ -878,6 +890,36 @@ export class ZInput {
|
|
|
878
890
|
"resolved": "any",
|
|
879
891
|
"references": {}
|
|
880
892
|
}
|
|
893
|
+
}, {
|
|
894
|
+
"method": "inputFocus",
|
|
895
|
+
"name": "inputFocus",
|
|
896
|
+
"bubbles": true,
|
|
897
|
+
"cancelable": true,
|
|
898
|
+
"composed": true,
|
|
899
|
+
"docs": {
|
|
900
|
+
"tags": [],
|
|
901
|
+
"text": "Emitted on input focus"
|
|
902
|
+
},
|
|
903
|
+
"complexType": {
|
|
904
|
+
"original": "any",
|
|
905
|
+
"resolved": "any",
|
|
906
|
+
"references": {}
|
|
907
|
+
}
|
|
908
|
+
}, {
|
|
909
|
+
"method": "inputBlur",
|
|
910
|
+
"name": "inputBlur",
|
|
911
|
+
"bubbles": true,
|
|
912
|
+
"cancelable": true,
|
|
913
|
+
"composed": true,
|
|
914
|
+
"docs": {
|
|
915
|
+
"tags": [],
|
|
916
|
+
"text": "Emitted on input blur"
|
|
917
|
+
},
|
|
918
|
+
"complexType": {
|
|
919
|
+
"original": "any",
|
|
920
|
+
"resolved": "any",
|
|
921
|
+
"references": {}
|
|
922
|
+
}
|
|
881
923
|
}];
|
|
882
924
|
}
|
|
883
925
|
static get methods() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/inputs/z-input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAgB,OAAO,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACtG,OAAO,EAAC,IAAI,EAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAC,SAAS,EAAE,aAAa,EAAe,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAQvD,MAAM,OAAO,MAAM;;QAmIT,kBAAa,GAAG,GAAG,CAAC;sBA9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CAAC;QAED,OAAO,EAAC,IAAI,uDAAE,KAAK,CAAQ,CAAC;IAC9B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Prop, State, h, Method, Event, EventEmitter, Element, Listen} from \"@stencil/core\";\nimport {Host, JSXBase} from \"@stencil/core/internal\";\nimport {InputType, LabelPosition, InputStatus, ControlSize} from \"../../../beans\";\nimport {boolean, randomId} from \"../../../utils/utils\";\n\n@Component({\n tag: \"z-input\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZInput {\n @Element() hostElement: HTMLZInputElement;\n\n /** the id of the input element */\n @Prop()\n htmlid = `id-${randomId()}`;\n\n /** input types */\n @Prop()\n type: InputType;\n\n /** the input name */\n @Prop()\n name?: string;\n\n /** the input label */\n @Prop()\n label?: string;\n\n /** the input aria-label */\n @Prop()\n ariaLabel = \"\";\n\n /** the input aria-expaded (optional): available for text, password, number, email */\n @Prop()\n ariaExpanded?: string;\n\n /** the input aria-controls (optional): available for text, password, number, email */\n @Prop()\n ariaControls?: string;\n\n /** the input aria-autocomplete (optional): available for text, password, number, email */\n @Prop()\n ariaAutocomplete?: string;\n\n /** the input aria-activedescendant (optional): available for text, password, number, email */\n @Prop()\n ariaActivedescendant?: string;\n\n /** the input value */\n @Prop({mutable: true})\n value?: string;\n\n /** the input is disabled */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /** the input is readonly */\n @Prop()\n readonly?: boolean = false;\n\n /** the input is required (optional): available for text, password, number, email, textarea, checkbox */\n @Prop()\n required?: boolean = false;\n\n /** checked: available for checkbox, radio */\n @Prop({mutable: true})\n checked?: boolean = false;\n\n /** the input placeholder (optional) */\n @Prop()\n placeholder?: string;\n\n /** the input html title (optional) */\n @Prop()\n htmltitle?: string;\n\n /** the input status (optional): available for text, password, number, email, textarea */\n @Prop()\n status?: InputStatus;\n\n /** input helper message (optional): available for text, password, number, email, textarea - if set to `false` message won't be displayed */\n @Prop()\n message?: string | boolean = true;\n\n /** the input label position: available for checkbox, radio */\n @Prop()\n labelPosition?: LabelPosition = LabelPosition.RIGHT;\n\n /** the input has autocomplete option (optional): available for text, password, number, email */\n @Prop()\n autocomplete?: string;\n\n /** the input role (optional) */\n @Prop()\n role?: string;\n\n /** render clear icon when typing (optional): available for text */\n @Prop()\n hasclearicon?: boolean = true;\n\n /** render icon (optional): available for text */\n @Prop()\n icon?: string;\n\n /** min number value (optional): available for number */\n @Prop()\n min?: number;\n\n /** Min length value (optional): available for text */\n @Prop()\n minlength?: number;\n\n /** max number value (optional): available for number */\n @Prop()\n max?: number;\n\n /** Max length value (optional): available for text */\n @Prop()\n maxlength?: number;\n\n /** step number value (optional): available for number */\n @Prop()\n step?: number;\n\n /** pattern value (optional): available for tel, text, search, url, email, password*/\n @Prop()\n pattern?: string;\n\n /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */\n @Prop({reflect: true})\n size?: ControlSize = ControlSize.BIG;\n\n @State()\n isTyping = false;\n\n @State()\n passwordHidden = true;\n\n private timer;\n\n private typingtimeout = 300;\n\n private inputRef: HTMLInputElement;\n\n @Listen(\"inputCheck\", {target: \"document\"})\n inputCheckListener(e: CustomEvent): void {\n const data = e.detail;\n switch (this.type) {\n case InputType.RADIO:\n if (data.type === InputType.RADIO && data.name === this.name && data.id !== this.htmlid) {\n this.checked = false;\n }\n break;\n }\n }\n\n /** get checked status */\n @Method()\n async isChecked(): Promise<boolean> {\n switch (this.type) {\n case InputType.CHECKBOX:\n case InputType.RADIO:\n return this.checked;\n default:\n console.warn(\"`isChecked` method is only available for type `checkbox` and `radio`\");\n\n return false;\n }\n }\n\n /** Emitted on input value change, returns value, validity */\n @Event()\n inputChange: EventEmitter;\n\n private emitInputChange(value: string): void {\n if (!this.isTyping) {\n this.emitStartTyping();\n }\n\n let validity: ValidityState;\n if (this.type === InputType.TEXTAREA) {\n validity = this.getValidity(\"textarea\");\n } else {\n validity = this.getValidity(\"input\");\n }\n this.value = value;\n this.inputChange.emit({value, validity});\n\n clearTimeout(this.timer);\n this.timer = setTimeout(() => {\n this.emitStopTyping(this.value, validity);\n }, this.typingtimeout);\n }\n\n /** Emitted when user starts typing */\n @Event()\n startTyping: EventEmitter;\n\n private emitStartTyping(): void {\n this.isTyping = true;\n this.startTyping.emit();\n }\n\n /** Emitted when user stops typing, returns value, validity */\n @Event()\n stopTyping: EventEmitter;\n\n private emitStopTyping(value: string, validity: ValidityState): void {\n this.isTyping = false;\n this.stopTyping.emit({\n value: value,\n validity: validity,\n });\n }\n\n /** Emitted on checkbox check/uncheck, returns id, checked, type, name, value, validity */\n @Event()\n inputCheck: EventEmitter;\n\n private emitInputCheck(checked: boolean): void {\n this.inputCheck.emit({\n id: this.htmlid,\n checked: checked,\n type: this.type,\n name: this.name,\n value: this.value,\n validity: this.getValidity(\"input\"),\n });\n }\n\n private getValidity(type: string): ValidityState {\n const input = this.hostElement.querySelector(type) as HTMLInputElement;\n\n return input.validity;\n }\n\n /* START text/password/email/number */\n\n private getTextAttributes(): JSXBase.InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement> {\n return {\n id: this.htmlid,\n name: this.name,\n placeholder: this.placeholder,\n value: this.value,\n disabled: this.disabled,\n readonly: this.readonly,\n required: this.required,\n title: this.htmltitle,\n minlength: this.minlength,\n maxlength: this.maxlength,\n class: {\n [`input-${this.status}`]: !!this.status,\n filled: !!this.value,\n },\n autocomplete: this.autocomplete,\n onInput: (e: InputEvent) => this.emitInputChange((e.target as HTMLInputElement).value),\n };\n }\n\n private getNumberAttributes(type: InputType): JSXBase.InputHTMLAttributes<HTMLInputElement> {\n if (type != InputType.NUMBER) {\n return;\n }\n\n return {\n min: this.min,\n max: this.max,\n step: this.step,\n };\n }\n\n private getPatternAttribute(type: InputType): JSXBase.InputHTMLAttributes<HTMLInputElement> {\n if (\n type != InputType.PASSWORD &&\n type != InputType.TEXT &&\n type != InputType.TEL &&\n type != InputType.SEARCH &&\n type != InputType.URL &&\n type != InputType.EMAIL\n ) {\n return;\n }\n\n return {\n pattern: this.pattern,\n };\n }\n\n private getRoleAttribute(): JSXBase.InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement> {\n return this.role ? {role: this.role} : {};\n }\n\n private getAriaAttrubutes(): Record<string, unknown> {\n const expanded = this.ariaExpanded ? {\"aria-expanded\": this.ariaExpanded} : {};\n const controls = this.ariaControls ? {\"aria-controls\": this.ariaControls} : {};\n const autocomplete = this.ariaAutocomplete ? {\"aria-autocomplete\": this.ariaAutocomplete} : {};\n const activedescendant = this.ariaActivedescendant ? {\"aria-activedescendant\": this.ariaActivedescendant} : {};\n\n return {\n ...expanded,\n ...controls,\n ...autocomplete,\n ...activedescendant,\n };\n }\n\n private renderInputText(type: InputType = InputType.TEXT): HTMLDivElement {\n const ariaLabel = this.ariaLabel ? {\"aria-label\": this.ariaLabel} : {};\n const attr = {\n ...this.getTextAttributes(),\n ...this.getNumberAttributes(type),\n ...this.getPatternAttribute(type),\n ...ariaLabel,\n ...this.getRoleAttribute(),\n ...this.getAriaAttrubutes(),\n };\n if (this.icon || type === InputType.PASSWORD) {\n Object.assign(attr.class, {\"has-icon\": true});\n }\n if (this.hasclearicon && type != InputType.NUMBER) {\n Object.assign(attr.class, {\"has-clear-icon\": true});\n }\n\n return (\n <div class=\"text-wrapper\">\n {this.renderLabel()}\n <div>\n <input\n type={type === InputType.PASSWORD && !this.passwordHidden ? InputType.TEXT : type}\n {...attr}\n ref={(el) => (this.inputRef = el)}\n />\n {this.renderIcons()}\n </div>\n {this.renderMessage()}\n </div>\n );\n }\n\n private renderLabel(): HTMLLabelElement {\n if (!this.label) {\n return;\n }\n\n return (\n <label\n class=\"input-label body-5-sb\"\n id={`${this.htmlid}_label`}\n htmlFor={this.htmlid}\n >\n {this.label}\n </label>\n );\n }\n\n private renderIcons(): HTMLSpanElement {\n return (\n <span class=\"icons-wrapper\">\n {this.renderResetIcon()}\n {this.renderIcon()}\n </span>\n );\n }\n\n private renderIcon(): HTMLButtonElement {\n if (this.type === InputType.PASSWORD) {\n return this.renderShowHidePassword();\n }\n\n if (!this.icon) {\n return;\n }\n\n return (\n <button\n type=\"button\"\n class=\"icon-button input-icon\"\n tabIndex={-1}\n aria-hidden=\"true\"\n >\n <z-icon\n name={this.icon}\n class={this.size}\n />\n </button>\n );\n }\n\n private renderResetIcon(): HTMLButtonElement {\n let hidden = false;\n if (!this.hasclearicon || !this.value || this.disabled || this.readonly || this.type == InputType.NUMBER) {\n hidden = true;\n }\n\n return (\n <button\n type=\"button\"\n class={`icon-button reset-icon ${hidden ? \"hidden\" : \"\"}`}\n aria-label=\"cancella il contenuto dell'input\"\n onClick={() => {\n this.inputRef.value = \"\";\n this.emitInputChange(\"\");\n }}\n >\n <z-icon\n name=\"multiply\"\n class={this.size}\n />\n </button>\n );\n }\n\n private renderShowHidePassword(): HTMLButtonElement {\n return (\n <button\n type=\"button\"\n class=\"icon-button toggle-password-icon\"\n disabled={this.disabled}\n aria-label={this.passwordHidden ? \"mostra password\" : \"nascondi password\"}\n onClick={() => (this.passwordHidden = !this.passwordHidden)}\n >\n <z-icon\n name={this.passwordHidden ? \"view-filled\" : \"view-off-filled\"}\n class={this.size}\n />\n </button>\n );\n }\n\n private renderMessage(): HTMLZInputMessageElement {\n if (boolean(this.message) === false) {\n return;\n }\n\n return (\n <z-input-message\n message={boolean(this.message) === true ? undefined : (this.message as string)}\n status={this.status}\n class={this.size}\n />\n );\n }\n\n /* END text/password/email/number */\n\n /* START textarea */\n\n private renderTextarea(): HTMLDivElement {\n const attributes = this.getTextAttributes();\n const ariaLabel = this.ariaLabel ? {\"aria-label\": this.ariaLabel} : {};\n\n return (\n <div class=\"text-wrapper\">\n {this.renderLabel()}\n <div\n class={{\n ...(attributes.class as Record<string, boolean>),\n \"textarea-wrapper\": true,\n \"readonly\": attributes.readonly as boolean,\n }}\n >\n <textarea\n {...attributes}\n {...ariaLabel}\n {...this.getRoleAttribute()}\n ></textarea>\n </div>\n {this.renderMessage()}\n </div>\n );\n }\n\n /* END textarea */\n\n private handleCheck(ev: Event): void {\n this.checked = (ev.target as HTMLInputElement).checked;\n this.emitInputCheck(this.checked);\n }\n\n /* START checkbox */\n private renderCheckbox(): HTMLDivElement {\n return (\n <div class=\"checkbox-wrapper\">\n <input\n id={this.htmlid}\n type=\"checkbox\"\n name={this.name}\n checked={this.checked}\n disabled={this.disabled}\n readonly={this.readonly}\n required={this.required}\n onChange={this.handleCheck.bind(this)}\n value={this.value}\n {...this.getRoleAttribute()}\n />\n\n <label\n htmlFor={this.htmlid}\n class={{\n \"checkbox-label\": true,\n \"after\": this.labelPosition === LabelPosition.RIGHT,\n \"before\": this.labelPosition === LabelPosition.LEFT,\n }}\n >\n <z-icon\n name={this.checked ? \"checkbox-checked\" : \"checkbox\"}\n aria-hidden=\"true\"\n class={this.size}\n />\n {this.label && <span innerHTML={this.label}></span>}\n </label>\n </div>\n );\n }\n\n /* END checkbox */\n\n /* START radio */\n private renderRadio(): HTMLDivElement {\n return (\n <div class=\"radio-wrapper\">\n <input\n id={this.htmlid}\n type=\"radio\"\n name={this.name}\n checked={this.checked}\n disabled={this.disabled}\n readonly={this.readonly}\n onChange={this.handleCheck.bind(this)}\n value={this.value}\n {...this.getRoleAttribute()}\n />\n\n <label\n htmlFor={this.htmlid}\n class={{\n \"radio-label\": true,\n \"after\": this.labelPosition === LabelPosition.RIGHT,\n \"before\": this.labelPosition === LabelPosition.LEFT,\n }}\n >\n <z-icon\n name={this.checked ? \"radio-button-checked\" : \"radio-button\"}\n aria-hidden=\"true\"\n class={this.size}\n />\n {this.label && <span innerHTML={this.label} />}\n </label>\n </div>\n );\n }\n /* END radio */\n\n render(): HTMLInputElement | HTMLDivElement {\n let input;\n switch (this.type) {\n case InputType.TEXTAREA:\n input = this.renderTextarea();\n break;\n case InputType.CHECKBOX:\n input = this.renderCheckbox();\n break;\n case InputType.RADIO:\n input = this.renderRadio();\n break;\n default:\n input = this.renderInputText(this.type);\n }\n\n return <Host>{input}</Host>;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/inputs/z-input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAgB,OAAO,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACtG,OAAO,EAAC,IAAI,EAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAC,SAAS,EAAE,aAAa,EAAe,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAQvD,MAAM,OAAO,MAAM;;QAmIT,kBAAa,GAAG,GAAG,CAAC;sBA9HnB,MAAM,QAAQ,E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Prop, State, h, Method, Event, EventEmitter, Element, Listen} from \"@stencil/core\";\nimport {Host, JSXBase} from \"@stencil/core/internal\";\nimport {InputType, LabelPosition, InputStatus, ControlSize} from \"../../../beans\";\nimport {boolean, randomId} from \"../../../utils/utils\";\n\n@Component({\n tag: \"z-input\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZInput {\n @Element() hostElement: HTMLZInputElement;\n\n /** the id of the input element */\n @Prop()\n htmlid = `id-${randomId()}`;\n\n /** input types */\n @Prop()\n type: InputType;\n\n /** the input name */\n @Prop()\n name?: string;\n\n /** the input label */\n @Prop()\n label?: string;\n\n /** the input aria-label */\n @Prop()\n ariaLabel = \"\";\n\n /** the input aria-expaded (optional): available for text, password, number, email */\n @Prop()\n ariaExpanded?: string;\n\n /** the input aria-controls (optional): available for text, password, number, email */\n @Prop()\n ariaControls?: string;\n\n /** the input aria-autocomplete (optional): available for text, password, number, email */\n @Prop()\n ariaAutocomplete?: string;\n\n /** the input aria-activedescendant (optional): available for text, password, number, email */\n @Prop()\n ariaActivedescendant?: string;\n\n /** the input value */\n @Prop({mutable: true})\n value?: string;\n\n /** the input is disabled */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /** the input is readonly */\n @Prop()\n readonly?: boolean = false;\n\n /** the input is required (optional): available for text, password, number, email, textarea, checkbox */\n @Prop()\n required?: boolean = false;\n\n /** checked: available for checkbox, radio */\n @Prop({mutable: true})\n checked?: boolean = false;\n\n /** the input placeholder (optional) */\n @Prop()\n placeholder?: string;\n\n /** the input html title (optional) */\n @Prop()\n htmltitle?: string;\n\n /** the input status (optional): available for text, password, number, email, textarea */\n @Prop()\n status?: InputStatus;\n\n /** input helper message (optional): available for text, password, number, email, textarea - if set to `false` message won't be displayed */\n @Prop()\n message?: string | boolean = true;\n\n /** the input label position: available for checkbox, radio */\n @Prop()\n labelPosition?: LabelPosition = LabelPosition.RIGHT;\n\n /** the input has autocomplete option (optional): available for text, password, number, email */\n @Prop()\n autocomplete?: string;\n\n /** the input role (optional) */\n @Prop()\n role?: string;\n\n /** render clear icon when typing (optional): available for text */\n @Prop()\n hasclearicon?: boolean = true;\n\n /** render icon (optional): available for text */\n @Prop()\n icon?: string;\n\n /** min number value (optional): available for number */\n @Prop()\n min?: number;\n\n /** Min length value (optional): available for text */\n @Prop()\n minlength?: number;\n\n /** max number value (optional): available for number */\n @Prop()\n max?: number;\n\n /** Max length value (optional): available for text */\n @Prop()\n maxlength?: number;\n\n /** step number value (optional): available for number */\n @Prop()\n step?: number;\n\n /** pattern value (optional): available for tel, text, search, url, email, password*/\n @Prop()\n pattern?: string;\n\n /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */\n @Prop({reflect: true})\n size?: ControlSize = ControlSize.BIG;\n\n @State()\n isTyping = false;\n\n @State()\n passwordHidden = true;\n\n private timer;\n\n private typingtimeout = 300;\n\n private inputRef: HTMLInputElement;\n\n @Listen(\"inputCheck\", {target: \"document\"})\n inputCheckListener(e: CustomEvent): void {\n const data = e.detail;\n switch (this.type) {\n case InputType.RADIO:\n if (data.type === InputType.RADIO && data.name === this.name && data.id !== this.htmlid) {\n this.checked = false;\n }\n break;\n }\n }\n\n /** get checked status */\n @Method()\n async isChecked(): Promise<boolean> {\n switch (this.type) {\n case InputType.CHECKBOX:\n case InputType.RADIO:\n return this.checked;\n default:\n console.warn(\"`isChecked` method is only available for type `checkbox` and `radio`\");\n\n return false;\n }\n }\n\n /** Emitted on input value change, returns value, validity */\n @Event()\n inputChange: EventEmitter;\n\n private emitInputChange(value: string): void {\n if (!this.isTyping) {\n this.emitStartTyping();\n }\n\n let validity: ValidityState;\n if (this.type === InputType.TEXTAREA) {\n validity = this.getValidity(\"textarea\");\n } else {\n validity = this.getValidity(\"input\");\n }\n this.value = value;\n this.inputChange.emit({value, validity});\n\n clearTimeout(this.timer);\n this.timer = setTimeout(() => {\n this.emitStopTyping(this.value, validity);\n }, this.typingtimeout);\n }\n\n /** Emitted when user starts typing */\n @Event()\n startTyping: EventEmitter;\n\n private emitStartTyping(): void {\n this.isTyping = true;\n this.startTyping.emit();\n }\n\n /** Emitted when user stops typing, returns value, validity */\n @Event()\n stopTyping: EventEmitter;\n\n private emitStopTyping(value: string, validity: ValidityState): void {\n this.isTyping = false;\n this.stopTyping.emit({\n value: value,\n validity: validity,\n });\n }\n\n /** Emitted on checkbox check/uncheck, returns id, checked, type, name, value, validity */\n @Event()\n inputCheck: EventEmitter;\n\n private emitInputCheck(checked: boolean): void {\n this.inputCheck.emit({\n id: this.htmlid,\n checked: checked,\n type: this.type,\n name: this.name,\n value: this.value,\n validity: this.getValidity(\"input\"),\n });\n }\n\n /** Emitted on input focus */\n @Event()\n inputFocus: EventEmitter;\n\n private emitInputFocus(): void {\n this.inputFocus.emit({id: this.htmlid});\n }\n\n /** Emitted on input blur */\n @Event()\n inputBlur: EventEmitter;\n\n private emitInputBlur(): void {\n this.inputBlur.emit({id: this.htmlid});\n }\n\n private getValidity(type: string): ValidityState {\n const input = this.hostElement.querySelector(type) as HTMLInputElement;\n\n return input.validity;\n }\n\n /* START text/password/email/number */\n\n private getTextAttributes(): JSXBase.InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement> {\n return {\n id: this.htmlid,\n name: this.name,\n placeholder: this.placeholder,\n value: this.value,\n disabled: this.disabled,\n readonly: this.readonly,\n required: this.required,\n title: this.htmltitle,\n minlength: this.minlength,\n maxlength: this.maxlength,\n class: {\n [`input-${this.status}`]: !!this.status,\n filled: !!this.value,\n },\n autocomplete: this.autocomplete,\n onInput: (e: InputEvent) => this.emitInputChange((e.target as HTMLInputElement).value),\n };\n }\n\n private getNumberAttributes(type: InputType): JSXBase.InputHTMLAttributes<HTMLInputElement> {\n if (type != InputType.NUMBER) {\n return;\n }\n\n return {\n min: this.min,\n max: this.max,\n step: this.step,\n };\n }\n\n private getPatternAttribute(type: InputType): JSXBase.InputHTMLAttributes<HTMLInputElement> {\n if (\n type != InputType.PASSWORD &&\n type != InputType.TEXT &&\n type != InputType.TEL &&\n type != InputType.SEARCH &&\n type != InputType.URL &&\n type != InputType.EMAIL\n ) {\n return;\n }\n\n return {\n pattern: this.pattern,\n };\n }\n\n private getRoleAttribute(): JSXBase.InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement> {\n return this.role ? {role: this.role} : {};\n }\n\n private getAriaAttrubutes(): Record<string, unknown> {\n const expanded = this.ariaExpanded ? {\"aria-expanded\": this.ariaExpanded} : {};\n const controls = this.ariaControls ? {\"aria-controls\": this.ariaControls} : {};\n const autocomplete = this.ariaAutocomplete ? {\"aria-autocomplete\": this.ariaAutocomplete} : {};\n const activedescendant = this.ariaActivedescendant ? {\"aria-activedescendant\": this.ariaActivedescendant} : {};\n\n return {\n ...expanded,\n ...controls,\n ...autocomplete,\n ...activedescendant,\n };\n }\n\n private getFocusBlurAttributes(): JSXBase.InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement> {\n return {\n onFocus: () => this.emitInputFocus(),\n onBlur: () => this.emitInputBlur(),\n };\n }\n\n private renderInputText(type: InputType = InputType.TEXT): HTMLDivElement {\n const ariaLabel = this.ariaLabel ? {\"aria-label\": this.ariaLabel} : {};\n const attr = {\n ...this.getTextAttributes(),\n ...this.getNumberAttributes(type),\n ...this.getPatternAttribute(type),\n ...ariaLabel,\n ...this.getRoleAttribute(),\n ...this.getAriaAttrubutes(),\n ...this.getFocusBlurAttributes(),\n };\n if (this.icon || type === InputType.PASSWORD) {\n Object.assign(attr.class, {\"has-icon\": true});\n }\n if (this.hasclearicon && type != InputType.NUMBER) {\n Object.assign(attr.class, {\"has-clear-icon\": true});\n }\n\n return (\n <div class=\"text-wrapper\">\n {this.renderLabel()}\n <div>\n <input\n type={type === InputType.PASSWORD && !this.passwordHidden ? InputType.TEXT : type}\n {...attr}\n ref={(el) => (this.inputRef = el)}\n />\n {this.renderIcons()}\n </div>\n {this.renderMessage()}\n </div>\n );\n }\n\n private renderLabel(): HTMLLabelElement {\n if (!this.label) {\n return;\n }\n\n return (\n <label\n class=\"input-label body-5-sb\"\n id={`${this.htmlid}_label`}\n htmlFor={this.htmlid}\n >\n {this.label}\n </label>\n );\n }\n\n private renderIcons(): HTMLSpanElement {\n return (\n <span class=\"icons-wrapper\">\n {this.renderResetIcon()}\n {this.renderIcon()}\n </span>\n );\n }\n\n private renderIcon(): HTMLButtonElement {\n if (this.type === InputType.PASSWORD) {\n return this.renderShowHidePassword();\n }\n\n if (!this.icon) {\n return;\n }\n\n return (\n <button\n type=\"button\"\n class=\"icon-button input-icon\"\n tabIndex={-1}\n aria-hidden=\"true\"\n >\n <z-icon\n name={this.icon}\n class={this.size}\n />\n </button>\n );\n }\n\n private renderResetIcon(): HTMLButtonElement {\n let hidden = false;\n if (!this.hasclearicon || !this.value || this.disabled || this.readonly || this.type == InputType.NUMBER) {\n hidden = true;\n }\n\n return (\n <button\n type=\"button\"\n class={`icon-button reset-icon ${hidden ? \"hidden\" : \"\"}`}\n aria-label=\"cancella il contenuto dell'input\"\n onClick={() => {\n this.inputRef.value = \"\";\n this.emitInputChange(\"\");\n }}\n >\n <z-icon\n name=\"multiply\"\n class={this.size}\n />\n </button>\n );\n }\n\n private renderShowHidePassword(): HTMLButtonElement {\n return (\n <button\n type=\"button\"\n class=\"icon-button toggle-password-icon\"\n disabled={this.disabled}\n aria-label={this.passwordHidden ? \"mostra password\" : \"nascondi password\"}\n onClick={() => (this.passwordHidden = !this.passwordHidden)}\n >\n <z-icon\n name={this.passwordHidden ? \"view-filled\" : \"view-off-filled\"}\n class={this.size}\n />\n </button>\n );\n }\n\n private renderMessage(): HTMLZInputMessageElement {\n if (boolean(this.message) === false) {\n return;\n }\n\n return (\n <z-input-message\n message={boolean(this.message) === true ? undefined : (this.message as string)}\n status={this.status}\n class={this.size}\n />\n );\n }\n\n /* END text/password/email/number */\n\n /* START textarea */\n\n private renderTextarea(): HTMLDivElement {\n const attributes = this.getTextAttributes();\n const ariaLabel = this.ariaLabel ? {\"aria-label\": this.ariaLabel} : {};\n\n return (\n <div class=\"text-wrapper\">\n {this.renderLabel()}\n <div\n class={{\n ...(attributes.class as Record<string, boolean>),\n \"textarea-wrapper\": true,\n \"readonly\": attributes.readonly as boolean,\n }}\n >\n <textarea\n {...attributes}\n {...ariaLabel}\n {...this.getRoleAttribute()}\n ></textarea>\n </div>\n {this.renderMessage()}\n </div>\n );\n }\n\n /* END textarea */\n\n private handleCheck(ev: Event): void {\n this.checked = (ev.target as HTMLInputElement).checked;\n this.emitInputCheck(this.checked);\n }\n\n /* START checkbox */\n private renderCheckbox(): HTMLDivElement {\n return (\n <div class=\"checkbox-wrapper\">\n <input\n id={this.htmlid}\n type=\"checkbox\"\n name={this.name}\n checked={this.checked}\n disabled={this.disabled}\n readonly={this.readonly}\n required={this.required}\n onChange={this.handleCheck.bind(this)}\n value={this.value}\n {...this.getRoleAttribute()}\n {...this.getFocusBlurAttributes()}\n />\n\n <label\n htmlFor={this.htmlid}\n class={{\n \"checkbox-label\": true,\n \"after\": this.labelPosition === LabelPosition.RIGHT,\n \"before\": this.labelPosition === LabelPosition.LEFT,\n }}\n >\n <z-icon\n name={this.checked ? \"checkbox-checked\" : \"checkbox\"}\n aria-hidden=\"true\"\n class={this.size}\n />\n {this.label && <span innerHTML={this.label}></span>}\n </label>\n </div>\n );\n }\n\n /* END checkbox */\n\n /* START radio */\n private renderRadio(): HTMLDivElement {\n return (\n <div class=\"radio-wrapper\">\n <input\n id={this.htmlid}\n type=\"radio\"\n name={this.name}\n checked={this.checked}\n disabled={this.disabled}\n readonly={this.readonly}\n onChange={this.handleCheck.bind(this)}\n value={this.value}\n {...this.getRoleAttribute()}\n {...this.getFocusBlurAttributes()}\n />\n\n <label\n htmlFor={this.htmlid}\n class={{\n \"radio-label\": true,\n \"after\": this.labelPosition === LabelPosition.RIGHT,\n \"before\": this.labelPosition === LabelPosition.LEFT,\n }}\n >\n <z-icon\n name={this.checked ? \"radio-button-checked\" : \"radio-button\"}\n aria-hidden=\"true\"\n class={this.size}\n />\n {this.label && <span innerHTML={this.label} />}\n </label>\n </div>\n );\n }\n /* END radio */\n\n render(): HTMLInputElement | HTMLDivElement {\n let input;\n switch (this.type) {\n case InputType.TEXTAREA:\n input = this.renderTextarea();\n break;\n case InputType.CHECKBOX:\n input = this.renderCheckbox();\n break;\n case InputType.RADIO:\n input = this.renderRadio();\n break;\n default:\n input = this.renderInputText(this.type);\n }\n\n return <Host>{input}</Host>;\n }\n}\n"]}
|
|
@@ -35,6 +35,7 @@ export class ZListElement {
|
|
|
35
35
|
this.listElementPosition = "0";
|
|
36
36
|
this.listType = ListType.NONE;
|
|
37
37
|
this.role = "listitem";
|
|
38
|
+
this.htmlTabindex = 0;
|
|
38
39
|
this.showInnerContent = false;
|
|
39
40
|
this.handleClick = this.handleClick.bind(this);
|
|
40
41
|
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
@@ -114,7 +115,7 @@ export class ZListElement {
|
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
render() {
|
|
117
|
-
return (h(Host, { key: '
|
|
118
|
+
return (h(Host, { key: 'fb33c5abf92ac7e89faea59b46358c847fd7efab', "aria-expanded": this.expandable ? this.showInnerContent : null, onClick: this.handleClick, onFocus: () => this.ariaDescendantFocus.emit(this.listElementId), onKeyDown: this.handleKeyDown, clickable: this.clickable && !this.disabled, tabIndex: this.htmlTabindex }, h("div", { key: '0bd49dca96fcb7ddfb8201ea0f3b6501b633bbbb', class: "container", style: { color: `var(--${this.color})` }, tabindex: "-1", id: `z-list-element-id-${this.listElementId}`, part: "list-item-container" }, h("div", { key: '5a548758092f2062823021a2c0ddd097f0296646', class: "z-list-element-container" }, this.renderExpandableButton(), this.renderContent()), this.renderExpandedContent()), this.dividerType === ListDividerType.ELEMENT && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))));
|
|
118
119
|
}
|
|
119
120
|
static get is() { return "z-list-element"; }
|
|
120
121
|
static get encapsulation() { return "shadow"; }
|
|
@@ -416,6 +417,24 @@ export class ZListElement {
|
|
|
416
417
|
"attribute": "role",
|
|
417
418
|
"reflect": true,
|
|
418
419
|
"defaultValue": "\"listitem\""
|
|
420
|
+
},
|
|
421
|
+
"htmlTabindex": {
|
|
422
|
+
"type": "number",
|
|
423
|
+
"mutable": false,
|
|
424
|
+
"complexType": {
|
|
425
|
+
"original": "number | null",
|
|
426
|
+
"resolved": "number",
|
|
427
|
+
"references": {}
|
|
428
|
+
},
|
|
429
|
+
"required": false,
|
|
430
|
+
"optional": true,
|
|
431
|
+
"docs": {
|
|
432
|
+
"tags": [],
|
|
433
|
+
"text": "set tabindex to Host tag (optional). Defaults to 0."
|
|
434
|
+
},
|
|
435
|
+
"attribute": "html-tabindex",
|
|
436
|
+
"reflect": false,
|
|
437
|
+
"defaultValue": "0"
|
|
419
438
|
}
|
|
420
439
|
};
|
|
421
440
|
}
|