@hortiview/shared-components 0.0.11528 → 0.0.11587
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/README.md +17 -0
- package/dist/{BigLoadingSpinner-D7H28pr5.js → BigLoadingSpinner-iegTbDcD.js} +6 -6
- package/dist/GenericCard-6J558OgP.js +350 -0
- package/dist/{ListAreaService-YS_UUPh5.js → ListAreaService-DOwtdRa4.js} +18 -16
- package/dist/_MapCache-B75yWNNd.js +376 -0
- package/dist/_baseIsEqual-D0Dsajdb.js +317 -0
- package/dist/_getTag-BCf9b56Z.js +81 -0
- package/dist/animationframe-EMBh6XeO.js +54 -0
- package/dist/component-DsB0poTj.js +571 -0
- package/dist/component-neHBNHRu.js +114 -0
- package/dist/components/AlertBanner/AlertBanner.js +16 -15
- package/dist/components/BaseView/BaseView.js +5 -5
- package/dist/components/BasicHeading/BasicHeading.js +25 -24
- package/dist/components/BasicHeading/BasicHeading.test.js +9 -9
- package/dist/components/BlockView/BlockView.js +5 -5
- package/dist/components/ChipCard/ChipCard.js +1765 -14
- package/dist/components/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +28 -27
- package/dist/components/DeleteModal/DeleteModal.js +37 -34
- package/dist/components/Disclaimer/Disclaimer.js +11 -9
- package/dist/components/EmptyView/EmptyView.js +258 -19
- package/dist/components/Filter/Filter.js +58 -54
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +13 -11
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +5974 -6387
- package/dist/components/FormComponents/FormNumber/CustomTextField.d.ts +1 -1
- package/dist/components/FormComponents/FormNumber/CustomTextField.js +5 -5
- package/dist/components/FormComponents/FormNumber/FormNumber.d.ts +1 -1
- package/dist/components/FormComponents/FormNumber/FormNumber.js +1 -1
- package/dist/components/FormComponents/FormRadio/FormRadio.js +4 -4
- package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +1 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.js +3 -3
- package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +6 -5
- package/dist/components/FormComponents/FormSlider/FormSlider.js +1155 -27
- package/dist/components/FormComponents/FormText/FormText.d.ts +1 -1
- package/dist/components/FormComponents/FormText/FormText.js +33 -32
- package/dist/components/FormComponents/FormToggle/FormToggle.d.ts +1 -1
- package/dist/components/FormComponents/FormToggle/FormToggle.js +17 -15
- package/dist/components/GenericTable/GenericTable.js +10486 -74
- package/dist/components/GenericTable/Mobile/GenericCard.js +4 -3
- package/dist/components/GenericTable/Mobile/GenericCard.test.js +1 -1
- package/dist/components/GenericTable/Mobile/GenericCardList.js +10 -8
- package/dist/components/HashTabView/HashTabView.js +1805 -72
- package/dist/components/HeaderFilter/HeaderFilter.d.ts +1 -1
- package/dist/components/HeaderFilter/HeaderFilter.js +4 -4
- package/dist/components/HealthCheckFailed/HealthCheckFailed.js +20 -17
- package/dist/components/Iconify/Iconify.d.ts +1 -2
- package/dist/components/Iconify/Iconify.js +42 -42
- package/dist/components/InfoGroup/InfoGroup.js +30 -28
- package/dist/components/ListArea/ListArea.js +29 -27
- package/dist/components/ListArea/ListArea.test.js +2 -2
- package/dist/components/ListArea/ListAreaService.js +7 -5
- 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 +506 -37
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.js +926 -9
- package/dist/components/ModulePadding/ModulePadding.d.ts +7 -0
- package/dist/components/ModulePadding/ModulePadding.js +28 -0
- package/dist/components/ModulePadding/ModulePadding.test.d.ts +1 -0
- package/dist/components/ModulePadding/ModulePadding.test.js +22 -0
- package/dist/components/OverflowTooltip/OverflowTooltip.js +6 -6
- package/dist/components/OverflowTooltip/OverflowTooltip.test.js +1 -1
- package/dist/components/SearchBar/SearchBar.js +7 -6
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.js +13 -13
- package/dist/floating-ui.dom-CeD8zknG.js +978 -0
- package/dist/get-7ACccM2X.js +114 -0
- package/dist/{get-BiqanC9_.js → get-DFv1gXfq.js} +1 -1
- package/dist/hooks/useHelperText.js +1 -1
- package/dist/identity-DLWZln-X.js +1763 -0
- package/dist/index.es-0lQcz8m1.js +444 -0
- package/dist/index.es-25EARqhH.js +2027 -0
- package/dist/index.es-3043KTnb.js +1066 -0
- package/dist/index.es-41ztjcFT.js +724 -0
- package/dist/index.es-6TJ1S8Jr.js +954 -0
- package/dist/index.es-8GOVkuo-.js +374 -0
- package/dist/index.es-B-_jXDuz.js +216 -0
- package/dist/index.es-BWgXLqXn.js +102 -0
- package/dist/index.es-BtjV0oNv.js +360 -0
- package/dist/index.es-BvrQnJ3j.js +509 -0
- package/dist/index.es-CF_xy2ns.js +674 -0
- package/dist/index.es-CL_Heu1n.js +54 -0
- package/dist/index.es-CiqbARoC.js +306 -0
- package/dist/index.es-D-CKRzIB.js +63 -0
- package/dist/index.es-D6N-XWHe.js +56 -0
- package/dist/index.es-DKDgy7Kt.js +45 -0
- package/dist/index.es-DntoATwO.js +159 -0
- package/dist/index.es-UHKFl8Da.js +7075 -0
- package/dist/index.es-d5xhUpJZ.js +3242 -0
- package/dist/index.es-da0cf7oE.js +569 -0
- package/dist/index.es-h2lMdt7G.js +107 -0
- package/dist/index.es-zr101OF5.js +4853 -0
- package/dist/{isArray-2zMxXFEr.js → isArray-DN9s620O.js} +3 -3
- package/dist/{isArray-C_5XvIlE.js → isArray-Dub1wGJM.js} +1 -1
- package/dist/isEmpty-B4GG2s-V.js +31 -0
- package/dist/isPlainObject-C273y67K.js +40 -0
- package/dist/isString-BW9UHONv.js +21 -0
- package/dist/keyboard-Bpt0aBqQ.js +107 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +57 -55
- package/dist/orderBy-Bd48bw88.js +316 -0
- package/dist/react-tooltip.min-DSY6KDqS.js +431 -0
- package/dist/services/UtilService.js +2 -2
- package/dist/toString-CrgB_7Pe.js +54 -0
- package/dist/tslib.es6-BDCynO9F.js +162 -0
- package/dist/types/GenericTable.d.ts +1 -1
- package/dist/uniqueId-NU3-C36A.js +18 -0
- package/dist/util-DA21pZXj.js +78 -0
- package/package.json +1 -1
- package/dist/GenericCard-jlt8ZsHi.js +0 -80
- package/dist/_Map-Dtlps7IZ.js +0 -113
- package/dist/_overArg-_0pUmCsX.js +0 -14
- package/dist/get-P-5PYZOE.js +0 -426
- package/dist/isEmpty-BimaZd5G.js +0 -225
- package/dist/isString-BOHPtrlm.js +0 -44
- package/dist/orderBy-BVQIswlJ.js +0 -765
- package/dist/react-tooltip.min-Czs4RGD1.js +0 -1400
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
import { c as M, _ as F, P as i } from "./identity-DLWZln-X.js";
|
|
2
|
+
import { F as B } from "./index.es-B-_jXDuz.js";
|
|
3
|
+
import { I as V } from "./index.es-CL_Heu1n.js";
|
|
4
|
+
import l, { forwardRef as G, useState as q, useRef as O, useImperativeHandle as W, useCallback as z, useEffect as b } from "react";
|
|
5
|
+
import { f as X } from "./index.es-da0cf7oE.js";
|
|
6
|
+
import { b as U, c as T } from "./tslib.es6-BDCynO9F.js";
|
|
7
|
+
import { g as S } from "./util-DA21pZXj.js";
|
|
8
|
+
import { M as $, a as J } from "./component-neHBNHRu.js";
|
|
9
|
+
import { M as H, a as x, m as Q, b as Y } from "./component-DsB0poTj.js";
|
|
10
|
+
/**
|
|
11
|
+
* @license
|
|
12
|
+
* Copyright 2016 Google Inc.
|
|
13
|
+
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
* in the Software without restriction, including without limitation the rights
|
|
17
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
* furnished to do so, subject to the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be included in
|
|
22
|
+
* all copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
30
|
+
* THE SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
var f = {
|
|
33
|
+
ANIM_CHECKED_INDETERMINATE: "mdc-checkbox--anim-checked-indeterminate",
|
|
34
|
+
ANIM_CHECKED_UNCHECKED: "mdc-checkbox--anim-checked-unchecked",
|
|
35
|
+
ANIM_INDETERMINATE_CHECKED: "mdc-checkbox--anim-indeterminate-checked",
|
|
36
|
+
ANIM_INDETERMINATE_UNCHECKED: "mdc-checkbox--anim-indeterminate-unchecked",
|
|
37
|
+
ANIM_UNCHECKED_CHECKED: "mdc-checkbox--anim-unchecked-checked",
|
|
38
|
+
ANIM_UNCHECKED_INDETERMINATE: "mdc-checkbox--anim-unchecked-indeterminate",
|
|
39
|
+
BACKGROUND: "mdc-checkbox__background",
|
|
40
|
+
CHECKED: "mdc-checkbox--checked",
|
|
41
|
+
CHECKMARK: "mdc-checkbox__checkmark",
|
|
42
|
+
CHECKMARK_PATH: "mdc-checkbox__checkmark-path",
|
|
43
|
+
DISABLED: "mdc-checkbox--disabled",
|
|
44
|
+
INDETERMINATE: "mdc-checkbox--indeterminate",
|
|
45
|
+
MIXEDMARK: "mdc-checkbox__mixedmark",
|
|
46
|
+
NATIVE_CONTROL: "mdc-checkbox__native-control",
|
|
47
|
+
ROOT: "mdc-checkbox",
|
|
48
|
+
SELECTED: "mdc-checkbox--selected",
|
|
49
|
+
UPGRADED: "mdc-checkbox--upgraded"
|
|
50
|
+
}, c = {
|
|
51
|
+
ARIA_CHECKED_ATTR: "aria-checked",
|
|
52
|
+
ARIA_CHECKED_INDETERMINATE_VALUE: "mixed",
|
|
53
|
+
DATA_INDETERMINATE_ATTR: "data-indeterminate",
|
|
54
|
+
NATIVE_CONTROL_SELECTOR: ".mdc-checkbox__native-control",
|
|
55
|
+
TRANSITION_STATE_CHECKED: "checked",
|
|
56
|
+
TRANSITION_STATE_INDETERMINATE: "indeterminate",
|
|
57
|
+
TRANSITION_STATE_INIT: "init",
|
|
58
|
+
TRANSITION_STATE_UNCHECKED: "unchecked"
|
|
59
|
+
}, K = {
|
|
60
|
+
ANIM_END_LATCH_MS: 250
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* @license
|
|
64
|
+
* Copyright 2016 Google Inc.
|
|
65
|
+
*
|
|
66
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
67
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
68
|
+
* in the Software without restriction, including without limitation the rights
|
|
69
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
70
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
71
|
+
* furnished to do so, subject to the following conditions:
|
|
72
|
+
*
|
|
73
|
+
* The above copyright notice and this permission notice shall be included in
|
|
74
|
+
* all copies or substantial portions of the Software.
|
|
75
|
+
*
|
|
76
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
77
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
78
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
79
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
80
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
81
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
82
|
+
* THE SOFTWARE.
|
|
83
|
+
*/
|
|
84
|
+
var Z = (
|
|
85
|
+
/** @class */
|
|
86
|
+
function(s) {
|
|
87
|
+
U(n, s);
|
|
88
|
+
function n(e) {
|
|
89
|
+
var t = s.call(this, T(T({}, n.defaultAdapter), e)) || this;
|
|
90
|
+
return t.currentCheckState_ = c.TRANSITION_STATE_INIT, t.currentAnimationClass_ = "", t.animEndLatchTimer_ = 0, t.enableAnimationEndHandler_ = !1, t;
|
|
91
|
+
}
|
|
92
|
+
return Object.defineProperty(n, "cssClasses", {
|
|
93
|
+
get: function() {
|
|
94
|
+
return f;
|
|
95
|
+
},
|
|
96
|
+
enumerable: !1,
|
|
97
|
+
configurable: !0
|
|
98
|
+
}), Object.defineProperty(n, "strings", {
|
|
99
|
+
get: function() {
|
|
100
|
+
return c;
|
|
101
|
+
},
|
|
102
|
+
enumerable: !1,
|
|
103
|
+
configurable: !0
|
|
104
|
+
}), Object.defineProperty(n, "numbers", {
|
|
105
|
+
get: function() {
|
|
106
|
+
return K;
|
|
107
|
+
},
|
|
108
|
+
enumerable: !1,
|
|
109
|
+
configurable: !0
|
|
110
|
+
}), Object.defineProperty(n, "defaultAdapter", {
|
|
111
|
+
get: function() {
|
|
112
|
+
return {
|
|
113
|
+
addClass: function() {
|
|
114
|
+
},
|
|
115
|
+
forceLayout: function() {
|
|
116
|
+
},
|
|
117
|
+
hasNativeControl: function() {
|
|
118
|
+
return !1;
|
|
119
|
+
},
|
|
120
|
+
isAttachedToDOM: function() {
|
|
121
|
+
return !1;
|
|
122
|
+
},
|
|
123
|
+
isChecked: function() {
|
|
124
|
+
return !1;
|
|
125
|
+
},
|
|
126
|
+
isIndeterminate: function() {
|
|
127
|
+
return !1;
|
|
128
|
+
},
|
|
129
|
+
removeClass: function() {
|
|
130
|
+
},
|
|
131
|
+
removeNativeControlAttr: function() {
|
|
132
|
+
},
|
|
133
|
+
setNativeControlAttr: function() {
|
|
134
|
+
},
|
|
135
|
+
setNativeControlDisabled: function() {
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
|
+
enumerable: !1,
|
|
140
|
+
configurable: !0
|
|
141
|
+
}), n.prototype.init = function() {
|
|
142
|
+
this.currentCheckState_ = this.determineCheckState_(), this.updateAriaChecked_(), this.adapter.addClass(f.UPGRADED);
|
|
143
|
+
}, n.prototype.destroy = function() {
|
|
144
|
+
clearTimeout(this.animEndLatchTimer_);
|
|
145
|
+
}, n.prototype.setDisabled = function(e) {
|
|
146
|
+
this.adapter.setNativeControlDisabled(e), e ? this.adapter.addClass(f.DISABLED) : this.adapter.removeClass(f.DISABLED);
|
|
147
|
+
}, n.prototype.handleAnimationEnd = function() {
|
|
148
|
+
var e = this;
|
|
149
|
+
this.enableAnimationEndHandler_ && (clearTimeout(this.animEndLatchTimer_), this.animEndLatchTimer_ = setTimeout(function() {
|
|
150
|
+
e.adapter.removeClass(e.currentAnimationClass_), e.enableAnimationEndHandler_ = !1;
|
|
151
|
+
}, K.ANIM_END_LATCH_MS));
|
|
152
|
+
}, n.prototype.handleChange = function() {
|
|
153
|
+
this.transitionCheckState_();
|
|
154
|
+
}, n.prototype.transitionCheckState_ = function() {
|
|
155
|
+
if (this.adapter.hasNativeControl()) {
|
|
156
|
+
var e = this.currentCheckState_, t = this.determineCheckState_();
|
|
157
|
+
if (e !== t) {
|
|
158
|
+
this.updateAriaChecked_();
|
|
159
|
+
var r = c.TRANSITION_STATE_UNCHECKED, a = f.SELECTED;
|
|
160
|
+
t === r ? this.adapter.removeClass(a) : this.adapter.addClass(a), this.currentAnimationClass_.length > 0 && (clearTimeout(this.animEndLatchTimer_), this.adapter.forceLayout(), this.adapter.removeClass(this.currentAnimationClass_)), this.currentAnimationClass_ = this.getTransitionAnimationClass_(e, t), this.currentCheckState_ = t, this.adapter.isAttachedToDOM() && this.currentAnimationClass_.length > 0 && (this.adapter.addClass(this.currentAnimationClass_), this.enableAnimationEndHandler_ = !0);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}, n.prototype.determineCheckState_ = function() {
|
|
164
|
+
var e = c.TRANSITION_STATE_INDETERMINATE, t = c.TRANSITION_STATE_CHECKED, r = c.TRANSITION_STATE_UNCHECKED;
|
|
165
|
+
return this.adapter.isIndeterminate() ? e : this.adapter.isChecked() ? t : r;
|
|
166
|
+
}, n.prototype.getTransitionAnimationClass_ = function(e, t) {
|
|
167
|
+
var r = c.TRANSITION_STATE_INIT, a = c.TRANSITION_STATE_CHECKED, o = c.TRANSITION_STATE_UNCHECKED, d = n.cssClasses, _ = d.ANIM_UNCHECKED_CHECKED, E = d.ANIM_UNCHECKED_INDETERMINATE, N = d.ANIM_CHECKED_UNCHECKED, C = d.ANIM_CHECKED_INDETERMINATE, m = d.ANIM_INDETERMINATE_CHECKED, u = d.ANIM_INDETERMINATE_UNCHECKED;
|
|
168
|
+
switch (e) {
|
|
169
|
+
case r:
|
|
170
|
+
return t === o ? "" : t === a ? m : u;
|
|
171
|
+
case o:
|
|
172
|
+
return t === a ? _ : E;
|
|
173
|
+
case a:
|
|
174
|
+
return t === o ? N : C;
|
|
175
|
+
default:
|
|
176
|
+
return t === a ? m : u;
|
|
177
|
+
}
|
|
178
|
+
}, n.prototype.updateAriaChecked_ = function() {
|
|
179
|
+
this.adapter.isIndeterminate() ? this.adapter.setNativeControlAttr(c.ARIA_CHECKED_ATTR, c.ARIA_CHECKED_INDETERMINATE_VALUE) : this.adapter.removeNativeControlAttr(c.ARIA_CHECKED_ATTR);
|
|
180
|
+
}, n;
|
|
181
|
+
}($)
|
|
182
|
+
);
|
|
183
|
+
/**
|
|
184
|
+
* @license
|
|
185
|
+
* Copyright 2016 Google Inc.
|
|
186
|
+
*
|
|
187
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
188
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
189
|
+
* in the Software without restriction, including without limitation the rights
|
|
190
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
191
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
192
|
+
* furnished to do so, subject to the following conditions:
|
|
193
|
+
*
|
|
194
|
+
* The above copyright notice and this permission notice shall be included in
|
|
195
|
+
* all copies or substantial portions of the Software.
|
|
196
|
+
*
|
|
197
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
198
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
199
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
200
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
201
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
202
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
203
|
+
* THE SOFTWARE.
|
|
204
|
+
*/
|
|
205
|
+
var L = ["checked", "indeterminate"], ee = (
|
|
206
|
+
/** @class */
|
|
207
|
+
function(s) {
|
|
208
|
+
U(n, s);
|
|
209
|
+
function n() {
|
|
210
|
+
var e = s !== null && s.apply(this, arguments) || this;
|
|
211
|
+
return e.ripple_ = e.createRipple_(), e;
|
|
212
|
+
}
|
|
213
|
+
return n.attachTo = function(e) {
|
|
214
|
+
return new n(e);
|
|
215
|
+
}, Object.defineProperty(n.prototype, "ripple", {
|
|
216
|
+
get: function() {
|
|
217
|
+
return this.ripple_;
|
|
218
|
+
},
|
|
219
|
+
enumerable: !1,
|
|
220
|
+
configurable: !0
|
|
221
|
+
}), Object.defineProperty(n.prototype, "checked", {
|
|
222
|
+
get: function() {
|
|
223
|
+
return this.nativeControl_.checked;
|
|
224
|
+
},
|
|
225
|
+
set: function(e) {
|
|
226
|
+
this.nativeControl_.checked = e;
|
|
227
|
+
},
|
|
228
|
+
enumerable: !1,
|
|
229
|
+
configurable: !0
|
|
230
|
+
}), Object.defineProperty(n.prototype, "indeterminate", {
|
|
231
|
+
get: function() {
|
|
232
|
+
return this.nativeControl_.indeterminate;
|
|
233
|
+
},
|
|
234
|
+
set: function(e) {
|
|
235
|
+
this.nativeControl_.indeterminate = e;
|
|
236
|
+
},
|
|
237
|
+
enumerable: !1,
|
|
238
|
+
configurable: !0
|
|
239
|
+
}), Object.defineProperty(n.prototype, "disabled", {
|
|
240
|
+
get: function() {
|
|
241
|
+
return this.nativeControl_.disabled;
|
|
242
|
+
},
|
|
243
|
+
set: function(e) {
|
|
244
|
+
this.foundation.setDisabled(e);
|
|
245
|
+
},
|
|
246
|
+
enumerable: !1,
|
|
247
|
+
configurable: !0
|
|
248
|
+
}), Object.defineProperty(n.prototype, "value", {
|
|
249
|
+
get: function() {
|
|
250
|
+
return this.nativeControl_.value;
|
|
251
|
+
},
|
|
252
|
+
set: function(e) {
|
|
253
|
+
this.nativeControl_.value = e;
|
|
254
|
+
},
|
|
255
|
+
enumerable: !1,
|
|
256
|
+
configurable: !0
|
|
257
|
+
}), n.prototype.initialize = function() {
|
|
258
|
+
var e = c.DATA_INDETERMINATE_ATTR;
|
|
259
|
+
this.nativeControl_.indeterminate = this.nativeControl_.getAttribute(e) === "true", this.nativeControl_.removeAttribute(e);
|
|
260
|
+
}, n.prototype.initialSyncWithDOM = function() {
|
|
261
|
+
var e = this;
|
|
262
|
+
this.handleChange_ = function() {
|
|
263
|
+
return e.foundation.handleChange();
|
|
264
|
+
}, this.handleAnimationEnd_ = function() {
|
|
265
|
+
return e.foundation.handleAnimationEnd();
|
|
266
|
+
}, this.nativeControl_.addEventListener("change", this.handleChange_), this.listen(S(window, "animationend"), this.handleAnimationEnd_), this.installPropertyChangeHooks_();
|
|
267
|
+
}, n.prototype.destroy = function() {
|
|
268
|
+
this.ripple_.destroy(), this.nativeControl_.removeEventListener("change", this.handleChange_), this.unlisten(S(window, "animationend"), this.handleAnimationEnd_), this.uninstallPropertyChangeHooks_(), s.prototype.destroy.call(this);
|
|
269
|
+
}, n.prototype.getDefaultFoundation = function() {
|
|
270
|
+
var e = this, t = {
|
|
271
|
+
addClass: function(r) {
|
|
272
|
+
return e.root.classList.add(r);
|
|
273
|
+
},
|
|
274
|
+
forceLayout: function() {
|
|
275
|
+
return e.root.offsetWidth;
|
|
276
|
+
},
|
|
277
|
+
hasNativeControl: function() {
|
|
278
|
+
return !!e.nativeControl_;
|
|
279
|
+
},
|
|
280
|
+
isAttachedToDOM: function() {
|
|
281
|
+
return !!e.root.parentNode;
|
|
282
|
+
},
|
|
283
|
+
isChecked: function() {
|
|
284
|
+
return e.checked;
|
|
285
|
+
},
|
|
286
|
+
isIndeterminate: function() {
|
|
287
|
+
return e.indeterminate;
|
|
288
|
+
},
|
|
289
|
+
removeClass: function(r) {
|
|
290
|
+
e.root.classList.remove(r);
|
|
291
|
+
},
|
|
292
|
+
removeNativeControlAttr: function(r) {
|
|
293
|
+
e.nativeControl_.removeAttribute(r);
|
|
294
|
+
},
|
|
295
|
+
setNativeControlAttr: function(r, a) {
|
|
296
|
+
e.nativeControl_.setAttribute(r, a);
|
|
297
|
+
},
|
|
298
|
+
setNativeControlDisabled: function(r) {
|
|
299
|
+
e.nativeControl_.disabled = r;
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
return new Z(t);
|
|
303
|
+
}, n.prototype.createRipple_ = function() {
|
|
304
|
+
var e = this, t = T(T({}, H.createAdapter(this)), { deregisterInteractionHandler: function(r, a) {
|
|
305
|
+
return e.nativeControl_.removeEventListener(r, a, x());
|
|
306
|
+
}, isSurfaceActive: function() {
|
|
307
|
+
return Q(e.nativeControl_, ":active");
|
|
308
|
+
}, isUnbounded: function() {
|
|
309
|
+
return !0;
|
|
310
|
+
}, registerInteractionHandler: function(r, a) {
|
|
311
|
+
return e.nativeControl_.addEventListener(r, a, x());
|
|
312
|
+
} });
|
|
313
|
+
return new H(this.root, new Y(t));
|
|
314
|
+
}, n.prototype.installPropertyChangeHooks_ = function() {
|
|
315
|
+
var e = this, t = this.nativeControl_, r = Object.getPrototypeOf(t);
|
|
316
|
+
L.forEach(function(a) {
|
|
317
|
+
var o = Object.getOwnPropertyDescriptor(r, a);
|
|
318
|
+
if (P(o)) {
|
|
319
|
+
var d = o.get, _ = {
|
|
320
|
+
configurable: o.configurable,
|
|
321
|
+
enumerable: o.enumerable,
|
|
322
|
+
get: d,
|
|
323
|
+
set: function(E) {
|
|
324
|
+
o.set.call(t, E), e.foundation.handleChange();
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
Object.defineProperty(t, a, _);
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
}, n.prototype.uninstallPropertyChangeHooks_ = function() {
|
|
331
|
+
var e = this.nativeControl_, t = Object.getPrototypeOf(e);
|
|
332
|
+
L.forEach(function(r) {
|
|
333
|
+
var a = Object.getOwnPropertyDescriptor(t, r);
|
|
334
|
+
P(a) && Object.defineProperty(e, r, a);
|
|
335
|
+
});
|
|
336
|
+
}, Object.defineProperty(n.prototype, "nativeControl_", {
|
|
337
|
+
get: function() {
|
|
338
|
+
var e = c.NATIVE_CONTROL_SELECTOR, t = this.root.querySelector(e);
|
|
339
|
+
if (!t)
|
|
340
|
+
throw new Error("Checkbox component requires a " + e + " element");
|
|
341
|
+
return t;
|
|
342
|
+
},
|
|
343
|
+
enumerable: !1,
|
|
344
|
+
configurable: !0
|
|
345
|
+
}), n;
|
|
346
|
+
}(J)
|
|
347
|
+
);
|
|
348
|
+
function P(s) {
|
|
349
|
+
return !!s && typeof s.set == "function";
|
|
350
|
+
}
|
|
351
|
+
const te = {
|
|
352
|
+
/**
|
|
353
|
+
* Aligns checkbox to the right of the label.
|
|
354
|
+
*
|
|
355
|
+
* Defaults to **false**.
|
|
356
|
+
*/
|
|
357
|
+
alignEnd: i.bool,
|
|
358
|
+
/**
|
|
359
|
+
* The current state of the checkbox.
|
|
360
|
+
*
|
|
361
|
+
* Defaults to **null**.
|
|
362
|
+
*/
|
|
363
|
+
checked: i.bool,
|
|
364
|
+
/**
|
|
365
|
+
* Alternative to `label`, if both `label` and `children` are set, `label` will take priority. Expects a string, but will accept any valid markup.
|
|
366
|
+
*
|
|
367
|
+
* Defaults to **undefined**.
|
|
368
|
+
*/
|
|
369
|
+
children: i.node,
|
|
370
|
+
/**
|
|
371
|
+
* The css class name to be passed through to the component markup.
|
|
372
|
+
*
|
|
373
|
+
* Defaults to **undefined**.
|
|
374
|
+
*/
|
|
375
|
+
className: i.string,
|
|
376
|
+
/**
|
|
377
|
+
* Prevent the user from interacting with the component.
|
|
378
|
+
*
|
|
379
|
+
* Defaults to **false**.
|
|
380
|
+
*/
|
|
381
|
+
disabled: i.bool,
|
|
382
|
+
/**
|
|
383
|
+
* The label not be displayed, but will still be available to screen readers. This should only be used when the context of the checkbox is clear and understandable. An example use-case could be as a column in a table where the column header specifies the action.
|
|
384
|
+
*
|
|
385
|
+
* Defaults to **false**.
|
|
386
|
+
*/
|
|
387
|
+
hideLabel: i.bool,
|
|
388
|
+
/**
|
|
389
|
+
* Randomly generated id. May be overwritten.
|
|
390
|
+
*
|
|
391
|
+
* Defaults to **undefined**.
|
|
392
|
+
*/
|
|
393
|
+
id: i.string,
|
|
394
|
+
/**
|
|
395
|
+
* The checkbox will show an indicator if no value (true or false) is set.
|
|
396
|
+
*
|
|
397
|
+
* Defaults to **false**.
|
|
398
|
+
*/
|
|
399
|
+
indeterminate: i.bool,
|
|
400
|
+
/**
|
|
401
|
+
* Display label. The `label` should always be set even when using `hideLabel` - it will be used by screen readers.
|
|
402
|
+
*
|
|
403
|
+
* Defaults to **null**.
|
|
404
|
+
*/
|
|
405
|
+
label: i.oneOfType([i.string, i.node]),
|
|
406
|
+
/**
|
|
407
|
+
* Fired when checkbox value is changed
|
|
408
|
+
*
|
|
409
|
+
* Defaults to **null**.
|
|
410
|
+
*/
|
|
411
|
+
onChange: i.func,
|
|
412
|
+
/**
|
|
413
|
+
* Override the default (`primary`) color with the `secondary` color. Most commonly used when the control is placed on a darker surface.
|
|
414
|
+
*
|
|
415
|
+
* Defaults to **'primary'**.
|
|
416
|
+
*/
|
|
417
|
+
themeColor: i.oneOf(["primary", "secondary", "danger", "success"]),
|
|
418
|
+
/**
|
|
419
|
+
* Any additional value information to be included with the event.
|
|
420
|
+
*
|
|
421
|
+
* Defaults to **null**.
|
|
422
|
+
*/
|
|
423
|
+
value: i.oneOfType([i.string, i.number, i.bool, i.object])
|
|
424
|
+
}, ne = {
|
|
425
|
+
alignEnd: !1,
|
|
426
|
+
checked: null,
|
|
427
|
+
children: void 0,
|
|
428
|
+
className: void 0,
|
|
429
|
+
disabled: !1,
|
|
430
|
+
hideLabel: !1,
|
|
431
|
+
id: void 0,
|
|
432
|
+
indeterminate: !1,
|
|
433
|
+
label: null,
|
|
434
|
+
themeColor: "primary",
|
|
435
|
+
value: null
|
|
436
|
+
}, I = /* @__PURE__ */ G((s, n) => {
|
|
437
|
+
const {
|
|
438
|
+
alignEnd: e,
|
|
439
|
+
checked: t,
|
|
440
|
+
children: r,
|
|
441
|
+
className: a,
|
|
442
|
+
disabled: o,
|
|
443
|
+
hideLabel: d,
|
|
444
|
+
id: _,
|
|
445
|
+
indeterminate: E,
|
|
446
|
+
label: N,
|
|
447
|
+
onChange: C,
|
|
448
|
+
themeColor: m,
|
|
449
|
+
value: u,
|
|
450
|
+
...j
|
|
451
|
+
} = s, [v] = q(() => _ || X()), A = O(), h = O(), w = N || r;
|
|
452
|
+
W(n, () => A.current, []);
|
|
453
|
+
let D = !1, p = t;
|
|
454
|
+
const k = z((g) => {
|
|
455
|
+
const y = g.target.checked;
|
|
456
|
+
D && y === p || (D = !0, p = y, C?.(p, g, u));
|
|
457
|
+
}, [C]);
|
|
458
|
+
b(() => (h.current = new ee(A.current), () => {
|
|
459
|
+
h.current.destroy();
|
|
460
|
+
}), []), b(() => {
|
|
461
|
+
h.current.checked !== t && (h.current.checked = t);
|
|
462
|
+
}, [t]), b(() => {
|
|
463
|
+
E && t === null ? h.current.indeterminate = !0 : h.current.indeterminate = !1;
|
|
464
|
+
}, [t, E]);
|
|
465
|
+
const R = {};
|
|
466
|
+
return u != null && (R.value = u), /* @__PURE__ */ l.createElement(B, {
|
|
467
|
+
alignEnd: e,
|
|
468
|
+
input: h,
|
|
469
|
+
className: "lmnt mdc-touch-target-wrapper"
|
|
470
|
+
}, /* @__PURE__ */ l.createElement("div", {
|
|
471
|
+
// onClick={handleChange}
|
|
472
|
+
ref: A,
|
|
473
|
+
className: M("lmnt mdc-checkbox lmnt-checkbox mdc-checkbox--touch", o && "mdc-checkbox--disabled", m && `lmnt-checkbox--${m}`, a)
|
|
474
|
+
}, /* @__PURE__ */ l.createElement("input", F({
|
|
475
|
+
id: v,
|
|
476
|
+
disabled: o,
|
|
477
|
+
type: "checkbox",
|
|
478
|
+
className: "mdc-checkbox__native-control",
|
|
479
|
+
onChange: k,
|
|
480
|
+
onClick: k,
|
|
481
|
+
defaultChecked: t
|
|
482
|
+
}, R, j)), /* @__PURE__ */ l.createElement("div", {
|
|
483
|
+
className: "mdc-checkbox__background"
|
|
484
|
+
}, /* @__PURE__ */ l.createElement("svg", {
|
|
485
|
+
className: "mdc-checkbox__checkmark",
|
|
486
|
+
viewBox: "0 0 24 24"
|
|
487
|
+
}, /* @__PURE__ */ l.createElement("path", {
|
|
488
|
+
className: "mdc-checkbox__checkmark-path",
|
|
489
|
+
fill: "none",
|
|
490
|
+
stroke: "white",
|
|
491
|
+
d: "M1.73,12.91 8.1,19.28 22.79,4.59"
|
|
492
|
+
})), /* @__PURE__ */ l.createElement("div", {
|
|
493
|
+
className: "mdc-checkbox__mixedmark"
|
|
494
|
+
})), /* @__PURE__ */ l.createElement("div", {
|
|
495
|
+
className: "mdc-checkbox__ripple"
|
|
496
|
+
})), /* @__PURE__ */ l.createElement(V, {
|
|
497
|
+
hideLabel: d,
|
|
498
|
+
targetId: v,
|
|
499
|
+
className: M(o && "lmnt-theme-on-surface-disabled"),
|
|
500
|
+
disabled: o
|
|
501
|
+
}, w));
|
|
502
|
+
});
|
|
503
|
+
I.displayName = "Checkbox";
|
|
504
|
+
I.propTypes = te;
|
|
505
|
+
I.defaultProps = ne;
|
|
506
|
+
export {
|
|
507
|
+
I as C,
|
|
508
|
+
ee as M
|
|
509
|
+
};
|