@watermarkinsights/ripple 3.15.0-2 → 3.16.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{chartFunctions-08494c24.js → chartFunctions-f77a6366.js} +11 -10
- package/dist/cjs/{functions-e1b590e0.js → functions-1c5fdef0.js} +48 -0
- package/dist/cjs/{global-0a41410c.js → global-1aa1d96b.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/priv-chart-popover.cjs.entry.js +1 -1
- package/dist/cjs/priv-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/ripple.cjs.js +2 -2
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +1 -1
- package/dist/cjs/wm-button.cjs.entry.js +1 -1
- package/dist/cjs/wm-chart.cjs.entry.js +2 -2
- package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-input.cjs.entry.js +1 -1
- package/dist/cjs/wm-modal-header.cjs.entry.js +1 -1
- package/dist/cjs/wm-modal.cjs.entry.js +1 -1
- package/dist/cjs/wm-navigation_3.cjs.entry.js +1 -1
- package/dist/cjs/wm-navigator.cjs.entry.js +1 -1
- package/dist/cjs/wm-network-uploader.cjs.entry.js +1 -1
- package/dist/cjs/wm-option_2.cjs.entry.js +1 -1
- package/dist/cjs/wm-pagination.cjs.entry.js +1 -1
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-search.cjs.entry.js +1 -1
- package/dist/cjs/wm-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +1 -1
- package/dist/cjs/wm-tag-input-row.cjs.entry.js +19 -0
- package/dist/cjs/wm-tag-input.cjs.entry.js +305 -62
- package/dist/cjs/wm-timepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-toggletip.cjs.entry.js +1 -1
- package/dist/cjs/wm-uploader.cjs.entry.js +3 -46
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/wm-tag-input/wm-tag-input-row/wm-tag-input-row.js +115 -0
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +133 -13
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +403 -72
- package/dist/collection/components/wm-uploader/wm-uploader.js +3 -46
- package/dist/collection/global/chartFunctions.js +10 -9
- package/dist/collection/global/functions.js +45 -0
- package/dist/esm/{chartFunctions-a310b9d0.js → chartFunctions-0883598c.js} +11 -10
- package/dist/esm/{functions-b4b62a23.js → functions-d39bf1c4.js} +46 -1
- package/dist/esm/{global-e80a0ec8.js → global-93944c59.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/priv-chart-popover.entry.js +1 -1
- package/dist/esm/priv-datepicker.entry.js +1 -1
- package/dist/esm/ripple.js +2 -2
- package/dist/esm/wm-action-menu_2.entry.js +1 -1
- package/dist/esm/wm-button.entry.js +1 -1
- package/dist/esm/wm-chart.entry.js +2 -2
- package/dist/esm/wm-datepicker.entry.js +1 -1
- package/dist/esm/wm-input.entry.js +1 -1
- package/dist/esm/wm-modal-header.entry.js +1 -1
- package/dist/esm/wm-modal.entry.js +1 -1
- package/dist/esm/wm-navigation_3.entry.js +1 -1
- package/dist/esm/wm-navigator.entry.js +1 -1
- package/dist/esm/wm-network-uploader.entry.js +1 -1
- package/dist/esm/wm-option_2.entry.js +1 -1
- package/dist/esm/wm-pagination.entry.js +1 -1
- package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
- package/dist/esm/wm-search.entry.js +1 -1
- package/dist/esm/wm-snackbar.entry.js +1 -1
- package/dist/esm/wm-tab-item_3.entry.js +1 -1
- package/dist/esm/wm-tag-input-row.entry.js +15 -0
- package/dist/esm/wm-tag-input.entry.js +306 -63
- package/dist/esm/wm-timepicker.entry.js +1 -1
- package/dist/esm/wm-toggletip.entry.js +1 -1
- package/dist/esm/wm-uploader.entry.js +3 -46
- package/dist/esm-es5/chartFunctions-0883598c.js +1 -0
- package/dist/esm-es5/{functions-b4b62a23.js → functions-d39bf1c4.js} +1 -1
- package/dist/esm-es5/{global-e80a0ec8.js → global-93944c59.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-datepicker.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-modal-header.entry.js +1 -1
- package/dist/esm-es5/wm-modal.entry.js +1 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-network-uploader.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-pagination.entry.js +1 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input-row.entry.js +1 -0
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/ripple/{p-93321f18.system.entry.js → p-078141c4.system.entry.js} +1 -1
- package/dist/ripple/{p-617b738b.system.entry.js → p-1456d52f.system.entry.js} +1 -1
- package/dist/ripple/{p-7a07096b.system.entry.js → p-171b3c6c.system.entry.js} +1 -1
- package/dist/ripple/{p-7833008a.entry.js → p-1abe7a88.entry.js} +1 -1
- package/dist/ripple/{p-477688c8.entry.js → p-1cc8fd4b.entry.js} +1 -1
- package/dist/ripple/{p-0f08a806.system.entry.js → p-222d670b.system.entry.js} +1 -1
- package/dist/ripple/{p-d3326191.entry.js → p-27060507.entry.js} +1 -1
- package/dist/ripple/p-32ba6ca4.system.entry.js +1 -0
- package/dist/ripple/{p-b5a6aebc.entry.js → p-35c05d11.entry.js} +1 -1
- package/dist/ripple/{p-3a71d9a3.entry.js → p-38414137.entry.js} +1 -1
- package/dist/ripple/p-3ae9cb55.system.entry.js +1 -0
- package/dist/ripple/{p-9caf189d.system.entry.js → p-3fe2023e.system.entry.js} +1 -1
- package/dist/ripple/p-40c8e2f2.entry.js +1 -0
- package/dist/ripple/{p-9ef524df.system.entry.js → p-4275d767.system.entry.js} +1 -1
- package/dist/ripple/{p-990db03b.system.entry.js → p-4405cdb4.system.entry.js} +1 -1
- package/dist/ripple/{p-9fd29197.system.entry.js → p-49bda38c.system.entry.js} +1 -1
- package/dist/ripple/p-4b8f71c9.entry.js +1 -0
- package/dist/ripple/{p-6d7a6954.js → p-4ca088ef.js} +1 -1
- package/dist/ripple/p-4edfdcf4.entry.js +1 -0
- package/dist/ripple/{p-32da7cdf.entry.js → p-4f8767df.entry.js} +1 -1
- package/dist/ripple/p-50f5c187.system.entry.js +1 -0
- package/dist/ripple/{p-96b47a13.js → p-5435b11d.js} +1 -1
- package/dist/ripple/{p-61e2a39a.system.entry.js → p-59593d4a.system.entry.js} +1 -1
- package/dist/ripple/{p-981788dd.system.entry.js → p-5fb85304.system.entry.js} +1 -1
- package/dist/ripple/{p-73a66a6c.entry.js → p-78c5b0ee.entry.js} +1 -1
- package/dist/ripple/p-80046dc1.entry.js +1 -0
- package/dist/ripple/{p-719864a5.system.entry.js → p-80fdafba.system.entry.js} +1 -1
- package/dist/ripple/{p-1ba2134b.system.entry.js → p-8ab3a80b.system.entry.js} +1 -1
- package/dist/ripple/{p-a2f8608f.system.entry.js → p-8d2dfe15.system.entry.js} +1 -1
- package/dist/ripple/{p-6ddfada6.entry.js → p-91c90e0e.entry.js} +1 -1
- package/dist/ripple/{p-428b8b24.entry.js → p-92d93fc5.entry.js} +1 -1
- package/dist/ripple/{p-4be49461.system.entry.js → p-96b03f2d.system.entry.js} +1 -1
- package/dist/ripple/{p-eb308bc7.js → p-9f81517c.js} +1 -1
- package/dist/ripple/{p-9ad7db55.entry.js → p-a4e8e1b5.entry.js} +1 -1
- package/dist/ripple/p-c5d594c4.entry.js +1 -0
- package/dist/ripple/{p-c95317b4.system.entry.js → p-c7ceb8b2.system.entry.js} +1 -1
- package/dist/ripple/{p-79542ae3.system.entry.js → p-c8eb6f95.system.entry.js} +1 -1
- package/dist/ripple/{p-c5a3766f.entry.js → p-c98dcd45.entry.js} +1 -1
- package/dist/ripple/p-c9f09fea.system.js +1 -0
- package/dist/ripple/{p-ab7ce269.system.entry.js → p-cbeb1cc5.system.entry.js} +1 -1
- package/dist/ripple/{p-2531b343.system.entry.js → p-cfbdcbba.system.entry.js} +1 -1
- package/dist/ripple/{p-fcb81a4e.entry.js → p-d187e19a.entry.js} +1 -1
- package/dist/ripple/{p-99791f7a.system.js → p-d1c34819.system.js} +1 -1
- package/dist/ripple/{p-79b8e996.entry.js → p-d2fcd64d.entry.js} +1 -1
- package/dist/ripple/{p-75346877.entry.js → p-d6db9e72.entry.js} +1 -1
- package/dist/ripple/{p-65d5f494.entry.js → p-dc382256.entry.js} +1 -1
- package/dist/ripple/{p-aa35c9dd.system.entry.js → p-df7ff551.system.entry.js} +1 -1
- package/dist/ripple/{p-51b60241.system.entry.js → p-e106957e.system.entry.js} +1 -1
- package/dist/ripple/p-e5a2eabe.system.js +1 -0
- package/dist/ripple/{p-1cadcfc1.entry.js → p-e906e855.entry.js} +1 -1
- package/dist/ripple/{p-6ac734b7.entry.js → p-e9c3d4c8.entry.js} +1 -1
- package/dist/ripple/p-eb19ef4c.system.js +1 -0
- package/dist/ripple/{p-1c75615f.entry.js → p-eb549326.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/wm-tag-input/wm-tag-input-row/wm-tag-input-row.d.ts +11 -0
- package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +34 -3
- package/dist/types/components/wm-uploader/wm-uploader.d.ts +0 -4
- package/dist/types/components.d.ts +32 -0
- package/dist/types/global/functions.d.ts +4 -0
- package/package.json +1 -1
- package/dist/esm-es5/chartFunctions-a310b9d0.js +0 -1
- package/dist/ripple/p-375a850f.system.js +0 -1
- package/dist/ripple/p-5754e2b8.system.js +0 -1
- package/dist/ripple/p-591fae61.system.js +0 -1
- package/dist/ripple/p-5f589556.entry.js +0 -1
- package/dist/ripple/p-b6c197c7.system.entry.js +0 -1
- package/dist/ripple/p-ce696630.entry.js +0 -1
- package/dist/ripple/p-e47b10b1.system.entry.js +0 -1
- package/dist/ripple/p-f5cec3d1.entry.js +0 -1
- package/dist/ripple/p-f7c2b508.entry.js +0 -1
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-df6a3611.js');
|
|
6
|
-
const functions = require('./functions-
|
|
6
|
+
const functions = require('./functions-1c5fdef0.js');
|
|
7
7
|
|
|
8
|
-
const wmTagInputCss = ":host,wm-tag-input{font-family:inherit;width:100%}:host *,wm-tag-input *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}:host .wrapper,wm-tag-input .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label,wm-tag-input .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required,wm-tag-input .wrapper .label .required{color:#c0392b}:host .wrapper.label-left,wm-tag-input .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper,wm-tag-input .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label,wm-tag-input .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label,wm-tag-input .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label,wm-tag-input .wrapper.invalid .label{color:#c0392b}:host .wrapper.invalid .label:after,wm-tag-input .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f026\";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after,[dir=RTL] wm-tag-input .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label,wm-tag-input .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper,wm-tag-input .wrapper{width:100%;position:relative}:host .field-wrapper,wm-tag-input .field-wrapper{position:relative;width:100%;min-height:2.5rem;border:1px solid #4a4a4a;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused,wm-tag-input .field-wrapper.focused{-webkit-box-shadow:0 0 0 1px #20cbd4;-moz-box-shadow:0 0 0 1px #20cbd4;box-shadow:0 0 0 1px #20cbd4;outline:none;border-color:#20cbd4}:host .character-count,wm-tag-input .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:rgba(74, 74, 74, 0.05);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper,wm-tag-input .tags-and-input-wrapper{position:relative;width:100%;padding:0.5rem 0.25rem;margin-bottom:-0.5rem}:host .upper-row,wm-tag-input .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .lower-row,wm-tag-input .lower-row{width:100%;border-radius:0 0 3px 3px}:host #max-tags,wm-tag-input #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:1.875rem;background-color:#6b6b6b;padding:0.5rem 1rem;color:white;font-size:0.875rem}:host .tag-area,wm-tag-input .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0;padding:0}:host .tag-area:focus,wm-tag-input .tag-area:focus{outline:none}:host .tag-area [role=option],wm-tag-input .tag-area [role=option]{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:#4a4a4a;background-color:rgba(3, 0, 0, 0.1);padding:0.5rem 0.625rem;margin-bottom:0.5rem;margin-right:0.25rem;margin-left:0.25rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area [role=option].highlight,wm-tag-input .tag-area [role=option].highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:rgba(3, 0, 0, 0.1)}50%{background-color:#c8dfcc}100%{background-color:rgba(3, 0, 0, 0.1)}}@keyframes fadeIn{0%{background-color:rgba(3, 0, 0, 0.1)}50%{background-color:#c8dfcc}100%{background-color:rgba(3, 0, 0, 0.1)}}:host .tag-area [role=option].focused,wm-tag-input .tag-area [role=option].focused{background-color:#d1d1d1}:host .tag-area [role=option] .remove-btn,wm-tag-input .tag-area [role=option] .remove-btn{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;border:1px solid #575195;color:#575195;border-radius:50%;padding:0;margin-left:0.5rem;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1)}:host .tag-area [role=option] .remove-btn:hover,wm-tag-input .tag-area [role=option] .remove-btn:hover{color:white;background-color:#575195}:host .tag-area [role=option] .remove-btn:before,wm-tag-input .tag-area [role=option] .remove-btn:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f156\"}:host input,wm-tag-input input{font-family:inherit;border:none;height:1.75rem;padding:0;margin-bottom:0.5rem;margin-right:0.25rem;padding-left:0.5rem;right:0px}:host input.hidden,wm-tag-input input.hidden{display:none}:host input:focus,wm-tag-input input:focus{outline:none}:host .dropdown-wrapper,wm-tag-input .dropdown-wrapper{margin:0;padding:0;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:calc(100% + 2px);right:0;background:#fff;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown,wm-tag-input .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open,wm-tag-input .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards,wm-tag-input .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div,wm-tag-input .dropdown-wrapper li,wm-tag-input .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:#fff;list-style:none;height:2.6875rem;white-space:pre}:host .dropdown-wrapper li[role=option],:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div[role=option],:host .dropdown-wrapper div.add-new-btn,wm-tag-input .dropdown-wrapper li[role=option],wm-tag-input .dropdown-wrapper li.add-new-btn,wm-tag-input .dropdown-wrapper div[role=option],wm-tag-input .dropdown-wrapper div.add-new-btn{cursor:pointer;color:#575195;font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li[role=option][aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div[role=option][aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true],wm-tag-input .dropdown-wrapper li[role=option][aria-selected=true],wm-tag-input .dropdown-wrapper li.add-new-btn[aria-selected=true],wm-tag-input .dropdown-wrapper div[role=option][aria-selected=true],wm-tag-input .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:#6b6b6b;font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li[role=option]:hover:not([aria-selected=true]),:host .dropdown-wrapper li[role=option].focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div[role=option]:hover:not([aria-selected=true]),:host .dropdown-wrapper div[role=option].focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused,wm-tag-input .dropdown-wrapper li[role=option]:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper li[role=option].focused,wm-tag-input .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper li.add-new-btn.focused,wm-tag-input .dropdown-wrapper div[role=option]:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper div[role=option].focused,wm-tag-input .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper div.add-new-btn.focused{outline:none;background:#f4f4f4}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text,wm-tag-input .dropdown-wrapper li.help-text,wm-tag-input .dropdown-wrapper div.help-text{color:#4a4a4a;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child),wm-tag-input .dropdown-wrapper li:not(:last-child),wm-tag-input .dropdown-wrapper div:not(:last-child){border-bottom:2px solid rgba(46, 27, 70, 0.05)}:host .info-text,wm-tag-input .info-text{font-style:italic;margin-top:0.25rem}:host .sr-only,wm-tag-input .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}";
|
|
8
|
+
const wmTagInputCss = ":host,wm-tag-input{font-family:inherit;width:100%}:host *,wm-tag-input *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}:host .wrapper,wm-tag-input .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label,wm-tag-input .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required,wm-tag-input .wrapper .label .required{color:#c0392b}:host .wrapper.label-left,wm-tag-input .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper,wm-tag-input .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label,wm-tag-input .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label,wm-tag-input .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label,wm-tag-input .wrapper.invalid .label{color:#c0392b}:host .wrapper.invalid .label:after,wm-tag-input .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f026\";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after,[dir=RTL] wm-tag-input .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label,wm-tag-input .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper,wm-tag-input .wrapper{width:100%;position:relative}:host .field-wrapper,wm-tag-input .field-wrapper{position:relative;width:100%;min-height:2.5rem;border:1px solid #4a4a4a;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused,wm-tag-input .field-wrapper.focused{-webkit-box-shadow:0 0 0 1px #20cbd4;-moz-box-shadow:0 0 0 1px #20cbd4;box-shadow:0 0 0 1px #20cbd4;outline:none;border-color:#20cbd4}:host .character-count,wm-tag-input .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:rgba(74, 74, 74, 0.05);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper,wm-tag-input .tags-and-input-wrapper{position:relative;width:100%;padding:0.5rem 0.25rem 0.5rem 0;margin-bottom:-0.5rem}:host .upper-row,wm-tag-input .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between}:host .upper-row:before,wm-tag-input .upper-row:before{-ms-flex-item-align:start;align-self:flex-start;display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f349\";color:#b5b5b5;padding:0.75rem 0.5rem 0.75rem 0.75rem}:host .lower-row,wm-tag-input .lower-row{width:100%}:host #max-tags,wm-tag-input #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:1.875rem;background-color:#e6e6e6;padding:0.5rem 1rem;color:#4a4a4a;font-size:0.875rem;border-top:1px solid rgba(35, 35, 35, 0.6);border-radius:0 0 3px 3px}:host .tag-area,wm-tag-input .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0;padding:0}:host .tag-area:focus,wm-tag-input .tag-area:focus{outline:none}:host .tag-area [role=option],wm-tag-input .tag-area [role=option]{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:#4a4a4a;background-color:rgba(3, 0, 0, 0.1);padding:0.5rem 0.625rem;margin-bottom:0.5rem;margin-right:0.25rem;margin-left:0.25rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area [role=option].highlight,wm-tag-input .tag-area [role=option].highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:rgba(3, 0, 0, 0.1)}50%{background-color:#c8dfcc}100%{background-color:rgba(3, 0, 0, 0.1)}}@keyframes fadeIn{0%{background-color:rgba(3, 0, 0, 0.1)}50%{background-color:#c8dfcc}100%{background-color:rgba(3, 0, 0, 0.1)}}:host .tag-area [role=option].focused,wm-tag-input .tag-area [role=option].focused{background-color:#d1d1d1}:host .tag-area [role=option].locked,wm-tag-input .tag-area [role=option].locked{background-color:#6b6b6b;color:white}:host .tag-area [role=option] .icon,wm-tag-input .tag-area [role=option] .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;padding:0;margin-left:0.5rem}:host .tag-area [role=option] .icon.remove-btn,wm-tag-input .tag-area [role=option] .icon.remove-btn{border:1px solid #575195;color:#575195;border-radius:50%;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1)}:host .tag-area [role=option] .icon.remove-btn:hover,wm-tag-input .tag-area [role=option] .icon.remove-btn:hover{color:white;background-color:#575195}:host .tag-area [role=option] .icon.remove-btn:before,wm-tag-input .tag-area [role=option] .icon.remove-btn:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f156\"}:host .tag-area [role=option] .icon.lock,wm-tag-input .tag-area [role=option] .icon.lock{color:white}:host .tag-area [role=option] .icon.lock:before,wm-tag-input .tag-area [role=option] .icon.lock:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f341\"}:host input,wm-tag-input input{font-family:inherit;border:none;height:1.75rem;padding:0;margin-bottom:0.5rem;margin-right:0.25rem;padding-left:0.5rem;right:0px}:host input.hidden,wm-tag-input input.hidden{display:none}:host input:focus,wm-tag-input input:focus{outline:none}:host .dropdown-wrapper,wm-tag-input .dropdown-wrapper{margin:0;padding:0;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:calc(100% + 2px);right:0;background:#fff;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown,wm-tag-input .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open,wm-tag-input .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards,wm-tag-input .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div,wm-tag-input .dropdown-wrapper li,wm-tag-input .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:#fff;list-style:none;height:2.6875rem;white-space:pre}:host .dropdown-wrapper li[role=option],:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div[role=option],:host .dropdown-wrapper div.add-new-btn,wm-tag-input .dropdown-wrapper li[role=option],wm-tag-input .dropdown-wrapper li.add-new-btn,wm-tag-input .dropdown-wrapper div[role=option],wm-tag-input .dropdown-wrapper div.add-new-btn{cursor:pointer;color:#575195;font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li[role=option][aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div[role=option][aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true],wm-tag-input .dropdown-wrapper li[role=option][aria-selected=true],wm-tag-input .dropdown-wrapper li.add-new-btn[aria-selected=true],wm-tag-input .dropdown-wrapper div[role=option][aria-selected=true],wm-tag-input .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:#6b6b6b;font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li[role=option]:hover:not([aria-selected=true]),:host .dropdown-wrapper li[role=option].focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div[role=option]:hover:not([aria-selected=true]),:host .dropdown-wrapper div[role=option].focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused,wm-tag-input .dropdown-wrapper li[role=option]:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper li[role=option].focused,wm-tag-input .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper li.add-new-btn.focused,wm-tag-input .dropdown-wrapper div[role=option]:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper div[role=option].focused,wm-tag-input .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),wm-tag-input .dropdown-wrapper div.add-new-btn.focused{outline:none;background:#f4f4f4}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text,wm-tag-input .dropdown-wrapper li.help-text,wm-tag-input .dropdown-wrapper div.help-text{color:#4a4a4a;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem;white-space:normal}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child),wm-tag-input .dropdown-wrapper li:not(:last-child),wm-tag-input .dropdown-wrapper div:not(:last-child){border-bottom:2px solid rgba(46, 27, 70, 0.05)}:host .info-text,wm-tag-input .info-text{font-style:italic;margin-top:0.25rem}:host .table-wrapper,wm-tag-input .table-wrapper{max-height:17.5rem;overflow:auto;margin-top:1.5rem}:host .table-wrapper #table,wm-tag-input .table-wrapper #table{width:100%;border-spacing:0px}:host .table-wrapper #table.fixed-widths,wm-tag-input .table-wrapper #table.fixed-widths{table-layout:fixed}:host .table-wrapper #table .headers,wm-tag-input .table-wrapper #table .headers{height:2.5rem;background-color:#eeedf4}:host .table-wrapper #table .headers th,wm-tag-input .table-wrapper #table .headers th{text-align:left;font-size:0.75rem;font-weight:700;text-transform:uppercase;padding:0 1.5rem}:host .table-wrapper tr.locked td:first-child:before,wm-tag-input .table-wrapper tr.locked td:first-child:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f33e\";margin-right:0.5rem;color:#4a4a4a}:host .table-wrapper tr:nth-child(even),wm-tag-input .table-wrapper tr:nth-child(even){background-color:#fafafa}:host .table-wrapper tr.selected,wm-tag-input .table-wrapper tr.selected{background-color:rgba(25, 161, 169, 0.2);-webkit-box-shadow:inset 0 0 0 1px #19a1a9;box-shadow:inset 0 0 0 1px #19a1a9;font-weight:500}:host .table-wrapper tr.focused,:host .table-wrapper tr:hover,wm-tag-input .table-wrapper tr.focused,wm-tag-input .table-wrapper tr:hover{background-color:#e9e7ec;-webkit-box-shadow:none;box-shadow:none}:host .table-wrapper td,wm-tag-input .table-wrapper td{height:3.75rem;vertical-align:middle;padding:0 1.5rem;cursor:pointer}:host .table-wrapper td.trunc,wm-tag-input .table-wrapper td.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .table-wrapper td.focused,wm-tag-input .table-wrapper td.focused{-webkit-box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px #61279e;box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px #61279e}:host .table-wrapper td .description,wm-tag-input .table-wrapper td .description{display:none}:host .no-results,wm-tag-input .no-results{padding:1.25rem 1.5rem}:host .sr-only,wm-tag-input .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}";
|
|
9
9
|
|
|
10
10
|
const TagInput = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -16,11 +16,14 @@ const TagInput = class {
|
|
|
16
16
|
this.selectedTags = ""; // csv
|
|
17
17
|
this.addNew = true;
|
|
18
18
|
this.characterLimit = 50;
|
|
19
|
+
this.tagInputType = "dropdown";
|
|
19
20
|
this.uid = this.el.id ? this.el.id : functions.generateId();
|
|
20
21
|
this.openUp = false;
|
|
22
|
+
this.tooltipVisible = false;
|
|
23
|
+
this.tablePosition = { row: 0, column: 1 };
|
|
21
24
|
this.isExpanded = false;
|
|
22
|
-
this.tagsList =
|
|
23
|
-
this.optionsList =
|
|
25
|
+
this.tagsList = functions.csvToArray(this.selectedTags);
|
|
26
|
+
this.optionsList = functions.csvToArray(this.options);
|
|
24
27
|
this.charCount = 0;
|
|
25
28
|
this.liveRegionMessage = "";
|
|
26
29
|
this.tagAreaInstructions = functions.intl.formatMessage({
|
|
@@ -47,6 +50,25 @@ const TagInput = class {
|
|
|
47
50
|
get optionEls() {
|
|
48
51
|
return Array.from(this.dropdownEl.querySelectorAll(".option"));
|
|
49
52
|
}
|
|
53
|
+
get wmRowEls() {
|
|
54
|
+
return Array.from(this.el.querySelectorAll("wm-tag-input-row"));
|
|
55
|
+
}
|
|
56
|
+
get localRowEls() {
|
|
57
|
+
return Array.from(this.el.shadowRoot.querySelectorAll("tr"));
|
|
58
|
+
}
|
|
59
|
+
get filteredRows() {
|
|
60
|
+
return this.wmRowEls.filter((row) => {
|
|
61
|
+
const colValues = [row.col1, row.col2, row.col3, row.col4].join("").toLowerCase();
|
|
62
|
+
return this.inputEl && this.inputEl.value.toLowerCase() ? colValues.includes(this.inputEl.value) : true;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
get noResultsMessage() {
|
|
66
|
+
return functions.intl.formatMessage({
|
|
67
|
+
id: "tagInput.noResults",
|
|
68
|
+
defaultMessage: "No results match your search.",
|
|
69
|
+
description: "Message displayed when a user's search returns empty.",
|
|
70
|
+
});
|
|
71
|
+
}
|
|
50
72
|
generateTagAddedMessage(tag) {
|
|
51
73
|
return functions.intl.formatMessage({
|
|
52
74
|
id: "tagInput.tagAdded",
|
|
@@ -109,7 +131,7 @@ const TagInput = class {
|
|
|
109
131
|
this.options += `${this.options.length > 0 ? "," : ""}${tag}`;
|
|
110
132
|
}
|
|
111
133
|
});
|
|
112
|
-
this.optionsList =
|
|
134
|
+
this.optionsList = functions.csvToArray(this.options);
|
|
113
135
|
}
|
|
114
136
|
createPlaceholderDefault(addNew, hasOptions) {
|
|
115
137
|
const addAndSearchPlaceholder = functions.intl.formatMessage({
|
|
@@ -143,12 +165,25 @@ const TagInput = class {
|
|
|
143
165
|
this.selectedTags = this.listToCSV(this.tagsList);
|
|
144
166
|
this.wmTagInputChanged.emit({ value: this.tagsList });
|
|
145
167
|
}
|
|
168
|
+
handleRowUpdate() {
|
|
169
|
+
index.forceUpdate(this.el);
|
|
170
|
+
}
|
|
146
171
|
closeIfNotElOrChild(ev) {
|
|
147
172
|
const isntElOrChild = ev.target !== this.el && !this.el.shadowRoot.contains(ev.target);
|
|
148
|
-
if (isntElOrChild && this.isExpanded) {
|
|
173
|
+
if (this.tagInputType === "dropdown" && isntElOrChild && this.isExpanded) {
|
|
149
174
|
this.closeDropdown();
|
|
150
175
|
}
|
|
151
176
|
}
|
|
177
|
+
// From wm-button
|
|
178
|
+
// we need to listen for scroll events during the capture phase because they do not bubble up
|
|
179
|
+
// there can be layouts where the main content has 100vh and overflows
|
|
180
|
+
// in these cases window will register no scroll events unless we catch on they way down
|
|
181
|
+
dismissTooltip() {
|
|
182
|
+
if (this.tooltipVisible) {
|
|
183
|
+
functions.hideTooltip();
|
|
184
|
+
this.tooltipVisible = false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
152
187
|
handleResize() {
|
|
153
188
|
this.debouncedResize();
|
|
154
189
|
}
|
|
@@ -162,7 +197,7 @@ const TagInput = class {
|
|
|
162
197
|
case "Enter":
|
|
163
198
|
case ",":
|
|
164
199
|
ev.preventDefault();
|
|
165
|
-
this.
|
|
200
|
+
this.handleInputEnter();
|
|
166
201
|
break;
|
|
167
202
|
case "ArrowDown":
|
|
168
203
|
ev.preventDefault();
|
|
@@ -172,8 +207,20 @@ const TagInput = class {
|
|
|
172
207
|
ev.preventDefault();
|
|
173
208
|
this.handleInputArrowUp();
|
|
174
209
|
break;
|
|
210
|
+
case "ArrowLeft":
|
|
211
|
+
ev.preventDefault();
|
|
212
|
+
if (this.tagInputType === "table" && this.tablePosition.row) {
|
|
213
|
+
this.moveLeftCell();
|
|
214
|
+
}
|
|
215
|
+
break;
|
|
216
|
+
case "ArrowRight":
|
|
217
|
+
ev.preventDefault();
|
|
218
|
+
if (this.tagInputType === "table" && this.tablePosition.row) {
|
|
219
|
+
this.moveRightCell();
|
|
220
|
+
}
|
|
221
|
+
break;
|
|
175
222
|
case "Escape":
|
|
176
|
-
if (this.isExpanded) {
|
|
223
|
+
if (this.tagInputType === "dropdown" && this.isExpanded) {
|
|
177
224
|
this.closeDropdown();
|
|
178
225
|
}
|
|
179
226
|
break;
|
|
@@ -183,41 +230,71 @@ const TagInput = class {
|
|
|
183
230
|
break;
|
|
184
231
|
}
|
|
185
232
|
}
|
|
233
|
+
handleInputFocus() {
|
|
234
|
+
if (this.tagInputType === "dropdown") {
|
|
235
|
+
this.openDropdown();
|
|
236
|
+
this.clearListItemFocus();
|
|
237
|
+
}
|
|
238
|
+
// force update needed to apply styled state of field-wrapper el
|
|
239
|
+
index.forceUpdate(this.el);
|
|
240
|
+
}
|
|
186
241
|
handleInputChanged(value) {
|
|
187
242
|
this.charCount = value.length;
|
|
188
|
-
if (this.
|
|
189
|
-
this.
|
|
243
|
+
if (this.tagInputType === "dropdown") {
|
|
244
|
+
this.clearListItemFocus();
|
|
245
|
+
if (this.charCount >= this.characterLimit - 5) {
|
|
246
|
+
this.announceCharacterLimitWarning(this.charCount, this.characterLimit);
|
|
247
|
+
}
|
|
248
|
+
if (!this.isExpanded) {
|
|
249
|
+
this.openDropdown();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
else if (this.tagInputType === "table") {
|
|
253
|
+
this.clearCellFocus();
|
|
254
|
+
this.tablePosition = { row: 0, column: 1 };
|
|
190
255
|
}
|
|
191
256
|
this.announceExistingOptions();
|
|
192
|
-
|
|
193
|
-
|
|
257
|
+
}
|
|
258
|
+
handleInputEnter() {
|
|
259
|
+
if (this.tagInputType === "dropdown") {
|
|
260
|
+
if (this.focusedListItem) {
|
|
261
|
+
this.handleListItemClick(this.focusedListItem);
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
this.submitInput(this.addNew, this.inputEl.value.trim());
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
else if (this.tagInputType === "table" && this.tablePosition.row > 0) {
|
|
268
|
+
this.handleTableRowClick(this.localRowEls[this.tablePosition.row].id);
|
|
194
269
|
}
|
|
195
270
|
}
|
|
196
271
|
submitInput(canAddNew, value) {
|
|
197
272
|
const hasNonWhiteSpaceCharacters = value.match(/\S/);
|
|
198
273
|
if (canAddNew && hasNonWhiteSpaceCharacters) {
|
|
199
|
-
this.
|
|
274
|
+
this.addTag(value);
|
|
200
275
|
this.optionsList = this.addOption(value);
|
|
201
276
|
this.resetInput();
|
|
202
|
-
// if maxTags has been reached, focus should go to the tagArea instead of the input
|
|
203
|
-
if (this.maxTags && this.tagsList.length >= this.maxTags) {
|
|
204
|
-
this.tagAreaEl.focus();
|
|
205
|
-
}
|
|
206
277
|
}
|
|
207
278
|
}
|
|
208
279
|
handleInputArrowDown() {
|
|
209
|
-
if (this.
|
|
280
|
+
if (this.tagInputType === "table") {
|
|
281
|
+
this.moveDownRow();
|
|
282
|
+
}
|
|
283
|
+
else if (this.tagInputType === "dropdown" && this.isExpanded) {
|
|
210
284
|
this.moveDownListItem();
|
|
211
285
|
}
|
|
212
|
-
else {
|
|
286
|
+
else if (this.tagInputType === "dropdown") {
|
|
213
287
|
this.openDropdown();
|
|
214
288
|
}
|
|
215
289
|
}
|
|
216
290
|
handleInputArrowUp() {
|
|
217
|
-
if (this.
|
|
291
|
+
if (this.tagInputType === "table") {
|
|
292
|
+
this.moveUpRow();
|
|
293
|
+
}
|
|
294
|
+
else if (this.tagInputType === "dropdown" && this.isExpanded) {
|
|
218
295
|
this.moveUpListItem();
|
|
219
296
|
}
|
|
220
|
-
else {
|
|
297
|
+
else if (this.tagInputType === "dropdown") {
|
|
221
298
|
this.openDropdown();
|
|
222
299
|
}
|
|
223
300
|
}
|
|
@@ -251,27 +328,37 @@ const TagInput = class {
|
|
|
251
328
|
if (this.focusedElement !== this.inputEl) {
|
|
252
329
|
this.inputEl.focus();
|
|
253
330
|
}
|
|
254
|
-
else {
|
|
331
|
+
else if (this.tagInputType === "dropdown") {
|
|
255
332
|
this.closeDropdown();
|
|
256
333
|
}
|
|
257
334
|
break;
|
|
258
335
|
}
|
|
259
336
|
}
|
|
260
|
-
handleListItemClick(
|
|
261
|
-
const
|
|
262
|
-
const tag = typedEvTarget.dataset.option.trim() || "";
|
|
337
|
+
handleListItemClick(item) {
|
|
338
|
+
const tag = item.dataset.option.trim() || "";
|
|
263
339
|
if (this.includesCaseInsensitive(this.tagsList, tag)) {
|
|
264
340
|
this.announce(this.generateTagAlreadyAddedMessage(tag));
|
|
265
341
|
}
|
|
266
342
|
else {
|
|
267
343
|
this.announce(this.generateTagAddedMessage(tag));
|
|
268
344
|
this.resetInput();
|
|
269
|
-
this.
|
|
345
|
+
this.addTag(tag);
|
|
270
346
|
this.optionsList = this.addOption(tag);
|
|
271
347
|
this.focusedListItem = null;
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
handleTableRowClick(rowId) {
|
|
351
|
+
const referencedRow = this.el.querySelector(`#${rowId}`);
|
|
352
|
+
const tagText = referencedRow.col1;
|
|
353
|
+
const isLocked = referencedRow.locked;
|
|
354
|
+
if (!isLocked) {
|
|
355
|
+
if (this.includesCaseInsensitive(this.tagsList, rowId)) {
|
|
356
|
+
this.removeTag(rowId);
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
this.announce(this.generateTagAddedMessage(tagText));
|
|
360
|
+
this.addTag(rowId);
|
|
361
|
+
}
|
|
275
362
|
}
|
|
276
363
|
}
|
|
277
364
|
handleTagAreaKeyDown(ev) {
|
|
@@ -293,7 +380,8 @@ const TagInput = class {
|
|
|
293
380
|
}
|
|
294
381
|
}
|
|
295
382
|
handleTagAreaDelete() {
|
|
296
|
-
|
|
383
|
+
const isLocked = this.focusedTag && this.focusedTag.classList.contains("locked");
|
|
384
|
+
if (this.focusedTag && this.focusedTag.dataset.tag && !isLocked) {
|
|
297
385
|
this.removeTag(this.focusedTag.dataset.tag);
|
|
298
386
|
if (this.tagsList.length === 0) {
|
|
299
387
|
// focus input if no tags are left
|
|
@@ -308,13 +396,29 @@ const TagInput = class {
|
|
|
308
396
|
}
|
|
309
397
|
handleBlur(ev, component) {
|
|
310
398
|
const isntElOrChild = ev.relatedTarget !== component && !this.el.shadowRoot.contains(ev.relatedTarget);
|
|
399
|
+
this.dismissTooltip();
|
|
400
|
+
this.tablePosition = { row: 0, column: 1 };
|
|
401
|
+
this.clearCellFocus();
|
|
311
402
|
if (isntElOrChild) {
|
|
312
|
-
this.closeDropdown();
|
|
313
403
|
this.fieldWrapperEl.classList.remove("focused");
|
|
404
|
+
if (this.tagInputType === "dropdown") {
|
|
405
|
+
this.closeDropdown();
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
handleCellMouseEnter(ev) {
|
|
410
|
+
const cell = ev.target;
|
|
411
|
+
const isTruncated = cell.scrollWidth > cell.clientWidth;
|
|
412
|
+
if (isTruncated) {
|
|
413
|
+
// innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
|
|
414
|
+
functions.showTooltip("bottom", cell, cell.innerText);
|
|
415
|
+
this.tooltipVisible = true;
|
|
314
416
|
}
|
|
315
417
|
}
|
|
316
418
|
handleTagAreaFocus() {
|
|
317
|
-
this.
|
|
419
|
+
if (this.tagInputType === "dropdown") {
|
|
420
|
+
this.closeDropdown();
|
|
421
|
+
}
|
|
318
422
|
if (!this.focusedTag) {
|
|
319
423
|
this.focusedTag = this.tagEls[0];
|
|
320
424
|
}
|
|
@@ -348,10 +452,71 @@ const TagInput = class {
|
|
|
348
452
|
this.focusListItem(this.focusedListItem.previousElementSibling);
|
|
349
453
|
}
|
|
350
454
|
else {
|
|
351
|
-
this.
|
|
352
|
-
|
|
455
|
+
this.clearListItemFocus();
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
moveDownRow() {
|
|
460
|
+
if (this.filteredRows.length > 0) {
|
|
461
|
+
if (this.tablePosition.row === 0) {
|
|
462
|
+
this.tablePosition.row = 1;
|
|
463
|
+
}
|
|
464
|
+
else if (this.tablePosition.row === this.filteredRows.length) {
|
|
465
|
+
this.tablePosition.row = 1;
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
this.tablePosition.row++;
|
|
469
|
+
}
|
|
470
|
+
this.focusCell(this.tablePosition);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
moveUpRow() {
|
|
474
|
+
if (this.filteredRows.length > 0) {
|
|
475
|
+
if (this.tablePosition.row === 0) {
|
|
476
|
+
this.tablePosition.row = this.filteredRows.length;
|
|
477
|
+
}
|
|
478
|
+
else if (this.tablePosition.row === 1) {
|
|
479
|
+
this.tablePosition.row = 0;
|
|
353
480
|
}
|
|
481
|
+
else {
|
|
482
|
+
this.tablePosition.row--;
|
|
483
|
+
}
|
|
484
|
+
this.focusCell(this.tablePosition);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
moveLeftCell() {
|
|
488
|
+
const numCols = functions.csvToArray(this.colHeaders).length;
|
|
489
|
+
if (this.tablePosition.column === 1 && this.tablePosition.row === 1) {
|
|
490
|
+
// if in first cell in first row, focus the input
|
|
491
|
+
this.tablePosition.row = 0;
|
|
492
|
+
}
|
|
493
|
+
else if (this.tablePosition.column === 1) {
|
|
494
|
+
// if in first cell, focus last cell of previous row
|
|
495
|
+
this.tablePosition.row--;
|
|
496
|
+
this.tablePosition.column = numCols;
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
this.tablePosition.column--;
|
|
354
500
|
}
|
|
501
|
+
this.focusCell(this.tablePosition);
|
|
502
|
+
}
|
|
503
|
+
moveRightCell() {
|
|
504
|
+
const numRows = this.filteredRows.length;
|
|
505
|
+
const numCols = functions.csvToArray(this.colHeaders).length;
|
|
506
|
+
if (this.tablePosition.column === numCols && this.tablePosition.row === numRows) {
|
|
507
|
+
// if in last cell in last row, focus the first cell
|
|
508
|
+
this.tablePosition.row = 1;
|
|
509
|
+
this.tablePosition.column = 1;
|
|
510
|
+
}
|
|
511
|
+
else if (this.tablePosition.column === numCols) {
|
|
512
|
+
// if in last cell, focus first cell of next row
|
|
513
|
+
this.tablePosition.row++;
|
|
514
|
+
this.tablePosition.column = 1;
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
this.tablePosition.column++;
|
|
518
|
+
}
|
|
519
|
+
this.focusCell(this.tablePosition);
|
|
355
520
|
}
|
|
356
521
|
moveLeftTag() {
|
|
357
522
|
const lastTag = this.tagEls[this.tagEls.length - 1];
|
|
@@ -390,44 +555,79 @@ const TagInput = class {
|
|
|
390
555
|
const tagExistsAsOption = this.optionsList.filter((x) => x.toLowerCase() === tag.toLowerCase())[0];
|
|
391
556
|
if (!tagAlreadyAdded) {
|
|
392
557
|
this.announce(this.generateTagAddedMessage(tag));
|
|
393
|
-
|
|
558
|
+
this.tagsList = newTagsList.concat(tagExistsAsOption || tag);
|
|
559
|
+
// if maxTags has been reached, focus should go to the tagArea
|
|
560
|
+
if (this.maxTags && this.tagsList.length >= this.maxTags) {
|
|
561
|
+
this.tagAreaEl.focus();
|
|
562
|
+
}
|
|
394
563
|
}
|
|
395
|
-
return newTagsList;
|
|
396
564
|
}
|
|
397
565
|
removeTag(tag) {
|
|
398
566
|
const tagRemovedMessage = functions.intl.formatMessage({ id: "tagInput.tagRemoved", defaultMessage: "{tag} removed" }, { tag: tag });
|
|
399
567
|
this.announce(tagRemovedMessage);
|
|
400
568
|
this.tagsList = this.filterCaseInsensitive(this.tagsList, tag);
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
this.
|
|
569
|
+
if (this.tagInputType === "dropdown") {
|
|
570
|
+
// if a tag was introduced by the user, also remove it from the dropdown options
|
|
571
|
+
const devOptionsList = functions.csvToArray(this.options);
|
|
572
|
+
if (this.includesCaseInsensitive(this.optionsList, tag) && !this.includesCaseInsensitive(devOptionsList, tag)) {
|
|
573
|
+
this.removeOption(tag);
|
|
574
|
+
}
|
|
404
575
|
}
|
|
405
576
|
}
|
|
406
577
|
focusListItem(item) {
|
|
407
578
|
this.focusedListItem = item;
|
|
408
|
-
|
|
579
|
+
this.inputEl.setAttribute("aria-activedescendant", this.focusedListItem.id);
|
|
580
|
+
item.scrollIntoView({ block: "nearest" });
|
|
409
581
|
}
|
|
410
582
|
focusTag(element) {
|
|
411
583
|
this.focusedTag = element;
|
|
412
584
|
this.tagAreaEl.setAttribute("aria-activedescendant", this.focusedTag.id);
|
|
413
585
|
}
|
|
586
|
+
focusCell(position) {
|
|
587
|
+
this.clearCellFocus();
|
|
588
|
+
if (position.row) {
|
|
589
|
+
const rowToFocus = this.localRowEls[position.row];
|
|
590
|
+
const rowCells = rowToFocus.querySelectorAll("td");
|
|
591
|
+
const cellToFocus = rowCells[position.column - 1];
|
|
592
|
+
const isTruncated = cellToFocus.scrollWidth > cellToFocus.clientWidth;
|
|
593
|
+
rowToFocus.classList.add("focused");
|
|
594
|
+
cellToFocus.classList.add("focused");
|
|
595
|
+
cellToFocus.scrollIntoView({ block: "nearest" });
|
|
596
|
+
this.inputEl.setAttribute("aria-activedescendant", cellToFocus.id);
|
|
597
|
+
this.dismissTooltip();
|
|
598
|
+
if (isTruncated) {
|
|
599
|
+
// innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
|
|
600
|
+
functions.showTooltip("bottom", cellToFocus, cellToFocus.innerText);
|
|
601
|
+
this.tooltipVisible = true;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
414
605
|
clearTagFocus() {
|
|
415
|
-
this.tagAreaEl.
|
|
606
|
+
this.tagAreaEl.setAttribute("aria-activedescendant", "");
|
|
416
607
|
this.focusedTag = null;
|
|
417
608
|
}
|
|
609
|
+
clearCellFocus() {
|
|
610
|
+
this.inputEl.setAttribute("aria-activedescendant", "");
|
|
611
|
+
this.localRowEls.forEach((row) => {
|
|
612
|
+
row.classList.remove("focused");
|
|
613
|
+
row.querySelectorAll("td").forEach((cell) => {
|
|
614
|
+
cell.classList.remove("focused");
|
|
615
|
+
});
|
|
616
|
+
});
|
|
617
|
+
}
|
|
418
618
|
openDropdown() {
|
|
419
619
|
// given an offset of -2px because the dropdown is transformed downwards to avoid overlapping the focus border
|
|
420
620
|
this.openUp = functions.shouldOpenUp(this.el, this.dropdownEl, this.el.clientHeight, -2);
|
|
421
621
|
this.isExpanded = true;
|
|
422
622
|
}
|
|
423
623
|
closeDropdown() {
|
|
424
|
-
this.
|
|
624
|
+
this.clearListItemFocus();
|
|
425
625
|
this.isExpanded = false;
|
|
426
626
|
}
|
|
427
627
|
clearListItemFocus() {
|
|
428
628
|
this.focusedListItem = null;
|
|
629
|
+
this.inputEl.setAttribute("aria-activedescendant", "");
|
|
429
630
|
this.listItemEls.forEach((el) => {
|
|
430
|
-
el.tabIndex = -1;
|
|
431
631
|
el.classList.remove("focused");
|
|
432
632
|
});
|
|
433
633
|
}
|
|
@@ -445,11 +645,18 @@ const TagInput = class {
|
|
|
445
645
|
announceExistingOptions() {
|
|
446
646
|
// request animation frame to wait for re-rendering of filtered options
|
|
447
647
|
window.requestAnimationFrame(() => {
|
|
648
|
+
let numResults = 0;
|
|
649
|
+
if (this.tagInputType === "dropdown") {
|
|
650
|
+
numResults = this.optionEls.length;
|
|
651
|
+
}
|
|
652
|
+
else if (this.tagInputType === "table") {
|
|
653
|
+
numResults = this.filteredRows.length;
|
|
654
|
+
}
|
|
448
655
|
const existingOptionsMessage = functions.intl.formatMessage({
|
|
449
656
|
id: "tagInput.existingOptions",
|
|
450
657
|
defaultMessage: "{num, plural, one {1 existing option.} other {# existing options.}}",
|
|
451
|
-
}, { num:
|
|
452
|
-
if (
|
|
658
|
+
}, { num: numResults });
|
|
659
|
+
if (numResults > 0) {
|
|
453
660
|
this.announce(existingOptionsMessage);
|
|
454
661
|
}
|
|
455
662
|
});
|
|
@@ -489,9 +696,6 @@ const TagInput = class {
|
|
|
489
696
|
listToCSV(list) {
|
|
490
697
|
return list.join(",");
|
|
491
698
|
}
|
|
492
|
-
csvToArray(csv) {
|
|
493
|
-
return csv ? csv.split(/, ?/) : [];
|
|
494
|
-
}
|
|
495
699
|
includesCaseInsensitive(list, element) {
|
|
496
700
|
const lowercaseList = list.map((str) => str.toLowerCase());
|
|
497
701
|
return lowercaseList.includes(element.toLowerCase());
|
|
@@ -512,9 +716,24 @@ const TagInput = class {
|
|
|
512
716
|
renderTags() {
|
|
513
717
|
return this.tagsList.map((tag, idx) => {
|
|
514
718
|
const id = `tag${idx + 1}`;
|
|
515
|
-
|
|
719
|
+
let tagText = "";
|
|
720
|
+
let isLocked = false;
|
|
721
|
+
if (this.tagInputType === "dropdown") {
|
|
722
|
+
tagText = tag;
|
|
723
|
+
}
|
|
724
|
+
else if (this.tagInputType === "table") {
|
|
725
|
+
// display table tags using col1 of the row with the same id
|
|
726
|
+
// if one can't be found, display as empty
|
|
727
|
+
const referencedRow = this.el.querySelector(`#${tag}`);
|
|
728
|
+
tagText = referencedRow ? referencedRow.col1 : "";
|
|
729
|
+
isLocked = referencedRow.locked;
|
|
730
|
+
}
|
|
731
|
+
return (index.h("li", { id: id, class: `tag highlight ${this.focusedTag && this.focusedTag.id === id ? "focused" : ""} ${isLocked ? "locked" : ""}`, "data-tag": tag, role: "option" }, tagText, isLocked ? (index.h("div", { class: "icon lock" })) : (index.h("button", { class: "icon remove-btn", tabIndex: -1, onClick: () => this.handleRemoveButtonClick(tag) }))));
|
|
516
732
|
});
|
|
517
733
|
}
|
|
734
|
+
renderDropdown() {
|
|
735
|
+
return (index.h("div", { class: `dropdown-wrapper ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, index.h("div", { id: "help-text", class: "help-text" }, this.renderHelpText()), index.h("ul", { class: "dropdown", id: "dropdown", role: "listbox", "aria-multiselectable": "true", "aria-expanded": this.isExpanded ? "true" : false, "aria-label": this.label, tabindex: -1 }, this.inputEl && this.renderAddNewButton(), this.renderListItems(this.optionsList))));
|
|
736
|
+
}
|
|
518
737
|
renderListItems(optionsList) {
|
|
519
738
|
optionsList = this.sortCaseInsensitive(optionsList);
|
|
520
739
|
// filter by input
|
|
@@ -525,7 +744,7 @@ const TagInput = class {
|
|
|
525
744
|
const id = `option${idx + 1}`;
|
|
526
745
|
const isFocused = this.focusedListItem && this.focusedListItem.id === id;
|
|
527
746
|
const isSelected = this.includesCaseInsensitive(this.tagsList, option);
|
|
528
|
-
return (index.h("li", { class: `option ${isFocused ? "focused" : ""}`, role: "option", id: id, "data-option": option,
|
|
747
|
+
return (index.h("li", { class: `option ${isFocused ? "focused" : ""}`, role: "option", id: id, "data-option": option, "aria-selected": isSelected ? "true" : "false", "aria-disabled": isSelected ? "true" : "false", onKeyDown: (ev) => this.handleListItemKeyDown(ev), onBlur: (ev) => this.handleBlur(ev, this.el), onClick: (ev) => this.handleListItemClick(ev.target) }, option));
|
|
529
748
|
});
|
|
530
749
|
}
|
|
531
750
|
renderAddNewButton() {
|
|
@@ -534,7 +753,7 @@ const TagInput = class {
|
|
|
534
753
|
if (this.addNew && hasNonWhiteSpaceCharacters && !optionAlreadyExists) {
|
|
535
754
|
const id = `add-new-btn`;
|
|
536
755
|
const isFocused = this.focusedListItem && this.focusedListItem.id === id;
|
|
537
|
-
return (index.h("li", { role: "option", class: `add-new-btn ${isFocused ? "focused" : ""}`, id: id, "data-option": this.inputEl.value, onKeyDown: (ev) => this.handleListItemKeyDown(ev), onBlur: (ev) => this.handleBlur(ev, this.el), onClick: (ev) => this.handleListItemClick(ev), tabIndex: isFocused ? 0 : -1 }, `Add "${this.inputEl.value.trim()}"`));
|
|
756
|
+
return (index.h("li", { role: "option", class: `add-new-btn ${isFocused ? "focused" : ""}`, id: id, "data-option": this.inputEl.value, onKeyDown: (ev) => this.handleListItemKeyDown(ev), onBlur: (ev) => this.handleBlur(ev, this.el), onClick: (ev) => this.handleListItemClick(ev.target), tabIndex: isFocused ? 0 : -1 }, `Add "${this.inputEl.value.trim()}"`));
|
|
538
757
|
}
|
|
539
758
|
else
|
|
540
759
|
return "";
|
|
@@ -564,21 +783,45 @@ const TagInput = class {
|
|
|
564
783
|
return (index.h("div", { class: "lower-row" }, index.h("div", { id: "max-tags" }, this.generateTagCounterMessage(this.tagsList.length, this.maxTags), this.tagsList.length >= this.maxTags && index.h("span", { class: "sr-only" }, this.maxTagsReachedMessage))));
|
|
565
784
|
}
|
|
566
785
|
}
|
|
786
|
+
renderTable() {
|
|
787
|
+
return (index.h("div", { class: "table-wrapper", onScroll: () => this.dismissTooltip() }, index.h("table", { id: "table", role: "grid", class: `${this.colWidths ? "fixed-widths" : ""}`, "aria-label": this.label, "aria-multiselectable": "true" }, this.renderTableHeaders(), this.filteredRows.length ? this.renderTableRows() : index.h("div", { class: "no-results" }, this.noResultsMessage))));
|
|
788
|
+
}
|
|
789
|
+
renderTableHeaders() {
|
|
790
|
+
return (index.h("tr", { class: "headers", role: "row" }, functions.csvToArray(this.colHeaders).map((header, idx) => {
|
|
791
|
+
let overflowRule = "wrap";
|
|
792
|
+
if (this.colWrap && functions.csvToArray(this.colWrap)[idx]) {
|
|
793
|
+
overflowRule = functions.csvToArray(this.colWrap)[idx];
|
|
794
|
+
}
|
|
795
|
+
return (index.h("th", { class: `header-cell ${overflowRule}`, role: "columnheader",
|
|
796
|
+
// @ts-ignore
|
|
797
|
+
width: this.colWidths ? functions.csvToArray(this.colWidths)[idx] : "" }, header));
|
|
798
|
+
})));
|
|
799
|
+
}
|
|
800
|
+
renderTableRows() {
|
|
801
|
+
return this.filteredRows.map((row) => {
|
|
802
|
+
const isSelected = this.includesCaseInsensitive(this.tagsList, row.id);
|
|
803
|
+
return (index.h("tr", { id: row.id, class: `${row.locked ? "locked" : ""} ${isSelected ? "selected" : ""}`, role: "row", onClick: () => this.handleTableRowClick(row.id) }, this.renderTableCells(row)));
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
renderTableCells(row) {
|
|
807
|
+
const colValues = [row.col1, row.col2, row.col3, row.col4].filter((val) => !!val);
|
|
808
|
+
const isSelected = this.includesCaseInsensitive(this.tagsList, row.id);
|
|
809
|
+
return colValues.map((val, idx) => {
|
|
810
|
+
const localId = `${row.id}-col${idx + 1}`;
|
|
811
|
+
let overflowRule = "wrap";
|
|
812
|
+
if (this.colWrap && functions.csvToArray(this.colWrap)[idx]) {
|
|
813
|
+
overflowRule = functions.csvToArray(this.colWrap)[idx];
|
|
814
|
+
}
|
|
815
|
+
return (index.h("td", { id: localId, role: "gridcell", class: overflowRule, "aria-describedby": `${localId}-description`, "aria-selected": isSelected.toString(), onMouseEnter: (ev) => this.handleCellMouseEnter(ev), onMouseLeave: () => this.dismissTooltip() }, val, index.h("div", { class: "description", id: `${localId}-description` }, row.locked ? "locked" : "")));
|
|
816
|
+
});
|
|
817
|
+
}
|
|
567
818
|
render() {
|
|
568
|
-
|
|
569
|
-
(this.focusedElement === this.inputEl ||
|
|
570
|
-
this.focusedElement === this.tagAreaEl ||
|
|
571
|
-
this.focusedElement.classList.contains("add-new-btn") ||
|
|
572
|
-
(this.optionsList.length > 0 && this.listItemEls.includes(this.focusedElement)));
|
|
573
|
-
return (index.h(index.Host, { id: this.uid }, index.h("div", { class: `wrapper label-${this.labelPosition}` }, index.h("div", { class: "label-wrapper" }, index.h("label", { class: "label", htmlFor: `input${this.uid}` }, this.label)), index.h("div", { class: `field-wrapper ${isFocused ? "focused" : ""}`, ref: (el) => (this.fieldWrapperEl = el) }, index.h("div", { class: "upper-row" }, index.h("div", { class: "tags-and-input-wrapper" }, index.h("ul", { ref: (el) => (this.tagAreaEl = el), class: "tag-area", role: "listbox", "aria-orientation": "horizontal", "aria-label": `${this.label} ${this.tagsList.length > 0 ? this.tagAreaInstructions : ""}`, tabindex: this.tagsList.length > 0 ? 0 : -1, "aria-describedby": `info max-tags`, onFocus: () => this.handleTagAreaFocus(), onBlur: (ev) => {
|
|
819
|
+
return (index.h(index.Host, { id: this.uid }, index.h("div", { class: `wrapper label-${this.labelPosition}` }, index.h("div", { class: "label-wrapper" }, index.h("label", { class: "label", htmlFor: `input${this.uid}` }, this.label)), index.h("div", { class: `field-wrapper ${this.focusedElement ? "focused" : ""}`, ref: (el) => (this.fieldWrapperEl = el) }, index.h("div", { class: "upper-row" }, index.h("div", { class: "tags-and-input-wrapper" }, index.h("ul", { ref: (el) => (this.tagAreaEl = el), class: "tag-area", role: "listbox", "aria-orientation": "horizontal", "aria-label": `${this.label} ${this.tagsList.length > 0 ? this.tagAreaInstructions : ""}`, tabindex: this.tagsList.length > 0 ? 0 : -1, "aria-describedby": `info max-tags`, onFocus: () => this.handleTagAreaFocus(), onBlur: (ev) => {
|
|
574
820
|
this.clearTagFocus();
|
|
575
821
|
this.handleBlur(ev, this.el);
|
|
576
|
-
}, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), index.h("input", { id: `input${this.uid}`, class: this.maxTags && this.tagsList.length >= this.maxTags ? "hidden" : "", role: "combobox", ref: (el) => (this.inputEl = el), autocomplete: "off", "aria-controls":
|
|
822
|
+
}, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), index.h("input", { id: `input${this.uid}`, class: this.maxTags && this.tagsList.length >= this.maxTags ? "hidden" : "", role: "combobox", ref: (el) => (this.inputEl = el), autocomplete: "off", "aria-controls": this.tagInputType, "aria-describedby": "help-text", "aria-label": `${this.label} ${this.generateCharacterLimitLabel(this.characterLimit)}`, "aria-expanded": this.tagInputType === "dropdown" ? this.isExpanded.toString() : null, placeholder: this.placeholder, maxLength: this.tagInputType === "dropdown" ? this.characterLimit : undefined, onInput: () => this.handleInputChanged(this.inputEl.value), onBlur: (ev) => {
|
|
577
823
|
this.handleBlur(ev, this.el);
|
|
578
|
-
}, onFocus: () => {
|
|
579
|
-
this.openDropdown();
|
|
580
|
-
this.clearListItemFocus();
|
|
581
|
-
}, onKeyDown: (ev) => this.handleInputKeyDown(ev) })), index.h("div", { class: "character-count" }, this.charCount, "/", this.characterLimit)), this.renderTagCounter(), index.h("div", { class: `dropdown-wrapper ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, index.h("div", { id: "help-text", class: "help-text" }, this.renderHelpText()), index.h("ul", { class: "dropdown", id: "dropdown", role: "listbox", "aria-multiselectable": "true", "aria-expanded": this.isExpanded ? "true" : false, "aria-label": this.label, tabindex: -1 }, this.inputEl && this.renderAddNewButton(), this.renderListItems(this.optionsList)))), this.info ? (index.h("div", { id: "info", class: "info-text" }, this.info)) : (""), index.h("div", { class: "sr-only", "aria-live": "assertive", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage))));
|
|
824
|
+
}, onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) })), this.tagInputType === "dropdown" && (index.h("div", { class: "character-count" }, this.charCount, "/", this.characterLimit))), this.renderTagCounter(), this.tagInputType === "dropdown" && this.renderDropdown()), this.info ? (index.h("div", { id: "info", class: "info-text" }, this.info)) : (""), index.h("div", { class: "sr-only", "aria-live": "assertive", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage), this.tagInputType === "table" && this.renderTable())));
|
|
582
825
|
}
|
|
583
826
|
get el() { return index.getElement(this); }
|
|
584
827
|
static get watchers() { return {
|