@tamagui/checkbox-headless 2.0.0-rc.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BubbleInput.cjs +47 -41
- package/dist/cjs/BubbleInput.native.js +74 -69
- package/dist/cjs/BubbleInput.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +7 -5
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/useCheckbox.cjs +58 -52
- package/dist/cjs/useCheckbox.native.js +65 -59
- package/dist/cjs/useCheckbox.native.js.map +1 -1
- package/dist/cjs/utils.cjs +12 -10
- package/dist/cjs/utils.native.js +12 -10
- package/dist/cjs/utils.native.js.map +1 -1
- package/dist/esm/BubbleInput.mjs +19 -15
- package/dist/esm/BubbleInput.mjs.map +1 -1
- package/dist/esm/BubbleInput.native.js +19 -16
- package/dist/esm/BubbleInput.native.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/useCheckbox.mjs +26 -22
- package/dist/esm/useCheckbox.mjs.map +1 -1
- package/dist/esm/useCheckbox.native.js +33 -29
- package/dist/esm/useCheckbox.native.js.map +1 -1
- package/dist/jsx/BubbleInput.mjs +19 -15
- package/dist/jsx/BubbleInput.mjs.map +1 -1
- package/dist/jsx/BubbleInput.native.js +74 -69
- package/dist/jsx/BubbleInput.native.js.map +1 -1
- package/dist/jsx/index.js +2 -2
- package/dist/jsx/index.js.map +1 -6
- package/dist/jsx/index.native.js +7 -5
- package/dist/jsx/useCheckbox.mjs +26 -22
- package/dist/jsx/useCheckbox.mjs.map +1 -1
- package/dist/jsx/useCheckbox.native.js +65 -59
- package/dist/jsx/useCheckbox.native.js.map +1 -1
- package/dist/jsx/utils.native.js +12 -10
- package/package.json +16 -20
- package/dist/cjs/BubbleInput.js +0 -65
- package/dist/cjs/BubbleInput.js.map +0 -6
- package/dist/cjs/index.js +0 -16
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/useCheckbox.js +0 -81
- package/dist/cjs/useCheckbox.js.map +0 -6
- package/dist/cjs/utils.js +0 -27
- package/dist/cjs/utils.js.map +0 -6
- package/dist/esm/BubbleInput.js +0 -44
- package/dist/esm/BubbleInput.js.map +0 -6
- package/dist/esm/useCheckbox.js +0 -64
- package/dist/esm/useCheckbox.js.map +0 -6
- package/dist/esm/utils.js +0 -11
- package/dist/esm/utils.js.map +0 -6
- package/dist/jsx/BubbleInput.js +0 -44
- package/dist/jsx/BubbleInput.js.map +0 -6
- package/dist/jsx/useCheckbox.js +0 -64
- package/dist/jsx/useCheckbox.js.map +0 -6
- package/dist/jsx/utils.js +0 -11
- package/dist/jsx/utils.js.map +0 -6
package/dist/cjs/BubbleInput.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var BubbleInput_exports = {};
|
|
24
|
-
__export(BubbleInput_exports, {
|
|
25
|
-
BubbleInput: () => BubbleInput
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(BubbleInput_exports);
|
|
28
|
-
var import_use_previous = require("@tamagui/use-previous"), React = __toESM(require("react"), 1), import_utils = require("./utils"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
-
const BubbleInput = (props) => {
|
|
30
|
-
const { checked, bubbles = !0, control, isHidden, ...inputProps } = props, ref = React.useRef(null), prevChecked = (0, import_use_previous.usePrevious)(checked);
|
|
31
|
-
return React.useEffect(() => {
|
|
32
|
-
const input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(
|
|
33
|
-
inputProto,
|
|
34
|
-
"checked"
|
|
35
|
-
).set;
|
|
36
|
-
if (prevChecked !== checked && setChecked) {
|
|
37
|
-
const event = new Event("click", { bubbles });
|
|
38
|
-
input.indeterminate = (0, import_utils.isIndeterminate)(checked), setChecked.call(input, (0, import_utils.isIndeterminate)(checked) ? !1 : checked), input.dispatchEvent(event);
|
|
39
|
-
}
|
|
40
|
-
}, [prevChecked, checked, bubbles]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
-
"input",
|
|
42
|
-
{
|
|
43
|
-
type: "checkbox",
|
|
44
|
-
defaultChecked: (0, import_utils.isIndeterminate)(checked) ? !1 : checked,
|
|
45
|
-
...inputProps,
|
|
46
|
-
tabIndex: -1,
|
|
47
|
-
ref,
|
|
48
|
-
"aria-hidden": isHidden,
|
|
49
|
-
style: {
|
|
50
|
-
...isHidden ? {
|
|
51
|
-
// ...controlSize,
|
|
52
|
-
position: "absolute",
|
|
53
|
-
pointerEvents: "none",
|
|
54
|
-
opacity: 0,
|
|
55
|
-
margin: 0
|
|
56
|
-
} : {
|
|
57
|
-
appearance: "auto",
|
|
58
|
-
accentColor: "var(--color6)"
|
|
59
|
-
},
|
|
60
|
-
...props.style
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=BubbleInput.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/BubbleInput.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4B,kCAC5B,QAAuB,8BAGvB,eAAgC,oBAkC5B;AAxBG,MAAM,cAAc,CAAC,UAA4B;AACtD,QAAM,EAAE,SAAS,UAAU,IAAM,SAAS,UAAU,GAAG,WAAW,IAAI,OAChE,MAAM,MAAM,OAAyB,IAAI,GACzC,kBAAc,iCAAY,OAAO;AAGvC,eAAM,UAAU,MAAM;AACpB,UAAM,QAAQ,IAAI,SACZ,aAAa,OAAO,iBAAiB,WAKrC,aAJa,OAAO;AAAA,MACxB;AAAA,MACA;AAAA,IACF,EAC8B;AAE9B,QAAI,gBAAgB,WAAW,YAAY;AACzC,YAAM,QAAQ,IAAI,MAAM,SAAS,EAAE,QAAQ,CAAC;AAC5C,YAAM,oBAAgB,8BAAgB,OAAO,GAC7C,WAAW,KAAK,WAAO,8BAAgB,OAAO,IAAI,KAAQ,OAAO,GACjE,MAAM,cAAc,KAAK;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,aAAa,SAAS,OAAO,CAAC,GAGhC;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,oBAAgB,8BAAgB,OAAO,IAAI,KAAQ;AAAA,MAClD,GAAG;AAAA,MACJ,UAAU;AAAA,MACV;AAAA,MACA,eAAa;AAAA,MACb,OAAO;AAAA,QACL,GAAI,WACA;AAAA;AAAA,UAEE,UAAU;AAAA,UACV,eAAe;AAAA,UACf,SAAS;AAAA,UACT,QAAQ;AAAA,QACV,IACA;AAAA,UACE,YAAY;AAAA,UACZ,aAAa;AAAA,QACf;AAAA,QAEJ,GAAG,MAAM;AAAA,MACX;AAAA;AAAA,EACF;AAEJ;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
-
return to;
|
|
10
|
-
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
11
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
-
var index_exports = {};
|
|
13
|
-
module.exports = __toCommonJS(index_exports);
|
|
14
|
-
__reExport(index_exports, require("./useCheckbox"), module.exports);
|
|
15
|
-
__reExport(index_exports, require("./utils"), module.exports);
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
package/dist/cjs/useCheckbox.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var useCheckbox_exports = {};
|
|
24
|
-
__export(useCheckbox_exports, {
|
|
25
|
-
useCheckbox: () => useCheckbox
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(useCheckbox_exports);
|
|
28
|
-
var import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_helpers = require("@tamagui/helpers"), import_label = require("@tamagui/label"), import_react = __toESM(require("react"), 1), import_BubbleInput = require("./BubbleInput"), import_utils = require("./utils"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
-
function useCheckbox(props, [checked, setChecked], ref) {
|
|
30
|
-
const {
|
|
31
|
-
labelledBy: ariaLabelledby,
|
|
32
|
-
name,
|
|
33
|
-
required,
|
|
34
|
-
disabled,
|
|
35
|
-
value = "on",
|
|
36
|
-
onCheckedChange,
|
|
37
|
-
...checkboxProps
|
|
38
|
-
} = props, [button, setButton] = import_react.default.useState(null), composedRefs = (0, import_compose_refs.useComposedRefs)(ref, setButton), hasConsumerStoppedPropagationRef = import_react.default.useRef(!1), isFormControl = import_constants.isWeb ? button ? !!button.closest("form") : !0 : !1, labelId = (0, import_label.useLabelContext)(button), labelledBy = ariaLabelledby || labelId, parentKeyDown = props.onKeyDown, handleKeyDown = (0, import_react.useMemo)(
|
|
39
|
-
() => (0, import_helpers.composeEventHandlers)(parentKeyDown, (event) => {
|
|
40
|
-
event.key === "Enter" && event.preventDefault();
|
|
41
|
-
}),
|
|
42
|
-
[parentKeyDown]
|
|
43
|
-
), handlePress = (0, import_react.useMemo)(
|
|
44
|
-
() => (0, import_helpers.composeEventHandlers)(props.onPress, (event) => {
|
|
45
|
-
setChecked((prevChecked) => (0, import_utils.isIndeterminate)(prevChecked) ? !0 : !prevChecked), isFormControl && "isPropagationStopped" in event && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
46
|
-
}),
|
|
47
|
-
[isFormControl]
|
|
48
|
-
);
|
|
49
|
-
return {
|
|
50
|
-
bubbleInput: import_constants.isWeb && isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
-
import_BubbleInput.BubbleInput,
|
|
52
|
-
{
|
|
53
|
-
isHidden: !0,
|
|
54
|
-
control: button,
|
|
55
|
-
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
56
|
-
name,
|
|
57
|
-
value,
|
|
58
|
-
checked,
|
|
59
|
-
required,
|
|
60
|
-
disabled
|
|
61
|
-
}
|
|
62
|
-
) : null,
|
|
63
|
-
checkboxRef: composedRefs,
|
|
64
|
-
checkboxProps: {
|
|
65
|
-
role: "checkbox",
|
|
66
|
-
"aria-labelledby": labelledBy,
|
|
67
|
-
"aria-checked": (0, import_utils.isIndeterminate)(checked) ? "mixed" : checked,
|
|
68
|
-
...checkboxProps,
|
|
69
|
-
...import_constants.isWeb && {
|
|
70
|
-
type: "button",
|
|
71
|
-
value,
|
|
72
|
-
"data-state": (0, import_utils.getState)(checked),
|
|
73
|
-
"data-disabled": disabled ? "" : void 0,
|
|
74
|
-
disabled,
|
|
75
|
-
onKeyDown: disabled ? void 0 : handleKeyDown
|
|
76
|
-
},
|
|
77
|
-
onPress: disabled ? void 0 : handlePress
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=useCheckbox.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/useCheckbox.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgC,kCAChC,mBAAsB,+BAEtB,iBAAqC,6BACrC,eAAgC,2BAChC,eAA+B,8BAG/B,qBAA4B,0BAC5B,eAA0C,oBAiFlC;AAvDD,SAAS,YACd,OACA,CAAC,SAAS,UAAU,GAIpB,KACA;AACA,QAAM;AAAA,IACJ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA,GAAG;AAAA,EACL,IAAI,OACE,CAAC,QAAQ,SAAS,IAAI,aAAAA,QAAM,SAAmC,IAAI,GACnE,mBAAe,qCAAgB,KAAK,SAAgB,GACpD,mCAAmC,aAAAA,QAAM,OAAO,EAAK,GAErD,gBAAgB,yBAAS,SAAS,EAAQ,OAAO,QAAQ,MAAM,IAAK,KAAQ,IAE5E,cAAU,8BAAgB,MAAM,GAChC,aAAa,kBAAkB,SAE/B,gBAAiB,MAA6C,WAE9D,oBAAgB;AAAA,IACpB,UACE,qCAAqB,eAAe,CAAC,UAAU;AAE7C,MAAI,MAAM,QAAQ,WAAS,MAAM,eAAe;AAAA,IAClD,CAAC;AAAA,IACH,CAAC,aAAa;AAAA,EAChB,GAEM,kBAAc;AAAA,IAClB,UACE,qCAAqB,MAAM,SAAgB,CAAC,UAAgC;AAC1E,iBAAW,CAAC,oBAAiB,8BAAgB,WAAW,IAAI,KAAO,CAAC,WAAY,GAC5E,iBAAiB,0BAA0B,UAC7C,iCAAiC,UAAU,MAAM,qBAAqB,GAIjE,iCAAiC,WAAS,MAAM,gBAAgB;AAAA,IAEzE,CAAC;AAAA,IACH,CAAC,aAAa;AAAA,EAChB;AAEA,SAAO;AAAA,IACL,aACE,0BAAS,gBACP;AAAA,MAAC;AAAA;AAAA,QACC,UAAQ;AAAA,QACR,SAAS;AAAA,QACT,SAAS,CAAC,iCAAiC;AAAA,QAC3C;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF,IACE;AAAA,IACN,aAAa;AAAA,IACb,eAAe;AAAA,MACb,MAAM;AAAA,MACN,mBAAmB;AAAA,MACnB,oBAAgB,8BAAgB,OAAO,IAAI,UAAU;AAAA,MACrD,GAAG;AAAA,MACH,GAAI,0BAAS;AAAA,QACX,MAAM;AAAA,QACN;AAAA,QACA,kBAAc,uBAAS,OAAO;AAAA,QAC9B,iBAAiB,WAAW,KAAK;AAAA,QACjC;AAAA,QACA,WAAW,WAAW,SAAY;AAAA,MACpC;AAAA,MACA,SAAS,WAAW,SAAY;AAAA,IAClC;AAAA,EACF;AACF;",
|
|
5
|
-
"names": ["React"]
|
|
6
|
-
}
|
package/dist/cjs/utils.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var utils_exports = {};
|
|
16
|
-
__export(utils_exports, {
|
|
17
|
-
getState: () => getState,
|
|
18
|
-
isIndeterminate: () => isIndeterminate
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(utils_exports);
|
|
21
|
-
function isIndeterminate(checked) {
|
|
22
|
-
return checked === "indeterminate";
|
|
23
|
-
}
|
|
24
|
-
function getState(checked) {
|
|
25
|
-
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/cjs/utils.js.map
DELETED
package/dist/esm/BubbleInput.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { usePrevious } from "@tamagui/use-previous";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { isIndeterminate } from "./utils";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
const BubbleInput = (props) => {
|
|
6
|
-
const { checked, bubbles = !0, control, isHidden, ...inputProps } = props, ref = React.useRef(null), prevChecked = usePrevious(checked);
|
|
7
|
-
return React.useEffect(() => {
|
|
8
|
-
const input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(
|
|
9
|
-
inputProto,
|
|
10
|
-
"checked"
|
|
11
|
-
).set;
|
|
12
|
-
if (prevChecked !== checked && setChecked) {
|
|
13
|
-
const event = new Event("click", { bubbles });
|
|
14
|
-
input.indeterminate = isIndeterminate(checked), setChecked.call(input, isIndeterminate(checked) ? !1 : checked), input.dispatchEvent(event);
|
|
15
|
-
}
|
|
16
|
-
}, [prevChecked, checked, bubbles]), /* @__PURE__ */ jsx(
|
|
17
|
-
"input",
|
|
18
|
-
{
|
|
19
|
-
type: "checkbox",
|
|
20
|
-
defaultChecked: isIndeterminate(checked) ? !1 : checked,
|
|
21
|
-
...inputProps,
|
|
22
|
-
tabIndex: -1,
|
|
23
|
-
ref,
|
|
24
|
-
"aria-hidden": isHidden,
|
|
25
|
-
style: {
|
|
26
|
-
...isHidden ? {
|
|
27
|
-
// ...controlSize,
|
|
28
|
-
position: "absolute",
|
|
29
|
-
pointerEvents: "none",
|
|
30
|
-
opacity: 0,
|
|
31
|
-
margin: 0
|
|
32
|
-
} : {
|
|
33
|
-
appearance: "auto",
|
|
34
|
-
accentColor: "var(--color6)"
|
|
35
|
-
},
|
|
36
|
-
...props.style
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
BubbleInput
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=BubbleInput.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/BubbleInput.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,mBAAmB;AAC5B,YAAY,WAAW;AAGvB,SAAS,uBAAuB;AAkC5B;AAxBG,MAAM,cAAc,CAAC,UAA4B;AACtD,QAAM,EAAE,SAAS,UAAU,IAAM,SAAS,UAAU,GAAG,WAAW,IAAI,OAChE,MAAM,MAAM,OAAyB,IAAI,GACzC,cAAc,YAAY,OAAO;AAGvC,eAAM,UAAU,MAAM;AACpB,UAAM,QAAQ,IAAI,SACZ,aAAa,OAAO,iBAAiB,WAKrC,aAJa,OAAO;AAAA,MACxB;AAAA,MACA;AAAA,IACF,EAC8B;AAE9B,QAAI,gBAAgB,WAAW,YAAY;AACzC,YAAM,QAAQ,IAAI,MAAM,SAAS,EAAE,QAAQ,CAAC;AAC5C,YAAM,gBAAgB,gBAAgB,OAAO,GAC7C,WAAW,KAAK,OAAO,gBAAgB,OAAO,IAAI,KAAQ,OAAO,GACjE,MAAM,cAAc,KAAK;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,aAAa,SAAS,OAAO,CAAC,GAGhC;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,gBAAgB,gBAAgB,OAAO,IAAI,KAAQ;AAAA,MAClD,GAAG;AAAA,MACJ,UAAU;AAAA,MACV;AAAA,MACA,eAAa;AAAA,MACb,OAAO;AAAA,QACL,GAAI,WACA;AAAA;AAAA,UAEE,UAAU;AAAA,UACV,eAAe;AAAA,UACf,SAAS;AAAA,UACT,QAAQ;AAAA,QACV,IACA;AAAA,UACE,YAAY;AAAA,UACZ,aAAa;AAAA,QACf;AAAA,QAEJ,GAAG,MAAM;AAAA,MACX;AAAA;AAAA,EACF;AAEJ;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/esm/useCheckbox.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
2
|
-
import { isWeb } from "@tamagui/constants";
|
|
3
|
-
import { composeEventHandlers } from "@tamagui/helpers";
|
|
4
|
-
import { useLabelContext } from "@tamagui/label";
|
|
5
|
-
import React, { useMemo } from "react";
|
|
6
|
-
import { BubbleInput } from "./BubbleInput";
|
|
7
|
-
import { getState, isIndeterminate } from "./utils";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
function useCheckbox(props, [checked, setChecked], ref) {
|
|
10
|
-
const {
|
|
11
|
-
labelledBy: ariaLabelledby,
|
|
12
|
-
name,
|
|
13
|
-
required,
|
|
14
|
-
disabled,
|
|
15
|
-
value = "on",
|
|
16
|
-
onCheckedChange,
|
|
17
|
-
...checkboxProps
|
|
18
|
-
} = props, [button, setButton] = React.useState(null), composedRefs = useComposedRefs(ref, setButton), hasConsumerStoppedPropagationRef = React.useRef(!1), isFormControl = isWeb ? button ? !!button.closest("form") : !0 : !1, labelId = useLabelContext(button), labelledBy = ariaLabelledby || labelId, parentKeyDown = props.onKeyDown, handleKeyDown = useMemo(
|
|
19
|
-
() => composeEventHandlers(parentKeyDown, (event) => {
|
|
20
|
-
event.key === "Enter" && event.preventDefault();
|
|
21
|
-
}),
|
|
22
|
-
[parentKeyDown]
|
|
23
|
-
), handlePress = useMemo(
|
|
24
|
-
() => composeEventHandlers(props.onPress, (event) => {
|
|
25
|
-
setChecked((prevChecked) => isIndeterminate(prevChecked) ? !0 : !prevChecked), isFormControl && "isPropagationStopped" in event && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
26
|
-
}),
|
|
27
|
-
[isFormControl]
|
|
28
|
-
);
|
|
29
|
-
return {
|
|
30
|
-
bubbleInput: isWeb && isFormControl ? /* @__PURE__ */ jsx(
|
|
31
|
-
BubbleInput,
|
|
32
|
-
{
|
|
33
|
-
isHidden: !0,
|
|
34
|
-
control: button,
|
|
35
|
-
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
36
|
-
name,
|
|
37
|
-
value,
|
|
38
|
-
checked,
|
|
39
|
-
required,
|
|
40
|
-
disabled
|
|
41
|
-
}
|
|
42
|
-
) : null,
|
|
43
|
-
checkboxRef: composedRefs,
|
|
44
|
-
checkboxProps: {
|
|
45
|
-
role: "checkbox",
|
|
46
|
-
"aria-labelledby": labelledBy,
|
|
47
|
-
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
48
|
-
...checkboxProps,
|
|
49
|
-
...isWeb && {
|
|
50
|
-
type: "button",
|
|
51
|
-
value,
|
|
52
|
-
"data-state": getState(checked),
|
|
53
|
-
"data-disabled": disabled ? "" : void 0,
|
|
54
|
-
disabled,
|
|
55
|
-
onKeyDown: disabled ? void 0 : handleKeyDown
|
|
56
|
-
},
|
|
57
|
-
onPress: disabled ? void 0 : handlePress
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export {
|
|
62
|
-
useCheckbox
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=useCheckbox.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/useCheckbox.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,uBAAuB;AAChC,SAAS,aAAa;AAEtB,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,OAAO,SAAS,eAAe;AAG/B,SAAS,mBAAmB;AAC5B,SAAS,UAAU,uBAAuB;AAiFlC;AAvDD,SAAS,YACd,OACA,CAAC,SAAS,UAAU,GAIpB,KACA;AACA,QAAM;AAAA,IACJ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA,GAAG;AAAA,EACL,IAAI,OACE,CAAC,QAAQ,SAAS,IAAI,MAAM,SAAmC,IAAI,GACnE,eAAe,gBAAgB,KAAK,SAAgB,GACpD,mCAAmC,MAAM,OAAO,EAAK,GAErD,gBAAgB,QAAS,SAAS,EAAQ,OAAO,QAAQ,MAAM,IAAK,KAAQ,IAE5E,UAAU,gBAAgB,MAAM,GAChC,aAAa,kBAAkB,SAE/B,gBAAiB,MAA6C,WAE9D,gBAAgB;AAAA,IACpB,MACE,qBAAqB,eAAe,CAAC,UAAU;AAE7C,MAAI,MAAM,QAAQ,WAAS,MAAM,eAAe;AAAA,IAClD,CAAC;AAAA,IACH,CAAC,aAAa;AAAA,EAChB,GAEM,cAAc;AAAA,IAClB,MACE,qBAAqB,MAAM,SAAgB,CAAC,UAAgC;AAC1E,iBAAW,CAAC,gBAAiB,gBAAgB,WAAW,IAAI,KAAO,CAAC,WAAY,GAC5E,iBAAiB,0BAA0B,UAC7C,iCAAiC,UAAU,MAAM,qBAAqB,GAIjE,iCAAiC,WAAS,MAAM,gBAAgB;AAAA,IAEzE,CAAC;AAAA,IACH,CAAC,aAAa;AAAA,EAChB;AAEA,SAAO;AAAA,IACL,aACE,SAAS,gBACP;AAAA,MAAC;AAAA;AAAA,QACC,UAAQ;AAAA,QACR,SAAS;AAAA,QACT,SAAS,CAAC,iCAAiC;AAAA,QAC3C;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF,IACE;AAAA,IACN,aAAa;AAAA,IACb,eAAe;AAAA,MACb,MAAM;AAAA,MACN,mBAAmB;AAAA,MACnB,gBAAgB,gBAAgB,OAAO,IAAI,UAAU;AAAA,MACrD,GAAG;AAAA,MACH,GAAI,SAAS;AAAA,QACX,MAAM;AAAA,QACN;AAAA,QACA,cAAc,SAAS,OAAO;AAAA,QAC9B,iBAAiB,WAAW,KAAK;AAAA,QACjC;AAAA,QACA,WAAW,WAAW,SAAY;AAAA,MACpC;AAAA,MACA,SAAS,WAAW,SAAY;AAAA,IAClC;AAAA,EACF;AACF;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/esm/utils.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function isIndeterminate(checked) {
|
|
2
|
-
return checked === "indeterminate";
|
|
3
|
-
}
|
|
4
|
-
function getState(checked) {
|
|
5
|
-
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
getState,
|
|
9
|
-
isIndeterminate
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/esm/utils.js.map
DELETED
package/dist/jsx/BubbleInput.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { usePrevious } from "@tamagui/use-previous";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { isIndeterminate } from "./utils";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
const BubbleInput = (props) => {
|
|
6
|
-
const { checked, bubbles = !0, control, isHidden, ...inputProps } = props, ref = React.useRef(null), prevChecked = usePrevious(checked);
|
|
7
|
-
return React.useEffect(() => {
|
|
8
|
-
const input = ref.current, inputProto = window.HTMLInputElement.prototype, setChecked = Object.getOwnPropertyDescriptor(
|
|
9
|
-
inputProto,
|
|
10
|
-
"checked"
|
|
11
|
-
).set;
|
|
12
|
-
if (prevChecked !== checked && setChecked) {
|
|
13
|
-
const event = new Event("click", { bubbles });
|
|
14
|
-
input.indeterminate = isIndeterminate(checked), setChecked.call(input, isIndeterminate(checked) ? !1 : checked), input.dispatchEvent(event);
|
|
15
|
-
}
|
|
16
|
-
}, [prevChecked, checked, bubbles]), /* @__PURE__ */ jsx(
|
|
17
|
-
"input",
|
|
18
|
-
{
|
|
19
|
-
type: "checkbox",
|
|
20
|
-
defaultChecked: isIndeterminate(checked) ? !1 : checked,
|
|
21
|
-
...inputProps,
|
|
22
|
-
tabIndex: -1,
|
|
23
|
-
ref,
|
|
24
|
-
"aria-hidden": isHidden,
|
|
25
|
-
style: {
|
|
26
|
-
...isHidden ? {
|
|
27
|
-
// ...controlSize,
|
|
28
|
-
position: "absolute",
|
|
29
|
-
pointerEvents: "none",
|
|
30
|
-
opacity: 0,
|
|
31
|
-
margin: 0
|
|
32
|
-
} : {
|
|
33
|
-
appearance: "auto",
|
|
34
|
-
accentColor: "var(--color6)"
|
|
35
|
-
},
|
|
36
|
-
...props.style
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
BubbleInput
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=BubbleInput.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/BubbleInput.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,mBAAmB;AAC5B,YAAY,WAAW;AAGvB,SAAS,uBAAuB;AAkC5B;AAxBG,MAAM,cAAc,CAAC,UAA4B;AACtD,QAAM,EAAE,SAAS,UAAU,IAAM,SAAS,UAAU,GAAG,WAAW,IAAI,OAChE,MAAM,MAAM,OAAyB,IAAI,GACzC,cAAc,YAAY,OAAO;AAGvC,eAAM,UAAU,MAAM;AACpB,UAAM,QAAQ,IAAI,SACZ,aAAa,OAAO,iBAAiB,WAKrC,aAJa,OAAO;AAAA,MACxB;AAAA,MACA;AAAA,IACF,EAC8B;AAE9B,QAAI,gBAAgB,WAAW,YAAY;AACzC,YAAM,QAAQ,IAAI,MAAM,SAAS,EAAE,QAAQ,CAAC;AAC5C,YAAM,gBAAgB,gBAAgB,OAAO,GAC7C,WAAW,KAAK,OAAO,gBAAgB,OAAO,IAAI,KAAQ,OAAO,GACjE,MAAM,cAAc,KAAK;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,aAAa,SAAS,OAAO,CAAC,GAGhC;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,gBAAgB,gBAAgB,OAAO,IAAI,KAAQ;AAAA,MAClD,GAAG;AAAA,MACJ,UAAU;AAAA,MACV;AAAA,MACA,eAAa;AAAA,MACb,OAAO;AAAA,QACL,GAAI,WACA;AAAA;AAAA,UAEE,UAAU;AAAA,UACV,eAAe;AAAA,UACf,SAAS;AAAA,UACT,QAAQ;AAAA,QACV,IACA;AAAA,UACE,YAAY;AAAA,UACZ,aAAa;AAAA,QACf;AAAA,QAEJ,GAAG,MAAM;AAAA,MACX;AAAA;AAAA,EACF;AAEJ;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/jsx/useCheckbox.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
2
|
-
import { isWeb } from "@tamagui/constants";
|
|
3
|
-
import { composeEventHandlers } from "@tamagui/helpers";
|
|
4
|
-
import { useLabelContext } from "@tamagui/label";
|
|
5
|
-
import React, { useMemo } from "react";
|
|
6
|
-
import { BubbleInput } from "./BubbleInput";
|
|
7
|
-
import { getState, isIndeterminate } from "./utils";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
function useCheckbox(props, [checked, setChecked], ref) {
|
|
10
|
-
const {
|
|
11
|
-
labelledBy: ariaLabelledby,
|
|
12
|
-
name,
|
|
13
|
-
required,
|
|
14
|
-
disabled,
|
|
15
|
-
value = "on",
|
|
16
|
-
onCheckedChange,
|
|
17
|
-
...checkboxProps
|
|
18
|
-
} = props, [button, setButton] = React.useState(null), composedRefs = useComposedRefs(ref, setButton), hasConsumerStoppedPropagationRef = React.useRef(!1), isFormControl = isWeb ? button ? !!button.closest("form") : !0 : !1, labelId = useLabelContext(button), labelledBy = ariaLabelledby || labelId, parentKeyDown = props.onKeyDown, handleKeyDown = useMemo(
|
|
19
|
-
() => composeEventHandlers(parentKeyDown, (event) => {
|
|
20
|
-
event.key === "Enter" && event.preventDefault();
|
|
21
|
-
}),
|
|
22
|
-
[parentKeyDown]
|
|
23
|
-
), handlePress = useMemo(
|
|
24
|
-
() => composeEventHandlers(props.onPress, (event) => {
|
|
25
|
-
setChecked((prevChecked) => isIndeterminate(prevChecked) ? !0 : !prevChecked), isFormControl && "isPropagationStopped" in event && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
26
|
-
}),
|
|
27
|
-
[isFormControl]
|
|
28
|
-
);
|
|
29
|
-
return {
|
|
30
|
-
bubbleInput: isWeb && isFormControl ? /* @__PURE__ */ jsx(
|
|
31
|
-
BubbleInput,
|
|
32
|
-
{
|
|
33
|
-
isHidden: !0,
|
|
34
|
-
control: button,
|
|
35
|
-
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
36
|
-
name,
|
|
37
|
-
value,
|
|
38
|
-
checked,
|
|
39
|
-
required,
|
|
40
|
-
disabled
|
|
41
|
-
}
|
|
42
|
-
) : null,
|
|
43
|
-
checkboxRef: composedRefs,
|
|
44
|
-
checkboxProps: {
|
|
45
|
-
role: "checkbox",
|
|
46
|
-
"aria-labelledby": labelledBy,
|
|
47
|
-
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
48
|
-
...checkboxProps,
|
|
49
|
-
...isWeb && {
|
|
50
|
-
type: "button",
|
|
51
|
-
value,
|
|
52
|
-
"data-state": getState(checked),
|
|
53
|
-
"data-disabled": disabled ? "" : void 0,
|
|
54
|
-
disabled,
|
|
55
|
-
onKeyDown: disabled ? void 0 : handleKeyDown
|
|
56
|
-
},
|
|
57
|
-
onPress: disabled ? void 0 : handlePress
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export {
|
|
62
|
-
useCheckbox
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=useCheckbox.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/useCheckbox.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,uBAAuB;AAChC,SAAS,aAAa;AAEtB,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,OAAO,SAAS,eAAe;AAG/B,SAAS,mBAAmB;AAC5B,SAAS,UAAU,uBAAuB;AAiFlC;AAvDD,SAAS,YACd,OACA,CAAC,SAAS,UAAU,GAIpB,KACA;AACA,QAAM;AAAA,IACJ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA,GAAG;AAAA,EACL,IAAI,OACE,CAAC,QAAQ,SAAS,IAAI,MAAM,SAAmC,IAAI,GACnE,eAAe,gBAAgB,KAAK,SAAgB,GACpD,mCAAmC,MAAM,OAAO,EAAK,GAErD,gBAAgB,QAAS,SAAS,EAAQ,OAAO,QAAQ,MAAM,IAAK,KAAQ,IAE5E,UAAU,gBAAgB,MAAM,GAChC,aAAa,kBAAkB,SAE/B,gBAAiB,MAA6C,WAE9D,gBAAgB;AAAA,IACpB,MACE,qBAAqB,eAAe,CAAC,UAAU;AAE7C,MAAI,MAAM,QAAQ,WAAS,MAAM,eAAe;AAAA,IAClD,CAAC;AAAA,IACH,CAAC,aAAa;AAAA,EAChB,GAEM,cAAc;AAAA,IAClB,MACE,qBAAqB,MAAM,SAAgB,CAAC,UAAgC;AAC1E,iBAAW,CAAC,gBAAiB,gBAAgB,WAAW,IAAI,KAAO,CAAC,WAAY,GAC5E,iBAAiB,0BAA0B,UAC7C,iCAAiC,UAAU,MAAM,qBAAqB,GAIjE,iCAAiC,WAAS,MAAM,gBAAgB;AAAA,IAEzE,CAAC;AAAA,IACH,CAAC,aAAa;AAAA,EAChB;AAEA,SAAO;AAAA,IACL,aACE,SAAS,gBACP;AAAA,MAAC;AAAA;AAAA,QACC,UAAQ;AAAA,QACR,SAAS;AAAA,QACT,SAAS,CAAC,iCAAiC;AAAA,QAC3C;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF,IACE;AAAA,IACN,aAAa;AAAA,IACb,eAAe;AAAA,MACb,MAAM;AAAA,MACN,mBAAmB;AAAA,MACnB,gBAAgB,gBAAgB,OAAO,IAAI,UAAU;AAAA,MACrD,GAAG;AAAA,MACH,GAAI,SAAS;AAAA,QACX,MAAM;AAAA,QACN;AAAA,QACA,cAAc,SAAS,OAAO;AAAA,QAC9B,iBAAiB,WAAW,KAAK;AAAA,QACjC;AAAA,QACA,WAAW,WAAW,SAAY;AAAA,MACpC;AAAA,MACA,SAAS,WAAW,SAAY;AAAA,IAClC;AAAA,EACF;AACF;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/jsx/utils.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function isIndeterminate(checked) {
|
|
2
|
-
return checked === "indeterminate";
|
|
3
|
-
}
|
|
4
|
-
function getState(checked) {
|
|
5
|
-
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
getState,
|
|
9
|
-
isIndeterminate
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=utils.js.map
|