@nectary/components 0.24.0 → 0.26.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/colors.json +2 -0
- package/dialog/index.js +2 -2
- package/icons/add/index.d.ts +11 -0
- package/icons/add/index.js +4 -0
- package/icons/add-box/index.d.ts +11 -0
- package/icons/add-box/index.js +4 -0
- package/icons/add-circle/index.d.ts +11 -0
- package/icons/add-circle/index.js +4 -0
- package/icons/add-circle-outline/index.d.ts +11 -0
- package/icons/add-circle-outline/index.js +4 -0
- package/icons/amp-stories/index.d.ts +11 -0
- package/icons/amp-stories/index.js +4 -0
- package/icons/archive/index.d.ts +11 -0
- package/icons/archive/index.js +4 -0
- package/icons/attach-file/index.d.ts +11 -0
- package/icons/attach-file/index.js +4 -0
- package/icons/attach-money/index.d.ts +11 -0
- package/icons/attach-money/index.js +4 -0
- package/icons/attribution/index.d.ts +11 -0
- package/icons/attribution/index.js +4 -0
- package/icons/backspace/index.d.ts +11 -0
- package/icons/backspace/index.js +4 -0
- package/icons/ballot/index.d.ts +11 -0
- package/icons/ballot/index.js +4 -0
- package/icons/bar-chart/index.d.ts +11 -0
- package/icons/bar-chart/index.js +4 -0
- package/icons/biotech/index.d.ts +11 -0
- package/icons/biotech/index.js +4 -0
- package/icons/block/index.d.ts +11 -0
- package/icons/block/index.js +4 -0
- package/icons/border-all/index.d.ts +11 -0
- package/icons/border-all/index.js +4 -0
- package/icons/border-bottom/index.d.ts +11 -0
- package/icons/border-bottom/index.js +4 -0
- package/icons/border-clear/index.d.ts +11 -0
- package/icons/border-clear/index.js +4 -0
- package/icons/border-horizontal/index.d.ts +11 -0
- package/icons/border-horizontal/index.js +4 -0
- package/icons/border-inner/index.d.ts +11 -0
- package/icons/border-inner/index.js +4 -0
- package/icons/border-left/index.d.ts +11 -0
- package/icons/border-left/index.js +4 -0
- package/icons/border-outer/index.d.ts +11 -0
- package/icons/border-outer/index.js +4 -0
- package/icons/border-right/index.d.ts +11 -0
- package/icons/border-right/index.js +4 -0
- package/icons/border-style/index.d.ts +11 -0
- package/icons/border-style/index.js +4 -0
- package/icons/border-top/index.d.ts +11 -0
- package/icons/border-top/index.js +4 -0
- package/icons/border-vertical/index.d.ts +11 -0
- package/icons/border-vertical/index.js +4 -0
- package/icons/bubble-chart/index.d.ts +11 -0
- package/icons/bubble-chart/index.js +4 -0
- package/icons/calculate/index.d.ts +11 -0
- package/icons/calculate/index.js +4 -0
- package/icons/clear/index.d.ts +11 -0
- package/icons/clear/index.js +4 -0
- package/icons/content-copy/index.d.ts +11 -0
- package/icons/content-copy/index.js +4 -0
- package/icons/content-cut/index.d.ts +11 -0
- package/icons/content-cut/index.js +4 -0
- package/icons/content-paste/index.d.ts +11 -0
- package/icons/content-paste/index.js +4 -0
- package/icons/delete-sweep/index.d.ts +11 -0
- package/icons/delete-sweep/index.js +4 -0
- package/icons/drafts/index.d.ts +11 -0
- package/icons/drafts/index.js +4 -0
- package/icons/drag-handle/index.d.ts +11 -0
- package/icons/drag-handle/index.js +4 -0
- package/icons/dynamic-feed/index.d.ts +11 -0
- package/icons/dynamic-feed/index.js +4 -0
- package/icons/file-copy/index.d.ts +11 -0
- package/icons/file-copy/index.js +4 -0
- package/icons/flag/index.d.ts +11 -0
- package/icons/flag/index.js +4 -0
- package/icons/font-download/index.d.ts +11 -0
- package/icons/font-download/index.js +4 -0
- package/icons/format-align-center/index.d.ts +11 -0
- package/icons/format-align-center/index.js +4 -0
- package/icons/format-align-justify/index.d.ts +11 -0
- package/icons/format-align-justify/index.js +4 -0
- package/icons/format-align-left/index.d.ts +11 -0
- package/icons/format-align-left/index.js +4 -0
- package/icons/format-align-right/index.d.ts +11 -0
- package/icons/format-align-right/index.js +4 -0
- package/icons/format-bold/index.d.ts +11 -0
- package/icons/format-bold/index.js +4 -0
- package/icons/format-clear/index.d.ts +11 -0
- package/icons/format-clear/index.js +4 -0
- package/icons/format-color-reset/index.d.ts +11 -0
- package/icons/format-color-reset/index.js +4 -0
- package/icons/format-indent-decrease/index.d.ts +11 -0
- package/icons/format-indent-decrease/index.js +4 -0
- package/icons/format-indent-increase/index.d.ts +11 -0
- package/icons/format-indent-increase/index.js +4 -0
- package/icons/format-italic/index.d.ts +11 -0
- package/icons/format-italic/index.js +4 -0
- package/icons/format-line-spacing/index.d.ts +11 -0
- package/icons/format-line-spacing/index.js +4 -0
- package/icons/format-list-bulleted/index.d.ts +11 -0
- package/icons/format-list-bulleted/index.js +4 -0
- package/icons/format-list-numbered/index.d.ts +11 -0
- package/icons/format-list-numbered/index.js +4 -0
- package/icons/format-list-numbered-rtl/index.d.ts +11 -0
- package/icons/format-list-numbered-rtl/index.js +4 -0
- package/icons/format-paint/index.d.ts +11 -0
- package/icons/format-paint/index.js +4 -0
- package/icons/format-quote/index.d.ts +11 -0
- package/icons/format-quote/index.js +4 -0
- package/icons/format-shapes/index.d.ts +11 -0
- package/icons/format-shapes/index.js +4 -0
- package/icons/format-size/index.d.ts +11 -0
- package/icons/format-size/index.js +4 -0
- package/icons/format-strikethrough/index.d.ts +11 -0
- package/icons/format-strikethrough/index.js +4 -0
- package/icons/format-textdirection-l-to-r/index.d.ts +11 -0
- package/icons/format-textdirection-l-to-r/index.js +4 -0
- package/icons/format-textdirection-r-to-l/index.d.ts +11 -0
- package/icons/format-textdirection-r-to-l/index.js +4 -0
- package/icons/format-underlined/index.d.ts +11 -0
- package/icons/format-underlined/index.js +4 -0
- package/icons/forward/index.d.ts +11 -0
- package/icons/forward/index.js +4 -0
- package/icons/functions/index.d.ts +11 -0
- package/icons/functions/index.js +4 -0
- package/icons/gesture/index.d.ts +11 -0
- package/icons/gesture/index.js +4 -0
- package/icons/height/index.d.ts +11 -0
- package/icons/height/index.js +4 -0
- package/icons/highlight/index.d.ts +11 -0
- package/icons/highlight/index.js +4 -0
- package/icons/horizontal-rule/index.d.ts +11 -0
- package/icons/horizontal-rule/index.js +4 -0
- package/icons/how-to-reg/index.d.ts +11 -0
- package/icons/how-to-reg/index.js +4 -0
- package/icons/how-to-vote/index.d.ts +11 -0
- package/icons/how-to-vote/index.js +4 -0
- package/icons/inbox/index.d.ts +11 -0
- package/icons/inbox/index.js +4 -0
- package/icons/insert-chart/index.d.ts +11 -0
- package/icons/insert-chart/index.js +4 -0
- package/icons/insert-chart-outlined/index.d.ts +11 -0
- package/icons/insert-chart-outlined/index.js +4 -0
- package/icons/insert-comment/index.d.ts +11 -0
- package/icons/insert-comment/index.js +4 -0
- package/icons/insert-drive-file/index.d.ts +11 -0
- package/icons/insert-drive-file/index.js +4 -0
- package/icons/insert-emoticon/index.js +1 -1
- package/icons/insert-invitation/index.d.ts +11 -0
- package/icons/insert-invitation/index.js +4 -0
- package/icons/insert-link/index.d.ts +11 -0
- package/icons/insert-link/index.js +4 -0
- package/icons/insert-photo/index.d.ts +11 -0
- package/icons/insert-photo/index.js +4 -0
- package/icons/insights/index.d.ts +11 -0
- package/icons/insights/index.js +4 -0
- package/icons/linear-scale/index.d.ts +11 -0
- package/icons/linear-scale/index.js +4 -0
- package/icons/link/index.d.ts +11 -0
- package/icons/link/index.js +4 -0
- package/icons/link-off/index.d.ts +11 -0
- package/icons/link-off/index.js +4 -0
- package/icons/low-priority/index.d.ts +11 -0
- package/icons/low-priority/index.js +4 -0
- package/icons/mail/index.d.ts +11 -0
- package/icons/mail/index.js +4 -0
- package/icons/markunread/index.d.ts +11 -0
- package/icons/markunread/index.js +4 -0
- package/icons/merge-type/index.d.ts +11 -0
- package/icons/merge-type/index.js +4 -0
- package/icons/mode/index.d.ts +11 -0
- package/icons/mode/index.js +4 -0
- package/icons/mode-comment/index.d.ts +11 -0
- package/icons/mode-comment/index.js +4 -0
- package/icons/monetization-on/index.d.ts +11 -0
- package/icons/monetization-on/index.js +4 -0
- package/icons/money-off/index.d.ts +11 -0
- package/icons/money-off/index.js +4 -0
- package/icons/money-off-csred/index.d.ts +11 -0
- package/icons/money-off-csred/index.js +4 -0
- package/icons/move-to-inbox/index.d.ts +11 -0
- package/icons/move-to-inbox/index.js +4 -0
- package/icons/multiline-chart/index.d.ts +11 -0
- package/icons/multiline-chart/index.js +4 -0
- package/icons/next-week/index.d.ts +11 -0
- package/icons/next-week/index.js +4 -0
- package/icons/notes/index.js +1 -1
- package/icons/outlined-flag/index.d.ts +11 -0
- package/icons/outlined-flag/index.js +4 -0
- package/icons/pie-chart/index.d.ts +11 -0
- package/icons/pie-chart/index.js +4 -0
- package/icons/pie-chart-outline/index.d.ts +11 -0
- package/icons/pie-chart-outline/index.js +4 -0
- package/icons/policy/index.d.ts +11 -0
- package/icons/policy/index.js +4 -0
- package/icons/post-add/index.d.ts +11 -0
- package/icons/post-add/index.js +4 -0
- package/icons/publish/index.d.ts +11 -0
- package/icons/publish/index.js +4 -0
- package/icons/push-pin/index.d.ts +11 -0
- package/icons/push-pin/index.js +4 -0
- package/icons/redo/index.d.ts +11 -0
- package/icons/redo/index.js +4 -0
- package/icons/remove/index.d.ts +11 -0
- package/icons/remove/index.js +4 -0
- package/icons/remove-circle/index.d.ts +11 -0
- package/icons/remove-circle/index.js +4 -0
- package/icons/remove-circle-outline/index.d.ts +11 -0
- package/icons/remove-circle-outline/index.js +4 -0
- package/icons/reply-all/index.d.ts +11 -0
- package/icons/reply-all/index.js +4 -0
- package/icons/report/index.d.ts +11 -0
- package/icons/report/index.js +4 -0
- package/icons/report-off/index.d.ts +11 -0
- package/icons/report-off/index.js +4 -0
- package/icons/report-outline/index.d.ts +11 -0
- package/icons/report-outline/index.js +4 -0
- package/icons/save/index.d.ts +11 -0
- package/icons/save/index.js +4 -0
- package/icons/save-alt/index.d.ts +11 -0
- package/icons/save-alt/index.js +4 -0
- package/icons/scatter-plot/index.d.ts +11 -0
- package/icons/scatter-plot/index.js +4 -0
- package/icons/score/index.d.ts +11 -0
- package/icons/score/index.js +4 -0
- package/icons/select-all/index.d.ts +11 -0
- package/icons/select-all/index.js +4 -0
- package/icons/short-text/index.d.ts +11 -0
- package/icons/short-text/index.js +4 -0
- package/icons/show-chart/index.d.ts +11 -0
- package/icons/show-chart/index.js +4 -0
- package/icons/smart-toy/index.d.ts +11 -0
- package/icons/smart-toy/index.js +4 -0
- package/icons/sort/index.d.ts +11 -0
- package/icons/sort/index.js +4 -0
- package/icons/space-bar/index.d.ts +11 -0
- package/icons/space-bar/index.js +4 -0
- package/icons/square-foot/index.d.ts +11 -0
- package/icons/square-foot/index.js +4 -0
- package/icons/stacked-line-chart/index.d.ts +11 -0
- package/icons/stacked-line-chart/index.js +4 -0
- package/icons/strikethrough-s/index.d.ts +11 -0
- package/icons/strikethrough-s/index.js +4 -0
- package/icons/subscript/index.d.ts +11 -0
- package/icons/subscript/index.js +4 -0
- package/icons/superscript/index.d.ts +11 -0
- package/icons/superscript/index.js +4 -0
- package/icons/table-chart/index.d.ts +11 -0
- package/icons/table-chart/index.js +4 -0
- package/icons/table-rows/index.d.ts +11 -0
- package/icons/table-rows/index.js +4 -0
- package/icons/text-fields/index.d.ts +11 -0
- package/icons/text-fields/index.js +4 -0
- package/icons/text-format/index.d.ts +11 -0
- package/icons/text-format/index.js +4 -0
- package/icons/title/index.d.ts +11 -0
- package/icons/title/index.js +4 -0
- package/icons/unarchive/index.d.ts +11 -0
- package/icons/unarchive/index.js +4 -0
- package/icons/vertical-align-bottom/index.d.ts +11 -0
- package/icons/vertical-align-bottom/index.js +4 -0
- package/icons/vertical-align-center/index.d.ts +11 -0
- package/icons/vertical-align-center/index.js +4 -0
- package/icons/vertical-align-top/index.d.ts +11 -0
- package/icons/vertical-align-top/index.js +4 -0
- package/icons/waves/index.d.ts +11 -0
- package/icons/waves/index.js +4 -0
- package/icons/weekend/index.d.ts +11 -0
- package/icons/weekend/index.js +4 -0
- package/icons/where-to-vote/index.d.ts +11 -0
- package/icons/where-to-vote/index.js +4 -0
- package/icons/wrap-text/index.d.ts +11 -0
- package/icons/wrap-text/index.js +4 -0
- package/index.d.ts +137 -0
- package/index.js +138 -1
- package/package.json +3 -5
- package/popover/index.js +1 -1
- package/search/index.js +55 -42
- package/search-option/index.d.ts +1 -1
- package/search-option/index.js +4 -4
- package/segment/index.d.ts +2 -1
- package/segment/index.js +16 -3
- package/segment-collapse/index.d.ts +1 -0
- package/segment-collapse/index.js +23 -25
- package/segmented-control/index.d.ts +20 -0
- package/segmented-control/index.js +208 -0
- package/segmented-control-option/index.d.ts +29 -0
- package/segmented-control-option/index.js +112 -0
- package/segmented-icon-control/index.d.ts +22 -0
- package/segmented-icon-control/index.js +126 -0
- package/segmented-icon-control-option/index.d.ts +27 -0
- package/segmented-icon-control-option/index.js +103 -0
- package/tabs/index.js +1 -1
- package/tabs-option/index.js +10 -26
package/search/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
|
|
2
2
|
import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
|
|
3
3
|
|
|
4
|
-
var _$label, _$input, _selectionStart, _selectionEnd, _$optionSlot, _$listbox, _$clear, _isPendingDk, _onCompositionStart, _onInput, _onValueChange, _onClearMouseDown, _onClear, _onInputFocus, _onInputBlur, _onListboxClick,
|
|
4
|
+
var _$label, _$input, _selectionStart, _selectionEnd, _$optionSlot, _$listbox, _$clear, _isPendingDk, _sh, _onCompositionStart, _onInput, _onValueChange, _onClearMouseDown, _onClear, _onInputFocus, _onInputBlur, _onListboxClick, _onListboxKeyUp, _onListboxKeyDown, _onOptionSlotChange, _onExpand, _onCollapse, _getFirstOption, _getLastOption, _getNextOption, _getPrevOption, _selectOption, _findSelectedOption;
|
|
5
5
|
|
|
6
6
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
|
7
7
|
|
|
@@ -11,31 +11,20 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
|
11
11
|
|
|
12
12
|
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
import { attrValueToPixels, defineCustomElement, getAttribute, getIntegerAttribute, getRect, NectaryElement, updateAttribute, updateIntegerAttribute } from '../utils';
|
|
16
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;width:100%;box-sizing:border-box;--sinch-size-icon:24px}#label{display:none;font:var(--sinch-font-title-s);color:var(--sinch-color-text-default);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;height:24px;margin-bottom:2px}#input{all:initial;display:block;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:4px;width:100%;height:48px;padding:0 44px;padding-right:12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);caret-color:var(--sinch-caret-color,auto);background-color:var(--sinch-color-snow-100)}#input::placeholder{font:var(--sinch-font-body);color:var(--sinch-color-text-muted)}#input:focus{border-color:var(--sinch-color-stormy-600)}#icon-search{position:absolute;left:12px;top:12px;pointer-events:none;--sinch-color-icon:var(--sinch-color-stormy-500)}#clear{position:absolute;right:8px;top:8px;display:none;--sinch-color-icon:red}#clear:focus{--sinch-color-icon:var(--sinch-color-stormy-500)}:host([value]:not([value=""])) #clear{display:flex}:host([value]:not([value=""])) #input{padding-right:44px}#listbox{display:none;position:absolute;z-index:1;left:0;top:calc(100% + 8px);width:100%;box-sizing:border-box;font:var(--sinch-font-body);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);box-shadow:1px 2px 4px rgba(0,0,0,.15);overflow-y:auto
|
|
14
|
+
import { isSinchSearchOptionElement } from '../search-option';
|
|
15
|
+
import { attrValueToPixels, defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, getRect, NectaryElement, updateAttribute, updateIntegerAttribute } from '../utils';
|
|
16
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;width:100%;box-sizing:border-box;--sinch-size-icon:24px}#label{display:none;font:var(--sinch-font-title-s);color:var(--sinch-color-text-default);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;height:24px;margin-bottom:2px}#input{all:initial;display:block;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:4px;width:100%;height:48px;padding:0 44px;padding-right:12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);caret-color:var(--sinch-caret-color,auto);background-color:var(--sinch-color-snow-100)}#input::placeholder{font:var(--sinch-font-body);color:var(--sinch-color-text-muted)}#input:focus{border-color:var(--sinch-color-stormy-600)}#icon-search{position:absolute;left:12px;top:12px;pointer-events:none;--sinch-color-icon:var(--sinch-color-stormy-500)}#clear{position:absolute;right:8px;top:8px;display:none;--sinch-color-icon:red}#clear:focus{--sinch-color-icon:var(--sinch-color-stormy-500)}:host([value]:not([value=""])) #clear{display:flex}:host([value]:not([value=""])) #input{padding-right:44px}#listbox{display:none;position:absolute;z-index:1;left:0;top:calc(100% + 8px);width:100%;box-sizing:border-box;font:var(--sinch-font-body);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);box-shadow:1px 2px 4px rgba(0,0,0,.15);overflow-y:auto}:host([aria-expanded=true]) #listbox{display:block}:host([label]:not([label=""])) #label{display:block}</style><label id="label" for="input"></label><div id="wrapper"><input id="input" type="text"/><sinch-icon-search id="icon-search"></sinch-icon-search><sinch-icon-button id="clear" small><sinch-icon-close id="icon-close" slot="icon"></sinch-icon-close></sinch-icon-button><div id="listbox"><slot name="option"></slot></div></div>';
|
|
17
17
|
import '../icons/search';
|
|
18
18
|
import '../icons/close';
|
|
19
19
|
import '../icon-button';
|
|
20
20
|
const ITEM_HEIGHT = 40;
|
|
21
|
-
|
|
22
|
-
const findSelectedOption = elements => {
|
|
23
|
-
for (const el of elements) {
|
|
24
|
-
if (el.selected) {
|
|
25
|
-
return el;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return null;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
21
|
const template = document.createElement('template');
|
|
33
22
|
template.innerHTML = templateHTML;
|
|
34
|
-
defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new WeakMap(), _selectionStart = new WeakMap(), _selectionEnd = new WeakMap(), _$optionSlot = new WeakMap(), _$listbox = new WeakMap(), _$clear = new WeakMap(), _isPendingDk = new WeakMap(), _onCompositionStart = new WeakMap(), _onInput = new WeakMap(), _onValueChange = new WeakSet(), _onClearMouseDown = new WeakMap(), _onClear = new WeakMap(), _onInputFocus = new WeakMap(), _onInputBlur = new WeakMap(), _onListboxClick = new WeakMap(),
|
|
23
|
+
defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new WeakMap(), _selectionStart = new WeakMap(), _selectionEnd = new WeakMap(), _$optionSlot = new WeakMap(), _$listbox = new WeakMap(), _$clear = new WeakMap(), _isPendingDk = new WeakMap(), _sh = new WeakMap(), _onCompositionStart = new WeakMap(), _onInput = new WeakMap(), _onValueChange = new WeakSet(), _onClearMouseDown = new WeakMap(), _onClear = new WeakMap(), _onInputFocus = new WeakMap(), _onInputBlur = new WeakMap(), _onListboxClick = new WeakMap(), _onListboxKeyUp = new WeakMap(), _onListboxKeyDown = new WeakMap(), _onOptionSlotChange = new WeakMap(), _onExpand = new WeakSet(), _onCollapse = new WeakSet(), _getFirstOption = new WeakSet(), _getLastOption = new WeakSet(), _getNextOption = new WeakSet(), _getPrevOption = new WeakSet(), _selectOption = new WeakSet(), _findSelectedOption = new WeakSet(), class extends NectaryElement {
|
|
35
24
|
constructor() {
|
|
36
25
|
super();
|
|
37
26
|
|
|
38
|
-
_classPrivateMethodInitSpec(this,
|
|
27
|
+
_classPrivateMethodInitSpec(this, _findSelectedOption);
|
|
39
28
|
|
|
40
29
|
_classPrivateMethodInitSpec(this, _selectOption);
|
|
41
30
|
|
|
@@ -93,6 +82,11 @@ defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new Weak
|
|
|
93
82
|
value: false
|
|
94
83
|
});
|
|
95
84
|
|
|
85
|
+
_classPrivateFieldInitSpec(this, _sh, {
|
|
86
|
+
writable: true,
|
|
87
|
+
value: void 0
|
|
88
|
+
});
|
|
89
|
+
|
|
96
90
|
_classPrivateFieldInitSpec(this, _onCompositionStart, {
|
|
97
91
|
writable: true,
|
|
98
92
|
value: () => {
|
|
@@ -147,7 +141,7 @@ defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new Weak
|
|
|
147
141
|
e.stopPropagation();
|
|
148
142
|
const $elem = e.target;
|
|
149
143
|
|
|
150
|
-
if (
|
|
144
|
+
if (isSinchSearchOptionElement($elem)) {
|
|
151
145
|
_classPrivateMethodGet(this, _onValueChange, _onValueChange2).call(this, $elem.text);
|
|
152
146
|
}
|
|
153
147
|
|
|
@@ -155,17 +149,18 @@ defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new Weak
|
|
|
155
149
|
}
|
|
156
150
|
});
|
|
157
151
|
|
|
158
|
-
_classPrivateFieldInitSpec(this,
|
|
152
|
+
_classPrivateFieldInitSpec(this, _onListboxKeyUp, {
|
|
159
153
|
writable: true,
|
|
160
154
|
value: e => {
|
|
161
155
|
switch (e.code) {
|
|
162
156
|
case 'Enter':
|
|
163
157
|
{
|
|
164
158
|
e.preventDefault();
|
|
165
|
-
const $elem = findSelectedOption(_classPrivateMethodGet(this, _getOptionElements, _getOptionElements2).call(this));
|
|
166
159
|
|
|
167
|
-
|
|
168
|
-
|
|
160
|
+
const $opt = _classPrivateMethodGet(this, _findSelectedOption, _findSelectedOption2).call(this);
|
|
161
|
+
|
|
162
|
+
if ($opt != null) {
|
|
163
|
+
_classPrivateMethodGet(this, _onValueChange, _onValueChange2).call(this, $opt.text);
|
|
169
164
|
}
|
|
170
165
|
|
|
171
166
|
_classPrivateMethodGet(this, _onCollapse, _onCollapse2).call(this);
|
|
@@ -183,6 +178,7 @@ defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new Weak
|
|
|
183
178
|
case 'ArrowUp':
|
|
184
179
|
{
|
|
185
180
|
e.preventDefault();
|
|
181
|
+
e.stopPropagation();
|
|
186
182
|
|
|
187
183
|
_classPrivateMethodGet(this, _selectOption, _selectOption2).call(this, _classPrivateMethodGet(this, _getPrevOption, _getPrevOption2).call(this));
|
|
188
184
|
|
|
@@ -192,6 +188,7 @@ defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new Weak
|
|
|
192
188
|
case 'ArrowDown':
|
|
193
189
|
{
|
|
194
190
|
e.preventDefault();
|
|
191
|
+
e.stopPropagation();
|
|
195
192
|
|
|
196
193
|
_classPrivateMethodGet(this, _selectOption, _selectOption2).call(this, _classPrivateMethodGet(this, _getNextOption, _getNextOption2).call(this));
|
|
197
194
|
|
|
@@ -213,6 +210,12 @@ defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new Weak
|
|
|
213
210
|
_classPrivateFieldInitSpec(this, _onOptionSlotChange, {
|
|
214
211
|
writable: true,
|
|
215
212
|
value: () => {
|
|
213
|
+
const $opts = _classPrivateFieldGet(this, _$optionSlot).assignedElements();
|
|
214
|
+
|
|
215
|
+
if ($opts.length === 0) {
|
|
216
|
+
return _classPrivateMethodGet(this, _onCollapse, _onCollapse2).call(this);
|
|
217
|
+
}
|
|
218
|
+
|
|
216
219
|
_classPrivateMethodGet(this, _onExpand, _onExpand2).call(this);
|
|
217
220
|
}
|
|
218
221
|
});
|
|
@@ -220,6 +223,8 @@ defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new Weak
|
|
|
220
223
|
const shadowRoot = this.attachShadow();
|
|
221
224
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
222
225
|
|
|
226
|
+
_classPrivateFieldSet(this, _sh, shadowRoot);
|
|
227
|
+
|
|
223
228
|
_classPrivateFieldSet(this, _$input, shadowRoot.querySelector('#input'));
|
|
224
229
|
|
|
225
230
|
_classPrivateFieldSet(this, _$label, shadowRoot.querySelector('#label'));
|
|
@@ -246,9 +251,9 @@ defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new Weak
|
|
|
246
251
|
|
|
247
252
|
_classPrivateFieldGet(this, _$input).addEventListener('keydown', _classPrivateFieldGet(this, _onListboxKeyDown));
|
|
248
253
|
|
|
249
|
-
_classPrivateFieldGet(this, _$input).addEventListener('
|
|
254
|
+
_classPrivateFieldGet(this, _$input).addEventListener('keyup', _classPrivateFieldGet(this, _onListboxKeyUp));
|
|
250
255
|
|
|
251
|
-
_classPrivateFieldGet(this, _$listbox).addEventListener('
|
|
256
|
+
_classPrivateFieldGet(this, _$listbox).addEventListener('mousedown', _classPrivateFieldGet(this, _onListboxClick));
|
|
252
257
|
|
|
253
258
|
_classPrivateFieldGet(this, _$optionSlot).addEventListener('slotchange', _classPrivateFieldGet(this, _onOptionSlotChange));
|
|
254
259
|
|
|
@@ -268,9 +273,9 @@ defineCustomElement('sinch-search', (_$label = new WeakMap(), _$input = new Weak
|
|
|
268
273
|
|
|
269
274
|
_classPrivateFieldGet(this, _$input).removeEventListener('keydown', _classPrivateFieldGet(this, _onListboxKeyDown));
|
|
270
275
|
|
|
271
|
-
_classPrivateFieldGet(this, _$input).removeEventListener('
|
|
276
|
+
_classPrivateFieldGet(this, _$input).removeEventListener('keyup', _classPrivateFieldGet(this, _onListboxKeyUp));
|
|
272
277
|
|
|
273
|
-
_classPrivateFieldGet(this, _$listbox).removeEventListener('
|
|
278
|
+
_classPrivateFieldGet(this, _$listbox).removeEventListener('mousedown', _classPrivateFieldGet(this, _onListboxClick));
|
|
274
279
|
|
|
275
280
|
_classPrivateFieldGet(this, _$optionSlot).removeEventListener('slotchange', _classPrivateFieldGet(this, _onOptionSlotChange));
|
|
276
281
|
|
|
@@ -444,17 +449,17 @@ function _onValueChange2(nextValue) {
|
|
|
444
449
|
}
|
|
445
450
|
|
|
446
451
|
function _onExpand2() {
|
|
447
|
-
const
|
|
452
|
+
const isOpen = getBooleanAttribute(this, 'aria-expanded');
|
|
448
453
|
|
|
449
|
-
|
|
450
|
-
_classPrivateMethodGet(this, _onCollapse, _onCollapse2).call(this);
|
|
454
|
+
const $opts = _classPrivateFieldGet(this, _$optionSlot).assignedElements();
|
|
451
455
|
|
|
452
|
-
|
|
453
|
-
|
|
456
|
+
if (!isOpen && $opts.length > 0 && _classPrivateFieldGet(this, _sh).activeElement === _classPrivateFieldGet(this, _$input)) {
|
|
457
|
+
const opt = _classPrivateMethodGet(this, _getFirstOption, _getFirstOption2).call(this);
|
|
454
458
|
|
|
455
|
-
|
|
459
|
+
_classPrivateMethodGet(this, _selectOption, _selectOption2).call(this, opt);
|
|
456
460
|
|
|
457
|
-
|
|
461
|
+
this.setAttribute('aria-expanded', 'true');
|
|
462
|
+
}
|
|
458
463
|
}
|
|
459
464
|
|
|
460
465
|
function _onCollapse2() {
|
|
@@ -462,17 +467,18 @@ function _onCollapse2() {
|
|
|
462
467
|
}
|
|
463
468
|
|
|
464
469
|
function _getFirstOption2() {
|
|
465
|
-
return
|
|
470
|
+
return _classPrivateFieldGet(this, _$optionSlot).assignedElements().filter(isSinchSearchOptionElement)[0] ?? null;
|
|
466
471
|
}
|
|
467
472
|
|
|
468
473
|
function _getLastOption2() {
|
|
469
|
-
return
|
|
474
|
+
return _classPrivateFieldGet(this, _$optionSlot).assignedElements().filter(isSinchSearchOptionElement).reverse()[0] ?? null;
|
|
470
475
|
}
|
|
471
476
|
|
|
472
477
|
function _getNextOption2() {
|
|
473
|
-
const $options =
|
|
478
|
+
const $options = _classPrivateFieldGet(this, _$optionSlot).assignedElements().filter(isSinchSearchOptionElement);
|
|
479
|
+
|
|
480
|
+
const $selectedOption = _classPrivateMethodGet(this, _findSelectedOption, _findSelectedOption2).call(this);
|
|
474
481
|
|
|
475
|
-
const $selectedOption = findSelectedOption($options);
|
|
476
482
|
const currentIndex = $selectedOption !== null ? $options.indexOf($selectedOption) : -1;
|
|
477
483
|
|
|
478
484
|
if (currentIndex < 0) {
|
|
@@ -483,9 +489,10 @@ function _getNextOption2() {
|
|
|
483
489
|
}
|
|
484
490
|
|
|
485
491
|
function _getPrevOption2() {
|
|
486
|
-
const $options =
|
|
492
|
+
const $options = _classPrivateFieldGet(this, _$optionSlot).assignedElements().filter(isSinchSearchOptionElement);
|
|
493
|
+
|
|
494
|
+
const $selectedOption = _classPrivateMethodGet(this, _findSelectedOption, _findSelectedOption2).call(this);
|
|
487
495
|
|
|
488
|
-
const $selectedOption = findSelectedOption($options);
|
|
489
496
|
const currentIndex = $selectedOption !== null ? $options.indexOf($selectedOption) : -1;
|
|
490
497
|
|
|
491
498
|
if (currentIndex < 0) {
|
|
@@ -496,7 +503,7 @@ function _getPrevOption2() {
|
|
|
496
503
|
}
|
|
497
504
|
|
|
498
505
|
function _selectOption2($option) {
|
|
499
|
-
for (const $op of
|
|
506
|
+
for (const $op of _classPrivateFieldGet(this, _$optionSlot).assignedElements()) {
|
|
500
507
|
const isSelected = $op === $option;
|
|
501
508
|
$op.selected = isSelected;
|
|
502
509
|
|
|
@@ -508,6 +515,12 @@ function _selectOption2($option) {
|
|
|
508
515
|
}
|
|
509
516
|
}
|
|
510
517
|
|
|
511
|
-
function
|
|
512
|
-
|
|
518
|
+
function _findSelectedOption2() {
|
|
519
|
+
for (const el of _classPrivateFieldGet(this, _$optionSlot).assignedElements()) {
|
|
520
|
+
if (isSinchSearchOptionElement(el) && el.selected) {
|
|
521
|
+
return el;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
return null;
|
|
513
526
|
}
|
package/search-option/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSinchElementReact } from '../types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const isSinchSearchOptionElement: (element: EventTarget | Element | null) => element is TSinchSearchOptionElement;
|
|
3
3
|
export declare type TSinchSearchOptionElement = HTMLElement & {
|
|
4
4
|
text: string;
|
|
5
5
|
selected: boolean;
|
package/search-option/index.js
CHANGED
|
@@ -12,7 +12,7 @@ template.innerHTML = templateHTML;
|
|
|
12
12
|
|
|
13
13
|
var _$content = new WeakMap();
|
|
14
14
|
|
|
15
|
-
class
|
|
15
|
+
class SinchSearchOption extends NectaryElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
|
|
@@ -68,7 +68,7 @@ class SearchOption extends NectaryElement {
|
|
|
68
68
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
defineCustomElement('sinch-search-option',
|
|
72
|
-
export const
|
|
73
|
-
return element instanceof
|
|
71
|
+
defineCustomElement('sinch-search-option', SinchSearchOption);
|
|
72
|
+
export const isSinchSearchOptionElement = element => {
|
|
73
|
+
return element instanceof SinchSearchOption;
|
|
74
74
|
};
|
package/segment/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { TSinchElementReact } from '../types';
|
|
1
|
+
import type { TRect, TSinchElementReact } from '../types';
|
|
2
2
|
declare type TSinchSegmentElement = HTMLElement & {
|
|
3
3
|
caption: string;
|
|
4
4
|
collapsed: boolean;
|
|
5
|
+
readonly collapseButtonRect: TRect | null;
|
|
5
6
|
};
|
|
6
7
|
declare type TSinchSegmentReact = TSinchElementReact<TSinchSegmentElement> & {
|
|
7
8
|
caption: string;
|
package/segment/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
|
|
2
2
|
import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
|
|
3
3
|
|
|
4
|
-
var _$caption;
|
|
4
|
+
var _$caption, _$collapseSlot;
|
|
5
5
|
|
|
6
6
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
7
7
|
|
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9
9
|
|
|
10
|
-
import { defineCustomElement, getAttribute, getBooleanAttribute, NectaryElement, updateAttribute, updateBooleanAttribute } from '../utils';
|
|
10
|
+
import { defineCustomElement, getAttribute, getBooleanAttribute, getRect, NectaryElement, updateAttribute, updateBooleanAttribute } from '../utils';
|
|
11
11
|
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:column;width:100%;height:100%;border-radius:4px;box-sizing:border-box;background-color:var(--sinch-color-snow-100);color:var(--sinch-color-text-default);font:var(--sinch-font-body);border:none;box-shadow:1px 2px 8px rgba(0,0,0,.1)}#header{position:relative;display:flex;flex-direction:row;align-items:center;gap:16px;height:32px;padding:24px 32px 16px;--sinch-size-icon:32px}#caption{font:var(--sinch-font-title-l);color:var(--sinch-color-text-default);flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#content-wrapper{padding:0 32px;flex:1;min-height:0;overflow:auto}#action{display:flex;flex-direction:row;justify-content:flex-end;gap:16px;padding:16px 32px 24px}#info{position:relative;display:flex;flex-direction:row;align-items:center;gap:16px;z-index:1}:host([collapsed]:not([collapsed=false])) :is(#content-wrapper,#action){display:none}:host([collapsed]:not([collapsed=false])) #header{padding-bottom:24px}</style><div id="wrapper"><div id="header"><slot name="icon"></slot><span id="caption"></span><div id="info"><slot name="info"></slot></div><slot name="collapse"></slot></div><div id="content-wrapper"><slot name="content"></slot></div><div id="action"><slot name="action"></slot></div></div>';
|
|
12
12
|
const template = document.createElement('template');
|
|
13
13
|
template.innerHTML = templateHTML;
|
|
14
|
-
defineCustomElement('sinch-segment', (_$caption = new WeakMap(), class extends NectaryElement {
|
|
14
|
+
defineCustomElement('sinch-segment', (_$caption = new WeakMap(), _$collapseSlot = new WeakMap(), class extends NectaryElement {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
|
|
@@ -20,10 +20,17 @@ defineCustomElement('sinch-segment', (_$caption = new WeakMap(), class extends N
|
|
|
20
20
|
value: void 0
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
_classPrivateFieldInitSpec(this, _$collapseSlot, {
|
|
24
|
+
writable: true,
|
|
25
|
+
value: void 0
|
|
26
|
+
});
|
|
27
|
+
|
|
23
28
|
const shadowRoot = this.attachShadow();
|
|
24
29
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
25
30
|
|
|
26
31
|
_classPrivateFieldSet(this, _$caption, shadowRoot.querySelector('#caption'));
|
|
32
|
+
|
|
33
|
+
_classPrivateFieldSet(this, _$collapseSlot, shadowRoot.querySelector('slot[name="collapse"]'));
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
static get observedAttributes() {
|
|
@@ -56,4 +63,10 @@ defineCustomElement('sinch-segment', (_$caption = new WeakMap(), class extends N
|
|
|
56
63
|
return getBooleanAttribute(this, 'collapsed');
|
|
57
64
|
}
|
|
58
65
|
|
|
66
|
+
get collapseButtonRect() {
|
|
67
|
+
const $collapseButton = _classPrivateFieldGet(this, _$collapseSlot).assignedElements()[0];
|
|
68
|
+
|
|
69
|
+
return $collapseButton != null ? getRect($collapseButton) : null;
|
|
70
|
+
}
|
|
71
|
+
|
|
59
72
|
}));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../icons/expand-less';
|
|
2
2
|
import '../icons/expand-more';
|
|
3
|
+
import '../icon-button';
|
|
3
4
|
import type { TSinchElementReact } from '../types';
|
|
4
5
|
import type { FocusEvent, SyntheticEvent } from 'react';
|
|
5
6
|
export declare type TSinchSegmentExpandElement = HTMLElement & {
|
|
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
|
|
3
3
|
import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
|
|
4
4
|
|
|
5
|
-
var _$
|
|
5
|
+
var _$button;
|
|
6
6
|
|
|
7
7
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
8
8
|
|
|
@@ -10,27 +10,24 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
|
10
10
|
|
|
11
11
|
import '../icons/expand-less';
|
|
12
12
|
import '../icons/expand-more';
|
|
13
|
+
import '../icon-button';
|
|
13
14
|
import { defineCustomElement, getBooleanAttribute, isAttrTrue, NectaryElement, updateBooleanAttribute } from '../utils';
|
|
14
|
-
const templateHTML = '<style>:host{display:
|
|
15
|
+
const templateHTML = '<style>:host{display:block;--sinch-size-icon:32px}#up{display:block}#down{display:none}:host([value]:not([value=false])) #up{display:none}:host([value]:not([value=false])) #down{display:block}</style><sinch-icon-button id="button" small><sinch-icon-expand-less id="up" slot="icon"></sinch-icon-expand-less><sinch-icon-expand-more id="down" slot="icon"></sinch-icon-expand-more></sinch-icon-button>';
|
|
15
16
|
const template = document.createElement('template');
|
|
16
17
|
template.innerHTML = templateHTML;
|
|
17
|
-
defineCustomElement('sinch-segment-collapse', (_$
|
|
18
|
+
defineCustomElement('sinch-segment-collapse', (_$button = new WeakMap(), class extends NectaryElement {
|
|
18
19
|
constructor() {
|
|
19
20
|
super();
|
|
20
21
|
|
|
21
|
-
_classPrivateFieldInitSpec(this, _$
|
|
22
|
+
_classPrivateFieldInitSpec(this, _$button, {
|
|
22
23
|
writable: true,
|
|
23
24
|
value: void 0
|
|
24
25
|
});
|
|
25
26
|
|
|
26
|
-
_defineProperty(this, '
|
|
27
|
+
_defineProperty(this, 'onClick', e => {
|
|
27
28
|
e.stopPropagation();
|
|
28
|
-
|
|
29
|
-
const isChecked = _classPrivateFieldGet(this, _$input).checked;
|
|
30
|
-
|
|
31
|
-
_classPrivateFieldGet(this, _$input).checked = this.value;
|
|
32
29
|
this.dispatchEvent(new CustomEvent('change', {
|
|
33
|
-
detail:
|
|
30
|
+
detail: !this.value,
|
|
34
31
|
bubbles: true
|
|
35
32
|
}));
|
|
36
33
|
});
|
|
@@ -38,41 +35,42 @@ defineCustomElement('sinch-segment-collapse', (_$input = new WeakMap(), class ex
|
|
|
38
35
|
const shadowRoot = this.attachShadow();
|
|
39
36
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
40
37
|
|
|
41
|
-
_classPrivateFieldSet(this, _$
|
|
38
|
+
_classPrivateFieldSet(this, _$button, shadowRoot.querySelector('#button'));
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
connectedCallback() {
|
|
45
42
|
this.setAttribute('role', 'checkbox');
|
|
43
|
+
this.setAttribute('aria-checked', String(getBooleanAttribute(this, 'value')));
|
|
46
44
|
|
|
47
|
-
_classPrivateFieldGet(this, _$
|
|
45
|
+
_classPrivateFieldGet(this, _$button).addEventListener('click', this.onClick);
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
disconnectedCallback() {
|
|
51
|
-
_classPrivateFieldGet(this, _$
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
get type() {
|
|
55
|
-
return 'text';
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
get nodeName() {
|
|
59
|
-
return 'input';
|
|
49
|
+
_classPrivateFieldGet(this, _$button).removeEventListener('click', this.onClick);
|
|
60
50
|
}
|
|
61
51
|
|
|
62
52
|
static get observedAttributes() {
|
|
63
53
|
return ['value'];
|
|
64
54
|
}
|
|
65
55
|
|
|
66
|
-
attributeChangedCallback(name,
|
|
56
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
67
57
|
switch (name) {
|
|
68
58
|
case 'value':
|
|
69
59
|
{
|
|
70
|
-
|
|
60
|
+
this.setAttribute('aria-checked', String(isAttrTrue(newVal)));
|
|
71
61
|
break;
|
|
72
62
|
}
|
|
73
63
|
}
|
|
74
64
|
}
|
|
75
65
|
|
|
66
|
+
get type() {
|
|
67
|
+
return 'text';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get nodeName() {
|
|
71
|
+
return 'input';
|
|
72
|
+
}
|
|
73
|
+
|
|
76
74
|
set value(isChecked) {
|
|
77
75
|
updateBooleanAttribute(this, 'value', isChecked);
|
|
78
76
|
}
|
|
@@ -82,11 +80,11 @@ defineCustomElement('sinch-segment-collapse', (_$input = new WeakMap(), class ex
|
|
|
82
80
|
}
|
|
83
81
|
|
|
84
82
|
focus() {
|
|
85
|
-
_classPrivateFieldGet(this, _$
|
|
83
|
+
_classPrivateFieldGet(this, _$button).focus();
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
blur() {
|
|
89
|
-
_classPrivateFieldGet(this, _$
|
|
87
|
+
_classPrivateFieldGet(this, _$button).blur();
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TSinchElementReact } from '../types';
|
|
2
|
+
import type { SyntheticEvent } from 'react';
|
|
3
|
+
export declare type TSinchSegmentedControlElement = HTMLElement & {
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type TSinchSegmentedControlReact = TSinchElementReact<TSinchSegmentedControlElement> & {
|
|
7
|
+
value: string;
|
|
8
|
+
'aria-label': string;
|
|
9
|
+
onChange: (event: SyntheticEvent<TSinchSegmentedControlElement, CustomEvent<string>>) => void;
|
|
10
|
+
};
|
|
11
|
+
declare global {
|
|
12
|
+
namespace JSX {
|
|
13
|
+
interface IntrinsicElements {
|
|
14
|
+
'sinch-segmented-control': TSinchSegmentedControlReact;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'sinch-segmented-control': TSinchSegmentedControlElement;
|
|
19
|
+
}
|
|
20
|
+
}
|