@hortiview/shared-components 2.8.6 → 2.8.8
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/CHANGELOG.md +12 -0
- package/dist/{AlertBanner-DlgFtlZm.js → AlertBanner-D-NTP_6i.js} +3 -3
- package/dist/{BigLoadingSpinner-B_HFhx2F.js → BigLoadingSpinner-CCxsMWnc.js} +1 -1
- package/dist/{GenericCard-Cv8qaFLu.js → GenericCard-DOKyENNm.js} +3 -3
- package/dist/{ListAreaService-D9HRsvH0.js → ListAreaService-CI-s1Xx5.js} +5 -5
- package/dist/{OfflineView-Bw-sbsym.js → OfflineView-DHtzNLwt.js} +3 -3
- package/dist/_Map-BmafU0dj.js +113 -0
- package/dist/assets/FormSelect.css +1 -1
- package/dist/components/AlertBanner/AlertBanner.js +4 -4
- package/dist/components/AlertBanner/AlertBanner.test.js +1 -1
- package/dist/components/AlertBanner/LinkBanner.js +3 -3
- package/dist/components/BaseView/BaseView.js +2 -2
- package/dist/components/BasicHeading/BasicHeading.js +2 -2
- package/dist/components/BasicHeading/BasicHeading.test.js +1 -1
- package/dist/components/BlockView/BlockView.js +1 -1
- package/dist/components/ChipCard/ChipCard.js +499 -390
- package/dist/components/ContextMenu/ContextMenu.js +4 -4
- package/dist/components/DeleteModal/DeleteModal.js +5 -5
- package/dist/components/DetailContentWrapper/DetailContentWrapper.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.js +3 -3
- package/dist/components/EmptyView/EmptyView.js +161 -125
- package/dist/components/Filter/Filter.js +11 -11
- package/dist/components/Filter/Filter.test.js +51 -35
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +10 -10
- package/dist/components/FormComponents/FormNumber/CustomTextField.js +3 -3
- package/dist/components/FormComponents/FormRadio/FormRadio.js +1 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.js +53 -53
- package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +2 -2
- package/dist/components/FormComponents/FormSlider/FormSlider.js +540 -535
- package/dist/components/FormComponents/FormText/FormText.js +2 -2
- package/dist/components/FormComponents/FormToggle/FormToggle.js +4 -4
- package/dist/components/GenericTable/GenericTable.js +8246 -7153
- package/dist/components/GenericTable/Mobile/GenericCard.js +4 -4
- package/dist/components/GenericTable/Mobile/GenericCard.test.js +1 -1
- package/dist/components/GenericTable/Mobile/GenericCardList.js +4 -4
- package/dist/components/HashTabView/HashTabView.js +552 -541
- package/dist/components/HeaderFilter/HeaderFilter.js +1 -1
- package/dist/components/Iconify/Iconify.js +2 -2
- package/dist/components/InfoCard/InfoCard.js +4 -4
- package/dist/components/InfoGroup/InfoGroup.js +3 -3
- package/dist/components/ListArea/ListArea.js +16 -16
- package/dist/components/ListArea/ListArea.test.js +20 -20
- package/dist/components/ListArea/ListAreaService.js +6 -6
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +2 -2
- package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +1 -1
- package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +164 -178
- package/dist/components/Modal/Modal.js +305 -312
- package/dist/components/ModulePadding/ModulePadding.js +8 -8
- package/dist/components/OfflineView/OfflineView.js +4 -4
- package/dist/components/OfflineView/OfflineView.test.js +1 -1
- package/dist/components/OnboardingBanner/OnboardingBanner.js +13 -13
- package/dist/components/OverflowTooltip/OverflowTooltip.js +1 -1
- package/dist/components/OverflowTooltip/OverflowTooltip.test.js +1 -1
- package/dist/components/SearchBar/SearchBar.js +2 -2
- package/dist/components/SearchBar/SearchBar.test.js +1 -1
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Stepper/components/StepperButton.js +1 -1
- package/dist/components/Stepper/components/StepperHeader.js +2 -2
- package/dist/components/Stepper/components/StepperIndicator.js +1 -1
- package/dist/defineProperty-CmuOyxyf.js +318 -0
- package/dist/es.string.iterator-DrqCBub-.js +581 -0
- package/dist/find-B-dm7n_F.js +88 -0
- package/dist/{get-CqneoueQ.js → get-DuK51wnj.js} +1 -1
- package/dist/get-u1nFMLdT.js +377 -0
- package/dist/hooks/useHelperText.js +1 -1
- package/dist/identity-BIZAN_pL.js +213 -0
- package/dist/includes-Bt-Stz_B.js +110 -0
- package/dist/index-Cpb-8cAN.js +2465 -0
- package/dist/index.es-0QJC9VS2.js +325 -0
- package/dist/{index.es-CyjMwj5g.js → index.es-45NOgWlB.js} +93 -101
- package/dist/index.es-B6ZgiW2s.js +3790 -0
- package/dist/{index.es-1zrFd4Te.js → index.es-BGordhUK.js} +352 -323
- package/dist/index.es-BRtk0Q33.js +42 -0
- package/dist/index.es-BXj90wb_.js +402 -0
- package/dist/index.es-Bg8hxXM8.js +912 -0
- package/dist/index.es-Bgjh6euR.js +292 -0
- package/dist/index.es-Bo1Rhtyb.js +80 -0
- package/dist/{index.es-BaX-8joZ.js → index.es-CK4oZMKs.js} +3329 -3232
- package/dist/{index.es-nQ0lMwpE.js → index.es-CKdJX75f.js} +74 -78
- package/dist/index.es-CmF6xAUJ.js +48 -0
- package/dist/{index.es-p4O33fMu.js → index.es-Cq04gn3U.js} +321 -305
- package/dist/{index.es-Cdu6tjUC.js → index.es-D1IpdMde.js} +87 -95
- package/dist/index.es-DDYCugj-.js +166 -0
- package/dist/{index.es-jFaPNuBO.js → index.es-DENZVv7_.js} +427 -444
- package/dist/{index.es-Dnrk7XL6.js → index.es-DObVvepK.js} +158 -166
- package/dist/index.es-DeF-y7fd.js +122 -0
- package/dist/{index.es-ks_RnHLh.js → index.es-Dfju71Pi.js} +27 -37
- package/dist/index.es-DqSY-ePE.js +4923 -0
- package/dist/index.es-DwzB1d7_.js +1061 -0
- package/dist/index.es-IXyb5F6n.js +457 -0
- package/dist/index.es-t7hFwQSs.js +67 -0
- package/dist/isArray-DN9s620O.js +83 -0
- package/dist/{isArray-CSaAxHlq.js → isArray-Dub1wGJM.js} +1 -1
- package/dist/{isEmpty-SkzPhavO.js → isEmpty-CxD71Jv8.js} +4 -5
- package/dist/{isString-CZsZiWgW.js → isString-BNaBRq3S.js} +2 -2
- package/dist/isTypedArray-Dw_IY7Zq.js +212 -0
- package/dist/keyboard-B-WUULl-.js +173 -0
- package/dist/main.js +2 -2
- package/dist/map-Dbvlv_6y.js +707 -0
- package/dist/omit-uTAyrUTm.js +645 -0
- package/dist/orderBy-BXxEvUw6.js +571 -0
- package/dist/parse-int-qVAoFbOL.js +75 -0
- package/dist/services/UtilService.js +7 -7
- package/dist/slicedToArray-BWk2gTCn.js +436 -0
- package/dist/{toString-BFJes2_D.js → toString-CrgB_7Pe.js} +1 -1
- package/dist/{uniqueId-DrPMzA-E.js → uniqueId-NU3-C36A.js} +1 -1
- package/package.json +3 -3
- package/dist/_baseIsEqual-Df2URKWm.js +0 -240
- package/dist/_getAllKeys-BQWmkEw5.js +0 -86
- package/dist/_getTag-BkGSRa18.js +0 -79
- package/dist/_setToString-B6E13pDg.js +0 -580
- package/dist/get-DQr2KQKm.js +0 -113
- package/dist/index-D5m--65X.js +0 -1491
- package/dist/index.es-8MVlRCi4.js +0 -1066
- package/dist/index.es-BbaCXS9-.js +0 -45
- package/dist/index.es-BikIx4uw.js +0 -3242
- package/dist/index.es-CDMu_yu0.js +0 -954
- package/dist/index.es-ChSlnpSq.js +0 -309
- package/dist/index.es-D66OkZJH.js +0 -4853
- package/dist/index.es-DFFyENnI.js +0 -63
- package/dist/index.es-DTMwaJ6B.js +0 -56
- package/dist/index.es-DgTJmbgD.js +0 -268
- package/dist/index.es-DmsyeHLO.js +0 -306
- package/dist/index.es-Dw1eih7R.js +0 -159
- package/dist/index.es-eKuwB1ll.js +0 -54
- package/dist/index.es-qxTN-Bb2.js +0 -107
- package/dist/index.es-xnSvM9b9.js +0 -444
- package/dist/isArray-DDZrq40X.js +0 -456
- package/dist/keyboard-Bpt0aBqQ.js +0 -107
- package/dist/omit-BN3qeeaj.js +0 -364
- package/dist/orderBy-D4LvP9Az.js +0 -316
|
@@ -1,3242 +0,0 @@
|
|
|
1
|
-
import { c as q, _ as $, P as o } from "./index-D5m--65X.js";
|
|
2
|
-
import u, { createContext as Ct, forwardRef as Q, useState as Se, useRef as ge, useImperativeHandle as Pe, useCallback as W, useEffect as j, useMemo as ee, useContext as qe, Fragment as ot } from "react";
|
|
3
|
-
import { f as ft, C as Tt, c as rt, b as Pt, h as Rt, j as _t, k as at, l as wt } from "./index.es-ChSlnpSq.js";
|
|
4
|
-
import { P as Bt } from "./index.es-DTMwaJ6B.js";
|
|
5
|
-
import { b as Re, c as Ne, d as Ft } from "./tslib.es6-BDCynO9F.js";
|
|
6
|
-
import { M as ht, a as mt } from "./component-neHBNHRu.js";
|
|
7
|
-
import { a as kt } from "./util-DA21pZXj.js";
|
|
8
|
-
import { m as ke, c as lt } from "./component-DsB0poTj.js";
|
|
9
|
-
import { n as se } from "./keyboard-Bpt0aBqQ.js";
|
|
10
|
-
import { g as Ht } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
11
|
-
import { r as Kt } from "./_baseIsEqual-Df2URKWm.js";
|
|
12
|
-
import { R as Ut } from "./index.es-BbaCXS9-.js";
|
|
13
|
-
import { R as Gt } from "./index.es-Cdu6tjUC.js";
|
|
14
|
-
import { C as Vt } from "./index.es-Dnrk7XL6.js";
|
|
15
|
-
import { S as zt } from "./index.es-CyjMwj5g.js";
|
|
16
|
-
import { I as je } from "./index.es-8MVlRCi4.js";
|
|
17
|
-
import { d as ct, a as Xt } from "./index.es-1zrFd4Te.js";
|
|
18
|
-
/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright 2018 Google Inc.
|
|
21
|
-
*
|
|
22
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
23
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
24
|
-
* in the Software without restriction, including without limitation the rights
|
|
25
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
26
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
27
|
-
* furnished to do so, subject to the following conditions:
|
|
28
|
-
*
|
|
29
|
-
* The above copyright notice and this permission notice shall be included in
|
|
30
|
-
* all copies or substantial portions of the Software.
|
|
31
|
-
*
|
|
32
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
33
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
34
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
35
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
36
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
37
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
38
|
-
* THE SOFTWARE.
|
|
39
|
-
*/
|
|
40
|
-
var He = {
|
|
41
|
-
ANCHOR: "mdc-menu-surface--anchor",
|
|
42
|
-
ANIMATING_CLOSED: "mdc-menu-surface--animating-closed",
|
|
43
|
-
ANIMATING_OPEN: "mdc-menu-surface--animating-open",
|
|
44
|
-
FIXED: "mdc-menu-surface--fixed",
|
|
45
|
-
IS_OPEN_BELOW: "mdc-menu-surface--is-open-below",
|
|
46
|
-
OPEN: "mdc-menu-surface--open",
|
|
47
|
-
ROOT: "mdc-menu-surface"
|
|
48
|
-
}, Ke = {
|
|
49
|
-
CLOSED_EVENT: "MDCMenuSurface:closed",
|
|
50
|
-
CLOSING_EVENT: "MDCMenuSurface:closing",
|
|
51
|
-
OPENED_EVENT: "MDCMenuSurface:opened",
|
|
52
|
-
FOCUSABLE_ELEMENTS: [
|
|
53
|
-
"button:not(:disabled)",
|
|
54
|
-
'[href]:not([aria-disabled="true"])',
|
|
55
|
-
"input:not(:disabled)",
|
|
56
|
-
"select:not(:disabled)",
|
|
57
|
-
"textarea:not(:disabled)",
|
|
58
|
-
'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'
|
|
59
|
-
].join(", ")
|
|
60
|
-
}, Xe = {
|
|
61
|
-
/** Total duration of menu-surface open animation. */
|
|
62
|
-
TRANSITION_OPEN_DURATION: 120,
|
|
63
|
-
/** Total duration of menu-surface close animation. */
|
|
64
|
-
TRANSITION_CLOSE_DURATION: 75,
|
|
65
|
-
/** Margin left to the edge of the viewport when menu-surface is at maximum possible height. Also used as a viewport margin. */
|
|
66
|
-
MARGIN_TO_EDGE: 32,
|
|
67
|
-
/** Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning. */
|
|
68
|
-
ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67
|
|
69
|
-
}, V;
|
|
70
|
-
(function(s) {
|
|
71
|
-
s[s.BOTTOM = 1] = "BOTTOM", s[s.CENTER = 2] = "CENTER", s[s.RIGHT = 4] = "RIGHT", s[s.FLIP_RTL = 8] = "FLIP_RTL";
|
|
72
|
-
})(V || (V = {}));
|
|
73
|
-
var Oe;
|
|
74
|
-
(function(s) {
|
|
75
|
-
s[s.TOP_LEFT = 0] = "TOP_LEFT", s[s.TOP_RIGHT = 4] = "TOP_RIGHT", s[s.BOTTOM_LEFT = 1] = "BOTTOM_LEFT", s[s.BOTTOM_RIGHT = 5] = "BOTTOM_RIGHT", s[s.TOP_START = 8] = "TOP_START", s[s.TOP_END = 12] = "TOP_END", s[s.BOTTOM_START = 9] = "BOTTOM_START", s[s.BOTTOM_END = 13] = "BOTTOM_END";
|
|
76
|
-
})(Oe || (Oe = {}));
|
|
77
|
-
/**
|
|
78
|
-
* @license
|
|
79
|
-
* Copyright 2018 Google Inc.
|
|
80
|
-
*
|
|
81
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
82
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
83
|
-
* in the Software without restriction, including without limitation the rights
|
|
84
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
85
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
86
|
-
* furnished to do so, subject to the following conditions:
|
|
87
|
-
*
|
|
88
|
-
* The above copyright notice and this permission notice shall be included in
|
|
89
|
-
* all copies or substantial portions of the Software.
|
|
90
|
-
*
|
|
91
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
92
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
93
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
94
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
95
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
96
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
97
|
-
* THE SOFTWARE.
|
|
98
|
-
*/
|
|
99
|
-
var Te, ye, I = {
|
|
100
|
-
LIST_ITEM_ACTIVATED_CLASS: "mdc-list-item--activated",
|
|
101
|
-
LIST_ITEM_CLASS: "mdc-list-item",
|
|
102
|
-
LIST_ITEM_DISABLED_CLASS: "mdc-list-item--disabled",
|
|
103
|
-
LIST_ITEM_SELECTED_CLASS: "mdc-list-item--selected",
|
|
104
|
-
LIST_ITEM_TEXT_CLASS: "mdc-list-item__text",
|
|
105
|
-
LIST_ITEM_PRIMARY_TEXT_CLASS: "mdc-list-item__primary-text",
|
|
106
|
-
ROOT: "mdc-list"
|
|
107
|
-
}, jt = (Te = {}, Te["" + I.LIST_ITEM_ACTIVATED_CLASS] = "mdc-list-item--activated", Te["" + I.LIST_ITEM_CLASS] = "mdc-list-item", Te["" + I.LIST_ITEM_DISABLED_CLASS] = "mdc-list-item--disabled", Te["" + I.LIST_ITEM_SELECTED_CLASS] = "mdc-list-item--selected", Te["" + I.LIST_ITEM_PRIMARY_TEXT_CLASS] = "mdc-list-item__primary-text", Te["" + I.ROOT] = "mdc-list", Te), ve = (ye = {}, ye["" + I.LIST_ITEM_ACTIVATED_CLASS] = "mdc-deprecated-list-item--activated", ye["" + I.LIST_ITEM_CLASS] = "mdc-deprecated-list-item", ye["" + I.LIST_ITEM_DISABLED_CLASS] = "mdc-deprecated-list-item--disabled", ye["" + I.LIST_ITEM_SELECTED_CLASS] = "mdc-deprecated-list-item--selected", ye["" + I.LIST_ITEM_TEXT_CLASS] = "mdc-deprecated-list-item__text", ye["" + I.LIST_ITEM_PRIMARY_TEXT_CLASS] = "mdc-deprecated-list-item__primary-text", ye["" + I.ROOT] = "mdc-deprecated-list", ye), K = {
|
|
108
|
-
ACTION_EVENT: "MDCList:action",
|
|
109
|
-
ARIA_CHECKED: "aria-checked",
|
|
110
|
-
ARIA_CHECKED_CHECKBOX_SELECTOR: '[role="checkbox"][aria-checked="true"]',
|
|
111
|
-
ARIA_CHECKED_RADIO_SELECTOR: '[role="radio"][aria-checked="true"]',
|
|
112
|
-
ARIA_CURRENT: "aria-current",
|
|
113
|
-
ARIA_DISABLED: "aria-disabled",
|
|
114
|
-
ARIA_ORIENTATION: "aria-orientation",
|
|
115
|
-
ARIA_ORIENTATION_HORIZONTAL: "horizontal",
|
|
116
|
-
ARIA_ROLE_CHECKBOX_SELECTOR: '[role="checkbox"]',
|
|
117
|
-
ARIA_SELECTED: "aria-selected",
|
|
118
|
-
ARIA_INTERACTIVE_ROLES_SELECTOR: '[role="listbox"], [role="menu"]',
|
|
119
|
-
ARIA_MULTI_SELECTABLE_SELECTOR: '[aria-multiselectable="true"]',
|
|
120
|
-
CHECKBOX_RADIO_SELECTOR: 'input[type="checkbox"], input[type="radio"]',
|
|
121
|
-
CHECKBOX_SELECTOR: 'input[type="checkbox"]',
|
|
122
|
-
CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: `
|
|
123
|
-
.` + I.LIST_ITEM_CLASS + ` button:not(:disabled),
|
|
124
|
-
.` + I.LIST_ITEM_CLASS + ` a,
|
|
125
|
-
.` + ve[I.LIST_ITEM_CLASS] + ` button:not(:disabled),
|
|
126
|
-
.` + ve[I.LIST_ITEM_CLASS] + ` a
|
|
127
|
-
`,
|
|
128
|
-
DEPRECATED_SELECTOR: ".mdc-deprecated-list",
|
|
129
|
-
FOCUSABLE_CHILD_ELEMENTS: `
|
|
130
|
-
.` + I.LIST_ITEM_CLASS + ` button:not(:disabled),
|
|
131
|
-
.` + I.LIST_ITEM_CLASS + ` a,
|
|
132
|
-
.` + I.LIST_ITEM_CLASS + ` input[type="radio"]:not(:disabled),
|
|
133
|
-
.` + I.LIST_ITEM_CLASS + ` input[type="checkbox"]:not(:disabled),
|
|
134
|
-
.` + ve[I.LIST_ITEM_CLASS] + ` button:not(:disabled),
|
|
135
|
-
.` + ve[I.LIST_ITEM_CLASS] + ` a,
|
|
136
|
-
.` + ve[I.LIST_ITEM_CLASS] + ` input[type="radio"]:not(:disabled),
|
|
137
|
-
.` + ve[I.LIST_ITEM_CLASS] + ` input[type="checkbox"]:not(:disabled)
|
|
138
|
-
`,
|
|
139
|
-
RADIO_SELECTOR: 'input[type="radio"]',
|
|
140
|
-
SELECTED_ITEM_SELECTOR: '[aria-selected="true"], [aria-current="true"]'
|
|
141
|
-
}, Y = {
|
|
142
|
-
UNSET_INDEX: -1,
|
|
143
|
-
TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS: 300
|
|
144
|
-
}, qt = "evolution";
|
|
145
|
-
/**
|
|
146
|
-
* @license
|
|
147
|
-
* Copyright 2020 Google Inc.
|
|
148
|
-
*
|
|
149
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
150
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
151
|
-
* in the Software without restriction, including without limitation the rights
|
|
152
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
153
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
154
|
-
* furnished to do so, subject to the following conditions:
|
|
155
|
-
*
|
|
156
|
-
* The above copyright notice and this permission notice shall be included in
|
|
157
|
-
* all copies or substantial portions of the Software.
|
|
158
|
-
*
|
|
159
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
160
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
161
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
162
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
163
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
164
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
165
|
-
* THE SOFTWARE.
|
|
166
|
-
*/
|
|
167
|
-
var $t = ["input", "button", "textarea", "select"], Ce = function(s) {
|
|
168
|
-
var n = s.target;
|
|
169
|
-
if (n) {
|
|
170
|
-
var e = ("" + n.tagName).toLowerCase();
|
|
171
|
-
$t.indexOf(e) === -1 && s.preventDefault();
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
/**
|
|
175
|
-
* @license
|
|
176
|
-
* Copyright 2020 Google Inc.
|
|
177
|
-
*
|
|
178
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
179
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
180
|
-
* in the Software without restriction, including without limitation the rights
|
|
181
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
182
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
183
|
-
* furnished to do so, subject to the following conditions:
|
|
184
|
-
*
|
|
185
|
-
* The above copyright notice and this permission notice shall be included in
|
|
186
|
-
* all copies or substantial portions of the Software.
|
|
187
|
-
*
|
|
188
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
189
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
190
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
191
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
192
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
193
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
194
|
-
* THE SOFTWARE.
|
|
195
|
-
*/
|
|
196
|
-
function Wt() {
|
|
197
|
-
var s = {
|
|
198
|
-
bufferClearTimeout: 0,
|
|
199
|
-
currentFirstChar: "",
|
|
200
|
-
sortedIndexCursor: 0,
|
|
201
|
-
typeaheadBuffer: ""
|
|
202
|
-
};
|
|
203
|
-
return s;
|
|
204
|
-
}
|
|
205
|
-
function Yt(s, n) {
|
|
206
|
-
for (var e = /* @__PURE__ */ new Map(), t = 0; t < s; t++) {
|
|
207
|
-
var i = n(t).trim();
|
|
208
|
-
if (i) {
|
|
209
|
-
var r = i[0].toLowerCase();
|
|
210
|
-
e.has(r) || e.set(r, []), e.get(r).push({ text: i.toLowerCase(), index: t });
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
return e.forEach(function(a) {
|
|
214
|
-
a.sort(function(l, m) {
|
|
215
|
-
return l.index - m.index;
|
|
216
|
-
});
|
|
217
|
-
}), e;
|
|
218
|
-
}
|
|
219
|
-
function ut(s, n) {
|
|
220
|
-
var e = s.nextChar, t = s.focusItemAtIndex, i = s.sortedIndexByFirstChar, r = s.focusedItemIndex, a = s.skipFocus, l = s.isItemAtIndexDisabled;
|
|
221
|
-
clearTimeout(n.bufferClearTimeout), n.bufferClearTimeout = setTimeout(function() {
|
|
222
|
-
bt(n);
|
|
223
|
-
}, Y.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS), n.typeaheadBuffer = n.typeaheadBuffer + e;
|
|
224
|
-
var m;
|
|
225
|
-
return n.typeaheadBuffer.length === 1 ? m = Qt(i, r, l, n) : m = Zt(i, l, n), m !== -1 && !a && t(m), m;
|
|
226
|
-
}
|
|
227
|
-
function Qt(s, n, e, t) {
|
|
228
|
-
var i = t.typeaheadBuffer[0], r = s.get(i);
|
|
229
|
-
if (!r)
|
|
230
|
-
return -1;
|
|
231
|
-
if (i === t.currentFirstChar && r[t.sortedIndexCursor].index === n) {
|
|
232
|
-
t.sortedIndexCursor = (t.sortedIndexCursor + 1) % r.length;
|
|
233
|
-
var a = r[t.sortedIndexCursor].index;
|
|
234
|
-
if (!e(a))
|
|
235
|
-
return a;
|
|
236
|
-
}
|
|
237
|
-
t.currentFirstChar = i;
|
|
238
|
-
var l = -1, m;
|
|
239
|
-
for (m = 0; m < r.length; m++)
|
|
240
|
-
if (!e(r[m].index)) {
|
|
241
|
-
l = m;
|
|
242
|
-
break;
|
|
243
|
-
}
|
|
244
|
-
for (; m < r.length; m++)
|
|
245
|
-
if (r[m].index > n && !e(r[m].index)) {
|
|
246
|
-
l = m;
|
|
247
|
-
break;
|
|
248
|
-
}
|
|
249
|
-
return l !== -1 ? (t.sortedIndexCursor = l, r[t.sortedIndexCursor].index) : -1;
|
|
250
|
-
}
|
|
251
|
-
function Zt(s, n, e) {
|
|
252
|
-
var t = e.typeaheadBuffer[0], i = s.get(t);
|
|
253
|
-
if (!i)
|
|
254
|
-
return -1;
|
|
255
|
-
var r = i[e.sortedIndexCursor];
|
|
256
|
-
if (r.text.lastIndexOf(e.typeaheadBuffer, 0) === 0 && !n(r.index))
|
|
257
|
-
return r.index;
|
|
258
|
-
for (var a = (e.sortedIndexCursor + 1) % i.length, l = -1; a !== e.sortedIndexCursor; ) {
|
|
259
|
-
var m = i[a], D = m.text.lastIndexOf(e.typeaheadBuffer, 0) === 0, b = !n(m.index);
|
|
260
|
-
if (D && b) {
|
|
261
|
-
l = a;
|
|
262
|
-
break;
|
|
263
|
-
}
|
|
264
|
-
a = (a + 1) % i.length;
|
|
265
|
-
}
|
|
266
|
-
return l !== -1 ? (e.sortedIndexCursor = l, i[e.sortedIndexCursor].index) : -1;
|
|
267
|
-
}
|
|
268
|
-
function xt(s) {
|
|
269
|
-
return s.typeaheadBuffer.length > 0;
|
|
270
|
-
}
|
|
271
|
-
function bt(s) {
|
|
272
|
-
s.typeaheadBuffer = "";
|
|
273
|
-
}
|
|
274
|
-
function St(s, n) {
|
|
275
|
-
var e = s.event, t = s.isTargetListItem, i = s.focusedItemIndex, r = s.focusItemAtIndex, a = s.sortedIndexByFirstChar, l = s.isItemAtIndexDisabled, m = se(e) === "ArrowLeft", D = se(e) === "ArrowUp", b = se(e) === "ArrowRight", y = se(e) === "ArrowDown", S = se(e) === "Home", d = se(e) === "End", f = se(e) === "Enter", L = se(e) === "Spacebar";
|
|
276
|
-
if (e.ctrlKey || e.metaKey || m || D || b || y || S || d || f)
|
|
277
|
-
return -1;
|
|
278
|
-
var B = !L && e.key.length === 1;
|
|
279
|
-
if (B) {
|
|
280
|
-
Ce(e);
|
|
281
|
-
var M = {
|
|
282
|
-
focusItemAtIndex: r,
|
|
283
|
-
focusedItemIndex: i,
|
|
284
|
-
nextChar: e.key.toLowerCase(),
|
|
285
|
-
sortedIndexByFirstChar: a,
|
|
286
|
-
skipFocus: !1,
|
|
287
|
-
isItemAtIndexDisabled: l
|
|
288
|
-
};
|
|
289
|
-
return ut(M, n);
|
|
290
|
-
}
|
|
291
|
-
if (!L)
|
|
292
|
-
return -1;
|
|
293
|
-
t && Ce(e);
|
|
294
|
-
var c = t && xt(n);
|
|
295
|
-
if (c) {
|
|
296
|
-
var M = {
|
|
297
|
-
focusItemAtIndex: r,
|
|
298
|
-
focusedItemIndex: i,
|
|
299
|
-
nextChar: " ",
|
|
300
|
-
sortedIndexByFirstChar: a,
|
|
301
|
-
skipFocus: !1,
|
|
302
|
-
isItemAtIndexDisabled: l
|
|
303
|
-
};
|
|
304
|
-
return ut(M, n);
|
|
305
|
-
}
|
|
306
|
-
return -1;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* @license
|
|
310
|
-
* Copyright 2018 Google Inc.
|
|
311
|
-
*
|
|
312
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
313
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
314
|
-
* in the Software without restriction, including without limitation the rights
|
|
315
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
316
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
317
|
-
* furnished to do so, subject to the following conditions:
|
|
318
|
-
*
|
|
319
|
-
* The above copyright notice and this permission notice shall be included in
|
|
320
|
-
* all copies or substantial portions of the Software.
|
|
321
|
-
*
|
|
322
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
323
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
324
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
325
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
326
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
327
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
328
|
-
* THE SOFTWARE.
|
|
329
|
-
*/
|
|
330
|
-
function Jt(s) {
|
|
331
|
-
return s instanceof Array;
|
|
332
|
-
}
|
|
333
|
-
var dt = (
|
|
334
|
-
/** @class */
|
|
335
|
-
function(s) {
|
|
336
|
-
Re(n, s);
|
|
337
|
-
function n(e) {
|
|
338
|
-
var t = s.call(this, Ne(Ne({}, n.defaultAdapter), e)) || this;
|
|
339
|
-
return t.wrapFocus_ = !1, t.isVertical_ = !0, t.isSingleSelectionList_ = !1, t.selectedIndex_ = Y.UNSET_INDEX, t.focusedItemIndex = Y.UNSET_INDEX, t.useActivatedClass_ = !1, t.useSelectedAttr_ = !1, t.ariaCurrentAttrValue_ = null, t.isCheckboxList_ = !1, t.isRadioList_ = !1, t.hasTypeahead = !1, t.typeaheadState = Wt(), t.sortedIndexByFirstChar = /* @__PURE__ */ new Map(), t;
|
|
340
|
-
}
|
|
341
|
-
return Object.defineProperty(n, "strings", {
|
|
342
|
-
get: function() {
|
|
343
|
-
return K;
|
|
344
|
-
},
|
|
345
|
-
enumerable: !1,
|
|
346
|
-
configurable: !0
|
|
347
|
-
}), Object.defineProperty(n, "cssClasses", {
|
|
348
|
-
get: function() {
|
|
349
|
-
return I;
|
|
350
|
-
},
|
|
351
|
-
enumerable: !1,
|
|
352
|
-
configurable: !0
|
|
353
|
-
}), Object.defineProperty(n, "numbers", {
|
|
354
|
-
get: function() {
|
|
355
|
-
return Y;
|
|
356
|
-
},
|
|
357
|
-
enumerable: !1,
|
|
358
|
-
configurable: !0
|
|
359
|
-
}), Object.defineProperty(n, "defaultAdapter", {
|
|
360
|
-
get: function() {
|
|
361
|
-
return {
|
|
362
|
-
addClassForElementIndex: function() {
|
|
363
|
-
},
|
|
364
|
-
focusItemAtIndex: function() {
|
|
365
|
-
},
|
|
366
|
-
getAttributeForElementIndex: function() {
|
|
367
|
-
return null;
|
|
368
|
-
},
|
|
369
|
-
getFocusedElementIndex: function() {
|
|
370
|
-
return 0;
|
|
371
|
-
},
|
|
372
|
-
getListItemCount: function() {
|
|
373
|
-
return 0;
|
|
374
|
-
},
|
|
375
|
-
hasCheckboxAtIndex: function() {
|
|
376
|
-
return !1;
|
|
377
|
-
},
|
|
378
|
-
hasRadioAtIndex: function() {
|
|
379
|
-
return !1;
|
|
380
|
-
},
|
|
381
|
-
isCheckboxCheckedAtIndex: function() {
|
|
382
|
-
return !1;
|
|
383
|
-
},
|
|
384
|
-
isFocusInsideList: function() {
|
|
385
|
-
return !1;
|
|
386
|
-
},
|
|
387
|
-
isRootFocused: function() {
|
|
388
|
-
return !1;
|
|
389
|
-
},
|
|
390
|
-
listItemAtIndexHasClass: function() {
|
|
391
|
-
return !1;
|
|
392
|
-
},
|
|
393
|
-
notifyAction: function() {
|
|
394
|
-
},
|
|
395
|
-
removeClassForElementIndex: function() {
|
|
396
|
-
},
|
|
397
|
-
setAttributeForElementIndex: function() {
|
|
398
|
-
},
|
|
399
|
-
setCheckedCheckboxOrRadioAtIndex: function() {
|
|
400
|
-
},
|
|
401
|
-
setTabIndexForListItemChildren: function() {
|
|
402
|
-
},
|
|
403
|
-
getPrimaryTextAtIndex: function() {
|
|
404
|
-
return "";
|
|
405
|
-
}
|
|
406
|
-
};
|
|
407
|
-
},
|
|
408
|
-
enumerable: !1,
|
|
409
|
-
configurable: !0
|
|
410
|
-
}), n.prototype.layout = function() {
|
|
411
|
-
this.adapter.getListItemCount() !== 0 && (this.adapter.hasCheckboxAtIndex(0) ? this.isCheckboxList_ = !0 : this.adapter.hasRadioAtIndex(0) ? this.isRadioList_ = !0 : this.maybeInitializeSingleSelection(), this.hasTypeahead && (this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex()));
|
|
412
|
-
}, n.prototype.setWrapFocus = function(e) {
|
|
413
|
-
this.wrapFocus_ = e;
|
|
414
|
-
}, n.prototype.setVerticalOrientation = function(e) {
|
|
415
|
-
this.isVertical_ = e;
|
|
416
|
-
}, n.prototype.setSingleSelection = function(e) {
|
|
417
|
-
this.isSingleSelectionList_ = e, e && this.maybeInitializeSingleSelection();
|
|
418
|
-
}, n.prototype.maybeInitializeSingleSelection = function() {
|
|
419
|
-
for (var e = this.adapter.getListItemCount(), t = 0; t < e; t++) {
|
|
420
|
-
var i = this.adapter.listItemAtIndexHasClass(t, I.LIST_ITEM_SELECTED_CLASS), r = this.adapter.listItemAtIndexHasClass(t, I.LIST_ITEM_ACTIVATED_CLASS);
|
|
421
|
-
if (i || r) {
|
|
422
|
-
r && this.setUseActivatedClass(!0), this.isSingleSelectionList_ = !0, this.selectedIndex_ = t;
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
}, n.prototype.setHasTypeahead = function(e) {
|
|
427
|
-
this.hasTypeahead = e, e && (this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex());
|
|
428
|
-
}, n.prototype.isTypeaheadInProgress = function() {
|
|
429
|
-
return this.hasTypeahead && xt(this.typeaheadState);
|
|
430
|
-
}, n.prototype.setUseActivatedClass = function(e) {
|
|
431
|
-
this.useActivatedClass_ = e;
|
|
432
|
-
}, n.prototype.setUseSelectedAttribute = function(e) {
|
|
433
|
-
this.useSelectedAttr_ = e;
|
|
434
|
-
}, n.prototype.getSelectedIndex = function() {
|
|
435
|
-
return this.selectedIndex_;
|
|
436
|
-
}, n.prototype.setSelectedIndex = function(e) {
|
|
437
|
-
this.isIndexValid_(e) && (this.isCheckboxList_ ? this.setCheckboxAtIndex_(e) : this.isRadioList_ ? this.setRadioAtIndex_(e) : this.setSingleSelectionAtIndex_(e));
|
|
438
|
-
}, n.prototype.handleFocusIn = function(e, t) {
|
|
439
|
-
t >= 0 && (this.focusedItemIndex = t, this.adapter.setAttributeForElementIndex(t, "tabindex", "0"), this.adapter.setTabIndexForListItemChildren(t, "0"));
|
|
440
|
-
}, n.prototype.handleFocusOut = function(e, t) {
|
|
441
|
-
var i = this;
|
|
442
|
-
t >= 0 && (this.adapter.setAttributeForElementIndex(t, "tabindex", "-1"), this.adapter.setTabIndexForListItemChildren(t, "-1")), setTimeout(function() {
|
|
443
|
-
i.adapter.isFocusInsideList() || i.setTabindexToFirstSelectedOrFocusedItem();
|
|
444
|
-
}, 0);
|
|
445
|
-
}, n.prototype.handleKeydown = function(e, t, i) {
|
|
446
|
-
var r = this, a = se(e) === "ArrowLeft", l = se(e) === "ArrowUp", m = se(e) === "ArrowRight", D = se(e) === "ArrowDown", b = se(e) === "Home", y = se(e) === "End", S = se(e) === "Enter", d = se(e) === "Spacebar", f = e.key === "A" || e.key === "a";
|
|
447
|
-
if (this.adapter.isRootFocused()) {
|
|
448
|
-
if (l || y ? (e.preventDefault(), this.focusLastElement()) : (D || b) && (e.preventDefault(), this.focusFirstElement()), this.hasTypeahead) {
|
|
449
|
-
var L = {
|
|
450
|
-
event: e,
|
|
451
|
-
focusItemAtIndex: function(c) {
|
|
452
|
-
r.focusItemAtIndex(c);
|
|
453
|
-
},
|
|
454
|
-
focusedItemIndex: -1,
|
|
455
|
-
isTargetListItem: t,
|
|
456
|
-
sortedIndexByFirstChar: this.sortedIndexByFirstChar,
|
|
457
|
-
isItemAtIndexDisabled: function(c) {
|
|
458
|
-
return r.adapter.listItemAtIndexHasClass(c, I.LIST_ITEM_DISABLED_CLASS);
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
St(L, this.typeaheadState);
|
|
462
|
-
}
|
|
463
|
-
return;
|
|
464
|
-
}
|
|
465
|
-
var B = this.adapter.getFocusedElementIndex();
|
|
466
|
-
if (!(B === -1 && (B = i, B < 0))) {
|
|
467
|
-
if (this.isVertical_ && D || !this.isVertical_ && m)
|
|
468
|
-
Ce(e), this.focusNextElement(B);
|
|
469
|
-
else if (this.isVertical_ && l || !this.isVertical_ && a)
|
|
470
|
-
Ce(e), this.focusPrevElement(B);
|
|
471
|
-
else if (b)
|
|
472
|
-
Ce(e), this.focusFirstElement();
|
|
473
|
-
else if (y)
|
|
474
|
-
Ce(e), this.focusLastElement();
|
|
475
|
-
else if (f && e.ctrlKey && this.isCheckboxList_)
|
|
476
|
-
e.preventDefault(), this.toggleAll(this.selectedIndex_ === Y.UNSET_INDEX ? [] : this.selectedIndex_);
|
|
477
|
-
else if ((S || d) && t) {
|
|
478
|
-
var M = e.target;
|
|
479
|
-
if (M && M.tagName === "A" && S || (Ce(e), this.adapter.listItemAtIndexHasClass(B, I.LIST_ITEM_DISABLED_CLASS)))
|
|
480
|
-
return;
|
|
481
|
-
this.isTypeaheadInProgress() || (this.isSelectableList_() && this.setSelectedIndexOnAction_(B), this.adapter.notifyAction(B));
|
|
482
|
-
}
|
|
483
|
-
if (this.hasTypeahead) {
|
|
484
|
-
var L = {
|
|
485
|
-
event: e,
|
|
486
|
-
focusItemAtIndex: function(A) {
|
|
487
|
-
r.focusItemAtIndex(A);
|
|
488
|
-
},
|
|
489
|
-
focusedItemIndex: this.focusedItemIndex,
|
|
490
|
-
isTargetListItem: t,
|
|
491
|
-
sortedIndexByFirstChar: this.sortedIndexByFirstChar,
|
|
492
|
-
isItemAtIndexDisabled: function(A) {
|
|
493
|
-
return r.adapter.listItemAtIndexHasClass(A, I.LIST_ITEM_DISABLED_CLASS);
|
|
494
|
-
}
|
|
495
|
-
};
|
|
496
|
-
St(L, this.typeaheadState);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
}, n.prototype.handleClick = function(e, t) {
|
|
500
|
-
e !== Y.UNSET_INDEX && (this.adapter.listItemAtIndexHasClass(e, I.LIST_ITEM_DISABLED_CLASS) || (this.isSelectableList_() && this.setSelectedIndexOnAction_(e, t), this.adapter.notifyAction(e)));
|
|
501
|
-
}, n.prototype.focusNextElement = function(e) {
|
|
502
|
-
var t = this.adapter.getListItemCount(), i = e + 1;
|
|
503
|
-
if (i >= t)
|
|
504
|
-
if (this.wrapFocus_)
|
|
505
|
-
i = 0;
|
|
506
|
-
else
|
|
507
|
-
return e;
|
|
508
|
-
return this.focusItemAtIndex(i), i;
|
|
509
|
-
}, n.prototype.focusPrevElement = function(e) {
|
|
510
|
-
var t = e - 1;
|
|
511
|
-
if (t < 0)
|
|
512
|
-
if (this.wrapFocus_)
|
|
513
|
-
t = this.adapter.getListItemCount() - 1;
|
|
514
|
-
else
|
|
515
|
-
return e;
|
|
516
|
-
return this.focusItemAtIndex(t), t;
|
|
517
|
-
}, n.prototype.focusFirstElement = function() {
|
|
518
|
-
return this.focusItemAtIndex(0), 0;
|
|
519
|
-
}, n.prototype.focusLastElement = function() {
|
|
520
|
-
var e = this.adapter.getListItemCount() - 1;
|
|
521
|
-
return this.focusItemAtIndex(e), e;
|
|
522
|
-
}, n.prototype.focusInitialElement = function() {
|
|
523
|
-
var e = this.getFirstSelectedOrFocusedItemIndex();
|
|
524
|
-
return this.focusItemAtIndex(e), e;
|
|
525
|
-
}, n.prototype.setEnabled = function(e, t) {
|
|
526
|
-
this.isIndexValid_(e) && (t ? (this.adapter.removeClassForElementIndex(e, I.LIST_ITEM_DISABLED_CLASS), this.adapter.setAttributeForElementIndex(e, K.ARIA_DISABLED, "false")) : (this.adapter.addClassForElementIndex(e, I.LIST_ITEM_DISABLED_CLASS), this.adapter.setAttributeForElementIndex(e, K.ARIA_DISABLED, "true")));
|
|
527
|
-
}, n.prototype.setSingleSelectionAtIndex_ = function(e) {
|
|
528
|
-
if (this.selectedIndex_ !== e) {
|
|
529
|
-
var t = I.LIST_ITEM_SELECTED_CLASS;
|
|
530
|
-
this.useActivatedClass_ && (t = I.LIST_ITEM_ACTIVATED_CLASS), this.selectedIndex_ !== Y.UNSET_INDEX && this.adapter.removeClassForElementIndex(this.selectedIndex_, t), this.setAriaForSingleSelectionAtIndex_(e), this.setTabindexAtIndex(e), e !== Y.UNSET_INDEX && this.adapter.addClassForElementIndex(e, t), this.selectedIndex_ = e;
|
|
531
|
-
}
|
|
532
|
-
}, n.prototype.setAriaForSingleSelectionAtIndex_ = function(e) {
|
|
533
|
-
this.selectedIndex_ === Y.UNSET_INDEX && (this.ariaCurrentAttrValue_ = this.adapter.getAttributeForElementIndex(e, K.ARIA_CURRENT));
|
|
534
|
-
var t = this.ariaCurrentAttrValue_ !== null, i = t ? K.ARIA_CURRENT : K.ARIA_SELECTED;
|
|
535
|
-
if (this.selectedIndex_ !== Y.UNSET_INDEX && this.adapter.setAttributeForElementIndex(this.selectedIndex_, i, "false"), e !== Y.UNSET_INDEX) {
|
|
536
|
-
var r = t ? this.ariaCurrentAttrValue_ : "true";
|
|
537
|
-
this.adapter.setAttributeForElementIndex(e, i, r);
|
|
538
|
-
}
|
|
539
|
-
}, n.prototype.getSelectionAttribute = function() {
|
|
540
|
-
return this.useSelectedAttr_ ? K.ARIA_SELECTED : K.ARIA_CHECKED;
|
|
541
|
-
}, n.prototype.setRadioAtIndex_ = function(e) {
|
|
542
|
-
var t = this.getSelectionAttribute();
|
|
543
|
-
this.adapter.setCheckedCheckboxOrRadioAtIndex(e, !0), this.selectedIndex_ !== Y.UNSET_INDEX && this.adapter.setAttributeForElementIndex(this.selectedIndex_, t, "false"), this.adapter.setAttributeForElementIndex(e, t, "true"), this.selectedIndex_ = e;
|
|
544
|
-
}, n.prototype.setCheckboxAtIndex_ = function(e) {
|
|
545
|
-
for (var t = this.getSelectionAttribute(), i = 0; i < this.adapter.getListItemCount(); i++) {
|
|
546
|
-
var r = !1;
|
|
547
|
-
e.indexOf(i) >= 0 && (r = !0), this.adapter.setCheckedCheckboxOrRadioAtIndex(i, r), this.adapter.setAttributeForElementIndex(i, t, r ? "true" : "false");
|
|
548
|
-
}
|
|
549
|
-
this.selectedIndex_ = e;
|
|
550
|
-
}, n.prototype.setTabindexAtIndex = function(e) {
|
|
551
|
-
this.focusedItemIndex === Y.UNSET_INDEX && e !== 0 ? this.adapter.setAttributeForElementIndex(0, "tabindex", "-1") : this.focusedItemIndex >= 0 && this.focusedItemIndex !== e && this.adapter.setAttributeForElementIndex(this.focusedItemIndex, "tabindex", "-1"), !(this.selectedIndex_ instanceof Array) && this.selectedIndex_ !== e && this.adapter.setAttributeForElementIndex(this.selectedIndex_, "tabindex", "-1"), e !== Y.UNSET_INDEX && this.adapter.setAttributeForElementIndex(e, "tabindex", "0");
|
|
552
|
-
}, n.prototype.isSelectableList_ = function() {
|
|
553
|
-
return this.isSingleSelectionList_ || this.isCheckboxList_ || this.isRadioList_;
|
|
554
|
-
}, n.prototype.setTabindexToFirstSelectedOrFocusedItem = function() {
|
|
555
|
-
var e = this.getFirstSelectedOrFocusedItemIndex();
|
|
556
|
-
this.setTabindexAtIndex(e);
|
|
557
|
-
}, n.prototype.getFirstSelectedOrFocusedItemIndex = function() {
|
|
558
|
-
var e = this.focusedItemIndex >= 0 ? this.focusedItemIndex : 0;
|
|
559
|
-
return this.isSelectableList_() && (typeof this.selectedIndex_ == "number" && this.selectedIndex_ !== Y.UNSET_INDEX ? e = this.selectedIndex_ : Jt(this.selectedIndex_) && this.selectedIndex_.length > 0 && (e = this.selectedIndex_.reduce(function(t, i) {
|
|
560
|
-
return Math.min(t, i);
|
|
561
|
-
}))), e;
|
|
562
|
-
}, n.prototype.isIndexValid_ = function(e) {
|
|
563
|
-
var t = this;
|
|
564
|
-
if (e instanceof Array) {
|
|
565
|
-
if (!this.isCheckboxList_)
|
|
566
|
-
throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");
|
|
567
|
-
return e.length === 0 ? !0 : e.some(function(i) {
|
|
568
|
-
return t.isIndexInRange_(i);
|
|
569
|
-
});
|
|
570
|
-
} else if (typeof e == "number") {
|
|
571
|
-
if (this.isCheckboxList_)
|
|
572
|
-
throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: " + e);
|
|
573
|
-
return this.isIndexInRange_(e) || this.isSingleSelectionList_ && e === Y.UNSET_INDEX;
|
|
574
|
-
} else
|
|
575
|
-
return !1;
|
|
576
|
-
}, n.prototype.isIndexInRange_ = function(e) {
|
|
577
|
-
var t = this.adapter.getListItemCount();
|
|
578
|
-
return e >= 0 && e < t;
|
|
579
|
-
}, n.prototype.setSelectedIndexOnAction_ = function(e, t) {
|
|
580
|
-
t === void 0 && (t = !0), this.isCheckboxList_ ? this.toggleCheckboxAtIndex_(e, t) : this.setSelectedIndex(e);
|
|
581
|
-
}, n.prototype.toggleCheckboxAtIndex_ = function(e, t) {
|
|
582
|
-
var i = this.getSelectionAttribute(), r = this.adapter.isCheckboxCheckedAtIndex(e);
|
|
583
|
-
t && (r = !r, this.adapter.setCheckedCheckboxOrRadioAtIndex(e, r)), this.adapter.setAttributeForElementIndex(e, i, r ? "true" : "false");
|
|
584
|
-
var a = this.selectedIndex_ === Y.UNSET_INDEX ? [] : this.selectedIndex_.slice();
|
|
585
|
-
r ? a.push(e) : a = a.filter(function(l) {
|
|
586
|
-
return l !== e;
|
|
587
|
-
}), this.selectedIndex_ = a;
|
|
588
|
-
}, n.prototype.focusItemAtIndex = function(e) {
|
|
589
|
-
this.adapter.focusItemAtIndex(e), this.focusedItemIndex = e;
|
|
590
|
-
}, n.prototype.toggleAll = function(e) {
|
|
591
|
-
var t = this.adapter.getListItemCount();
|
|
592
|
-
if (e.length === t)
|
|
593
|
-
this.setCheckboxAtIndex_([]);
|
|
594
|
-
else {
|
|
595
|
-
for (var i = [], r = 0; r < t; r++)
|
|
596
|
-
(!this.adapter.listItemAtIndexHasClass(r, I.LIST_ITEM_DISABLED_CLASS) || e.indexOf(r) > -1) && i.push(r);
|
|
597
|
-
this.setCheckboxAtIndex_(i);
|
|
598
|
-
}
|
|
599
|
-
}, n.prototype.typeaheadMatchItem = function(e, t, i) {
|
|
600
|
-
var r = this;
|
|
601
|
-
i === void 0 && (i = !1);
|
|
602
|
-
var a = {
|
|
603
|
-
focusItemAtIndex: function(l) {
|
|
604
|
-
r.focusItemAtIndex(l);
|
|
605
|
-
},
|
|
606
|
-
focusedItemIndex: t || this.focusedItemIndex,
|
|
607
|
-
nextChar: e,
|
|
608
|
-
sortedIndexByFirstChar: this.sortedIndexByFirstChar,
|
|
609
|
-
skipFocus: i,
|
|
610
|
-
isItemAtIndexDisabled: function(l) {
|
|
611
|
-
return r.adapter.listItemAtIndexHasClass(l, I.LIST_ITEM_DISABLED_CLASS);
|
|
612
|
-
}
|
|
613
|
-
};
|
|
614
|
-
return ut(a, this.typeaheadState);
|
|
615
|
-
}, n.prototype.typeaheadInitSortedIndex = function() {
|
|
616
|
-
return Yt(this.adapter.getListItemCount(), this.adapter.getPrimaryTextAtIndex);
|
|
617
|
-
}, n.prototype.clearTypeaheadBuffer = function() {
|
|
618
|
-
bt(this.typeaheadState);
|
|
619
|
-
}, n;
|
|
620
|
-
}(ht)
|
|
621
|
-
);
|
|
622
|
-
/**
|
|
623
|
-
* @license
|
|
624
|
-
* Copyright 2018 Google Inc.
|
|
625
|
-
*
|
|
626
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
627
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
628
|
-
* in the Software without restriction, including without limitation the rights
|
|
629
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
630
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
631
|
-
* furnished to do so, subject to the following conditions:
|
|
632
|
-
*
|
|
633
|
-
* The above copyright notice and this permission notice shall be included in
|
|
634
|
-
* all copies or substantial portions of the Software.
|
|
635
|
-
*
|
|
636
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
637
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
638
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
639
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
640
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
641
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
642
|
-
* THE SOFTWARE.
|
|
643
|
-
*/
|
|
644
|
-
var Lt = (
|
|
645
|
-
/** @class */
|
|
646
|
-
function(s) {
|
|
647
|
-
Re(n, s);
|
|
648
|
-
function n() {
|
|
649
|
-
return s !== null && s.apply(this, arguments) || this;
|
|
650
|
-
}
|
|
651
|
-
return Object.defineProperty(n.prototype, "vertical", {
|
|
652
|
-
set: function(e) {
|
|
653
|
-
this.foundation.setVerticalOrientation(e);
|
|
654
|
-
},
|
|
655
|
-
enumerable: !1,
|
|
656
|
-
configurable: !0
|
|
657
|
-
}), Object.defineProperty(n.prototype, "listElements", {
|
|
658
|
-
get: function() {
|
|
659
|
-
return Array.from(this.root.querySelectorAll("." + this.classNameMap[I.LIST_ITEM_CLASS]));
|
|
660
|
-
},
|
|
661
|
-
enumerable: !1,
|
|
662
|
-
configurable: !0
|
|
663
|
-
}), Object.defineProperty(n.prototype, "wrapFocus", {
|
|
664
|
-
set: function(e) {
|
|
665
|
-
this.foundation.setWrapFocus(e);
|
|
666
|
-
},
|
|
667
|
-
enumerable: !1,
|
|
668
|
-
configurable: !0
|
|
669
|
-
}), Object.defineProperty(n.prototype, "typeaheadInProgress", {
|
|
670
|
-
/**
|
|
671
|
-
* @return Whether typeahead is currently matching a user-specified prefix.
|
|
672
|
-
*/
|
|
673
|
-
get: function() {
|
|
674
|
-
return this.foundation.isTypeaheadInProgress();
|
|
675
|
-
},
|
|
676
|
-
enumerable: !1,
|
|
677
|
-
configurable: !0
|
|
678
|
-
}), Object.defineProperty(n.prototype, "hasTypeahead", {
|
|
679
|
-
/**
|
|
680
|
-
* Sets whether typeahead functionality is enabled on the list.
|
|
681
|
-
* @param hasTypeahead Whether typeahead is enabled.
|
|
682
|
-
*/
|
|
683
|
-
set: function(e) {
|
|
684
|
-
this.foundation.setHasTypeahead(e);
|
|
685
|
-
},
|
|
686
|
-
enumerable: !1,
|
|
687
|
-
configurable: !0
|
|
688
|
-
}), Object.defineProperty(n.prototype, "singleSelection", {
|
|
689
|
-
set: function(e) {
|
|
690
|
-
this.foundation.setSingleSelection(e);
|
|
691
|
-
},
|
|
692
|
-
enumerable: !1,
|
|
693
|
-
configurable: !0
|
|
694
|
-
}), Object.defineProperty(n.prototype, "selectedIndex", {
|
|
695
|
-
get: function() {
|
|
696
|
-
return this.foundation.getSelectedIndex();
|
|
697
|
-
},
|
|
698
|
-
set: function(e) {
|
|
699
|
-
this.foundation.setSelectedIndex(e);
|
|
700
|
-
},
|
|
701
|
-
enumerable: !1,
|
|
702
|
-
configurable: !0
|
|
703
|
-
}), n.attachTo = function(e) {
|
|
704
|
-
return new n(e);
|
|
705
|
-
}, n.prototype.initialSyncWithDOM = function() {
|
|
706
|
-
this.isEvolutionEnabled = qt in this.root.dataset, this.isEvolutionEnabled ? this.classNameMap = jt : ke(this.root, K.DEPRECATED_SELECTOR) ? this.classNameMap = ve : this.classNameMap = Object.values(I).reduce(function(e, t) {
|
|
707
|
-
return e[t] = t, e;
|
|
708
|
-
}, {}), this.handleClick = this.handleClickEvent.bind(this), this.handleKeydown = this.handleKeydownEvent.bind(this), this.focusInEventListener = this.handleFocusInEvent.bind(this), this.focusOutEventListener = this.handleFocusOutEvent.bind(this), this.listen("keydown", this.handleKeydown), this.listen("click", this.handleClick), this.listen("focusin", this.focusInEventListener), this.listen("focusout", this.focusOutEventListener), this.layout(), this.initializeListType(), this.ensureFocusable();
|
|
709
|
-
}, n.prototype.destroy = function() {
|
|
710
|
-
this.unlisten("keydown", this.handleKeydown), this.unlisten("click", this.handleClick), this.unlisten("focusin", this.focusInEventListener), this.unlisten("focusout", this.focusOutEventListener);
|
|
711
|
-
}, n.prototype.layout = function() {
|
|
712
|
-
var e = this.root.getAttribute(K.ARIA_ORIENTATION);
|
|
713
|
-
this.vertical = e !== K.ARIA_ORIENTATION_HORIZONTAL;
|
|
714
|
-
var t = "." + this.classNameMap[I.LIST_ITEM_CLASS] + ":not([tabindex])", i = K.FOCUSABLE_CHILD_ELEMENTS, r = this.root.querySelectorAll(t);
|
|
715
|
-
r.length && Array.prototype.forEach.call(r, function(l) {
|
|
716
|
-
l.setAttribute("tabindex", "-1");
|
|
717
|
-
});
|
|
718
|
-
var a = this.root.querySelectorAll(i);
|
|
719
|
-
a.length && Array.prototype.forEach.call(a, function(l) {
|
|
720
|
-
l.setAttribute("tabindex", "-1");
|
|
721
|
-
}), this.isEvolutionEnabled && this.foundation.setUseSelectedAttribute(!0), this.foundation.layout();
|
|
722
|
-
}, n.prototype.getPrimaryText = function(e) {
|
|
723
|
-
var t, i = e.querySelector("." + this.classNameMap[I.LIST_ITEM_PRIMARY_TEXT_CLASS]);
|
|
724
|
-
if (this.isEvolutionEnabled || i)
|
|
725
|
-
return (t = i?.textContent) !== null && t !== void 0 ? t : "";
|
|
726
|
-
var r = e.querySelector("." + this.classNameMap[I.LIST_ITEM_TEXT_CLASS]);
|
|
727
|
-
return r && r.textContent || "";
|
|
728
|
-
}, n.prototype.initializeListType = function() {
|
|
729
|
-
var e = this;
|
|
730
|
-
if (this.isInteractive = ke(this.root, K.ARIA_INTERACTIVE_ROLES_SELECTOR), this.isEvolutionEnabled && this.isInteractive) {
|
|
731
|
-
var t = Array.from(this.root.querySelectorAll(K.SELECTED_ITEM_SELECTOR), function(l) {
|
|
732
|
-
return e.listElements.indexOf(l);
|
|
733
|
-
});
|
|
734
|
-
ke(this.root, K.ARIA_MULTI_SELECTABLE_SELECTOR) ? this.selectedIndex = t : t.length > 0 && (this.selectedIndex = t[0]);
|
|
735
|
-
return;
|
|
736
|
-
}
|
|
737
|
-
var i = this.root.querySelectorAll(K.ARIA_ROLE_CHECKBOX_SELECTOR), r = this.root.querySelector(K.ARIA_CHECKED_RADIO_SELECTOR);
|
|
738
|
-
if (i.length) {
|
|
739
|
-
var a = this.root.querySelectorAll(K.ARIA_CHECKED_CHECKBOX_SELECTOR);
|
|
740
|
-
this.selectedIndex = Array.from(a, function(l) {
|
|
741
|
-
return e.listElements.indexOf(l);
|
|
742
|
-
});
|
|
743
|
-
} else r && (this.selectedIndex = this.listElements.indexOf(r));
|
|
744
|
-
}, n.prototype.setEnabled = function(e, t) {
|
|
745
|
-
this.foundation.setEnabled(e, t);
|
|
746
|
-
}, n.prototype.typeaheadMatchItem = function(e, t) {
|
|
747
|
-
return this.foundation.typeaheadMatchItem(
|
|
748
|
-
e,
|
|
749
|
-
t,
|
|
750
|
-
/** skipFocus */
|
|
751
|
-
!0
|
|
752
|
-
);
|
|
753
|
-
}, n.prototype.getDefaultFoundation = function() {
|
|
754
|
-
var e = this, t = {
|
|
755
|
-
addClassForElementIndex: function(i, r) {
|
|
756
|
-
var a = e.listElements[i];
|
|
757
|
-
a && a.classList.add(e.classNameMap[r]);
|
|
758
|
-
},
|
|
759
|
-
focusItemAtIndex: function(i) {
|
|
760
|
-
var r = e.listElements[i];
|
|
761
|
-
r && r.focus();
|
|
762
|
-
},
|
|
763
|
-
getAttributeForElementIndex: function(i, r) {
|
|
764
|
-
return e.listElements[i].getAttribute(r);
|
|
765
|
-
},
|
|
766
|
-
getFocusedElementIndex: function() {
|
|
767
|
-
return e.listElements.indexOf(document.activeElement);
|
|
768
|
-
},
|
|
769
|
-
getListItemCount: function() {
|
|
770
|
-
return e.listElements.length;
|
|
771
|
-
},
|
|
772
|
-
getPrimaryTextAtIndex: function(i) {
|
|
773
|
-
return e.getPrimaryText(e.listElements[i]);
|
|
774
|
-
},
|
|
775
|
-
hasCheckboxAtIndex: function(i) {
|
|
776
|
-
var r = e.listElements[i];
|
|
777
|
-
return !!r.querySelector(K.CHECKBOX_SELECTOR);
|
|
778
|
-
},
|
|
779
|
-
hasRadioAtIndex: function(i) {
|
|
780
|
-
var r = e.listElements[i];
|
|
781
|
-
return !!r.querySelector(K.RADIO_SELECTOR);
|
|
782
|
-
},
|
|
783
|
-
isCheckboxCheckedAtIndex: function(i) {
|
|
784
|
-
var r = e.listElements[i], a = r.querySelector(K.CHECKBOX_SELECTOR);
|
|
785
|
-
return a.checked;
|
|
786
|
-
},
|
|
787
|
-
isFocusInsideList: function() {
|
|
788
|
-
return e.root !== document.activeElement && e.root.contains(document.activeElement);
|
|
789
|
-
},
|
|
790
|
-
isRootFocused: function() {
|
|
791
|
-
return document.activeElement === e.root;
|
|
792
|
-
},
|
|
793
|
-
listItemAtIndexHasClass: function(i, r) {
|
|
794
|
-
return e.listElements[i].classList.contains(e.classNameMap[r]);
|
|
795
|
-
},
|
|
796
|
-
notifyAction: function(i) {
|
|
797
|
-
e.emit(
|
|
798
|
-
K.ACTION_EVENT,
|
|
799
|
-
{ index: i },
|
|
800
|
-
/** shouldBubble */
|
|
801
|
-
!0
|
|
802
|
-
);
|
|
803
|
-
},
|
|
804
|
-
removeClassForElementIndex: function(i, r) {
|
|
805
|
-
var a = e.listElements[i];
|
|
806
|
-
a && a.classList.remove(e.classNameMap[r]);
|
|
807
|
-
},
|
|
808
|
-
setAttributeForElementIndex: function(i, r, a) {
|
|
809
|
-
var l = e.listElements[i];
|
|
810
|
-
l && l.setAttribute(r, a);
|
|
811
|
-
},
|
|
812
|
-
setCheckedCheckboxOrRadioAtIndex: function(i, r) {
|
|
813
|
-
var a = e.listElements[i], l = a.querySelector(K.CHECKBOX_RADIO_SELECTOR);
|
|
814
|
-
l.checked = r;
|
|
815
|
-
var m = document.createEvent("Event");
|
|
816
|
-
m.initEvent("change", !0, !0), l.dispatchEvent(m);
|
|
817
|
-
},
|
|
818
|
-
setTabIndexForListItemChildren: function(i, r) {
|
|
819
|
-
var a = e.listElements[i], l = K.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;
|
|
820
|
-
Array.prototype.forEach.call(a.querySelectorAll(l), function(m) {
|
|
821
|
-
m.setAttribute("tabindex", r);
|
|
822
|
-
});
|
|
823
|
-
}
|
|
824
|
-
};
|
|
825
|
-
return new dt(t);
|
|
826
|
-
}, n.prototype.ensureFocusable = function() {
|
|
827
|
-
if (this.isEvolutionEnabled && this.isInteractive && !this.root.querySelector("." + this.classNameMap[I.LIST_ITEM_CLASS] + '[tabindex="0"]')) {
|
|
828
|
-
var e = this.initialFocusIndex();
|
|
829
|
-
e !== -1 && (this.listElements[e].tabIndex = 0);
|
|
830
|
-
}
|
|
831
|
-
}, n.prototype.initialFocusIndex = function() {
|
|
832
|
-
if (this.selectedIndex instanceof Array && this.selectedIndex.length > 0)
|
|
833
|
-
return this.selectedIndex[0];
|
|
834
|
-
if (typeof this.selectedIndex == "number" && this.selectedIndex !== Y.UNSET_INDEX)
|
|
835
|
-
return this.selectedIndex;
|
|
836
|
-
var e = this.root.querySelector("." + this.classNameMap[I.LIST_ITEM_CLASS] + ":not(." + this.classNameMap[I.LIST_ITEM_DISABLED_CLASS] + ")");
|
|
837
|
-
return e === null ? -1 : this.getListItemIndex(e);
|
|
838
|
-
}, n.prototype.getListItemIndex = function(e) {
|
|
839
|
-
var t = lt(e, "." + this.classNameMap[I.LIST_ITEM_CLASS] + ", ." + this.classNameMap[I.ROOT]);
|
|
840
|
-
return t && ke(t, "." + this.classNameMap[I.LIST_ITEM_CLASS]) ? this.listElements.indexOf(t) : -1;
|
|
841
|
-
}, n.prototype.handleFocusInEvent = function(e) {
|
|
842
|
-
var t = this.getListItemIndex(e.target);
|
|
843
|
-
this.foundation.handleFocusIn(e, t);
|
|
844
|
-
}, n.prototype.handleFocusOutEvent = function(e) {
|
|
845
|
-
var t = this.getListItemIndex(e.target);
|
|
846
|
-
this.foundation.handleFocusOut(e, t);
|
|
847
|
-
}, n.prototype.handleKeydownEvent = function(e) {
|
|
848
|
-
var t = this.getListItemIndex(e.target), i = e.target;
|
|
849
|
-
this.foundation.handleKeydown(e, i.classList.contains(this.classNameMap[I.LIST_ITEM_CLASS]), t);
|
|
850
|
-
}, n.prototype.handleClickEvent = function(e) {
|
|
851
|
-
var t = this.getListItemIndex(e.target), i = e.target, r = !ke(i, K.CHECKBOX_RADIO_SELECTOR);
|
|
852
|
-
this.foundation.handleClick(t, r);
|
|
853
|
-
}, n;
|
|
854
|
-
}(mt)
|
|
855
|
-
);
|
|
856
|
-
/**
|
|
857
|
-
* @license
|
|
858
|
-
* Copyright 2018 Google Inc.
|
|
859
|
-
*
|
|
860
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
861
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
862
|
-
* in the Software without restriction, including without limitation the rights
|
|
863
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
864
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
865
|
-
* furnished to do so, subject to the following conditions:
|
|
866
|
-
*
|
|
867
|
-
* The above copyright notice and this permission notice shall be included in
|
|
868
|
-
* all copies or substantial portions of the Software.
|
|
869
|
-
*
|
|
870
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
871
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
872
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
873
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
874
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
875
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
876
|
-
* THE SOFTWARE.
|
|
877
|
-
*/
|
|
878
|
-
var xe = (
|
|
879
|
-
/** @class */
|
|
880
|
-
function(s) {
|
|
881
|
-
Re(n, s);
|
|
882
|
-
function n(e) {
|
|
883
|
-
var t = s.call(this, Ne(Ne({}, n.defaultAdapter), e)) || this;
|
|
884
|
-
return t.isSurfaceOpen = !1, t.isQuickOpen = !1, t.isHoistedElement = !1, t.isFixedPosition = !1, t.isHorizontallyCenteredOnViewport = !1, t.maxHeight = 0, t.openAnimationEndTimerId = 0, t.closeAnimationEndTimerId = 0, t.animationRequestId = 0, t.anchorCorner = Oe.TOP_START, t.originCorner = Oe.TOP_START, t.anchorMargin = { top: 0, right: 0, bottom: 0, left: 0 }, t.position = { x: 0, y: 0 }, t;
|
|
885
|
-
}
|
|
886
|
-
return Object.defineProperty(n, "cssClasses", {
|
|
887
|
-
get: function() {
|
|
888
|
-
return He;
|
|
889
|
-
},
|
|
890
|
-
enumerable: !1,
|
|
891
|
-
configurable: !0
|
|
892
|
-
}), Object.defineProperty(n, "strings", {
|
|
893
|
-
get: function() {
|
|
894
|
-
return Ke;
|
|
895
|
-
},
|
|
896
|
-
enumerable: !1,
|
|
897
|
-
configurable: !0
|
|
898
|
-
}), Object.defineProperty(n, "numbers", {
|
|
899
|
-
get: function() {
|
|
900
|
-
return Xe;
|
|
901
|
-
},
|
|
902
|
-
enumerable: !1,
|
|
903
|
-
configurable: !0
|
|
904
|
-
}), Object.defineProperty(n, "Corner", {
|
|
905
|
-
get: function() {
|
|
906
|
-
return Oe;
|
|
907
|
-
},
|
|
908
|
-
enumerable: !1,
|
|
909
|
-
configurable: !0
|
|
910
|
-
}), Object.defineProperty(n, "defaultAdapter", {
|
|
911
|
-
/**
|
|
912
|
-
* @see {@link MDCMenuSurfaceAdapter} for typing information on parameters and return types.
|
|
913
|
-
*/
|
|
914
|
-
get: function() {
|
|
915
|
-
return {
|
|
916
|
-
addClass: function() {
|
|
917
|
-
},
|
|
918
|
-
removeClass: function() {
|
|
919
|
-
},
|
|
920
|
-
hasClass: function() {
|
|
921
|
-
return !1;
|
|
922
|
-
},
|
|
923
|
-
hasAnchor: function() {
|
|
924
|
-
return !1;
|
|
925
|
-
},
|
|
926
|
-
isElementInContainer: function() {
|
|
927
|
-
return !1;
|
|
928
|
-
},
|
|
929
|
-
isFocused: function() {
|
|
930
|
-
return !1;
|
|
931
|
-
},
|
|
932
|
-
isRtl: function() {
|
|
933
|
-
return !1;
|
|
934
|
-
},
|
|
935
|
-
getInnerDimensions: function() {
|
|
936
|
-
return { height: 0, width: 0 };
|
|
937
|
-
},
|
|
938
|
-
getAnchorDimensions: function() {
|
|
939
|
-
return null;
|
|
940
|
-
},
|
|
941
|
-
getWindowDimensions: function() {
|
|
942
|
-
return { height: 0, width: 0 };
|
|
943
|
-
},
|
|
944
|
-
getBodyDimensions: function() {
|
|
945
|
-
return { height: 0, width: 0 };
|
|
946
|
-
},
|
|
947
|
-
getWindowScroll: function() {
|
|
948
|
-
return { x: 0, y: 0 };
|
|
949
|
-
},
|
|
950
|
-
setPosition: function() {
|
|
951
|
-
},
|
|
952
|
-
setMaxHeight: function() {
|
|
953
|
-
},
|
|
954
|
-
setTransformOrigin: function() {
|
|
955
|
-
},
|
|
956
|
-
saveFocus: function() {
|
|
957
|
-
},
|
|
958
|
-
restoreFocus: function() {
|
|
959
|
-
},
|
|
960
|
-
notifyClose: function() {
|
|
961
|
-
},
|
|
962
|
-
notifyOpen: function() {
|
|
963
|
-
},
|
|
964
|
-
notifyClosing: function() {
|
|
965
|
-
}
|
|
966
|
-
};
|
|
967
|
-
},
|
|
968
|
-
enumerable: !1,
|
|
969
|
-
configurable: !0
|
|
970
|
-
}), n.prototype.init = function() {
|
|
971
|
-
var e = n.cssClasses, t = e.ROOT, i = e.OPEN;
|
|
972
|
-
if (!this.adapter.hasClass(t))
|
|
973
|
-
throw new Error(t + " class required in root element.");
|
|
974
|
-
this.adapter.hasClass(i) && (this.isSurfaceOpen = !0);
|
|
975
|
-
}, n.prototype.destroy = function() {
|
|
976
|
-
clearTimeout(this.openAnimationEndTimerId), clearTimeout(this.closeAnimationEndTimerId), cancelAnimationFrame(this.animationRequestId);
|
|
977
|
-
}, n.prototype.setAnchorCorner = function(e) {
|
|
978
|
-
this.anchorCorner = e;
|
|
979
|
-
}, n.prototype.flipCornerHorizontally = function() {
|
|
980
|
-
this.originCorner = this.originCorner ^ V.RIGHT;
|
|
981
|
-
}, n.prototype.setAnchorMargin = function(e) {
|
|
982
|
-
this.anchorMargin.top = e.top || 0, this.anchorMargin.right = e.right || 0, this.anchorMargin.bottom = e.bottom || 0, this.anchorMargin.left = e.left || 0;
|
|
983
|
-
}, n.prototype.setIsHoisted = function(e) {
|
|
984
|
-
this.isHoistedElement = e;
|
|
985
|
-
}, n.prototype.setFixedPosition = function(e) {
|
|
986
|
-
this.isFixedPosition = e;
|
|
987
|
-
}, n.prototype.setAbsolutePosition = function(e, t) {
|
|
988
|
-
this.position.x = this.isFinite(e) ? e : 0, this.position.y = this.isFinite(t) ? t : 0;
|
|
989
|
-
}, n.prototype.setIsHorizontallyCenteredOnViewport = function(e) {
|
|
990
|
-
this.isHorizontallyCenteredOnViewport = e;
|
|
991
|
-
}, n.prototype.setQuickOpen = function(e) {
|
|
992
|
-
this.isQuickOpen = e;
|
|
993
|
-
}, n.prototype.setMaxHeight = function(e) {
|
|
994
|
-
this.maxHeight = e;
|
|
995
|
-
}, n.prototype.isOpen = function() {
|
|
996
|
-
return this.isSurfaceOpen;
|
|
997
|
-
}, n.prototype.open = function() {
|
|
998
|
-
var e = this;
|
|
999
|
-
this.isSurfaceOpen || (this.adapter.saveFocus(), this.isQuickOpen ? (this.isSurfaceOpen = !0, this.adapter.addClass(n.cssClasses.OPEN), this.dimensions = this.adapter.getInnerDimensions(), this.autoposition(), this.adapter.notifyOpen()) : (this.adapter.addClass(n.cssClasses.ANIMATING_OPEN), this.animationRequestId = requestAnimationFrame(function() {
|
|
1000
|
-
e.adapter.addClass(n.cssClasses.OPEN), e.dimensions = e.adapter.getInnerDimensions(), e.autoposition(), e.openAnimationEndTimerId = setTimeout(function() {
|
|
1001
|
-
e.openAnimationEndTimerId = 0, e.adapter.removeClass(n.cssClasses.ANIMATING_OPEN), e.adapter.notifyOpen();
|
|
1002
|
-
}, Xe.TRANSITION_OPEN_DURATION);
|
|
1003
|
-
}), this.isSurfaceOpen = !0));
|
|
1004
|
-
}, n.prototype.close = function(e) {
|
|
1005
|
-
var t = this;
|
|
1006
|
-
if (e === void 0 && (e = !1), !!this.isSurfaceOpen) {
|
|
1007
|
-
if (this.adapter.notifyClosing(), this.isQuickOpen) {
|
|
1008
|
-
this.isSurfaceOpen = !1, e || this.maybeRestoreFocus(), this.adapter.removeClass(n.cssClasses.OPEN), this.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW), this.adapter.notifyClose();
|
|
1009
|
-
return;
|
|
1010
|
-
}
|
|
1011
|
-
this.adapter.addClass(n.cssClasses.ANIMATING_CLOSED), requestAnimationFrame(function() {
|
|
1012
|
-
t.adapter.removeClass(n.cssClasses.OPEN), t.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW), t.closeAnimationEndTimerId = setTimeout(function() {
|
|
1013
|
-
t.closeAnimationEndTimerId = 0, t.adapter.removeClass(n.cssClasses.ANIMATING_CLOSED), t.adapter.notifyClose();
|
|
1014
|
-
}, Xe.TRANSITION_CLOSE_DURATION);
|
|
1015
|
-
}), this.isSurfaceOpen = !1, e || this.maybeRestoreFocus();
|
|
1016
|
-
}
|
|
1017
|
-
}, n.prototype.handleBodyClick = function(e) {
|
|
1018
|
-
var t = e.target;
|
|
1019
|
-
this.adapter.isElementInContainer(t) || this.close();
|
|
1020
|
-
}, n.prototype.handleKeydown = function(e) {
|
|
1021
|
-
var t = e.keyCode, i = e.key, r = i === "Escape" || t === 27;
|
|
1022
|
-
r && this.close();
|
|
1023
|
-
}, n.prototype.autoposition = function() {
|
|
1024
|
-
var e;
|
|
1025
|
-
this.measurements = this.getAutoLayoutmeasurements();
|
|
1026
|
-
var t = this.getoriginCorner(), i = this.getMenuSurfaceMaxHeight(t), r = this.hasBit(t, V.BOTTOM) ? "bottom" : "top", a = this.hasBit(t, V.RIGHT) ? "right" : "left", l = this.getHorizontalOriginOffset(t), m = this.getVerticalOriginOffset(t), D = this.measurements, b = D.anchorSize, y = D.surfaceSize, S = (e = {}, e[a] = l, e[r] = m, e);
|
|
1027
|
-
b.width / y.width > Xe.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO && (a = "center"), (this.isHoistedElement || this.isFixedPosition) && this.adjustPositionForHoistedElement(S), this.adapter.setTransformOrigin(a + " " + r), this.adapter.setPosition(S), this.adapter.setMaxHeight(i ? i + "px" : ""), this.hasBit(t, V.BOTTOM) || this.adapter.addClass(n.cssClasses.IS_OPEN_BELOW);
|
|
1028
|
-
}, n.prototype.getAutoLayoutmeasurements = function() {
|
|
1029
|
-
var e = this.adapter.getAnchorDimensions(), t = this.adapter.getBodyDimensions(), i = this.adapter.getWindowDimensions(), r = this.adapter.getWindowScroll();
|
|
1030
|
-
return e || (e = {
|
|
1031
|
-
top: this.position.y,
|
|
1032
|
-
right: this.position.x,
|
|
1033
|
-
bottom: this.position.y,
|
|
1034
|
-
left: this.position.x,
|
|
1035
|
-
width: 0,
|
|
1036
|
-
height: 0
|
|
1037
|
-
}), {
|
|
1038
|
-
anchorSize: e,
|
|
1039
|
-
bodySize: t,
|
|
1040
|
-
surfaceSize: this.dimensions,
|
|
1041
|
-
viewportDistance: {
|
|
1042
|
-
// tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together
|
|
1043
|
-
top: e.top,
|
|
1044
|
-
right: i.width - e.right,
|
|
1045
|
-
bottom: i.height - e.bottom,
|
|
1046
|
-
left: e.left
|
|
1047
|
-
// tslint:enable:object-literal-sort-keys
|
|
1048
|
-
},
|
|
1049
|
-
viewportSize: i,
|
|
1050
|
-
windowScroll: r
|
|
1051
|
-
};
|
|
1052
|
-
}, n.prototype.getoriginCorner = function() {
|
|
1053
|
-
var e = this.originCorner, t = this.measurements, i = t.viewportDistance, r = t.anchorSize, a = t.surfaceSize, l = n.numbers.MARGIN_TO_EDGE, m = this.hasBit(this.anchorCorner, V.BOTTOM), D, b;
|
|
1054
|
-
m ? (D = i.top - l + this.anchorMargin.bottom, b = i.bottom - l - this.anchorMargin.bottom) : (D = i.top - l + this.anchorMargin.top, b = i.bottom - l + r.height - this.anchorMargin.top);
|
|
1055
|
-
var y = b - a.height > 0;
|
|
1056
|
-
!y && D > b && (e = this.setBit(e, V.BOTTOM));
|
|
1057
|
-
var S = this.adapter.isRtl(), d = this.hasBit(this.anchorCorner, V.FLIP_RTL), f = this.hasBit(this.anchorCorner, V.RIGHT) || this.hasBit(e, V.RIGHT), L = !1;
|
|
1058
|
-
S && d ? L = !f : L = f;
|
|
1059
|
-
var B, M;
|
|
1060
|
-
L ? (B = i.left + r.width + this.anchorMargin.right, M = i.right - this.anchorMargin.right) : (B = i.left + this.anchorMargin.left, M = i.right + r.width - this.anchorMargin.left);
|
|
1061
|
-
var c = B - a.width > 0, A = M - a.width > 0, P = this.hasBit(e, V.FLIP_RTL) && this.hasBit(e, V.RIGHT);
|
|
1062
|
-
return A && P && S || !c && P ? e = this.unsetBit(e, V.RIGHT) : (c && L && S || c && !L && f || !A && B >= M) && (e = this.setBit(e, V.RIGHT)), e;
|
|
1063
|
-
}, n.prototype.getMenuSurfaceMaxHeight = function(e) {
|
|
1064
|
-
if (this.maxHeight > 0)
|
|
1065
|
-
return this.maxHeight;
|
|
1066
|
-
var t = this.measurements.viewportDistance, i = 0, r = this.hasBit(e, V.BOTTOM), a = this.hasBit(this.anchorCorner, V.BOTTOM), l = n.numbers.MARGIN_TO_EDGE;
|
|
1067
|
-
return r ? (i = t.top + this.anchorMargin.top - l, a || (i += this.measurements.anchorSize.height)) : (i = t.bottom - this.anchorMargin.bottom + this.measurements.anchorSize.height - l, a && (i -= this.measurements.anchorSize.height)), i;
|
|
1068
|
-
}, n.prototype.getHorizontalOriginOffset = function(e) {
|
|
1069
|
-
var t = this.measurements.anchorSize, i = this.hasBit(e, V.RIGHT), r = this.hasBit(this.anchorCorner, V.RIGHT);
|
|
1070
|
-
if (i) {
|
|
1071
|
-
var a = r ? t.width - this.anchorMargin.left : this.anchorMargin.right;
|
|
1072
|
-
return this.isHoistedElement || this.isFixedPosition ? a - (this.measurements.viewportSize.width - this.measurements.bodySize.width) : a;
|
|
1073
|
-
}
|
|
1074
|
-
return r ? t.width - this.anchorMargin.right : this.anchorMargin.left;
|
|
1075
|
-
}, n.prototype.getVerticalOriginOffset = function(e) {
|
|
1076
|
-
var t = this.measurements.anchorSize, i = this.hasBit(e, V.BOTTOM), r = this.hasBit(this.anchorCorner, V.BOTTOM), a = 0;
|
|
1077
|
-
return i ? a = r ? t.height - this.anchorMargin.top : -this.anchorMargin.bottom : a = r ? t.height + this.anchorMargin.bottom : this.anchorMargin.top, a;
|
|
1078
|
-
}, n.prototype.adjustPositionForHoistedElement = function(e) {
|
|
1079
|
-
var t, i, r = this.measurements, a = r.windowScroll, l = r.viewportDistance, m = r.surfaceSize, D = r.viewportSize, b = Object.keys(e);
|
|
1080
|
-
try {
|
|
1081
|
-
for (var y = Ft(b), S = y.next(); !S.done; S = y.next()) {
|
|
1082
|
-
var d = S.value, f = e[d] || 0;
|
|
1083
|
-
if (this.isHorizontallyCenteredOnViewport && (d === "left" || d === "right")) {
|
|
1084
|
-
e[d] = (D.width - m.width) / 2;
|
|
1085
|
-
continue;
|
|
1086
|
-
}
|
|
1087
|
-
f += l[d], this.isFixedPosition || (d === "top" ? f += a.y : d === "bottom" ? f -= a.y : d === "left" ? f += a.x : f -= a.x), e[d] = f;
|
|
1088
|
-
}
|
|
1089
|
-
} catch (L) {
|
|
1090
|
-
t = { error: L };
|
|
1091
|
-
} finally {
|
|
1092
|
-
try {
|
|
1093
|
-
S && !S.done && (i = y.return) && i.call(y);
|
|
1094
|
-
} finally {
|
|
1095
|
-
if (t) throw t.error;
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
}, n.prototype.maybeRestoreFocus = function() {
|
|
1099
|
-
var e = this.adapter.isFocused(), t = document.activeElement && this.adapter.isElementInContainer(document.activeElement);
|
|
1100
|
-
(e || t) && this.adapter.restoreFocus();
|
|
1101
|
-
}, n.prototype.hasBit = function(e, t) {
|
|
1102
|
-
return !!(e & t);
|
|
1103
|
-
}, n.prototype.setBit = function(e, t) {
|
|
1104
|
-
return e | t;
|
|
1105
|
-
}, n.prototype.unsetBit = function(e, t) {
|
|
1106
|
-
return e ^ t;
|
|
1107
|
-
}, n.prototype.isFinite = function(e) {
|
|
1108
|
-
return typeof e == "number" && isFinite(e);
|
|
1109
|
-
}, n;
|
|
1110
|
-
}(ht)
|
|
1111
|
-
);
|
|
1112
|
-
/**
|
|
1113
|
-
* @license
|
|
1114
|
-
* Copyright 2018 Google Inc.
|
|
1115
|
-
*
|
|
1116
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1117
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1118
|
-
* in the Software without restriction, including without limitation the rights
|
|
1119
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1120
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1121
|
-
* furnished to do so, subject to the following conditions:
|
|
1122
|
-
*
|
|
1123
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1124
|
-
* all copies or substantial portions of the Software.
|
|
1125
|
-
*
|
|
1126
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1127
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1128
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1129
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1130
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1131
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1132
|
-
* THE SOFTWARE.
|
|
1133
|
-
*/
|
|
1134
|
-
var Ot = (
|
|
1135
|
-
/** @class */
|
|
1136
|
-
function(s) {
|
|
1137
|
-
Re(n, s);
|
|
1138
|
-
function n() {
|
|
1139
|
-
return s !== null && s.apply(this, arguments) || this;
|
|
1140
|
-
}
|
|
1141
|
-
return n.attachTo = function(e) {
|
|
1142
|
-
return new n(e);
|
|
1143
|
-
}, n.prototype.initialSyncWithDOM = function() {
|
|
1144
|
-
var e = this, t = this.root.parentElement;
|
|
1145
|
-
this.anchorElement = t && t.classList.contains(He.ANCHOR) ? t : null, this.root.classList.contains(He.FIXED) && this.setFixedPosition(!0), this.handleKeydown = function(i) {
|
|
1146
|
-
e.foundation.handleKeydown(i);
|
|
1147
|
-
}, this.handleBodyClick = function(i) {
|
|
1148
|
-
e.foundation.handleBodyClick(i);
|
|
1149
|
-
}, this.registerBodyClickListener = function() {
|
|
1150
|
-
document.body.addEventListener("click", e.handleBodyClick, { capture: !0 });
|
|
1151
|
-
}, this.deregisterBodyClickListener = function() {
|
|
1152
|
-
document.body.removeEventListener("click", e.handleBodyClick, { capture: !0 });
|
|
1153
|
-
}, this.listen("keydown", this.handleKeydown), this.listen(Ke.OPENED_EVENT, this.registerBodyClickListener), this.listen(Ke.CLOSED_EVENT, this.deregisterBodyClickListener);
|
|
1154
|
-
}, n.prototype.destroy = function() {
|
|
1155
|
-
this.unlisten("keydown", this.handleKeydown), this.unlisten(Ke.OPENED_EVENT, this.registerBodyClickListener), this.unlisten(Ke.CLOSED_EVENT, this.deregisterBodyClickListener), s.prototype.destroy.call(this);
|
|
1156
|
-
}, n.prototype.isOpen = function() {
|
|
1157
|
-
return this.foundation.isOpen();
|
|
1158
|
-
}, n.prototype.open = function() {
|
|
1159
|
-
this.foundation.open();
|
|
1160
|
-
}, n.prototype.close = function(e) {
|
|
1161
|
-
e === void 0 && (e = !1), this.foundation.close(e);
|
|
1162
|
-
}, Object.defineProperty(n.prototype, "quickOpen", {
|
|
1163
|
-
set: function(e) {
|
|
1164
|
-
this.foundation.setQuickOpen(e);
|
|
1165
|
-
},
|
|
1166
|
-
enumerable: !1,
|
|
1167
|
-
configurable: !0
|
|
1168
|
-
}), n.prototype.setIsHoisted = function(e) {
|
|
1169
|
-
this.foundation.setIsHoisted(e);
|
|
1170
|
-
}, n.prototype.setMenuSurfaceAnchorElement = function(e) {
|
|
1171
|
-
this.anchorElement = e;
|
|
1172
|
-
}, n.prototype.setFixedPosition = function(e) {
|
|
1173
|
-
e ? this.root.classList.add(He.FIXED) : this.root.classList.remove(He.FIXED), this.foundation.setFixedPosition(e);
|
|
1174
|
-
}, n.prototype.setAbsolutePosition = function(e, t) {
|
|
1175
|
-
this.foundation.setAbsolutePosition(e, t), this.setIsHoisted(!0);
|
|
1176
|
-
}, n.prototype.setAnchorCorner = function(e) {
|
|
1177
|
-
this.foundation.setAnchorCorner(e);
|
|
1178
|
-
}, n.prototype.setAnchorMargin = function(e) {
|
|
1179
|
-
this.foundation.setAnchorMargin(e);
|
|
1180
|
-
}, n.prototype.getDefaultFoundation = function() {
|
|
1181
|
-
var e = this, t = {
|
|
1182
|
-
addClass: function(i) {
|
|
1183
|
-
return e.root.classList.add(i);
|
|
1184
|
-
},
|
|
1185
|
-
removeClass: function(i) {
|
|
1186
|
-
return e.root.classList.remove(i);
|
|
1187
|
-
},
|
|
1188
|
-
hasClass: function(i) {
|
|
1189
|
-
return e.root.classList.contains(i);
|
|
1190
|
-
},
|
|
1191
|
-
hasAnchor: function() {
|
|
1192
|
-
return !!e.anchorElement;
|
|
1193
|
-
},
|
|
1194
|
-
notifyClose: function() {
|
|
1195
|
-
return e.emit(xe.strings.CLOSED_EVENT, {});
|
|
1196
|
-
},
|
|
1197
|
-
notifyClosing: function() {
|
|
1198
|
-
e.emit(xe.strings.CLOSING_EVENT, {});
|
|
1199
|
-
},
|
|
1200
|
-
notifyOpen: function() {
|
|
1201
|
-
return e.emit(xe.strings.OPENED_EVENT, {});
|
|
1202
|
-
},
|
|
1203
|
-
isElementInContainer: function(i) {
|
|
1204
|
-
return e.root.contains(i);
|
|
1205
|
-
},
|
|
1206
|
-
isRtl: function() {
|
|
1207
|
-
return getComputedStyle(e.root).getPropertyValue("direction") === "rtl";
|
|
1208
|
-
},
|
|
1209
|
-
setTransformOrigin: function(i) {
|
|
1210
|
-
var r = kt(window, "transform") + "-origin";
|
|
1211
|
-
e.root.style.setProperty(r, i);
|
|
1212
|
-
},
|
|
1213
|
-
isFocused: function() {
|
|
1214
|
-
return document.activeElement === e.root;
|
|
1215
|
-
},
|
|
1216
|
-
saveFocus: function() {
|
|
1217
|
-
e.previousFocus = document.activeElement;
|
|
1218
|
-
},
|
|
1219
|
-
restoreFocus: function() {
|
|
1220
|
-
e.root.contains(document.activeElement) && e.previousFocus && e.previousFocus.focus && e.previousFocus.focus();
|
|
1221
|
-
},
|
|
1222
|
-
getInnerDimensions: function() {
|
|
1223
|
-
return {
|
|
1224
|
-
width: e.root.offsetWidth,
|
|
1225
|
-
height: e.root.offsetHeight
|
|
1226
|
-
};
|
|
1227
|
-
},
|
|
1228
|
-
getAnchorDimensions: function() {
|
|
1229
|
-
return e.anchorElement ? e.anchorElement.getBoundingClientRect() : null;
|
|
1230
|
-
},
|
|
1231
|
-
getWindowDimensions: function() {
|
|
1232
|
-
return { width: window.innerWidth, height: window.innerHeight };
|
|
1233
|
-
},
|
|
1234
|
-
getBodyDimensions: function() {
|
|
1235
|
-
return { width: document.body.clientWidth, height: document.body.clientHeight };
|
|
1236
|
-
},
|
|
1237
|
-
getWindowScroll: function() {
|
|
1238
|
-
return { x: window.pageXOffset, y: window.pageYOffset };
|
|
1239
|
-
},
|
|
1240
|
-
setPosition: function(i) {
|
|
1241
|
-
var r = e.root;
|
|
1242
|
-
r.style.left = "left" in i ? i.left + "px" : "", r.style.right = "right" in i ? i.right + "px" : "", r.style.top = "top" in i ? i.top + "px" : "", r.style.bottom = "bottom" in i ? i.bottom + "px" : "";
|
|
1243
|
-
},
|
|
1244
|
-
setMaxHeight: function(i) {
|
|
1245
|
-
e.root.style.maxHeight = i;
|
|
1246
|
-
}
|
|
1247
|
-
};
|
|
1248
|
-
return new xe(t);
|
|
1249
|
-
}, n;
|
|
1250
|
-
}(mt)
|
|
1251
|
-
);
|
|
1252
|
-
/**
|
|
1253
|
-
* @license
|
|
1254
|
-
* Copyright 2018 Google Inc.
|
|
1255
|
-
*
|
|
1256
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1257
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1258
|
-
* in the Software without restriction, including without limitation the rights
|
|
1259
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1260
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1261
|
-
* furnished to do so, subject to the following conditions:
|
|
1262
|
-
*
|
|
1263
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1264
|
-
* all copies or substantial portions of the Software.
|
|
1265
|
-
*
|
|
1266
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1267
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1268
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1269
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1270
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1271
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1272
|
-
* THE SOFTWARE.
|
|
1273
|
-
*/
|
|
1274
|
-
var Me = {
|
|
1275
|
-
MENU_SELECTED_LIST_ITEM: "mdc-menu-item--selected",
|
|
1276
|
-
MENU_SELECTION_GROUP: "mdc-menu__selection-group",
|
|
1277
|
-
ROOT: "mdc-menu"
|
|
1278
|
-
}, _e = {
|
|
1279
|
-
ARIA_CHECKED_ATTR: "aria-checked",
|
|
1280
|
-
ARIA_DISABLED_ATTR: "aria-disabled",
|
|
1281
|
-
CHECKBOX_SELECTOR: 'input[type="checkbox"]',
|
|
1282
|
-
LIST_SELECTOR: ".mdc-list,.mdc-deprecated-list",
|
|
1283
|
-
SELECTED_EVENT: "MDCMenu:selected"
|
|
1284
|
-
}, en = {
|
|
1285
|
-
FOCUS_ROOT_INDEX: -1
|
|
1286
|
-
}, Le;
|
|
1287
|
-
(function(s) {
|
|
1288
|
-
s[s.NONE = 0] = "NONE", s[s.LIST_ROOT = 1] = "LIST_ROOT", s[s.FIRST_ITEM = 2] = "FIRST_ITEM", s[s.LAST_ITEM = 3] = "LAST_ITEM";
|
|
1289
|
-
})(Le || (Le = {}));
|
|
1290
|
-
/**
|
|
1291
|
-
* @license
|
|
1292
|
-
* Copyright 2018 Google Inc.
|
|
1293
|
-
*
|
|
1294
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1295
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1296
|
-
* in the Software without restriction, including without limitation the rights
|
|
1297
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1298
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1299
|
-
* furnished to do so, subject to the following conditions:
|
|
1300
|
-
*
|
|
1301
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1302
|
-
* all copies or substantial portions of the Software.
|
|
1303
|
-
*
|
|
1304
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1305
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1306
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1307
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1308
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1309
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1310
|
-
* THE SOFTWARE.
|
|
1311
|
-
*/
|
|
1312
|
-
var tn = (
|
|
1313
|
-
/** @class */
|
|
1314
|
-
function(s) {
|
|
1315
|
-
Re(n, s);
|
|
1316
|
-
function n(e) {
|
|
1317
|
-
var t = s.call(this, Ne(Ne({}, n.defaultAdapter), e)) || this;
|
|
1318
|
-
return t.closeAnimationEndTimerId_ = 0, t.defaultFocusState_ = Le.LIST_ROOT, t;
|
|
1319
|
-
}
|
|
1320
|
-
return Object.defineProperty(n, "cssClasses", {
|
|
1321
|
-
get: function() {
|
|
1322
|
-
return Me;
|
|
1323
|
-
},
|
|
1324
|
-
enumerable: !1,
|
|
1325
|
-
configurable: !0
|
|
1326
|
-
}), Object.defineProperty(n, "strings", {
|
|
1327
|
-
get: function() {
|
|
1328
|
-
return _e;
|
|
1329
|
-
},
|
|
1330
|
-
enumerable: !1,
|
|
1331
|
-
configurable: !0
|
|
1332
|
-
}), Object.defineProperty(n, "numbers", {
|
|
1333
|
-
get: function() {
|
|
1334
|
-
return en;
|
|
1335
|
-
},
|
|
1336
|
-
enumerable: !1,
|
|
1337
|
-
configurable: !0
|
|
1338
|
-
}), Object.defineProperty(n, "defaultAdapter", {
|
|
1339
|
-
/**
|
|
1340
|
-
* @see {@link MDCMenuAdapter} for typing information on parameters and return types.
|
|
1341
|
-
*/
|
|
1342
|
-
get: function() {
|
|
1343
|
-
return {
|
|
1344
|
-
addClassToElementAtIndex: function() {
|
|
1345
|
-
},
|
|
1346
|
-
removeClassFromElementAtIndex: function() {
|
|
1347
|
-
},
|
|
1348
|
-
addAttributeToElementAtIndex: function() {
|
|
1349
|
-
},
|
|
1350
|
-
removeAttributeFromElementAtIndex: function() {
|
|
1351
|
-
},
|
|
1352
|
-
elementContainsClass: function() {
|
|
1353
|
-
return !1;
|
|
1354
|
-
},
|
|
1355
|
-
closeSurface: function() {
|
|
1356
|
-
},
|
|
1357
|
-
getElementIndex: function() {
|
|
1358
|
-
return -1;
|
|
1359
|
-
},
|
|
1360
|
-
notifySelected: function() {
|
|
1361
|
-
},
|
|
1362
|
-
getMenuItemCount: function() {
|
|
1363
|
-
return 0;
|
|
1364
|
-
},
|
|
1365
|
-
focusItemAtIndex: function() {
|
|
1366
|
-
},
|
|
1367
|
-
focusListRoot: function() {
|
|
1368
|
-
},
|
|
1369
|
-
getSelectedSiblingOfItemAtIndex: function() {
|
|
1370
|
-
return -1;
|
|
1371
|
-
},
|
|
1372
|
-
isSelectableItemAtIndex: function() {
|
|
1373
|
-
return !1;
|
|
1374
|
-
}
|
|
1375
|
-
};
|
|
1376
|
-
},
|
|
1377
|
-
enumerable: !1,
|
|
1378
|
-
configurable: !0
|
|
1379
|
-
}), n.prototype.destroy = function() {
|
|
1380
|
-
this.closeAnimationEndTimerId_ && clearTimeout(this.closeAnimationEndTimerId_), this.adapter.closeSurface();
|
|
1381
|
-
}, n.prototype.handleKeydown = function(e) {
|
|
1382
|
-
var t = e.key, i = e.keyCode, r = t === "Tab" || i === 9;
|
|
1383
|
-
r && this.adapter.closeSurface(
|
|
1384
|
-
/** skipRestoreFocus */
|
|
1385
|
-
!0
|
|
1386
|
-
);
|
|
1387
|
-
}, n.prototype.handleItemAction = function(e) {
|
|
1388
|
-
var t = this, i = this.adapter.getElementIndex(e);
|
|
1389
|
-
i < 0 || (this.adapter.notifySelected({ index: i }), this.adapter.closeSurface(), this.closeAnimationEndTimerId_ = setTimeout(function() {
|
|
1390
|
-
var r = t.adapter.getElementIndex(e);
|
|
1391
|
-
r >= 0 && t.adapter.isSelectableItemAtIndex(r) && t.setSelectedIndex(r);
|
|
1392
|
-
}, xe.numbers.TRANSITION_CLOSE_DURATION));
|
|
1393
|
-
}, n.prototype.handleMenuSurfaceOpened = function() {
|
|
1394
|
-
switch (this.defaultFocusState_) {
|
|
1395
|
-
case Le.FIRST_ITEM:
|
|
1396
|
-
this.adapter.focusItemAtIndex(0);
|
|
1397
|
-
break;
|
|
1398
|
-
case Le.LAST_ITEM:
|
|
1399
|
-
this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount() - 1);
|
|
1400
|
-
break;
|
|
1401
|
-
case Le.NONE:
|
|
1402
|
-
break;
|
|
1403
|
-
default:
|
|
1404
|
-
this.adapter.focusListRoot();
|
|
1405
|
-
break;
|
|
1406
|
-
}
|
|
1407
|
-
}, n.prototype.setDefaultFocusState = function(e) {
|
|
1408
|
-
this.defaultFocusState_ = e;
|
|
1409
|
-
}, n.prototype.setSelectedIndex = function(e) {
|
|
1410
|
-
if (this.validatedIndex_(e), !this.adapter.isSelectableItemAtIndex(e))
|
|
1411
|
-
throw new Error("MDCMenuFoundation: No selection group at specified index.");
|
|
1412
|
-
var t = this.adapter.getSelectedSiblingOfItemAtIndex(e);
|
|
1413
|
-
t >= 0 && (this.adapter.removeAttributeFromElementAtIndex(t, _e.ARIA_CHECKED_ATTR), this.adapter.removeClassFromElementAtIndex(t, Me.MENU_SELECTED_LIST_ITEM)), this.adapter.addClassToElementAtIndex(e, Me.MENU_SELECTED_LIST_ITEM), this.adapter.addAttributeToElementAtIndex(e, _e.ARIA_CHECKED_ATTR, "true");
|
|
1414
|
-
}, n.prototype.setEnabled = function(e, t) {
|
|
1415
|
-
this.validatedIndex_(e), t ? (this.adapter.removeClassFromElementAtIndex(e, I.LIST_ITEM_DISABLED_CLASS), this.adapter.addAttributeToElementAtIndex(e, _e.ARIA_DISABLED_ATTR, "false")) : (this.adapter.addClassToElementAtIndex(e, I.LIST_ITEM_DISABLED_CLASS), this.adapter.addAttributeToElementAtIndex(e, _e.ARIA_DISABLED_ATTR, "true"));
|
|
1416
|
-
}, n.prototype.validatedIndex_ = function(e) {
|
|
1417
|
-
var t = this.adapter.getMenuItemCount(), i = e >= 0 && e < t;
|
|
1418
|
-
if (!i)
|
|
1419
|
-
throw new Error("MDCMenuFoundation: No list item at specified index.");
|
|
1420
|
-
}, n;
|
|
1421
|
-
}(ht)
|
|
1422
|
-
);
|
|
1423
|
-
/**
|
|
1424
|
-
* @license
|
|
1425
|
-
* Copyright 2018 Google Inc.
|
|
1426
|
-
*
|
|
1427
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1428
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1429
|
-
* in the Software without restriction, including without limitation the rights
|
|
1430
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1431
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1432
|
-
* furnished to do so, subject to the following conditions:
|
|
1433
|
-
*
|
|
1434
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1435
|
-
* all copies or substantial portions of the Software.
|
|
1436
|
-
*
|
|
1437
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1438
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1439
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1440
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1441
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1442
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1443
|
-
* THE SOFTWARE.
|
|
1444
|
-
*/
|
|
1445
|
-
var nn = (
|
|
1446
|
-
/** @class */
|
|
1447
|
-
function(s) {
|
|
1448
|
-
Re(n, s);
|
|
1449
|
-
function n() {
|
|
1450
|
-
return s !== null && s.apply(this, arguments) || this;
|
|
1451
|
-
}
|
|
1452
|
-
return n.attachTo = function(e) {
|
|
1453
|
-
return new n(e);
|
|
1454
|
-
}, n.prototype.initialize = function(e, t) {
|
|
1455
|
-
e === void 0 && (e = function(i) {
|
|
1456
|
-
return new Ot(i);
|
|
1457
|
-
}), t === void 0 && (t = function(i) {
|
|
1458
|
-
return new Lt(i);
|
|
1459
|
-
}), this.menuSurfaceFactory_ = e, this.listFactory_ = t;
|
|
1460
|
-
}, n.prototype.initialSyncWithDOM = function() {
|
|
1461
|
-
var e = this;
|
|
1462
|
-
this.menuSurface_ = this.menuSurfaceFactory_(this.root);
|
|
1463
|
-
var t = this.root.querySelector(_e.LIST_SELECTOR);
|
|
1464
|
-
t ? (this.list_ = this.listFactory_(t), this.list_.wrapFocus = !0) : this.list_ = null, this.handleKeydown_ = function(i) {
|
|
1465
|
-
return e.foundation.handleKeydown(i);
|
|
1466
|
-
}, this.handleItemAction_ = function(i) {
|
|
1467
|
-
return e.foundation.handleItemAction(e.items[i.detail.index]);
|
|
1468
|
-
}, this.handleMenuSurfaceOpened_ = function() {
|
|
1469
|
-
return e.foundation.handleMenuSurfaceOpened();
|
|
1470
|
-
}, this.menuSurface_.listen(xe.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_), this.listen("keydown", this.handleKeydown_), this.listen(dt.strings.ACTION_EVENT, this.handleItemAction_);
|
|
1471
|
-
}, n.prototype.destroy = function() {
|
|
1472
|
-
this.list_ && this.list_.destroy(), this.menuSurface_.destroy(), this.menuSurface_.unlisten(xe.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_), this.unlisten("keydown", this.handleKeydown_), this.unlisten(dt.strings.ACTION_EVENT, this.handleItemAction_), s.prototype.destroy.call(this);
|
|
1473
|
-
}, Object.defineProperty(n.prototype, "open", {
|
|
1474
|
-
get: function() {
|
|
1475
|
-
return this.menuSurface_.isOpen();
|
|
1476
|
-
},
|
|
1477
|
-
set: function(e) {
|
|
1478
|
-
e ? this.menuSurface_.open() : this.menuSurface_.close();
|
|
1479
|
-
},
|
|
1480
|
-
enumerable: !1,
|
|
1481
|
-
configurable: !0
|
|
1482
|
-
}), Object.defineProperty(n.prototype, "wrapFocus", {
|
|
1483
|
-
get: function() {
|
|
1484
|
-
return this.list_ ? this.list_.wrapFocus : !1;
|
|
1485
|
-
},
|
|
1486
|
-
set: function(e) {
|
|
1487
|
-
this.list_ && (this.list_.wrapFocus = e);
|
|
1488
|
-
},
|
|
1489
|
-
enumerable: !1,
|
|
1490
|
-
configurable: !0
|
|
1491
|
-
}), Object.defineProperty(n.prototype, "hasTypeahead", {
|
|
1492
|
-
/**
|
|
1493
|
-
* Sets whether the menu has typeahead functionality.
|
|
1494
|
-
* @param value Whether typeahead is enabled.
|
|
1495
|
-
*/
|
|
1496
|
-
set: function(e) {
|
|
1497
|
-
this.list_ && (this.list_.hasTypeahead = e);
|
|
1498
|
-
},
|
|
1499
|
-
enumerable: !1,
|
|
1500
|
-
configurable: !0
|
|
1501
|
-
}), Object.defineProperty(n.prototype, "typeaheadInProgress", {
|
|
1502
|
-
/**
|
|
1503
|
-
* @return Whether typeahead logic is currently matching some user prefix.
|
|
1504
|
-
*/
|
|
1505
|
-
get: function() {
|
|
1506
|
-
return this.list_ ? this.list_.typeaheadInProgress : !1;
|
|
1507
|
-
},
|
|
1508
|
-
enumerable: !1,
|
|
1509
|
-
configurable: !0
|
|
1510
|
-
}), n.prototype.typeaheadMatchItem = function(e, t) {
|
|
1511
|
-
return this.list_ ? this.list_.typeaheadMatchItem(e, t) : -1;
|
|
1512
|
-
}, n.prototype.layout = function() {
|
|
1513
|
-
this.list_ && this.list_.layout();
|
|
1514
|
-
}, Object.defineProperty(n.prototype, "items", {
|
|
1515
|
-
/**
|
|
1516
|
-
* Return the items within the menu. Note that this only contains the set of elements within
|
|
1517
|
-
* the items container that are proper list items, and not supplemental / presentational DOM
|
|
1518
|
-
* elements.
|
|
1519
|
-
*/
|
|
1520
|
-
get: function() {
|
|
1521
|
-
return this.list_ ? this.list_.listElements : [];
|
|
1522
|
-
},
|
|
1523
|
-
enumerable: !1,
|
|
1524
|
-
configurable: !0
|
|
1525
|
-
}), Object.defineProperty(n.prototype, "singleSelection", {
|
|
1526
|
-
/**
|
|
1527
|
-
* Turns on/off the underlying list's single selection mode. Used mainly
|
|
1528
|
-
* by select menu.
|
|
1529
|
-
*
|
|
1530
|
-
* @param singleSelection Whether to enable single selection mode.
|
|
1531
|
-
*/
|
|
1532
|
-
set: function(e) {
|
|
1533
|
-
this.list_ && (this.list_.singleSelection = e);
|
|
1534
|
-
},
|
|
1535
|
-
enumerable: !1,
|
|
1536
|
-
configurable: !0
|
|
1537
|
-
}), Object.defineProperty(n.prototype, "selectedIndex", {
|
|
1538
|
-
/**
|
|
1539
|
-
* Retrieves the selected index. Only applicable to select menus.
|
|
1540
|
-
* @return The selected index, which is a number for single selection and
|
|
1541
|
-
* radio lists, and an array of numbers for checkbox lists.
|
|
1542
|
-
*/
|
|
1543
|
-
get: function() {
|
|
1544
|
-
return this.list_ ? this.list_.selectedIndex : Y.UNSET_INDEX;
|
|
1545
|
-
},
|
|
1546
|
-
/**
|
|
1547
|
-
* Sets the selected index of the list. Only applicable to select menus.
|
|
1548
|
-
* @param index The selected index, which is a number for single selection and
|
|
1549
|
-
* radio lists, and an array of numbers for checkbox lists.
|
|
1550
|
-
*/
|
|
1551
|
-
set: function(e) {
|
|
1552
|
-
this.list_ && (this.list_.selectedIndex = e);
|
|
1553
|
-
},
|
|
1554
|
-
enumerable: !1,
|
|
1555
|
-
configurable: !0
|
|
1556
|
-
}), Object.defineProperty(n.prototype, "quickOpen", {
|
|
1557
|
-
set: function(e) {
|
|
1558
|
-
this.menuSurface_.quickOpen = e;
|
|
1559
|
-
},
|
|
1560
|
-
enumerable: !1,
|
|
1561
|
-
configurable: !0
|
|
1562
|
-
}), n.prototype.setDefaultFocusState = function(e) {
|
|
1563
|
-
this.foundation.setDefaultFocusState(e);
|
|
1564
|
-
}, n.prototype.setAnchorCorner = function(e) {
|
|
1565
|
-
this.menuSurface_.setAnchorCorner(e);
|
|
1566
|
-
}, n.prototype.setAnchorMargin = function(e) {
|
|
1567
|
-
this.menuSurface_.setAnchorMargin(e);
|
|
1568
|
-
}, n.prototype.setSelectedIndex = function(e) {
|
|
1569
|
-
this.foundation.setSelectedIndex(e);
|
|
1570
|
-
}, n.prototype.setEnabled = function(e, t) {
|
|
1571
|
-
this.foundation.setEnabled(e, t);
|
|
1572
|
-
}, n.prototype.getOptionByIndex = function(e) {
|
|
1573
|
-
var t = this.items;
|
|
1574
|
-
return e < t.length ? this.items[e] : null;
|
|
1575
|
-
}, n.prototype.getPrimaryTextAtIndex = function(e) {
|
|
1576
|
-
var t = this.getOptionByIndex(e);
|
|
1577
|
-
return t && this.list_ && this.list_.getPrimaryText(t) || "";
|
|
1578
|
-
}, n.prototype.setFixedPosition = function(e) {
|
|
1579
|
-
this.menuSurface_.setFixedPosition(e);
|
|
1580
|
-
}, n.prototype.setIsHoisted = function(e) {
|
|
1581
|
-
this.menuSurface_.setIsHoisted(e);
|
|
1582
|
-
}, n.prototype.setAbsolutePosition = function(e, t) {
|
|
1583
|
-
this.menuSurface_.setAbsolutePosition(e, t);
|
|
1584
|
-
}, n.prototype.setAnchorElement = function(e) {
|
|
1585
|
-
this.menuSurface_.anchorElement = e;
|
|
1586
|
-
}, n.prototype.getDefaultFoundation = function() {
|
|
1587
|
-
var e = this, t = {
|
|
1588
|
-
addClassToElementAtIndex: function(i, r) {
|
|
1589
|
-
var a = e.items;
|
|
1590
|
-
a[i].classList.add(r);
|
|
1591
|
-
},
|
|
1592
|
-
removeClassFromElementAtIndex: function(i, r) {
|
|
1593
|
-
var a = e.items;
|
|
1594
|
-
a[i].classList.remove(r);
|
|
1595
|
-
},
|
|
1596
|
-
addAttributeToElementAtIndex: function(i, r, a) {
|
|
1597
|
-
var l = e.items;
|
|
1598
|
-
l[i].setAttribute(r, a);
|
|
1599
|
-
},
|
|
1600
|
-
removeAttributeFromElementAtIndex: function(i, r) {
|
|
1601
|
-
var a = e.items;
|
|
1602
|
-
a[i].removeAttribute(r);
|
|
1603
|
-
},
|
|
1604
|
-
elementContainsClass: function(i, r) {
|
|
1605
|
-
return i.classList.contains(r);
|
|
1606
|
-
},
|
|
1607
|
-
closeSurface: function(i) {
|
|
1608
|
-
return e.menuSurface_.close(i);
|
|
1609
|
-
},
|
|
1610
|
-
getElementIndex: function(i) {
|
|
1611
|
-
return e.items.indexOf(i);
|
|
1612
|
-
},
|
|
1613
|
-
notifySelected: function(i) {
|
|
1614
|
-
return e.emit(_e.SELECTED_EVENT, {
|
|
1615
|
-
index: i.index,
|
|
1616
|
-
item: e.items[i.index]
|
|
1617
|
-
});
|
|
1618
|
-
},
|
|
1619
|
-
getMenuItemCount: function() {
|
|
1620
|
-
return e.items.length;
|
|
1621
|
-
},
|
|
1622
|
-
focusItemAtIndex: function(i) {
|
|
1623
|
-
return e.items[i].focus();
|
|
1624
|
-
},
|
|
1625
|
-
focusListRoot: function() {
|
|
1626
|
-
return e.root.querySelector(_e.LIST_SELECTOR).focus();
|
|
1627
|
-
},
|
|
1628
|
-
isSelectableItemAtIndex: function(i) {
|
|
1629
|
-
return !!lt(e.items[i], "." + Me.MENU_SELECTION_GROUP);
|
|
1630
|
-
},
|
|
1631
|
-
getSelectedSiblingOfItemAtIndex: function(i) {
|
|
1632
|
-
var r = lt(e.items[i], "." + Me.MENU_SELECTION_GROUP), a = r.querySelector("." + Me.MENU_SELECTED_LIST_ITEM);
|
|
1633
|
-
return a ? e.items.indexOf(a) : -1;
|
|
1634
|
-
}
|
|
1635
|
-
};
|
|
1636
|
-
return new tn(t);
|
|
1637
|
-
}, n;
|
|
1638
|
-
}(mt)
|
|
1639
|
-
);
|
|
1640
|
-
const rn = {
|
|
1641
|
-
/**
|
|
1642
|
-
* The horizontal position of the menu, when visible. The menu surface will be hoisted to the body of the DOM. This should only be used when the menu needs to be explicitly positioned and cannot be combined with MenuAnchor.
|
|
1643
|
-
*
|
|
1644
|
-
* Defaults to **null**.
|
|
1645
|
-
*/
|
|
1646
|
-
absolutePositionX: o.number,
|
|
1647
|
-
/**
|
|
1648
|
-
* The vertical position of the menu, when visible. The menu surface will be hoisted to the body of the DOM. This should only be used when the menu needs to be explicitly positioned and cannot be combined with MenuAnchor.
|
|
1649
|
-
*
|
|
1650
|
-
* Defaults to **null**.
|
|
1651
|
-
*/
|
|
1652
|
-
absolutePositionY: o.number,
|
|
1653
|
-
/**
|
|
1654
|
-
* Sets the display position of the menu relative to the parent element. It must be used with Menu Anchor.
|
|
1655
|
-
*
|
|
1656
|
-
* Defaults to **'BOTTOM_START'**.
|
|
1657
|
-
*/
|
|
1658
|
-
anchorCorner: o.oneOf(["TOP_LEFT", "TOP_RIGHT", "BOTTOM_LEFT", "BOTTOM_RIGHT", "TOP_START", "TOP_END", "BOTTOM_START", "BOTTOM_END"]),
|
|
1659
|
-
/**
|
|
1660
|
-
* Sets the distance from the anchor point that the menu surface should be shown. The object properties should include at least one of `top`, `bottom`, `left` or `right`.
|
|
1661
|
-
*
|
|
1662
|
-
* Defaults to **null**.
|
|
1663
|
-
*/
|
|
1664
|
-
anchorMargin: o.object,
|
|
1665
|
-
/**
|
|
1666
|
-
* Custom props to be sent to the MenuAnchor wrapper of the `trigger`
|
|
1667
|
-
*
|
|
1668
|
-
* Defaults to **{}**.
|
|
1669
|
-
*/
|
|
1670
|
-
anchorProps: o.object,
|
|
1671
|
-
/**
|
|
1672
|
-
* Expects a List or ListGroup component but accepts any valid markup or components.
|
|
1673
|
-
*
|
|
1674
|
-
* Defaults to **null**.
|
|
1675
|
-
*/
|
|
1676
|
-
children: o.node,
|
|
1677
|
-
/**
|
|
1678
|
-
* Sets the direction property for the menu. For right to left languages use `rtl`.
|
|
1679
|
-
*
|
|
1680
|
-
* Defaults to **'ltr'**.
|
|
1681
|
-
*/
|
|
1682
|
-
direction: o.oneOf(["ltr", "rtl"]),
|
|
1683
|
-
/**
|
|
1684
|
-
* Prevents the use of absolute position (x/y) props.
|
|
1685
|
-
*
|
|
1686
|
-
* Defaults to **false**.
|
|
1687
|
-
*/
|
|
1688
|
-
fixed: o.bool,
|
|
1689
|
-
/**
|
|
1690
|
-
* Sets the width of the menu to the full width of the body. It is to be used with `hoistToBody`. Useful when creating navigation menus for mobile devices.
|
|
1691
|
-
*
|
|
1692
|
-
* Defaults to **false**.
|
|
1693
|
-
*/
|
|
1694
|
-
fullScreen: o.bool,
|
|
1695
|
-
/**
|
|
1696
|
-
* Sets the width of the menu to the full width of the parent. Cannot be used with `hoistToBody` or when `absolutePositionY` or `absolutePositionY` is set.
|
|
1697
|
-
*
|
|
1698
|
-
* Defaults to **false**.
|
|
1699
|
-
*/
|
|
1700
|
-
fullWidth: o.bool,
|
|
1701
|
-
/**
|
|
1702
|
-
* Fired when html body is clicked. Default behavior is to close the menu.
|
|
1703
|
-
*
|
|
1704
|
-
* Defaults to **null**.
|
|
1705
|
-
*/
|
|
1706
|
-
handleBodyClick: o.func,
|
|
1707
|
-
/**
|
|
1708
|
-
* Enables the menu to be rendered as part of the body, enables higher z-index. Requires `surfaceOnly` to be true. This can improve menu to behavior better inside a table. Use with caution: may cause unintended side-effects.
|
|
1709
|
-
*
|
|
1710
|
-
* Defaults to **false**.
|
|
1711
|
-
*/
|
|
1712
|
-
hoistToBody: o.bool,
|
|
1713
|
-
/**
|
|
1714
|
-
* Sets the max height of the menu. It can be a number or string with 100% or so.
|
|
1715
|
-
*
|
|
1716
|
-
* Defaults to **275**.
|
|
1717
|
-
*/
|
|
1718
|
-
maxHeight: o.oneOfType([o.number, o.string]),
|
|
1719
|
-
/**
|
|
1720
|
-
* Fired after the menu surface is closed. For best performance, this method should be memoized or wrapped with useCallback.
|
|
1721
|
-
*
|
|
1722
|
-
* Defaults to **null**.
|
|
1723
|
-
*/
|
|
1724
|
-
onClose: o.func,
|
|
1725
|
-
/**
|
|
1726
|
-
* Fired after the menu surface is opened. For best performance, this method should be memoized or wrapped with useCallback.
|
|
1727
|
-
*
|
|
1728
|
-
* Defaults to **null**.
|
|
1729
|
-
*/
|
|
1730
|
-
onOpen: o.func,
|
|
1731
|
-
/**
|
|
1732
|
-
* Fired when a menu item is selected . It is not available if `surfaceOnly` is true. For best performance, this method should be memoized or wrapped with useCallback.
|
|
1733
|
-
*
|
|
1734
|
-
* Defaults to **null**.
|
|
1735
|
-
*/
|
|
1736
|
-
onSelect: o.func,
|
|
1737
|
-
/**
|
|
1738
|
-
* Controls the visibility of the menu.
|
|
1739
|
-
*
|
|
1740
|
-
* Defaults to **false**.
|
|
1741
|
-
*/
|
|
1742
|
-
open: o.bool,
|
|
1743
|
-
/**
|
|
1744
|
-
* When set to to true ensures no browser-specific apis are accessed during initialisation. When set to false, ignored or set to null, no conditional rendering is applied.
|
|
1745
|
-
*
|
|
1746
|
-
* Defaults to **null**.
|
|
1747
|
-
*/
|
|
1748
|
-
server: o.bool,
|
|
1749
|
-
/**
|
|
1750
|
-
* Passthrough style object.
|
|
1751
|
-
*
|
|
1752
|
-
* Defaults to **null**.
|
|
1753
|
-
*/
|
|
1754
|
-
style: o.object,
|
|
1755
|
-
/**
|
|
1756
|
-
* Renders as just the menu surface. While Menu expects a list of items, when surfaceOnly is true any content can go inside the menu.
|
|
1757
|
-
*
|
|
1758
|
-
* Defaults to **false**.
|
|
1759
|
-
*/
|
|
1760
|
-
surfaceOnly: o.bool,
|
|
1761
|
-
/**
|
|
1762
|
-
* Background color of the menu.
|
|
1763
|
-
*
|
|
1764
|
-
* Defaults to **'surface'**.
|
|
1765
|
-
*/
|
|
1766
|
-
themeColor: o.oneOf(["surface", "primary", "secondary"]),
|
|
1767
|
-
/**
|
|
1768
|
-
* Node used to trigger open the menu or menu surface. Will also serve as the anchor.
|
|
1769
|
-
*
|
|
1770
|
-
* Defaults to **null**.
|
|
1771
|
-
*/
|
|
1772
|
-
trigger: o.node,
|
|
1773
|
-
/**
|
|
1774
|
-
* When used with a List component `wrapFocus` allows keyboard navigation to jump to the top or bottom of the list to enable continuous navigation.
|
|
1775
|
-
*
|
|
1776
|
-
* Defaults to **true**.
|
|
1777
|
-
*/
|
|
1778
|
-
wrapFocus: o.bool
|
|
1779
|
-
}, sn = {
|
|
1780
|
-
absolutePositionX: null,
|
|
1781
|
-
absolutePositionY: null,
|
|
1782
|
-
anchorCorner: "BOTTOM_START",
|
|
1783
|
-
anchorMargin: null,
|
|
1784
|
-
anchorProps: {},
|
|
1785
|
-
children: null,
|
|
1786
|
-
direction: "ltr",
|
|
1787
|
-
fixed: !1,
|
|
1788
|
-
fullScreen: !1,
|
|
1789
|
-
fullWidth: !1,
|
|
1790
|
-
hoistToBody: !1,
|
|
1791
|
-
maxHeight: 275,
|
|
1792
|
-
open: !1,
|
|
1793
|
-
server: null,
|
|
1794
|
-
style: null,
|
|
1795
|
-
surfaceOnly: !1,
|
|
1796
|
-
themeColor: "surface",
|
|
1797
|
-
trigger: null,
|
|
1798
|
-
wrapFocus: !0
|
|
1799
|
-
}, on = {
|
|
1800
|
-
/**
|
|
1801
|
-
* Expects a clickable component such as Button or IconButton and the Menu component.
|
|
1802
|
-
*
|
|
1803
|
-
* Defaults to **null**.
|
|
1804
|
-
*/
|
|
1805
|
-
children: o.node
|
|
1806
|
-
}, an = {
|
|
1807
|
-
children: null
|
|
1808
|
-
}, $e = /* @__PURE__ */ Q((s, n) => {
|
|
1809
|
-
const {
|
|
1810
|
-
children: e,
|
|
1811
|
-
className: t,
|
|
1812
|
-
...i
|
|
1813
|
-
} = s;
|
|
1814
|
-
return /* @__PURE__ */ u.createElement("div", $({
|
|
1815
|
-
ref: n,
|
|
1816
|
-
className: q("lmnt", "mdc-menu-surface--anchor", t)
|
|
1817
|
-
}, i), e);
|
|
1818
|
-
});
|
|
1819
|
-
$e.displayName = "MenuAnchor";
|
|
1820
|
-
$e.propTypes = on;
|
|
1821
|
-
$e.defaultProps = an;
|
|
1822
|
-
const Mt = /* @__PURE__ */ Ct({}), ln = (s, n, e) => (t) => /* @__PURE__ */ u.createElement($e, $({}, s, {
|
|
1823
|
-
ref: e
|
|
1824
|
-
}), n, t), cn = (s) => (n) => /* @__PURE__ */ u.createElement(Bt, {
|
|
1825
|
-
disabled: !s
|
|
1826
|
-
}, n), pt = /* @__PURE__ */ Q((s, n) => {
|
|
1827
|
-
const {
|
|
1828
|
-
absolutePositionX: e,
|
|
1829
|
-
absolutePositionY: t,
|
|
1830
|
-
anchorCorner: i,
|
|
1831
|
-
anchorMargin: r,
|
|
1832
|
-
anchorProps: a,
|
|
1833
|
-
children: l,
|
|
1834
|
-
className: m,
|
|
1835
|
-
direction: D,
|
|
1836
|
-
fixed: b,
|
|
1837
|
-
fullScreen: y,
|
|
1838
|
-
fullWidth: S,
|
|
1839
|
-
handleBodyClick: d,
|
|
1840
|
-
hoistToBody: f,
|
|
1841
|
-
iconMenu: L,
|
|
1842
|
-
id: B,
|
|
1843
|
-
maxHeight: M,
|
|
1844
|
-
onClose: c,
|
|
1845
|
-
onOpen: A,
|
|
1846
|
-
onSelect: P,
|
|
1847
|
-
open: w,
|
|
1848
|
-
quickOpen: te,
|
|
1849
|
-
style: Z,
|
|
1850
|
-
surfaceOnly: C,
|
|
1851
|
-
themeColor: k,
|
|
1852
|
-
trigger: H,
|
|
1853
|
-
unexposed: le,
|
|
1854
|
-
wrapFocus: O,
|
|
1855
|
-
server: ne,
|
|
1856
|
-
...we
|
|
1857
|
-
} = s, [fe] = Se(() => B || ft()), [ue, me] = Se(), x = ge(), p = ge(), ie = ge();
|
|
1858
|
-
Pe(n, () => x.current, []);
|
|
1859
|
-
const R = W((g) => {
|
|
1860
|
-
const E = C ? p.current.foundation.getoriginCorner() : p.current.menuSurface_.foundation.getoriginCorner(), U = C && p.current.foundation.hasBit(E, V.BOTTOM) || !C && p.current.menuSurface_.foundation.hasBit(E, V.BOTTOM) ? "bottom" : "top";
|
|
1861
|
-
me(U === "bottom"), A && A(g);
|
|
1862
|
-
}, [A, C]), z = W((g) => {
|
|
1863
|
-
P && P(g.detail);
|
|
1864
|
-
}, [P]);
|
|
1865
|
-
j(() => (p.current = C ? Ot.attachTo(x.current) : nn.attachTo(x.current), () => {
|
|
1866
|
-
p.current.destroy();
|
|
1867
|
-
}), [C]), j(() => (C || p.current.listen("MDCMenu:selected", z), () => {
|
|
1868
|
-
C || p.current.unlisten("MDCMenu:selected", z);
|
|
1869
|
-
}), [z, C]), j(() => (p.current.listen("MDCMenuSurface:closed", c), () => {
|
|
1870
|
-
p.current.unlisten("MDCMenuSurface:closed", c);
|
|
1871
|
-
}), [c]), j(() => (p.current.listen("MDCMenuSurface:opened", R), () => {
|
|
1872
|
-
p.current.unlisten("MDCMenuSurface:opened", R);
|
|
1873
|
-
}), [R]), j(() => {
|
|
1874
|
-
C ? p.current.foundation.setMaxHeight(M) : p.current.menuSurface_.foundation.setMaxHeight(M);
|
|
1875
|
-
}, [M, C]), j(() => {
|
|
1876
|
-
r && (C ? p.current.foundation.setAnchorMargin(r) : p.current.menuSurface_.foundation.setAnchorMargin(r));
|
|
1877
|
-
}, [r, C]), j(() => {
|
|
1878
|
-
d && (p.current.handleBodyClick = d);
|
|
1879
|
-
}, [d]), j(() => {
|
|
1880
|
-
(!b && e && e > -1 || !b && t && t > -1) && (p.current.setAbsolutePosition(e, t), p.current.foundation.getAutoLayoutmeasurements().surfaceSize && p.current.foundation.autoposition());
|
|
1881
|
-
}, [e, t, b]), j(() => {
|
|
1882
|
-
p.current.setFixedPosition(b);
|
|
1883
|
-
}, [b]), j(() => {
|
|
1884
|
-
p.current.wrapFocus = O;
|
|
1885
|
-
}, [O]), j(() => {
|
|
1886
|
-
i && !(e || t) && p.current.setAnchorCorner(Oe[i.toUpperCase()]);
|
|
1887
|
-
}, [p, i, e, t]), j(() => {
|
|
1888
|
-
p.current.setIsHoisted(f), C ? p.current.setMenuSurfaceAnchorElement(ie.current) : p.current.setAnchorElement(ie.current);
|
|
1889
|
-
}, [f, C, H]), j(() => {
|
|
1890
|
-
p.current.quickOpen = te;
|
|
1891
|
-
}, [te]), j(() => {
|
|
1892
|
-
w ? !C && !p.current.open ? p.current.open = w : p.current.foundation.isSurfaceOpen || p.current.open() : !C && p.current.open ? p.current.open = !1 : p.current.foundation.isSurfaceOpen && p.current.close();
|
|
1893
|
-
}, [p, w, C]);
|
|
1894
|
-
const X = ee(() => ({
|
|
1895
|
-
inMenu: !0
|
|
1896
|
-
}), []), J = ee(() => {
|
|
1897
|
-
var g, E;
|
|
1898
|
-
return q("lmnt", "mdc-menu-surface", "lmnt-menu-container", (C && ((g = p.current) === null || g === void 0 ? void 0 : g.foundation.isOpen()) || !C && ((E = p.current) === null || E === void 0 ? void 0 : E.menuSurface_.foundation.isOpen())) && "mdc-menu-surface--open", ue && "lmnt-menu-open-up", !C && "mdc-menu", !f && S && "mdc-menu-surface--fullwidth", f && y && "lmnt-menu-surface--fullScreen", `lmnt-theme-${k}-bg`, m);
|
|
1899
|
-
}, [m, y, S, f, ue, C, k]), re = ee(() => ln(a, H, ie), [a, H]), he = ee(() => cn(f), [f]), de = ee(() => ({
|
|
1900
|
-
...Z,
|
|
1901
|
-
direction: D
|
|
1902
|
-
}), [Z, D]);
|
|
1903
|
-
return /* @__PURE__ */ u.createElement(Tt, {
|
|
1904
|
-
condition: H,
|
|
1905
|
-
wrapper: re
|
|
1906
|
-
}, /* @__PURE__ */ u.createElement(Tt, {
|
|
1907
|
-
condition: f && !ne,
|
|
1908
|
-
wrapper: he
|
|
1909
|
-
}, /* @__PURE__ */ u.createElement("div", $({
|
|
1910
|
-
ref: x,
|
|
1911
|
-
id: fe,
|
|
1912
|
-
style: de,
|
|
1913
|
-
className: J,
|
|
1914
|
-
tabIndex: "-1"
|
|
1915
|
-
}, we), /* @__PURE__ */ u.createElement(Mt.Provider, {
|
|
1916
|
-
value: X
|
|
1917
|
-
}, l))));
|
|
1918
|
-
});
|
|
1919
|
-
pt.displayName = "Menu";
|
|
1920
|
-
pt.propTypes = rn;
|
|
1921
|
-
pt.defaultProps = sn;
|
|
1922
|
-
var st, At;
|
|
1923
|
-
function un() {
|
|
1924
|
-
if (At) return st;
|
|
1925
|
-
At = 1;
|
|
1926
|
-
var s = Kt();
|
|
1927
|
-
function n(e, t) {
|
|
1928
|
-
return s(e, t);
|
|
1929
|
-
}
|
|
1930
|
-
return st = n, st;
|
|
1931
|
-
}
|
|
1932
|
-
var dn = un();
|
|
1933
|
-
const fn = /* @__PURE__ */ Ht(dn), hn = {
|
|
1934
|
-
/**
|
|
1935
|
-
* Label to be displayed in the Badge. Usually a string, but can also be an x-small icon.
|
|
1936
|
-
*
|
|
1937
|
-
* Defaults to **null**.
|
|
1938
|
-
*/
|
|
1939
|
-
label: o.oneOfType([o.string, o.func, o.node]),
|
|
1940
|
-
/**
|
|
1941
|
-
* Label type to be displayed in the Badge.
|
|
1942
|
-
*
|
|
1943
|
-
* Defaults to **'string'**.
|
|
1944
|
-
*/
|
|
1945
|
-
labelType: o.oneOf(["string", "icon"]),
|
|
1946
|
-
/**
|
|
1947
|
-
* Adds the given Icon to the left of the label text. May not be used with `trailingIcon` or if `labelType` is icon - if `leadingIcon` and `trailingIcon` are both set, `leadingIcon` will take priority. If `labelType` is set to `icon` label will take priority. Expects the name of a valid Material.io icon, however an icon component may be passed in instead for more control. If a custom icon is used, the icon should not be larger than 9 x 9.
|
|
1948
|
-
*
|
|
1949
|
-
* Defaults to **undefined**.
|
|
1950
|
-
*/
|
|
1951
|
-
leadingIcon: o.oneOfType([o.string, o.func, o.node]),
|
|
1952
|
-
/**
|
|
1953
|
-
* Color of the badge. It will default according to your theme. For most themes that is primary.
|
|
1954
|
-
*
|
|
1955
|
-
* Defaults to **'themeDefault'**.
|
|
1956
|
-
*/
|
|
1957
|
-
themeColor: Pt(o.oneOf(["themeDefault", "primary", "secondary", "danger", "success", "blue", "gray", "green", "orange", "purple", "red", "teal", "yellow", "black", "primary-variant", "no-bg-on-dark"]), ["primaryVariant"], "LabelBadge", "Please use one of 'themeDefault','primary','secondary','danger','success','blue','gray','green','orange','purple','red','teal','yellow','black','primary-variant','no-bg-on-dark'."),
|
|
1958
|
-
/**
|
|
1959
|
-
* Adds the given Icon to the right of the label text. May not be used with `leadingIcon` or if `labelType` is icon - if `leadingIcon` and `trailingIcon` are both set, `leadingIcon` will take priority. If `labelType` is set to `icon` label will take priority. Expects the name of a valid Material.io icon, however an icon component may be passed in instead for more control.
|
|
1960
|
-
*
|
|
1961
|
-
* Defaults to **undefined**.
|
|
1962
|
-
*/
|
|
1963
|
-
trailingIcon: o.oneOfType([o.string, o.func, o.node])
|
|
1964
|
-
}, mn = {
|
|
1965
|
-
label: null,
|
|
1966
|
-
labelType: "string",
|
|
1967
|
-
leadingIcon: void 0,
|
|
1968
|
-
themeColor: "themeDefault",
|
|
1969
|
-
trailingIcon: void 0
|
|
1970
|
-
}, pn = {
|
|
1971
|
-
/**
|
|
1972
|
-
* Number to be displayed in badge. Omit for a status light badge.
|
|
1973
|
-
*
|
|
1974
|
-
* Defaults to **null**.
|
|
1975
|
-
*/
|
|
1976
|
-
counter: o.number,
|
|
1977
|
-
/**
|
|
1978
|
-
* Max number the badge can display.
|
|
1979
|
-
*
|
|
1980
|
-
* Defaults to **99**.
|
|
1981
|
-
*/
|
|
1982
|
-
max: o.number,
|
|
1983
|
-
/**
|
|
1984
|
-
* Theme color of the badge.
|
|
1985
|
-
*
|
|
1986
|
-
* Defaults to **'danger'**.
|
|
1987
|
-
*/
|
|
1988
|
-
themeColor: o.oneOf(["primary", "secondary", "danger", "success"])
|
|
1989
|
-
}, In = {
|
|
1990
|
-
counter: null,
|
|
1991
|
-
max: 99,
|
|
1992
|
-
themeColor: "danger"
|
|
1993
|
-
}, vt = (s, n) => !s && s !== 0 ? null : s <= n ? s : `${n}+`, It = /* @__PURE__ */ Q((s, n) => {
|
|
1994
|
-
const {
|
|
1995
|
-
className: e,
|
|
1996
|
-
counter: t,
|
|
1997
|
-
max: i,
|
|
1998
|
-
themeColor: r,
|
|
1999
|
-
...a
|
|
2000
|
-
} = s, l = ge(), [m, D] = Se(vt(t, i));
|
|
2001
|
-
j(() => D(vt(t, i)), [t, i]), Pe(n, () => l.current, []);
|
|
2002
|
-
const b = q("lmnt", "lmnt-badge", "lmnt-badge--notification", `lmnt-badge--notification-${r}`, "mdc-typography--caption-bold", (m || m === 0) && "lmnt-badge--notification-badge-counter", e);
|
|
2003
|
-
return /* @__PURE__ */ u.createElement("div", $({
|
|
2004
|
-
ref: l,
|
|
2005
|
-
className: b
|
|
2006
|
-
}, a), m && m);
|
|
2007
|
-
});
|
|
2008
|
-
It.displayName = "NotificationBadge";
|
|
2009
|
-
It.propTypes = pn;
|
|
2010
|
-
It.defaultProps = In;
|
|
2011
|
-
const We = /* @__PURE__ */ Q((s, n) => {
|
|
2012
|
-
const {
|
|
2013
|
-
className: e,
|
|
2014
|
-
label: t,
|
|
2015
|
-
labelType: i,
|
|
2016
|
-
leadingIcon: r,
|
|
2017
|
-
trailingIcon: a,
|
|
2018
|
-
themeColor: l,
|
|
2019
|
-
...m
|
|
2020
|
-
} = s, D = ge();
|
|
2021
|
-
Pe(n, () => D.current, []);
|
|
2022
|
-
const b = q("lmnt", "lmnt-badge", "lmnt-badge--label", `lmnt-badge--label-${l}`, "mdc-typography--caption-bold", i === "icon" && "lmnt-badge--label-icon-as-label", r && "lmnt-badge--label-leading-icon", a && "lmnt-badge--label-trailing-icon", e), y = ee(() => {
|
|
2023
|
-
var f;
|
|
2024
|
-
return i === "icon" || !r ? null : typeof r == "string" ? /* @__PURE__ */ u.createElement(je, {
|
|
2025
|
-
className: "lmnt-badge-label__leading-icon",
|
|
2026
|
-
icon: r,
|
|
2027
|
-
iconSize: "xsmall"
|
|
2028
|
-
}) : typeof r == "function" ? r({
|
|
2029
|
-
className: "lmnt-icon--xsmall lmnt-badge-label__leading-icon"
|
|
2030
|
-
}) : rt(r, {
|
|
2031
|
-
className: q("lmnt-badge-label__leading-icon", r == null || (f = r.props) === null || f === void 0 ? void 0 : f.className)
|
|
2032
|
-
});
|
|
2033
|
-
}, [i, r]), S = ee(() => {
|
|
2034
|
-
var f;
|
|
2035
|
-
return i === "string" ? t : typeof t == "string" ? /* @__PURE__ */ u.createElement(je, {
|
|
2036
|
-
className: "lmnt-badge-label-icon",
|
|
2037
|
-
icon: t,
|
|
2038
|
-
iconSize: "xsmall"
|
|
2039
|
-
}) : typeof t == "function" ? t({
|
|
2040
|
-
className: "lmnt-icon--xsmall lmnt-badge-label-icon"
|
|
2041
|
-
}) : rt(t, {
|
|
2042
|
-
className: q("lmnt-badge-label-icon", "lmnt-icon--xsmall", t == null || (f = t.props) === null || f === void 0 ? void 0 : f.className)
|
|
2043
|
-
});
|
|
2044
|
-
}, [i, t]), d = ee(() => {
|
|
2045
|
-
var f;
|
|
2046
|
-
return !a || i === "icon" || y ? null : typeof a == "string" ? /* @__PURE__ */ u.createElement(je, {
|
|
2047
|
-
className: "lmnt-badge-label__trailing-icon",
|
|
2048
|
-
icon: a,
|
|
2049
|
-
iconSize: "xsmall"
|
|
2050
|
-
}) : typeof a == "function" ? a({
|
|
2051
|
-
className: "lmnt-icon--xsmall lmnt-badge-label__trailing-icon"
|
|
2052
|
-
}) : rt(a, {
|
|
2053
|
-
className: q("lmnt-badge-label__trailing-icon", a == null || (f = a.props) === null || f === void 0 ? void 0 : f.className)
|
|
2054
|
-
});
|
|
2055
|
-
}, [i, a, y]);
|
|
2056
|
-
return /* @__PURE__ */ u.createElement("div", $({
|
|
2057
|
-
ref: D,
|
|
2058
|
-
className: b
|
|
2059
|
-
}, m), y && y, /* @__PURE__ */ u.createElement("span", {
|
|
2060
|
-
className: "lmnt-badge--label__label"
|
|
2061
|
-
}, S), d && d);
|
|
2062
|
-
});
|
|
2063
|
-
We.displayName = "LabelBadge";
|
|
2064
|
-
We.propTypes = hn;
|
|
2065
|
-
We.defaultProps = mn;
|
|
2066
|
-
const Ye = /* @__PURE__ */ Ct({}), Nt = {
|
|
2067
|
-
/**
|
|
2068
|
-
* Name of the key for category ID in `items`.
|
|
2069
|
-
*
|
|
2070
|
-
* Defaults to **'id'**.
|
|
2071
|
-
*/
|
|
2072
|
-
categoryIdKey: o.string,
|
|
2073
|
-
/**
|
|
2074
|
-
* Name of the key for category name in `items`.
|
|
2075
|
-
*
|
|
2076
|
-
* Defaults to **'categoryName'**.
|
|
2077
|
-
*/
|
|
2078
|
-
categoryNameKey: o.string,
|
|
2079
|
-
/**
|
|
2080
|
-
* List content. Expects a 'ListItem'.
|
|
2081
|
-
*
|
|
2082
|
-
* Defaults to **null**.
|
|
2083
|
-
*/
|
|
2084
|
-
children: o.node,
|
|
2085
|
-
/**
|
|
2086
|
-
* Name of the key for group ID in `items`. custom props to apply to each list item.
|
|
2087
|
-
*
|
|
2088
|
-
* Defaults to **'componentProps'**.
|
|
2089
|
-
*/
|
|
2090
|
-
componentPropsKey: o.string,
|
|
2091
|
-
/**
|
|
2092
|
-
* Reduced height of list items.
|
|
2093
|
-
*
|
|
2094
|
-
* Defaults to **false**.
|
|
2095
|
-
*/
|
|
2096
|
-
dense: o.bool,
|
|
2097
|
-
/**
|
|
2098
|
-
* Variant of divider padding.
|
|
2099
|
-
*
|
|
2100
|
-
* Defaults to **'full'**.
|
|
2101
|
-
*/
|
|
2102
|
-
dividerVariant: o.oneOf(["full", "padded", "inset", "insetPadded"]),
|
|
2103
|
-
/**
|
|
2104
|
-
* Name of the key for group ID in `items`.
|
|
2105
|
-
*
|
|
2106
|
-
* Defaults to **'id'**.
|
|
2107
|
-
*/
|
|
2108
|
-
groupIdKey: o.string,
|
|
2109
|
-
/**
|
|
2110
|
-
* Name of the key for group name in `items`.
|
|
2111
|
-
*
|
|
2112
|
-
* Defaults to **'groupName'**.
|
|
2113
|
-
*/
|
|
2114
|
-
groupNameKey: o.string,
|
|
2115
|
-
/**
|
|
2116
|
-
* Name of the key for the id of the item in `items`.
|
|
2117
|
-
*
|
|
2118
|
-
* Defaults to **'id'**.
|
|
2119
|
-
*/
|
|
2120
|
-
itemIdKey: o.string,
|
|
2121
|
-
/**
|
|
2122
|
-
* An array of objects to be rendered as `ListItems`. If `items` is set children will be ignored.
|
|
2123
|
-
*
|
|
2124
|
-
* Defaults to **null**.
|
|
2125
|
-
*/
|
|
2126
|
-
items: o.oneOfType([o.arrayOf(o.object), o.arrayOf(o.string)]),
|
|
2127
|
-
/**
|
|
2128
|
-
* Name of the key for `items` in list schema.
|
|
2129
|
-
*
|
|
2130
|
-
* Defaults to **'items'**.
|
|
2131
|
-
*/
|
|
2132
|
-
itemsKey: o.string,
|
|
2133
|
-
/**
|
|
2134
|
-
* The type of media that will render in the leading block of the `ListItems`. See README for size constraints. If `leadingBlockType` and `trailingBlockType` are both set to a control type (checkbox, radio or switch) `trailingBlockType` will be ignored.
|
|
2135
|
-
*
|
|
2136
|
-
* Defaults to **undefined**.
|
|
2137
|
-
*/
|
|
2138
|
-
leadingBlockType: o.oneOf(["", "avatar", "checkbox", "icon", "image", "lgImage", "radio", "switch", "thumbnail"]),
|
|
2139
|
-
/**
|
|
2140
|
-
* Enables support for lists of navigation links. Each list item will be rendered as an anchor element by default unless overridden via the `component` prop on each list item.
|
|
2141
|
-
*
|
|
2142
|
-
* Defaults to **false**.
|
|
2143
|
-
*/
|
|
2144
|
-
navigation: o.bool,
|
|
2145
|
-
/**
|
|
2146
|
-
* Use for a list that does not require interaction.
|
|
2147
|
-
*
|
|
2148
|
-
* Defaults to **false**.
|
|
2149
|
-
*/
|
|
2150
|
-
nonInteractive: o.bool,
|
|
2151
|
-
/**
|
|
2152
|
-
* Fired when a List Item is activated.
|
|
2153
|
-
*
|
|
2154
|
-
* Defaults to **null**.
|
|
2155
|
-
*/
|
|
2156
|
-
onAction: o.func,
|
|
2157
|
-
/**
|
|
2158
|
-
* Name of the key for `overlineText` in `items`.
|
|
2159
|
-
*
|
|
2160
|
-
* Defaults to **'overlineText'**.
|
|
2161
|
-
*/
|
|
2162
|
-
overlineTextKey: o.string,
|
|
2163
|
-
/**
|
|
2164
|
-
* Name of the key for `primaryText` in `items`.
|
|
2165
|
-
*
|
|
2166
|
-
* Defaults to **'primaryText'**.
|
|
2167
|
-
*/
|
|
2168
|
-
primaryTextKey: o.string,
|
|
2169
|
-
/**
|
|
2170
|
-
* The aria role of the list. For selection list use `listbox`. For menu list use `menu`. For radio list use `radiogroup`. For checkbox list use `group`. For non-interactive list do not set.
|
|
2171
|
-
*
|
|
2172
|
-
* Defaults to **'listbox'**.
|
|
2173
|
-
*/
|
|
2174
|
-
role: o.oneOf(["", "listbox", "menu", "radiogroup", "group"]),
|
|
2175
|
-
/**
|
|
2176
|
-
* Name of the key for `secondaryText` in `items`.
|
|
2177
|
-
*
|
|
2178
|
-
* Defaults to **'secondaryText'**.
|
|
2179
|
-
*/
|
|
2180
|
-
secondaryTextKey: o.string,
|
|
2181
|
-
/**
|
|
2182
|
-
* Item or array of selected `ListItems`.
|
|
2183
|
-
*
|
|
2184
|
-
* Defaults to **null**.
|
|
2185
|
-
*/
|
|
2186
|
-
selected: o.oneOfType([o.string, o.number, o.object, o.arrayOf(o.string), o.arrayOf(o.number), o.arrayOf(o.object)]),
|
|
2187
|
-
/**
|
|
2188
|
-
* Whether or not to show a divider between list items, groups, or categories.
|
|
2189
|
-
*
|
|
2190
|
-
* Defaults to **true**.
|
|
2191
|
-
*/
|
|
2192
|
-
showDivider: o.bool,
|
|
2193
|
-
/**
|
|
2194
|
-
* When true group and category lists will be treated like one list for single selection type lists.
|
|
2195
|
-
*
|
|
2196
|
-
* Defaults to **true**.
|
|
2197
|
-
*/
|
|
2198
|
-
singleList: o.bool,
|
|
2199
|
-
/**
|
|
2200
|
-
* Customized background color.
|
|
2201
|
-
*
|
|
2202
|
-
* Defaults to **empty string**.
|
|
2203
|
-
*/
|
|
2204
|
-
themeColor: o.oneOf(["", "surface", "primary", "secondary"]),
|
|
2205
|
-
/**
|
|
2206
|
-
* The type of media that will render in the trailing block of the `ListItems`. See README for size constraints. If `leadingBlockType` and `trailingBlockType` are both set to a control type (checkbox, radio or switch) `trailingBlockType` will be ignored.
|
|
2207
|
-
*
|
|
2208
|
-
* Defaults to **undefined**.
|
|
2209
|
-
*/
|
|
2210
|
-
trailingBlockType: o.oneOf(["", "avatar", "badge", "checkbox", "icon", "image", "lgImage", "meta", "radio", "switch", "thumbnail"]),
|
|
2211
|
-
/**
|
|
2212
|
-
* When tab behavior is needed inside list items
|
|
2213
|
-
*
|
|
2214
|
-
* Defaults to **null**.
|
|
2215
|
-
*/
|
|
2216
|
-
trapTabInteraction: o.bool,
|
|
2217
|
-
/**
|
|
2218
|
-
* Allows keyboard navigation to jump to the top or bottom of the list to enable continuous navigation.
|
|
2219
|
-
*
|
|
2220
|
-
* Defaults to **true**.
|
|
2221
|
-
*/
|
|
2222
|
-
wrapFocus: o.bool
|
|
2223
|
-
}, Dt = {
|
|
2224
|
-
categoryIdKey: "id",
|
|
2225
|
-
categoryNameKey: "categoryName",
|
|
2226
|
-
children: null,
|
|
2227
|
-
componentPropsKey: "componentProps",
|
|
2228
|
-
dense: !1,
|
|
2229
|
-
dividerVariant: "full",
|
|
2230
|
-
groupIdKey: "id",
|
|
2231
|
-
groupNameKey: "groupName",
|
|
2232
|
-
itemIdKey: "id",
|
|
2233
|
-
items: null,
|
|
2234
|
-
itemsKey: "items",
|
|
2235
|
-
leadingBlockType: void 0,
|
|
2236
|
-
navigation: !1,
|
|
2237
|
-
nonInteractive: !1,
|
|
2238
|
-
overlineTextKey: "overlineText",
|
|
2239
|
-
primaryTextKey: "primaryText",
|
|
2240
|
-
role: "listbox",
|
|
2241
|
-
secondaryTextKey: "secondaryText",
|
|
2242
|
-
selected: null,
|
|
2243
|
-
showDivider: !0,
|
|
2244
|
-
singleList: !0,
|
|
2245
|
-
themeColor: "",
|
|
2246
|
-
trailingBlockType: void 0,
|
|
2247
|
-
trapTabInteraction: null,
|
|
2248
|
-
wrapFocus: !0
|
|
2249
|
-
}, yn = {
|
|
2250
|
-
/**
|
|
2251
|
-
* Variant of the divider padding.
|
|
2252
|
-
*
|
|
2253
|
-
* Defaults to **'full'**.
|
|
2254
|
-
*/
|
|
2255
|
-
variant: o.oneOf(["full", "padded", "inset", "insetPadded"])
|
|
2256
|
-
}, gn = {
|
|
2257
|
-
variant: "full"
|
|
2258
|
-
}, En = {
|
|
2259
|
-
/**
|
|
2260
|
-
* Expects one or more List or ListGroupSubHeader.
|
|
2261
|
-
*
|
|
2262
|
-
* Defaults to **null**.
|
|
2263
|
-
*/
|
|
2264
|
-
children: o.node
|
|
2265
|
-
}, Tn = {
|
|
2266
|
-
children: null
|
|
2267
|
-
}, _n = {}, Sn = {};
|
|
2268
|
-
o.node;
|
|
2269
|
-
const An = {
|
|
2270
|
-
/**
|
|
2271
|
-
* Alternate styling for selected interactive items without a control. Activation represents a status with more permanence (e.g., current page in a navigation list).
|
|
2272
|
-
*
|
|
2273
|
-
* Defaults to **false**.
|
|
2274
|
-
*/
|
|
2275
|
-
activated: o.bool,
|
|
2276
|
-
/**
|
|
2277
|
-
* Whether or not the list item's radio or checkbox is selected for radio or checkbox lists.
|
|
2278
|
-
*
|
|
2279
|
-
* Defaults to **false**.
|
|
2280
|
-
*/
|
|
2281
|
-
ariaChecked: o.bool,
|
|
2282
|
-
/**
|
|
2283
|
-
* Content to be rendered inside the list item content block. Most often a string, but accepts any valid markup. When using primaryText, secondaryText or overlineText the children will be ignored.
|
|
2284
|
-
*
|
|
2285
|
-
* Defaults to **null**.
|
|
2286
|
-
*/
|
|
2287
|
-
children: o.node,
|
|
2288
|
-
/**
|
|
2289
|
-
* Tells list item not to put selected class to add background to the list item.
|
|
2290
|
-
*
|
|
2291
|
-
* Defaults to **false**.
|
|
2292
|
-
*/
|
|
2293
|
-
disableHighlight: o.bool,
|
|
2294
|
-
/**
|
|
2295
|
-
* Disable interaction for the ListItem within an interactive List.
|
|
2296
|
-
*
|
|
2297
|
-
* Defaults to **false**.
|
|
2298
|
-
*/
|
|
2299
|
-
disabled: o.bool,
|
|
2300
|
-
/**
|
|
2301
|
-
* Increase left padding in list item by 40px
|
|
2302
|
-
*
|
|
2303
|
-
* Defaults to **false**.
|
|
2304
|
-
*/
|
|
2305
|
-
indented: o.bool,
|
|
2306
|
-
/**
|
|
2307
|
-
* Used with Select.
|
|
2308
|
-
*
|
|
2309
|
-
* Defaults to **false**.
|
|
2310
|
-
*/
|
|
2311
|
-
isChildOption: o.bool,
|
|
2312
|
-
/**
|
|
2313
|
-
* Content to be displayed in the leading block container. See README for types supported. If a string is sent for a control type, it will used for the `name` attribute on the control. For radio type controls, send the same name for every item.
|
|
2314
|
-
*
|
|
2315
|
-
* Defaults to **null**.
|
|
2316
|
-
*/
|
|
2317
|
-
leadingBlock: o.node,
|
|
2318
|
-
/**
|
|
2319
|
-
* The type of media that will render in the leading block. See README for size constraints. If `leadingBlockType` is set on the parent List, it will take precedence. If `leadingBlockType` and `trailingBlockType` are both set to a control type (checkbox, radio or switch) `trailingBlockType` will be ignored.
|
|
2320
|
-
*
|
|
2321
|
-
* Defaults to **empty string**.
|
|
2322
|
-
*/
|
|
2323
|
-
leadingBlockType: o.oneOf(["", "avatar", "checkbox", "icon", "icon-large", "icon-small", "icon-xsmall", "icon-xlarge", "image", "lgImage", "radio", "switch", "thumbnail"]),
|
|
2324
|
-
/**
|
|
2325
|
-
* A hover style will not be applied.
|
|
2326
|
-
*
|
|
2327
|
-
* Defaults to **false**.
|
|
2328
|
-
*/
|
|
2329
|
-
noHover: o.bool,
|
|
2330
|
-
/**
|
|
2331
|
-
* Used within a list that does not require interaction. See `disabled` for disabling an item within an interactive list.
|
|
2332
|
-
*
|
|
2333
|
-
* Defaults to **false**.
|
|
2334
|
-
*/
|
|
2335
|
-
nonInteractive: o.bool,
|
|
2336
|
-
/**
|
|
2337
|
-
* Fired when the user clicks the ListItem. Returns the event as the first argument and any specified value as the second argument.
|
|
2338
|
-
*
|
|
2339
|
-
* Defaults to **null**.
|
|
2340
|
-
*/
|
|
2341
|
-
onClick: o.func,
|
|
2342
|
-
/**
|
|
2343
|
-
* Fired when the user presses a key down.
|
|
2344
|
-
*
|
|
2345
|
-
* Defaults to **null**.
|
|
2346
|
-
*/
|
|
2347
|
-
onKeyPress: o.func,
|
|
2348
|
-
/**
|
|
2349
|
-
* Text that will appear above the standard text.
|
|
2350
|
-
*
|
|
2351
|
-
* Defaults to **null**.
|
|
2352
|
-
*/
|
|
2353
|
-
overlineText: o.node,
|
|
2354
|
-
/**
|
|
2355
|
-
* Standard list text.
|
|
2356
|
-
*
|
|
2357
|
-
* Defaults to **null**.
|
|
2358
|
-
*/
|
|
2359
|
-
primaryText: o.node,
|
|
2360
|
-
/**
|
|
2361
|
-
* Text that will appear below the standard text.
|
|
2362
|
-
*
|
|
2363
|
-
* Defaults to **null**.
|
|
2364
|
-
*/
|
|
2365
|
-
secondaryText: o.node,
|
|
2366
|
-
/**
|
|
2367
|
-
* A selected style will be applied. Selection represents a choice that might change frequently (e.g., option in a list). Required by selected interactive items without a control.
|
|
2368
|
-
*
|
|
2369
|
-
* Defaults to **false**.
|
|
2370
|
-
*/
|
|
2371
|
-
selected: o.bool,
|
|
2372
|
-
/**
|
|
2373
|
-
* Component to be rendered as each list item. Normal lists use `li` elements, nav lists use `a` elements. You would use this for example if you want to use a router link component as each list item.
|
|
2374
|
-
*
|
|
2375
|
-
* Defaults to **null**.
|
|
2376
|
-
*/
|
|
2377
|
-
tag: o.oneOfType([o.string, o.elementType, o.instanceOf(u.Component)]),
|
|
2378
|
-
/**
|
|
2379
|
-
* Customized background color.
|
|
2380
|
-
*
|
|
2381
|
-
* Defaults to **empty string**.
|
|
2382
|
-
*/
|
|
2383
|
-
themeColor: o.oneOf(["", "surface", "primary", "secondary"]),
|
|
2384
|
-
/**
|
|
2385
|
-
* Content to be displayed in the trailing block container. See README for types supported. If a string is sent for a control type, it will used for the `name` attribute on the control. For radio type controls, send the same name for every item.
|
|
2386
|
-
*
|
|
2387
|
-
* Defaults to **null**.
|
|
2388
|
-
*/
|
|
2389
|
-
trailingBlock: o.node,
|
|
2390
|
-
/**
|
|
2391
|
-
* The type of media that will render in the trailing block. See README for size constraints. If `trailingBlockType` is set on the parent List, it will take precedence. If `leadingBlockType` and `trailingBlockType` are both set to a control type (checkbox, radio or switch) `trailingBlockType` will be ignored.
|
|
2392
|
-
*
|
|
2393
|
-
* Defaults to **undefined**.
|
|
2394
|
-
*/
|
|
2395
|
-
trailingBlockType: o.oneOf(["", "avatar", "badge", "checkbox", "icon", "icon-large", "icon-small", "icon-xsmall", "icon-xlarge", "image", "lgImage", "meta", "radio", "switch", "thumbnail"]),
|
|
2396
|
-
/**
|
|
2397
|
-
* A custom value to be returned as the second onClick argument.
|
|
2398
|
-
*
|
|
2399
|
-
* Defaults to **null**.
|
|
2400
|
-
*/
|
|
2401
|
-
value: o.node,
|
|
2402
|
-
/**
|
|
2403
|
-
* Used to adjust the padding of the `ListItem` when used as a category or group header.
|
|
2404
|
-
*
|
|
2405
|
-
* Defaults to **'standard'**.
|
|
2406
|
-
*/
|
|
2407
|
-
variant: o.oneOf(["standard", "category", "group"]),
|
|
2408
|
-
/**
|
|
2409
|
-
* Determines the text wrapping mode of the list item: `wrap` will wrap text like normal, `truncate` will truncate text with an ellipsis and `noWrap` will truncate the text by clipping.
|
|
2410
|
-
*
|
|
2411
|
-
* Defaults to **'wrap'**.
|
|
2412
|
-
*/
|
|
2413
|
-
wrapMode: o.oneOf(["wrap", "noWrap", "truncate"])
|
|
2414
|
-
}, vn = {
|
|
2415
|
-
activated: !1,
|
|
2416
|
-
ariaChecked: !1,
|
|
2417
|
-
children: null,
|
|
2418
|
-
disableHighlight: !1,
|
|
2419
|
-
disabled: !1,
|
|
2420
|
-
indented: !1,
|
|
2421
|
-
isChildOption: !1,
|
|
2422
|
-
leadingBlock: null,
|
|
2423
|
-
leadingBlockType: "",
|
|
2424
|
-
noHover: !1,
|
|
2425
|
-
nonInteractive: !1,
|
|
2426
|
-
overlineText: null,
|
|
2427
|
-
primaryText: null,
|
|
2428
|
-
secondaryText: null,
|
|
2429
|
-
selected: !1,
|
|
2430
|
-
tag: null,
|
|
2431
|
-
themeColor: "",
|
|
2432
|
-
trailingBlock: null,
|
|
2433
|
-
trailingBlockType: void 0,
|
|
2434
|
-
value: null,
|
|
2435
|
-
variant: "standard",
|
|
2436
|
-
wrapMode: "wrap"
|
|
2437
|
-
}, Cn = {
|
|
2438
|
-
/**
|
|
2439
|
-
* Content to be rendered inside the list item primary text content block. Most often a string, but accepts any valid markup. When using primaryText, secondaryText or overlineText the children will be ignored.
|
|
2440
|
-
*
|
|
2441
|
-
* Defaults to **null**.
|
|
2442
|
-
*/
|
|
2443
|
-
children: o.node,
|
|
2444
|
-
/**
|
|
2445
|
-
* Text that will appear above the standard text.
|
|
2446
|
-
*
|
|
2447
|
-
* Defaults to **null**.
|
|
2448
|
-
*/
|
|
2449
|
-
overlineText: o.node,
|
|
2450
|
-
/**
|
|
2451
|
-
* Standard list text. `children` may also be used but will require additional styling. Use `primaryText` instead of `children` when using overline or secondary text.
|
|
2452
|
-
*
|
|
2453
|
-
* Defaults to **null**.
|
|
2454
|
-
*/
|
|
2455
|
-
primaryText: o.node,
|
|
2456
|
-
/**
|
|
2457
|
-
* Text that will appear below the standard text.
|
|
2458
|
-
*
|
|
2459
|
-
* Defaults to **null**.
|
|
2460
|
-
*/
|
|
2461
|
-
secondaryText: o.node
|
|
2462
|
-
}, xn = {
|
|
2463
|
-
children: null,
|
|
2464
|
-
overlineText: null,
|
|
2465
|
-
primaryText: null,
|
|
2466
|
-
secondaryText: null
|
|
2467
|
-
}, bn = {
|
|
2468
|
-
/**
|
|
2469
|
-
* Media or control to be rendered in the List Item's Leading Block
|
|
2470
|
-
*
|
|
2471
|
-
* Defaults to **null**.
|
|
2472
|
-
*/
|
|
2473
|
-
children: o.node
|
|
2474
|
-
}, Ln = {
|
|
2475
|
-
children: null
|
|
2476
|
-
}, On = {
|
|
2477
|
-
/**
|
|
2478
|
-
* Expects a string but accepts any valid markup or components.
|
|
2479
|
-
*
|
|
2480
|
-
* Defaults to **null**.
|
|
2481
|
-
*/
|
|
2482
|
-
children: o.node
|
|
2483
|
-
}, Mn = {
|
|
2484
|
-
children: null
|
|
2485
|
-
}, Nn = {
|
|
2486
|
-
/**
|
|
2487
|
-
* Expects a string but accepts any valid markup or components.
|
|
2488
|
-
*
|
|
2489
|
-
* Defaults to **null**.
|
|
2490
|
-
*/
|
|
2491
|
-
children: o.node
|
|
2492
|
-
}, Dn = {
|
|
2493
|
-
children: null
|
|
2494
|
-
}, Pn = {
|
|
2495
|
-
/**
|
|
2496
|
-
* Expects a string but accepts any valid markup or components.
|
|
2497
|
-
*
|
|
2498
|
-
* Defaults to **null**.
|
|
2499
|
-
*/
|
|
2500
|
-
children: o.node
|
|
2501
|
-
}, Rn = {
|
|
2502
|
-
children: null
|
|
2503
|
-
}, wn = {
|
|
2504
|
-
/**
|
|
2505
|
-
* Media, control or text to be rendered in the List Item's Trailing Block
|
|
2506
|
-
*
|
|
2507
|
-
* Defaults to **null**.
|
|
2508
|
-
*/
|
|
2509
|
-
children: o.node
|
|
2510
|
-
}, Bn = {
|
|
2511
|
-
children: null
|
|
2512
|
-
}, Fn = {
|
|
2513
|
-
/**
|
|
2514
|
-
* The List Items to be rendered in the Lists. If `items` is set children will be ignored.
|
|
2515
|
-
*
|
|
2516
|
-
* Defaults to **null**.
|
|
2517
|
-
*/
|
|
2518
|
-
items: o.oneOfType([o.arrayOf(o.object), o.arrayOf(o.string)])
|
|
2519
|
-
}, kn = {
|
|
2520
|
-
items: null
|
|
2521
|
-
}, Hn = {}, Kn = {}, Qe = /* @__PURE__ */ Q((s, n) => {
|
|
2522
|
-
const {
|
|
2523
|
-
children: e,
|
|
2524
|
-
className: t,
|
|
2525
|
-
...i
|
|
2526
|
-
} = s;
|
|
2527
|
-
return /* @__PURE__ */ u.createElement("span", $({
|
|
2528
|
-
ref: n,
|
|
2529
|
-
className: q("lmnt", "mdc-list-item__overline-text", t)
|
|
2530
|
-
}, i), e);
|
|
2531
|
-
});
|
|
2532
|
-
Qe.displayName = "ListItemOverline";
|
|
2533
|
-
Qe.propTypes = On;
|
|
2534
|
-
Qe.defaultProps = Mn;
|
|
2535
|
-
const Ze = /* @__PURE__ */ Q((s, n) => {
|
|
2536
|
-
const {
|
|
2537
|
-
children: e,
|
|
2538
|
-
className: t,
|
|
2539
|
-
...i
|
|
2540
|
-
} = s;
|
|
2541
|
-
return /* @__PURE__ */ u.createElement("span", $({
|
|
2542
|
-
ref: n,
|
|
2543
|
-
className: q("lmnt", "mdc-list-item__secondary-text", t)
|
|
2544
|
-
}, i), e);
|
|
2545
|
-
});
|
|
2546
|
-
Ze.displayName = "ListItemSecondaryText";
|
|
2547
|
-
Ze.defaultProps = Rn;
|
|
2548
|
-
Ze.propTypes = Pn;
|
|
2549
|
-
const Je = /* @__PURE__ */ Q((s, n) => {
|
|
2550
|
-
const {
|
|
2551
|
-
children: e,
|
|
2552
|
-
className: t,
|
|
2553
|
-
...i
|
|
2554
|
-
} = s;
|
|
2555
|
-
return /* @__PURE__ */ u.createElement("span", $({
|
|
2556
|
-
ref: n,
|
|
2557
|
-
className: q("lmnt", "mdc-list-item__primary-text", t)
|
|
2558
|
-
}, i), e);
|
|
2559
|
-
});
|
|
2560
|
-
Je.displayName = "ListItemPrimaryText";
|
|
2561
|
-
Je.propTypes = Nn;
|
|
2562
|
-
Je.defaultProps = Dn;
|
|
2563
|
-
const et = /* @__PURE__ */ Q((s, n) => {
|
|
2564
|
-
const {
|
|
2565
|
-
overlineText: e,
|
|
2566
|
-
primaryText: t,
|
|
2567
|
-
secondaryText: i,
|
|
2568
|
-
children: r,
|
|
2569
|
-
className: a,
|
|
2570
|
-
...l
|
|
2571
|
-
} = s;
|
|
2572
|
-
return /* @__PURE__ */ u.createElement("span", $({
|
|
2573
|
-
ref: n,
|
|
2574
|
-
className: q("lmnt", "mdc-list-item__content", a)
|
|
2575
|
-
}, l), e && /* @__PURE__ */ u.createElement(Qe, null, e), t && /* @__PURE__ */ u.createElement(Je, null, t), i && /* @__PURE__ */ u.createElement(Ze, null, i));
|
|
2576
|
-
});
|
|
2577
|
-
et.displayName = "ListItemContent";
|
|
2578
|
-
et.propTypes = Cn;
|
|
2579
|
-
et.defaultProps = xn;
|
|
2580
|
-
const tt = /* @__PURE__ */ Q((s, n) => {
|
|
2581
|
-
const {
|
|
2582
|
-
children: e,
|
|
2583
|
-
className: t,
|
|
2584
|
-
...i
|
|
2585
|
-
} = s;
|
|
2586
|
-
return /* @__PURE__ */ u.createElement("span", $({
|
|
2587
|
-
ref: n,
|
|
2588
|
-
className: q("mdc-list-item__start", t)
|
|
2589
|
-
}, i), e);
|
|
2590
|
-
});
|
|
2591
|
-
tt.displayName = "ListItemLeadingBlock";
|
|
2592
|
-
tt.propTypes = bn;
|
|
2593
|
-
tt.defaultProps = Ln;
|
|
2594
|
-
const nt = /* @__PURE__ */ Q((s, n) => {
|
|
2595
|
-
const {
|
|
2596
|
-
children: e,
|
|
2597
|
-
className: t,
|
|
2598
|
-
...i
|
|
2599
|
-
} = s;
|
|
2600
|
-
return /* @__PURE__ */ u.createElement("span", $({
|
|
2601
|
-
ref: n,
|
|
2602
|
-
className: q("lmnt", "mdc-list-item__end", t)
|
|
2603
|
-
}, i), e);
|
|
2604
|
-
});
|
|
2605
|
-
nt.displayName = "ListItemTrailingBlock";
|
|
2606
|
-
nt.propTypes = wn;
|
|
2607
|
-
nt.defaultProps = Bn;
|
|
2608
|
-
const De = /* @__PURE__ */ Q((s, n) => {
|
|
2609
|
-
const {
|
|
2610
|
-
activated: e,
|
|
2611
|
-
ariaChecked: t,
|
|
2612
|
-
children: i,
|
|
2613
|
-
className: r,
|
|
2614
|
-
disableHighlight: a,
|
|
2615
|
-
disabled: l,
|
|
2616
|
-
id: m,
|
|
2617
|
-
indented: D,
|
|
2618
|
-
isChildOption: b,
|
|
2619
|
-
leadingBlock: y,
|
|
2620
|
-
leadingBlockType: S,
|
|
2621
|
-
noHover: d,
|
|
2622
|
-
nonInteractive: f,
|
|
2623
|
-
onClick: L,
|
|
2624
|
-
onKeyPress: B,
|
|
2625
|
-
onMouseMove: M,
|
|
2626
|
-
onMouseOver: c,
|
|
2627
|
-
overlineText: A,
|
|
2628
|
-
primaryText: P,
|
|
2629
|
-
secondaryText: w,
|
|
2630
|
-
selected: te,
|
|
2631
|
-
tag: Z,
|
|
2632
|
-
themeColor: C,
|
|
2633
|
-
trailingBlock: k,
|
|
2634
|
-
trailingBlockType: H,
|
|
2635
|
-
value: le,
|
|
2636
|
-
variant: O,
|
|
2637
|
-
wrapMode: ne,
|
|
2638
|
-
...we
|
|
2639
|
-
} = s, fe = ge(), [ue, me] = Se("mdc-list-item--with-one-line"), x = qe(Ye), p = x.leadingBlockType || S, ie = x.trailingBlockType || H, R = P || i, z = ee(
|
|
2640
|
-
() => x.role !== "group" ? c : void 0,
|
|
2641
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2642
|
-
[]
|
|
2643
|
-
), X = ee(
|
|
2644
|
-
() => x.role !== "group" ? M : void 0,
|
|
2645
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2646
|
-
[]
|
|
2647
|
-
), J = ee(() => O !== "standard" ? "h3" : Z || (x.navigation ? "a" : "li"), [O, x.navigation, Z]);
|
|
2648
|
-
j(() => {
|
|
2649
|
-
P && A && w ? me("mdc-list-item--with-three-lines") : (P && w || A && w) && me("mdc-list-item--with-two-lines");
|
|
2650
|
-
}, [P, A, w]);
|
|
2651
|
-
const re = (T, N, ae) => T === "radiogroup" || N === "radio" || ae === "radio" ? "radio" : T === "group" || N === "switch" || N === "checkbox" || ae === "switch " || ae === "checkbox" ? "checkbox" : T === "listbox" ? "option" : T === "menu" ? "menuItem" : null, he = W((T) => {
|
|
2652
|
-
!x.nonInteractive && !l && L?.(T, le);
|
|
2653
|
-
}, [x.nonInteractive, l, L, le]), de = (T, N, ae, Ee, Be, Fe) => {
|
|
2654
|
-
switch (T) {
|
|
2655
|
-
case "checkbox":
|
|
2656
|
-
return Fe ? null : !N || typeof N == "string" ? /* @__PURE__ */ u.createElement(Vt, {
|
|
2657
|
-
hideLabel: !0,
|
|
2658
|
-
label: ae,
|
|
2659
|
-
checked: Ee
|
|
2660
|
-
}) : N;
|
|
2661
|
-
case "icon":
|
|
2662
|
-
return typeof N == "string" ? /* @__PURE__ */ u.createElement(je, {
|
|
2663
|
-
icon: N
|
|
2664
|
-
}) : N;
|
|
2665
|
-
case "radio":
|
|
2666
|
-
return Fe ? null : !N || typeof N == "string" ? /* @__PURE__ */ u.createElement(Gt, {
|
|
2667
|
-
hideLabel: !0,
|
|
2668
|
-
label: ae,
|
|
2669
|
-
name: N || Be,
|
|
2670
|
-
checked: Ee
|
|
2671
|
-
}) : N;
|
|
2672
|
-
case "switch":
|
|
2673
|
-
return Fe ? null : !N || typeof N == "string" ? /* @__PURE__ */ u.createElement(zt, {
|
|
2674
|
-
hideLabel: !0,
|
|
2675
|
-
label: ae
|
|
2676
|
-
}) : N;
|
|
2677
|
-
case "badge":
|
|
2678
|
-
return typeof N == "string" ? /* @__PURE__ */ u.createElement(We, {
|
|
2679
|
-
label: N
|
|
2680
|
-
}) : N;
|
|
2681
|
-
default:
|
|
2682
|
-
return T ? N : null;
|
|
2683
|
-
}
|
|
2684
|
-
}, g = ee(() => de(p, y, R, t, x.randomId, !1), [p, y, R, t, x.randomId]), E = ee(() => {
|
|
2685
|
-
const T = x.trailingBlockType || H, N = p === "checkbox" || p === "radio" || p === "switch";
|
|
2686
|
-
return de(T, k, R, t, x.randomId, N);
|
|
2687
|
-
}, [t, R, p, x.randomId, x.trailingBlockType, k, H]), U = (T, N) => {
|
|
2688
|
-
switch (N) {
|
|
2689
|
-
case "avatar":
|
|
2690
|
-
return `mdc-list-item--with-${T}-avatar`;
|
|
2691
|
-
case "checkbox":
|
|
2692
|
-
return `mdc-list-item--with-${T}-checkbox`;
|
|
2693
|
-
case "icon":
|
|
2694
|
-
return `mdc-list-item--with-${T}-icon`;
|
|
2695
|
-
case "icon-large":
|
|
2696
|
-
return `mdc-list-item--with-${T}-icon mdc-list-item--with-${T}-icon-large`;
|
|
2697
|
-
case "icon-xlarge":
|
|
2698
|
-
return `mdc-list-item--with-${T}-icon mdc-list-item--with-${T}-icon-xlarge`;
|
|
2699
|
-
case "icon-small":
|
|
2700
|
-
return `mdc-list-item--with-${T}-icon mdc-list-item--with-${T}-icon-small`;
|
|
2701
|
-
case "icon-xsmall":
|
|
2702
|
-
return `mdc-list-item--with-${T}-icon mdc-list-item--with-${T}-icon-xsmall`;
|
|
2703
|
-
case "image":
|
|
2704
|
-
return `mdc-list-item--with-${T}-image`;
|
|
2705
|
-
case "radio":
|
|
2706
|
-
return `mdc-list-item--with-${T}-radio`;
|
|
2707
|
-
case "switch":
|
|
2708
|
-
return `mdc-list-item--with-${T}-switch`;
|
|
2709
|
-
case "thumbnail":
|
|
2710
|
-
return `mdc-list-item--with-${T}-thumbnail`;
|
|
2711
|
-
case "lgImage":
|
|
2712
|
-
return `mdc-list-item--with-${T}-video`;
|
|
2713
|
-
case "badge":
|
|
2714
|
-
return `mdc-list-item--with-${T}-badge`;
|
|
2715
|
-
default:
|
|
2716
|
-
return null;
|
|
2717
|
-
}
|
|
2718
|
-
}, ce = ee(() => {
|
|
2719
|
-
let T;
|
|
2720
|
-
if (!O || O === "standard") {
|
|
2721
|
-
const N = U("leading", p), ae = U("trailing", ie);
|
|
2722
|
-
T = q(["mdc-list-item", `lmnt-theme-${C}-bg`, ue, (x.nonInteractive || f) && "mdc-list-item--non-interactive", N, ae]);
|
|
2723
|
-
}
|
|
2724
|
-
return T;
|
|
2725
|
-
}, [O, p, ie, C, ue, x.nonInteractive, f]), oe = q(["lmnt", ce, (!x.nonInteractive || f) && x.navigation && (t || e) && "mdc-list-item--activated", (!x.nonInteractive || f) && (!a || b) && (t || te) && "mdc-list-item--selected", (x.nonInteractive || d || f) && "lmnt-list-item__no-hover", D && "lmnt-list-item--indented", l && "mdc-list-item--disabled", ne === "truncate" && "lmnt-list-item--truncate", ne === "noWrap" && "lmnt-list-item--no-wrap", ne === "wrap" && "lmnt-list-item--wrap ", O === "group" && "mdc-list-group__subheader lmnt-list-group__subheader", O === "category" && "lmnt-list-group__category-header", r]), Ae = re(x.role, p, ie);
|
|
2726
|
-
return Pe(n, () => fe.current, []), /* @__PURE__ */ u.createElement(Ut, {
|
|
2727
|
-
componentRef: fe
|
|
2728
|
-
}, /* @__PURE__ */ u.createElement(J, $({
|
|
2729
|
-
id: m,
|
|
2730
|
-
"aria-checked": t,
|
|
2731
|
-
ref: fe,
|
|
2732
|
-
role: Ae,
|
|
2733
|
-
onClick: he,
|
|
2734
|
-
className: oe,
|
|
2735
|
-
onKeyPress: B,
|
|
2736
|
-
onMouseMove: X,
|
|
2737
|
-
onMouseOver: z
|
|
2738
|
-
}, we), /* @__PURE__ */ u.createElement("span", {
|
|
2739
|
-
className: "mdc-list-item__ripple"
|
|
2740
|
-
}), O === "standard" && g && /* @__PURE__ */ u.createElement(tt, null, g), O !== "standard" && O === "category" && /* @__PURE__ */ u.createElement(ct, {
|
|
2741
|
-
level: 0
|
|
2742
|
-
}, R), O !== "standard" && O === "group" && x.listType === "group" && /* @__PURE__ */ u.createElement(ct, {
|
|
2743
|
-
level: 2
|
|
2744
|
-
}, R), O !== "standard" && O === "group" && x.listType === "category" && /* @__PURE__ */ u.createElement(Xt, null, R), O === "standard" && /* @__PURE__ */ u.createElement(et, {
|
|
2745
|
-
primaryText: R,
|
|
2746
|
-
overlineText: O === "standard" && A,
|
|
2747
|
-
secondaryText: O === "standard" && w
|
|
2748
|
-
}), O === "standard" && E && /* @__PURE__ */ u.createElement(nt, null, E)));
|
|
2749
|
-
});
|
|
2750
|
-
De.displayName = "ListItem";
|
|
2751
|
-
De.propTypes = An;
|
|
2752
|
-
De.defaultProps = vn;
|
|
2753
|
-
const it = /* @__PURE__ */ Q((s, n) => {
|
|
2754
|
-
const {
|
|
2755
|
-
variant: e,
|
|
2756
|
-
className: t,
|
|
2757
|
-
...i
|
|
2758
|
-
} = s, {
|
|
2759
|
-
leadingBlockType: r,
|
|
2760
|
-
navigation: a
|
|
2761
|
-
} = qe(Ye), l = ee(() => a ? "hr" : "li", [a]);
|
|
2762
|
-
return /* @__PURE__ */ u.createElement(l, $({
|
|
2763
|
-
ref: n,
|
|
2764
|
-
role: "separator",
|
|
2765
|
-
className: q("mdc-list-divider", "lmnt-list-divider", (e === "padded" || e === "insetPadded") && "lmnt-list-divider--with-padding", (e === "insetPadded" || e === "inset") && "lmnt-list-divider--with-inset", r === "avatar" && " mdc-list-divider--with-leading-avatar", r === "checkbox" && " mdc-list-divider--with-leading-checkbox", r === "icon" && " mdc-list-divider--with-leading-icon", r === "image" && " mdc-list-divider--with-leading-image", r === "largeImage" && " mdc-list-divider--with-leading-video", r === "radio" && " mdc-list-divider--with-leading-radio", r === "switch" && " mdc-list-divider--with-leading-switch", r === "thumbnail" && " mdc-list-divider--with-leading-thumbnail", t)
|
|
2766
|
-
}, i));
|
|
2767
|
-
});
|
|
2768
|
-
it.displayName = "ListDivider";
|
|
2769
|
-
it.propTypes = yn;
|
|
2770
|
-
it.defaultProps = gn;
|
|
2771
|
-
const Ue = /* @__PURE__ */ Q((s, n) => {
|
|
2772
|
-
const {
|
|
2773
|
-
children: e,
|
|
2774
|
-
items: t,
|
|
2775
|
-
group: i,
|
|
2776
|
-
selectedIndex: r,
|
|
2777
|
-
itemIdKey: a
|
|
2778
|
-
} = s, {
|
|
2779
|
-
showDivider: l,
|
|
2780
|
-
dividerVariant: m,
|
|
2781
|
-
categoryNameKey: D,
|
|
2782
|
-
secondaryTextKey: b,
|
|
2783
|
-
overlineTextKey: y,
|
|
2784
|
-
groupNameKey: S,
|
|
2785
|
-
primaryTextKey: d,
|
|
2786
|
-
role: f,
|
|
2787
|
-
singleList: L,
|
|
2788
|
-
componentPropsKey: B
|
|
2789
|
-
} = qe(Ye), [M] = Se(() => ft());
|
|
2790
|
-
return Array.isArray(t) ? t?.map((c, A) => {
|
|
2791
|
-
let P = c[d];
|
|
2792
|
-
!P && typeof c == "string" && (P = c);
|
|
2793
|
-
const w = c[b], te = c[y], Z = at(c, S, D);
|
|
2794
|
-
let C;
|
|
2795
|
-
f === "group" ? Array.isArray(r) && r.length && (C = r.indexOf(A) !== -1) : C = r === A;
|
|
2796
|
-
let k, H;
|
|
2797
|
-
(!c.leadingBlock || typeof c.trailingBlock != "string") && f === "radiogroup" && !L ? k = M : k = c.leadingBlock, (!c.trailingBlock || typeof c.trailingBlock != "string") && f === "radiogroup" && !L ? H = M : H = c.trailingBlock;
|
|
2798
|
-
const le = c[B] || {};
|
|
2799
|
-
return /* @__PURE__ */ u.createElement(ot, {
|
|
2800
|
-
key: c[a] || P || w || te
|
|
2801
|
-
}, /* @__PURE__ */ u.createElement(De, $({
|
|
2802
|
-
ref: n,
|
|
2803
|
-
key: P,
|
|
2804
|
-
tabIndex: A === 0 ? 0 : -1,
|
|
2805
|
-
variant: Z,
|
|
2806
|
-
secondaryText: w,
|
|
2807
|
-
primaryText: P,
|
|
2808
|
-
overlineText: te,
|
|
2809
|
-
leadingBlock: k,
|
|
2810
|
-
trailingBlock: H,
|
|
2811
|
-
ariaChecked: C
|
|
2812
|
-
}, le)), !i && l && t.length > A + 1 && /* @__PURE__ */ u.createElement(it, {
|
|
2813
|
-
variant: m
|
|
2814
|
-
}));
|
|
2815
|
-
}) : e;
|
|
2816
|
-
});
|
|
2817
|
-
Ue.displayName = "ListItemsList";
|
|
2818
|
-
Ue.propTypes = Fn;
|
|
2819
|
-
Ue.defaultProps = kn;
|
|
2820
|
-
const Ge = /* @__PURE__ */ Q((s, n) => {
|
|
2821
|
-
const {
|
|
2822
|
-
className: e,
|
|
2823
|
-
...t
|
|
2824
|
-
} = s;
|
|
2825
|
-
return /* @__PURE__ */ u.createElement("hr", $({
|
|
2826
|
-
ref: n,
|
|
2827
|
-
className: q("lmnt", "lmnt-list-divider", "mdc-list-divider", e)
|
|
2828
|
-
}, t));
|
|
2829
|
-
});
|
|
2830
|
-
Ge.displayName = "ListGroupDivider";
|
|
2831
|
-
Ge.propTypes = _n;
|
|
2832
|
-
Ge.defaultProps = Sn;
|
|
2833
|
-
const be = /* @__PURE__ */ Q((s, n) => {
|
|
2834
|
-
const {
|
|
2835
|
-
categoryId: e,
|
|
2836
|
-
categoryIdKey: t,
|
|
2837
|
-
categoryNameKey: i,
|
|
2838
|
-
children: r,
|
|
2839
|
-
className: a,
|
|
2840
|
-
componentPropsKey: l,
|
|
2841
|
-
customRef: m,
|
|
2842
|
-
dense: D,
|
|
2843
|
-
dividerVariant: b,
|
|
2844
|
-
groupId: y,
|
|
2845
|
-
groupIdKey: S,
|
|
2846
|
-
groupItems: d,
|
|
2847
|
-
groupNameKey: f,
|
|
2848
|
-
groupSelectedIndex: L,
|
|
2849
|
-
inMenu: B,
|
|
2850
|
-
itemIdKey: M,
|
|
2851
|
-
items: c,
|
|
2852
|
-
itemsKey: A,
|
|
2853
|
-
leadingBlockType: P,
|
|
2854
|
-
listType: w,
|
|
2855
|
-
navigation: te,
|
|
2856
|
-
nonInteractive: Z,
|
|
2857
|
-
onAction: C,
|
|
2858
|
-
overlineTextKey: k,
|
|
2859
|
-
primaryTextKey: H,
|
|
2860
|
-
role: le,
|
|
2861
|
-
roleToUse: O,
|
|
2862
|
-
secondaryTextKey: ne,
|
|
2863
|
-
selected: we,
|
|
2864
|
-
showDivider: fe,
|
|
2865
|
-
singleList: ue,
|
|
2866
|
-
themeColor: me,
|
|
2867
|
-
trailingBlockType: x,
|
|
2868
|
-
wrapFocus: p,
|
|
2869
|
-
trapTabInteraction: ie,
|
|
2870
|
-
...R
|
|
2871
|
-
} = s, z = ge(m || null), X = ge(), J = W((h, _, v) => {
|
|
2872
|
-
const F = h[f], G = h[A][v];
|
|
2873
|
-
return {
|
|
2874
|
-
selectedGroup: F,
|
|
2875
|
-
selectedGroupIndex: _,
|
|
2876
|
-
selectedGroupId: h[S] || F,
|
|
2877
|
-
selectedIndex: v,
|
|
2878
|
-
selectedItem: typeof G == "string" ? G : G[M] || G[H]
|
|
2879
|
-
};
|
|
2880
|
-
}, [S, f, M, A, H]), re = W((h, _) => _.findIndex((v) => h === v[S] || h === v[f]), [S, f]), he = W((h, _) => _.findIndex((v) => h === v[t] || h === v[i]), [t, i]), de = W((h, _, v) => {
|
|
2881
|
-
const F = re(_, h);
|
|
2882
|
-
if (F === -1) return {};
|
|
2883
|
-
const G = c[F];
|
|
2884
|
-
return J(G, F, v);
|
|
2885
|
-
}, [J, re, c]), g = W((h, _) => {
|
|
2886
|
-
const v = h[i];
|
|
2887
|
-
return {
|
|
2888
|
-
selectedCategory: v,
|
|
2889
|
-
selectedCategoryIndex: _,
|
|
2890
|
-
selectedCategoryId: h[t] || v
|
|
2891
|
-
};
|
|
2892
|
-
}, [t, i]), E = W((h, _, v) => {
|
|
2893
|
-
const F = he(h, c);
|
|
2894
|
-
if (F === -1) return {};
|
|
2895
|
-
const G = c[F];
|
|
2896
|
-
return {
|
|
2897
|
-
...g(G, F),
|
|
2898
|
-
...de(G[A], _, v)
|
|
2899
|
-
};
|
|
2900
|
-
}, [g, he, de, c, A]), U = W((h, _, v) => w === "category" ? E(v, _, h) : w === "group" ? de(c, _, h) : c && c[h] && c[h][M] !== void 0 ? c[h][M] : h, [w, E, de, c, M]), ce = W((h, _, v) => {
|
|
2901
|
-
const F = he(h, c);
|
|
2902
|
-
if (F === -1) return [];
|
|
2903
|
-
const G = c[F], pe = G[A], Ie = re(_, pe);
|
|
2904
|
-
if (Ie === -1) return [];
|
|
2905
|
-
const ze = pe[Ie];
|
|
2906
|
-
return ze[A].length <= v ? [] : [{
|
|
2907
|
-
...g(G, F),
|
|
2908
|
-
...J(ze, Ie, v)
|
|
2909
|
-
}];
|
|
2910
|
-
}, [g, J, he, re, c, A]), oe = W((h, _) => {
|
|
2911
|
-
const v = [], F = re(h, c);
|
|
2912
|
-
if (F === -1) return [];
|
|
2913
|
-
const G = c[F];
|
|
2914
|
-
return v.push(J(G, F, _)), v;
|
|
2915
|
-
}, [J, re, c]), Ae = W((h, _, v) => h.reduce((G, pe) => {
|
|
2916
|
-
if (w === "simple" && G.push(c[pe][M] || c[pe]), w === "category" && G.splice(G.length - 1, 0, ...ce(v, _, pe)), w === "group") {
|
|
2917
|
-
const Ie = oe(_, pe);
|
|
2918
|
-
G.splice(G.length - 1, 0, ...Ie);
|
|
2919
|
-
}
|
|
2920
|
-
return G;
|
|
2921
|
-
}, []), [ce, oe, M, c, w]), T = W((h, _, v) => {
|
|
2922
|
-
const F = he(h, c);
|
|
2923
|
-
if (F === -1) return {};
|
|
2924
|
-
const G = c[F], pe = G[A], Ie = re(_, pe);
|
|
2925
|
-
if (Ie === -1) return {};
|
|
2926
|
-
const ze = pe[Ie];
|
|
2927
|
-
return {
|
|
2928
|
-
...g(G, F),
|
|
2929
|
-
...J(ze, Ie, v)
|
|
2930
|
-
};
|
|
2931
|
-
}, [g, J, he, re, c, A]), N = W((h) => c && h > -1 && c[h] && c[h][M] !== void 0 ? c[h][M] : h, [M, c]), ae = W((h, _, v) => w === "category" ? T(h, _, v) : w === "group" ? de(c, _, v) : N(v), [N, T, de, c, w]), Ee = W(
|
|
2932
|
-
(h, _, v) => O === "group" ? Ae(h, _, v) : ue ? ae(v, _, h) : N(h),
|
|
2933
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2934
|
-
[S, f, M, c, A, w, H, O, ue, t, i]
|
|
2935
|
-
), Be = W((h) => {
|
|
2936
|
-
var _;
|
|
2937
|
-
C && C(U(h.detail.index, y, e), Ee((_ = X.current) === null || _ === void 0 ? void 0 : _.foundation.getSelectedIndex(), y, e), y, e, h);
|
|
2938
|
-
}, [e, C, U, Ee, y]);
|
|
2939
|
-
j(() => {
|
|
2940
|
-
if (!(B || Z))
|
|
2941
|
-
return X.current = Lt.attachTo(z.current), ie && X.current.listElements.forEach((h) => {
|
|
2942
|
-
h.setAttribute("tabindex", "0");
|
|
2943
|
-
}), () => {
|
|
2944
|
-
var h;
|
|
2945
|
-
(h = X.current) === null || h === void 0 || h.destroy();
|
|
2946
|
-
};
|
|
2947
|
-
}, [B, Z, X, ie]), j(() => {
|
|
2948
|
-
var h;
|
|
2949
|
-
if (!Z)
|
|
2950
|
-
return (h = X.current) === null || h === void 0 || h.listen("MDCList:action", Be), () => {
|
|
2951
|
-
var _;
|
|
2952
|
-
(_ = X.current) === null || _ === void 0 || _.unlisten("MDCList:action", Be);
|
|
2953
|
-
};
|
|
2954
|
-
}, [Be, Z]), j(() => {
|
|
2955
|
-
X.current && (X.current.wrapFocus = p);
|
|
2956
|
-
}, [p]), j(() => {
|
|
2957
|
-
var h, _;
|
|
2958
|
-
if (Z) {
|
|
2959
|
-
var v;
|
|
2960
|
-
(v = X.current) === null || v === void 0 || v.foundation.setSingleSelection(!1);
|
|
2961
|
-
return;
|
|
2962
|
-
}
|
|
2963
|
-
const F = O === "listbox" || O === "radiogroup";
|
|
2964
|
-
(h = X.current) === null || h === void 0 || h.foundation.setSingleSelection(F), O && !F && ((_ = X.current) === null || _ === void 0 ? void 0 : _.foundation.getSelectedIndex()) === -1 && (X.current.foundation.isCheckboxList_ = !0, X.current.foundation.setSelectedIndex([])), F && X.current && (X.current.foundation.isCheckboxList_ = !1);
|
|
2965
|
-
}, [O, Z]);
|
|
2966
|
-
const Fe = te ? "nav" : "ul";
|
|
2967
|
-
return Pe(n, () => z.current, []), /* @__PURE__ */ u.createElement(Fe, $({
|
|
2968
|
-
"aria-multiselectable": P === "checkbox" || x === "checkbox" || P === "switch" || x === "switch" || O === "group",
|
|
2969
|
-
"data-evolution": "true",
|
|
2970
|
-
ref: z,
|
|
2971
|
-
role: O,
|
|
2972
|
-
"aria-orientation": "vertical",
|
|
2973
|
-
className: q("lmnt", "lmnt-list", "mdc-list", `lmnt-theme-${me}-bg`, D && "lmnt-list--dense", w === "category" && "lmnt-nested-list", a)
|
|
2974
|
-
}, R), r);
|
|
2975
|
-
});
|
|
2976
|
-
be.displayName = "ListRoot";
|
|
2977
|
-
be.propTypes = Nt;
|
|
2978
|
-
be.defaultProps = Dt;
|
|
2979
|
-
const Ve = /* @__PURE__ */ Q((s, n) => {
|
|
2980
|
-
const {
|
|
2981
|
-
children: e,
|
|
2982
|
-
className: t,
|
|
2983
|
-
variant: i
|
|
2984
|
-
} = s;
|
|
2985
|
-
return i === "group" ? /* @__PURE__ */ u.createElement("div", {
|
|
2986
|
-
ref: n,
|
|
2987
|
-
className: q("mdc-list-group", t)
|
|
2988
|
-
}, e) : i === "category" ? /* @__PURE__ */ u.createElement("div", {
|
|
2989
|
-
ref: n,
|
|
2990
|
-
className: q("lmnt-list-category", t)
|
|
2991
|
-
}, e) : /* @__PURE__ */ u.createElement(u.Fragment, null, e);
|
|
2992
|
-
});
|
|
2993
|
-
Ve.displayName = "ListWrapper";
|
|
2994
|
-
Ve.propTypes = Hn;
|
|
2995
|
-
Ve.defaultProps = Kn;
|
|
2996
|
-
const yt = /* @__PURE__ */ Q((s, n) => {
|
|
2997
|
-
const {
|
|
2998
|
-
categoryIdKey: e,
|
|
2999
|
-
categoryNameKey: t,
|
|
3000
|
-
children: i,
|
|
3001
|
-
className: r,
|
|
3002
|
-
componentPropsKey: a,
|
|
3003
|
-
customRef: l,
|
|
3004
|
-
dense: m,
|
|
3005
|
-
dividerVariant: D,
|
|
3006
|
-
groupIdKey: b,
|
|
3007
|
-
groupNameKey: y,
|
|
3008
|
-
itemIdKey: S,
|
|
3009
|
-
items: d,
|
|
3010
|
-
itemsKey: f,
|
|
3011
|
-
leadingBlockType: L,
|
|
3012
|
-
listType: B,
|
|
3013
|
-
multiSelect: M,
|
|
3014
|
-
navigation: c,
|
|
3015
|
-
nonInteractive: A,
|
|
3016
|
-
onAction: P,
|
|
3017
|
-
overlineTextKey: w,
|
|
3018
|
-
primaryTextKey: te,
|
|
3019
|
-
role: Z,
|
|
3020
|
-
secondaryTextKey: C,
|
|
3021
|
-
selected: k,
|
|
3022
|
-
showDivider: H,
|
|
3023
|
-
singleList: le,
|
|
3024
|
-
themeColor: O,
|
|
3025
|
-
trailingBlockType: ne,
|
|
3026
|
-
wrapFocus: we,
|
|
3027
|
-
...fe
|
|
3028
|
-
} = s, ue = ge(l || null);
|
|
3029
|
-
Pe(n, () => ue.current, []);
|
|
3030
|
-
const [me, x] = Se(k), [p] = Se(() => ft()), {
|
|
3031
|
-
inMenu: ie
|
|
3032
|
-
} = qe(Mt);
|
|
3033
|
-
j(() => {
|
|
3034
|
-
d && d.length > 0 && i && Rt("List: Items should not be used with children. If both are sent children will be ignored.");
|
|
3035
|
-
}, [d, i]);
|
|
3036
|
-
const R = ee(() => Array.isArray(d) && d[0] && typeof d[0] == "object" && d[0][t] ? "category" : Array.isArray(d) && d[0] && typeof d[0] == "object" && d[0][y] ? "group" : B || "simple", [t, y, d, B]), [z, X] = Se(() => _t(s));
|
|
3037
|
-
j(() => {
|
|
3038
|
-
X(_t({
|
|
3039
|
-
leadingBlockType: L,
|
|
3040
|
-
trailingBlockType: ne,
|
|
3041
|
-
nonInteractive: A,
|
|
3042
|
-
role: Z
|
|
3043
|
-
}));
|
|
3044
|
-
}, [L, ne, A, Z]);
|
|
3045
|
-
const J = W((g, E) => {
|
|
3046
|
-
if (P && z)
|
|
3047
|
-
if (R === "simple")
|
|
3048
|
-
P(g, E), x(E);
|
|
3049
|
-
else if (le)
|
|
3050
|
-
if (z !== "group")
|
|
3051
|
-
P(g, E);
|
|
3052
|
-
else {
|
|
3053
|
-
if (!me) {
|
|
3054
|
-
x(E), P(g, E);
|
|
3055
|
-
return;
|
|
3056
|
-
}
|
|
3057
|
-
const U = [...me], ce = me.findIndex((oe) => R === "category" ? oe.selectedCategoryId === g.selectedCategoryId && oe.selectedGroupId === g.selectedGroupId && oe.selectedItem === g.selectedItem : oe.selectedGroupId === g.selectedGroupId && oe.selectedItem === g.selectedItem);
|
|
3058
|
-
if (ce !== -1) {
|
|
3059
|
-
U.splice(ce, 1), x(U), P(g, U);
|
|
3060
|
-
return;
|
|
3061
|
-
}
|
|
3062
|
-
U.push(g), x(U), P(g, U);
|
|
3063
|
-
}
|
|
3064
|
-
else
|
|
3065
|
-
P(g, E);
|
|
3066
|
-
}, [me, R, P, z, le]), re = W((g, E, U, ce, oe, Ae) => {
|
|
3067
|
-
const T = E[y];
|
|
3068
|
-
if (!T) return null;
|
|
3069
|
-
const N = at(E, y, t), ae = E[b] || T, Ee = wt(U, Ae, z, le ? k : k[ae], le);
|
|
3070
|
-
return /* @__PURE__ */ u.createElement(ot, {
|
|
3071
|
-
key: ae
|
|
3072
|
-
}, /* @__PURE__ */ u.createElement(De, {
|
|
3073
|
-
variant: N,
|
|
3074
|
-
primaryText: T
|
|
3075
|
-
}), /* @__PURE__ */ u.createElement(g, $({
|
|
3076
|
-
inMenu: ie,
|
|
3077
|
-
ref: ue,
|
|
3078
|
-
categoryId: oe,
|
|
3079
|
-
groupId: ae,
|
|
3080
|
-
itemsKey: f,
|
|
3081
|
-
primaryTextKey: te,
|
|
3082
|
-
onAction: J,
|
|
3083
|
-
showDivider: H,
|
|
3084
|
-
className: r,
|
|
3085
|
-
dense: m,
|
|
3086
|
-
items: d,
|
|
3087
|
-
leadingBlockType: L,
|
|
3088
|
-
listType: R,
|
|
3089
|
-
roleToUse: z,
|
|
3090
|
-
trailingBlockType: ne,
|
|
3091
|
-
groupNameKey: y,
|
|
3092
|
-
groupIdKey: b,
|
|
3093
|
-
categoryNameKey: t,
|
|
3094
|
-
selected: k,
|
|
3095
|
-
groupItems: E[f],
|
|
3096
|
-
groupSelectedIndex: Ee,
|
|
3097
|
-
componentPropsKey: a
|
|
3098
|
-
}, fe), /* @__PURE__ */ u.createElement(Ue, {
|
|
3099
|
-
items: E[f],
|
|
3100
|
-
selectedIndex: Ee,
|
|
3101
|
-
group: !0
|
|
3102
|
-
}), ce && d.length > U + 1 && /* @__PURE__ */ u.createElement(Ge, null)));
|
|
3103
|
-
}, [t, le, r, fe, m, b, y, J, ie, d, f, L, R, te, z, k, H, ne, a]), he = ee(() => {
|
|
3104
|
-
if (!d && i)
|
|
3105
|
-
return /* @__PURE__ */ u.createElement(be, $({
|
|
3106
|
-
inMenu: ie,
|
|
3107
|
-
ref: ue,
|
|
3108
|
-
itemsKey: f,
|
|
3109
|
-
onAction: J,
|
|
3110
|
-
showDivider: H,
|
|
3111
|
-
className: r,
|
|
3112
|
-
dense: m,
|
|
3113
|
-
items: d,
|
|
3114
|
-
leadingBlockType: L,
|
|
3115
|
-
listType: R,
|
|
3116
|
-
roleToUse: z,
|
|
3117
|
-
trailingBlockType: ne,
|
|
3118
|
-
groupNameKey: y,
|
|
3119
|
-
categoryNameKey: t,
|
|
3120
|
-
categoryIdKey: e,
|
|
3121
|
-
componentPropsKey: a,
|
|
3122
|
-
navigation: c,
|
|
3123
|
-
nonInteractive: A
|
|
3124
|
-
}, fe), i);
|
|
3125
|
-
if (R === "simple") {
|
|
3126
|
-
let g;
|
|
3127
|
-
return z === "group" ? (g = [], Array.isArray(k) && k?.forEach((E) => {
|
|
3128
|
-
d?.forEach((U, ce) => {
|
|
3129
|
-
(E === U || E === U[S] || E === ce[te]) && g.push(ce);
|
|
3130
|
-
});
|
|
3131
|
-
})) : g = d?.findIndex((E) => typeof E == "string" ? E === k : typeof E == "object" ? E[S] || E[S] === 0 ? E[S] === k : fn(E, k) : null), /* @__PURE__ */ u.createElement(be, $({
|
|
3132
|
-
inMenu: ie,
|
|
3133
|
-
ref: ue,
|
|
3134
|
-
itemsKey: f,
|
|
3135
|
-
onAction: J,
|
|
3136
|
-
showDivider: H,
|
|
3137
|
-
className: r,
|
|
3138
|
-
dense: m,
|
|
3139
|
-
themeColor: O,
|
|
3140
|
-
items: d,
|
|
3141
|
-
leadingBlockType: L,
|
|
3142
|
-
listType: R,
|
|
3143
|
-
roleToUse: z,
|
|
3144
|
-
trailingBlockType: ne,
|
|
3145
|
-
groupNameKey: y,
|
|
3146
|
-
categoryNameKey: t,
|
|
3147
|
-
categoryIdKey: e,
|
|
3148
|
-
componentPropsKey: a,
|
|
3149
|
-
navigation: c,
|
|
3150
|
-
nonInteractive: A
|
|
3151
|
-
}, fe), /* @__PURE__ */ u.createElement(Ue, {
|
|
3152
|
-
itemIdKey: S,
|
|
3153
|
-
items: d,
|
|
3154
|
-
selectedIndex: g
|
|
3155
|
-
}, !d && i));
|
|
3156
|
-
}
|
|
3157
|
-
return R === "group" ? d?.map((g, E) => re(be, g, E, H)) : R === "category" ? d?.map((g, E) => {
|
|
3158
|
-
const U = g[t];
|
|
3159
|
-
if (!U) return null;
|
|
3160
|
-
const ce = at(g, y, t), oe = g[e] || U;
|
|
3161
|
-
return /* @__PURE__ */ u.createElement(ot, {
|
|
3162
|
-
key: oe
|
|
3163
|
-
}, /* @__PURE__ */ u.createElement(Ve, {
|
|
3164
|
-
variant: "group",
|
|
3165
|
-
className: `lmnt-nested-list mdc-list lmnt-theme-${O}-bg`
|
|
3166
|
-
}, /* @__PURE__ */ u.createElement(De, {
|
|
3167
|
-
variant: ce,
|
|
3168
|
-
primaryText: U
|
|
3169
|
-
}), g[f].map((Ae, T) => re(be, Ae, T, !1, oe, E))), H && d.length > E + 1 && /* @__PURE__ */ u.createElement(Ge, null));
|
|
3170
|
-
}) : null;
|
|
3171
|
-
}, [re, ie, f, H, i, r, fe, m, d, L, R, z, ne, y, t, k, e, J, te, S, a, c, O, A]), de = ee(() => ({
|
|
3172
|
-
role: z,
|
|
3173
|
-
nonInteractive: A,
|
|
3174
|
-
leadingBlockType: L,
|
|
3175
|
-
trailingBlockType: ne,
|
|
3176
|
-
showDivider: H,
|
|
3177
|
-
dividerVariant: D,
|
|
3178
|
-
selected: k,
|
|
3179
|
-
listType: R,
|
|
3180
|
-
categoryNameKey: t,
|
|
3181
|
-
secondaryTextKey: C,
|
|
3182
|
-
overlineTextKey: w,
|
|
3183
|
-
groupNameKey: y,
|
|
3184
|
-
primaryTextKey: te,
|
|
3185
|
-
randomId: p,
|
|
3186
|
-
singleList: le,
|
|
3187
|
-
navigation: c,
|
|
3188
|
-
componentPropsKey: a
|
|
3189
|
-
}), [t, a, D, y, L, R, c, A, w, te, p, z, C, k, H, le, ne]);
|
|
3190
|
-
return /* @__PURE__ */ u.createElement(Ye.Provider, {
|
|
3191
|
-
value: de
|
|
3192
|
-
}, /* @__PURE__ */ u.createElement(Ve, {
|
|
3193
|
-
variant: R
|
|
3194
|
-
}, he));
|
|
3195
|
-
});
|
|
3196
|
-
yt.displayName = "List";
|
|
3197
|
-
yt.propTypes = Nt;
|
|
3198
|
-
yt.defaultProps = Dt;
|
|
3199
|
-
const gt = /* @__PURE__ */ Q((s, n) => {
|
|
3200
|
-
const {
|
|
3201
|
-
children: e,
|
|
3202
|
-
className: t,
|
|
3203
|
-
...i
|
|
3204
|
-
} = s;
|
|
3205
|
-
return /* @__PURE__ */ u.createElement("div", $({
|
|
3206
|
-
ref: n,
|
|
3207
|
-
className: q("lmnt", "lmnt-list-group", "mdc-list-group", t)
|
|
3208
|
-
}, i), e);
|
|
3209
|
-
});
|
|
3210
|
-
gt.displayName = "ListGroup";
|
|
3211
|
-
gt.propTypes = En;
|
|
3212
|
-
gt.defaultProps = Tn;
|
|
3213
|
-
const Et = /* @__PURE__ */ Q((s, n) => {
|
|
3214
|
-
const {
|
|
3215
|
-
className: e,
|
|
3216
|
-
children: t,
|
|
3217
|
-
...i
|
|
3218
|
-
} = s;
|
|
3219
|
-
return /* @__PURE__ */ u.createElement("h3", $({
|
|
3220
|
-
ref: n,
|
|
3221
|
-
className: q("mdc-list-group__subheader lmnt-list-group__subheader", e)
|
|
3222
|
-
}, i), /* @__PURE__ */ u.createElement(ct, {
|
|
3223
|
-
level: 2
|
|
3224
|
-
}, t));
|
|
3225
|
-
});
|
|
3226
|
-
Et.displayName = "ListGroupSubHeader";
|
|
3227
|
-
Et.propTypes = {
|
|
3228
|
-
className: o.string,
|
|
3229
|
-
children: o.node
|
|
3230
|
-
};
|
|
3231
|
-
Et.defaultProps = {
|
|
3232
|
-
children: null,
|
|
3233
|
-
className: ""
|
|
3234
|
-
};
|
|
3235
|
-
export {
|
|
3236
|
-
yt as L,
|
|
3237
|
-
pt as M,
|
|
3238
|
-
It as N,
|
|
3239
|
-
De as a,
|
|
3240
|
-
it as b,
|
|
3241
|
-
Mt as c
|
|
3242
|
-
};
|