@tamagui/checkbox 2.7.7 → 3.0.0-beta.637.1
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/Checkbox.cjs +105 -101
- package/dist/cjs/Checkbox.native.cjs +137 -0
- package/dist/cjs/Checkbox.native.js +120 -100
- package/dist/cjs/Checkbox.native.js.map +1 -1
- package/dist/cjs/CheckboxStyledContext.cjs +18 -23
- package/dist/cjs/CheckboxStyledContext.native.cjs +32 -0
- package/dist/cjs/CheckboxStyledContext.native.js +18 -22
- package/dist/cjs/CheckboxStyledContext.native.js.map +1 -1
- package/dist/cjs/index.cjs +9 -26
- package/dist/cjs/index.native.cjs +22 -0
- package/dist/cjs/index.native.js +10 -26
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/Checkbox.mjs +83 -87
- package/dist/esm/Checkbox.mjs.map +1 -1
- package/dist/esm/Checkbox.native.js +99 -87
- package/dist/esm/Checkbox.native.js.map +1 -1
- package/dist/esm/CheckboxStyledContext.mjs +5 -5
- package/dist/esm/CheckboxStyledContext.mjs.map +1 -1
- package/dist/esm/CheckboxStyledContext.native.js +5 -5
- package/dist/esm/CheckboxStyledContext.native.js.map +1 -1
- package/dist/esm/index.js +3 -11
- package/dist/esm/index.mjs +3 -11
- package/dist/esm/index.native.js +3 -11
- package/dist/jsx/Checkbox.mjs +83 -87
- package/dist/jsx/Checkbox.mjs.map +1 -1
- package/dist/jsx/Checkbox.native.cjs +137 -0
- package/dist/jsx/Checkbox.native.js +120 -100
- package/dist/jsx/Checkbox.native.js.map +1 -1
- package/dist/jsx/CheckboxStyledContext.mjs +5 -5
- package/dist/jsx/CheckboxStyledContext.mjs.map +1 -1
- package/dist/jsx/CheckboxStyledContext.native.cjs +32 -0
- package/dist/jsx/CheckboxStyledContext.native.js +18 -22
- package/dist/jsx/CheckboxStyledContext.native.js.map +1 -1
- package/dist/jsx/index.js +3 -11
- package/dist/jsx/index.mjs +3 -11
- package/dist/jsx/index.native.cjs +22 -0
- package/dist/jsx/index.native.js +10 -26
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +6 -16
- package/src/Checkbox.tsx +189 -81
- package/src/CheckboxStyledContext.tsx +2 -6
- package/src/index.ts +0 -9
- package/types/Checkbox.d.ts +446 -24
- package/types/Checkbox.d.ts.map +1 -1
- package/types/CheckboxStyledContext.d.ts +2 -4
- package/types/CheckboxStyledContext.d.ts.map +1 -1
- package/types/index.d.ts +0 -320
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/createCheckbox.cjs +0 -194
- package/dist/cjs/createCheckbox.native.js +0 -213
- package/dist/cjs/createCheckbox.native.js.map +0 -1
- package/dist/esm/createCheckbox.mjs +0 -150
- package/dist/esm/createCheckbox.mjs.map +0 -1
- package/dist/esm/createCheckbox.native.js +0 -167
- package/dist/esm/createCheckbox.native.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/jsx/createCheckbox.mjs +0 -150
- package/dist/jsx/createCheckbox.mjs.map +0 -1
- package/dist/jsx/createCheckbox.native.js +0 -213
- package/dist/jsx/createCheckbox.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
- package/src/createCheckbox.tsx +0 -280
- package/types/createCheckbox.d.ts +0 -196
- package/types/createCheckbox.d.ts.map +0 -1
package/dist/cjs/Checkbox.cjs
CHANGED
|
@@ -1,116 +1,120 @@
|
|
|
1
|
+
|
|
2
|
+
var __create = Object.create;
|
|
1
3
|
var __defProp = Object.defineProperty;
|
|
2
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
8
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
10
13
|
};
|
|
11
14
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
19
22
|
};
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
28
|
var Checkbox_exports = {};
|
|
24
29
|
__export(Checkbox_exports, {
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
Checkbox: () => Checkbox2,
|
|
31
|
+
CheckboxContext: () => CheckboxContext,
|
|
32
|
+
CheckboxFrame: () => CheckboxFrame,
|
|
33
|
+
CheckboxIndicatorFrame: () => CheckboxIndicatorFrame
|
|
27
34
|
});
|
|
28
35
|
module.exports = __toCommonJS(Checkbox_exports);
|
|
36
|
+
var import_checkbox_headless = require("@tamagui/checkbox-headless");
|
|
29
37
|
var import_core = require("@tamagui/core");
|
|
30
|
-
|
|
31
|
-
var
|
|
38
|
+
require("@tamagui/focusable");
|
|
39
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
40
|
+
var import_react = __toESM(require("react"), 1);
|
|
32
41
|
var import_CheckboxStyledContext = require("./CheckboxStyledContext.cjs");
|
|
33
|
-
|
|
34
|
-
const CheckboxIndicatorFrame = (0, import_core.styled)(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
+
const CheckboxIndicatorFrame = (0, import_core.styled)(import_core.View, {
|
|
44
|
+
displayName: "CheckboxIndicator",
|
|
45
|
+
context: import_CheckboxStyledContext.CheckboxStyledContext
|
|
46
|
+
}, { accept: { activeStyle: "style" } });
|
|
47
|
+
const CheckboxFrame = (0, import_core.styled)(import_core.View, {
|
|
48
|
+
displayName: "Checkbox",
|
|
49
|
+
render: "button",
|
|
50
|
+
context: import_CheckboxStyledContext.CheckboxStyledContext,
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
justifyContent: "center",
|
|
53
|
+
variants: { disabled: { true: {
|
|
54
|
+
pointerEvents: "none",
|
|
55
|
+
userSelect: "none"
|
|
56
|
+
} } }
|
|
57
|
+
}, { accept: { activeStyle: "style" } });
|
|
58
|
+
const CheckboxContext = import_react.default.createContext({
|
|
59
|
+
checked: false,
|
|
60
|
+
disabled: false
|
|
50
61
|
});
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
111
|
-
}
|
|
112
|
-
}, {
|
|
113
|
-
accept: {
|
|
114
|
-
activeStyle: "style"
|
|
115
|
-
}
|
|
116
|
-
});
|
|
62
|
+
const CheckboxComponent = (0, import_core.createStyledHOC)(CheckboxFrame, function Checkbox(_props, forwardedRef) {
|
|
63
|
+
const { checked: checkedProp, defaultChecked, onCheckedChange, native, activeStyle, activeTheme, ...props } = _props;
|
|
64
|
+
const propsActive = (0, import_core.useProps)(props);
|
|
65
|
+
const styledContext = import_react.default.useContext(import_CheckboxStyledContext.CheckboxStyledContext.context);
|
|
66
|
+
const [checked = false, setChecked] = (0, import_use_controllable_state.useControllableState)({
|
|
67
|
+
prop: checkedProp,
|
|
68
|
+
defaultProp: defaultChecked,
|
|
69
|
+
onChange: onCheckedChange
|
|
70
|
+
});
|
|
71
|
+
const { checkboxProps, checkboxRef, bubbleInput } = (0, import_checkbox_headless.useCheckbox)(propsActive, [checked, setChecked], forwardedRef);
|
|
72
|
+
if ((0, import_core.shouldRenderNativePlatform)(native) === "web") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
|
73
|
+
type: "checkbox",
|
|
74
|
+
defaultChecked: (0, import_checkbox_headless.isIndeterminate)(checked) ? false : checked,
|
|
75
|
+
tabIndex: -1,
|
|
76
|
+
ref: checkboxRef,
|
|
77
|
+
disabled: checkboxProps.disabled,
|
|
78
|
+
style: checkboxProps.style
|
|
79
|
+
});
|
|
80
|
+
const memoizedContext = (0, import_react.useMemo)(() => ({
|
|
81
|
+
checked,
|
|
82
|
+
disabled: checkboxProps.disabled
|
|
83
|
+
}), [checked, checkboxProps.disabled]);
|
|
84
|
+
const isActive = !!checked;
|
|
85
|
+
const disabled = checkboxProps.disabled;
|
|
86
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxContext.Provider, {
|
|
87
|
+
value: memoizedContext,
|
|
88
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_CheckboxStyledContext.CheckboxStyledContext.Provider, {
|
|
89
|
+
size: propsActive.size ?? styledContext?.size ?? true,
|
|
90
|
+
active: isActive,
|
|
91
|
+
disabled,
|
|
92
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxFrame, {
|
|
93
|
+
render: "button",
|
|
94
|
+
ref: checkboxRef,
|
|
95
|
+
theme: activeTheme ?? null,
|
|
96
|
+
...import_core.isWeb && { type: "button" },
|
|
97
|
+
checked,
|
|
98
|
+
disabled,
|
|
99
|
+
...checkboxProps,
|
|
100
|
+
...props,
|
|
101
|
+
...isActive && activeStyle ? activeStyle : void 0,
|
|
102
|
+
children: propsActive.children
|
|
103
|
+
}), bubbleInput]
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
const CheckboxIndicator = (0, import_core.createStyledHOC)(CheckboxIndicatorFrame, (props, forwardedRef) => {
|
|
108
|
+
const { children, forceMount, activeStyle, ...indicatorProps } = props;
|
|
109
|
+
const { active } = import_CheckboxStyledContext.CheckboxStyledContext.useStyledContext();
|
|
110
|
+
const context = import_react.default.useContext(CheckboxContext);
|
|
111
|
+
if (forceMount || (0, import_checkbox_headless.isIndeterminate)(context.checked) || context.checked === true) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxIndicatorFrame, {
|
|
112
|
+
pointerEvents: "none",
|
|
113
|
+
...indicatorProps,
|
|
114
|
+
...active && activeStyle ? activeStyle : void 0,
|
|
115
|
+
ref: forwardedRef,
|
|
116
|
+
children
|
|
117
|
+
});
|
|
118
|
+
return null;
|
|
119
|
+
});
|
|
120
|
+
const Checkbox2 = (0, import_core.withStaticProperties)(CheckboxComponent, { Indicator: CheckboxIndicator });
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: () => from[key],
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: true
|
|
28
|
+
}) : target, mod));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var Checkbox_exports = {};
|
|
31
|
+
__export(Checkbox_exports, {
|
|
32
|
+
Checkbox: () => Checkbox2,
|
|
33
|
+
CheckboxContext: () => CheckboxContext,
|
|
34
|
+
CheckboxFrame: () => CheckboxFrame,
|
|
35
|
+
CheckboxIndicatorFrame: () => CheckboxIndicatorFrame
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(Checkbox_exports);
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var import_checkbox_headless = require("@tamagui/checkbox-headless");
|
|
40
|
+
var import_core = require("@tamagui/core");
|
|
41
|
+
var import_focusable = require("@tamagui/focusable");
|
|
42
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
43
|
+
var import_react = __toESM(require("react"), 1);
|
|
44
|
+
var import_CheckboxStyledContext = require("./CheckboxStyledContext.native.js");
|
|
45
|
+
var CheckboxIndicatorFrame = (0, import_core.styled)(import_core.View, {
|
|
46
|
+
displayName: "CheckboxIndicator",
|
|
47
|
+
context: import_CheckboxStyledContext.CheckboxStyledContext
|
|
48
|
+
}, { accept: { activeStyle: "style" } });
|
|
49
|
+
var CheckboxFrame = (0, import_core.styled)(import_core.View, {
|
|
50
|
+
displayName: "Checkbox",
|
|
51
|
+
render: "button",
|
|
52
|
+
context: import_CheckboxStyledContext.CheckboxStyledContext,
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
justifyContent: "center",
|
|
55
|
+
variants: { disabled: { true: {
|
|
56
|
+
pointerEvents: "none",
|
|
57
|
+
userSelect: "none"
|
|
58
|
+
} } }
|
|
59
|
+
}, { accept: { activeStyle: "style" } });
|
|
60
|
+
var CheckboxContext = /* @__PURE__ */ import_react.default.createContext({
|
|
61
|
+
checked: false,
|
|
62
|
+
disabled: false
|
|
63
|
+
});
|
|
64
|
+
var CheckboxComponent = (0, import_core.createStyledHOC)(CheckboxFrame, function Checkbox(_props, forwardedRef) {
|
|
65
|
+
var { checked: checkedProp, defaultChecked, onCheckedChange, native, activeStyle, activeTheme, ...props } = _props;
|
|
66
|
+
var propsActive = (0, import_core.useProps)(props);
|
|
67
|
+
var styledContext = import_react.default.useContext(import_CheckboxStyledContext.CheckboxStyledContext.context);
|
|
68
|
+
var [checked = false, setChecked] = (0, import_use_controllable_state.useControllableState)({
|
|
69
|
+
prop: checkedProp,
|
|
70
|
+
defaultProp: defaultChecked,
|
|
71
|
+
onChange: onCheckedChange
|
|
72
|
+
});
|
|
73
|
+
var { checkboxProps, checkboxRef, bubbleInput } = (0, import_checkbox_headless.useCheckbox)(propsActive, [checked, setChecked], forwardedRef);
|
|
74
|
+
import_react.default.useEffect(function() {
|
|
75
|
+
if (!props.id) return;
|
|
76
|
+
if (props.disabled) return;
|
|
77
|
+
return (0, import_focusable.registerFocusable)(props.id, {
|
|
78
|
+
focusAndSelect: function() {
|
|
79
|
+
setChecked === null || setChecked === void 0 || setChecked(function(value) {
|
|
80
|
+
return !value;
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
focus: function() {}
|
|
84
|
+
});
|
|
85
|
+
}, [props.id, props.disabled]);
|
|
86
|
+
if ((0, import_core.shouldRenderNativePlatform)(native) === "web") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
|
87
|
+
type: "checkbox",
|
|
88
|
+
defaultChecked: (0, import_checkbox_headless.isIndeterminate)(checked) ? false : checked,
|
|
89
|
+
tabIndex: -1,
|
|
90
|
+
ref: checkboxRef,
|
|
91
|
+
disabled: checkboxProps.disabled,
|
|
92
|
+
style: checkboxProps.style
|
|
93
|
+
});
|
|
94
|
+
var memoizedContext = (0, import_react.useMemo)(function() {
|
|
95
|
+
return {
|
|
96
|
+
checked,
|
|
97
|
+
disabled: checkboxProps.disabled
|
|
98
|
+
};
|
|
99
|
+
}, [checked, checkboxProps.disabled]);
|
|
100
|
+
var isActive = !!checked;
|
|
101
|
+
var disabled = checkboxProps.disabled;
|
|
102
|
+
var _propsActive_size, _ref;
|
|
103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxContext.Provider, {
|
|
104
|
+
value: memoizedContext,
|
|
105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_CheckboxStyledContext.CheckboxStyledContext.Provider, {
|
|
106
|
+
size: (_ref = (_propsActive_size = propsActive.size) !== null && _propsActive_size !== void 0 ? _propsActive_size : styledContext === null || styledContext === void 0 ? void 0 : styledContext.size) !== null && _ref !== void 0 ? _ref : true,
|
|
107
|
+
active: isActive,
|
|
108
|
+
disabled,
|
|
109
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxFrame, {
|
|
110
|
+
render: "button",
|
|
111
|
+
ref: checkboxRef,
|
|
112
|
+
theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,
|
|
113
|
+
...import_core.isWeb && { type: "button" },
|
|
114
|
+
checked,
|
|
115
|
+
disabled,
|
|
116
|
+
...checkboxProps,
|
|
117
|
+
...props,
|
|
118
|
+
...isActive && activeStyle ? activeStyle : void 0,
|
|
119
|
+
children: propsActive.children
|
|
120
|
+
}), bubbleInput]
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
var CheckboxIndicator = (0, import_core.createStyledHOC)(CheckboxIndicatorFrame, function(props, forwardedRef) {
|
|
125
|
+
var { children, forceMount, activeStyle, ...indicatorProps } = props;
|
|
126
|
+
var { active } = import_CheckboxStyledContext.CheckboxStyledContext.useStyledContext();
|
|
127
|
+
var context = import_react.default.useContext(CheckboxContext);
|
|
128
|
+
if (forceMount || (0, import_checkbox_headless.isIndeterminate)(context.checked) || context.checked === true) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxIndicatorFrame, {
|
|
129
|
+
pointerEvents: "none",
|
|
130
|
+
...indicatorProps,
|
|
131
|
+
...active && activeStyle ? activeStyle : void 0,
|
|
132
|
+
ref: forwardedRef,
|
|
133
|
+
children
|
|
134
|
+
});
|
|
135
|
+
return null;
|
|
136
|
+
});
|
|
137
|
+
var Checkbox2 = (0, import_core.withStaticProperties)(CheckboxComponent, { Indicator: CheckboxIndicator });
|
|
@@ -1,119 +1,139 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
var __create = Object.create;
|
|
3
5
|
var __defProp = Object.defineProperty;
|
|
4
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
10
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
12
15
|
};
|
|
13
16
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: () => from[key],
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
21
24
|
};
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: true
|
|
28
|
+
}) : target, mod));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
30
|
var Checkbox_exports = {};
|
|
26
31
|
__export(Checkbox_exports, {
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
Checkbox: () => Checkbox2,
|
|
33
|
+
CheckboxContext: () => CheckboxContext,
|
|
34
|
+
CheckboxFrame: () => CheckboxFrame,
|
|
35
|
+
CheckboxIndicatorFrame: () => CheckboxIndicatorFrame
|
|
29
36
|
});
|
|
30
37
|
module.exports = __toCommonJS(Checkbox_exports);
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var import_checkbox_headless = require("@tamagui/checkbox-headless");
|
|
31
40
|
var import_core = require("@tamagui/core");
|
|
32
|
-
var
|
|
33
|
-
var
|
|
41
|
+
var import_focusable = require("@tamagui/focusable");
|
|
42
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
43
|
+
var import_react = __toESM(require("react"), 1);
|
|
34
44
|
var import_CheckboxStyledContext = require("./CheckboxStyledContext.native.js");
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
var CheckboxIndicatorFrame = (0, import_core.styled)(import_core.View, {
|
|
46
|
+
displayName: "CheckboxIndicator",
|
|
47
|
+
context: import_CheckboxStyledContext.CheckboxStyledContext
|
|
48
|
+
}, { accept: { activeStyle: "style" } });
|
|
49
|
+
var CheckboxFrame = (0, import_core.styled)(import_core.View, {
|
|
50
|
+
displayName: "Checkbox",
|
|
51
|
+
render: "button",
|
|
52
|
+
context: import_CheckboxStyledContext.CheckboxStyledContext,
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
justifyContent: "center",
|
|
55
|
+
variants: { disabled: { true: {
|
|
56
|
+
pointerEvents: "none",
|
|
57
|
+
userSelect: "none"
|
|
58
|
+
} } }
|
|
59
|
+
}, { accept: { activeStyle: "style" } });
|
|
60
|
+
var CheckboxContext = /* @__PURE__ */ import_react.default.createContext({
|
|
61
|
+
checked: false,
|
|
62
|
+
disabled: false
|
|
63
|
+
});
|
|
64
|
+
var CheckboxComponent = (0, import_core.createStyledHOC)(CheckboxFrame, function Checkbox(_props, forwardedRef) {
|
|
65
|
+
var { checked: checkedProp, defaultChecked, onCheckedChange, native, activeStyle, activeTheme, ...props } = _props;
|
|
66
|
+
var propsActive = (0, import_core.useProps)(props);
|
|
67
|
+
var styledContext = import_react.default.useContext(import_CheckboxStyledContext.CheckboxStyledContext.context);
|
|
68
|
+
var [checked = false, setChecked] = (0, import_use_controllable_state.useControllableState)({
|
|
69
|
+
prop: checkedProp,
|
|
70
|
+
defaultProp: defaultChecked,
|
|
71
|
+
onChange: onCheckedChange
|
|
72
|
+
});
|
|
73
|
+
var { checkboxProps, checkboxRef, bubbleInput } = (0, import_checkbox_headless.useCheckbox)(propsActive, [checked, setChecked], forwardedRef);
|
|
74
|
+
import_react.default.useEffect(function() {
|
|
75
|
+
if (!props.id) return;
|
|
76
|
+
if (props.disabled) return;
|
|
77
|
+
return (0, import_focusable.registerFocusable)(props.id, {
|
|
78
|
+
focusAndSelect: function() {
|
|
79
|
+
setChecked === null || setChecked === void 0 || setChecked(function(value) {
|
|
80
|
+
return !value;
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
focus: function() {}
|
|
84
|
+
});
|
|
85
|
+
}, [props.id, props.disabled]);
|
|
86
|
+
if ((0, import_core.shouldRenderNativePlatform)(native) === "web") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
|
87
|
+
type: "checkbox",
|
|
88
|
+
defaultChecked: (0, import_checkbox_headless.isIndeterminate)(checked) ? false : checked,
|
|
89
|
+
tabIndex: -1,
|
|
90
|
+
ref: checkboxRef,
|
|
91
|
+
disabled: checkboxProps.disabled,
|
|
92
|
+
style: checkboxProps.style
|
|
93
|
+
});
|
|
94
|
+
var memoizedContext = (0, import_react.useMemo)(function() {
|
|
95
|
+
return {
|
|
96
|
+
checked,
|
|
97
|
+
disabled: checkboxProps.disabled
|
|
98
|
+
};
|
|
99
|
+
}, [checked, checkboxProps.disabled]);
|
|
100
|
+
var isActive = !!checked;
|
|
101
|
+
var disabled = checkboxProps.disabled;
|
|
102
|
+
var _propsActive_size, _ref;
|
|
103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxContext.Provider, {
|
|
104
|
+
value: memoizedContext,
|
|
105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_CheckboxStyledContext.CheckboxStyledContext.Provider, {
|
|
106
|
+
size: (_ref = (_propsActive_size = propsActive.size) !== null && _propsActive_size !== void 0 ? _propsActive_size : styledContext === null || styledContext === void 0 ? void 0 : styledContext.size) !== null && _ref !== void 0 ? _ref : true,
|
|
107
|
+
active: isActive,
|
|
108
|
+
disabled,
|
|
109
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxFrame, {
|
|
110
|
+
render: "button",
|
|
111
|
+
ref: checkboxRef,
|
|
112
|
+
theme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,
|
|
113
|
+
...import_core.isWeb && { type: "button" },
|
|
114
|
+
checked,
|
|
115
|
+
disabled,
|
|
116
|
+
...checkboxProps,
|
|
117
|
+
...props,
|
|
118
|
+
...isActive && activeStyle ? activeStyle : void 0,
|
|
119
|
+
children: propsActive.children
|
|
120
|
+
}), bubbleInput]
|
|
121
|
+
})
|
|
122
|
+
});
|
|
52
123
|
});
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
borderWidth: 1,
|
|
66
|
-
borderColor: "$borderColor",
|
|
67
|
-
hoverStyle: {
|
|
68
|
-
borderColor: "$borderColorHover"
|
|
69
|
-
},
|
|
70
|
-
pressStyle: {
|
|
71
|
-
backgroundColor: "$backgroundPress",
|
|
72
|
-
borderColor: "$borderColorPress"
|
|
73
|
-
},
|
|
74
|
-
focusStyle: {
|
|
75
|
-
borderColor: "$borderColorFocus"
|
|
76
|
-
},
|
|
77
|
-
focusVisibleStyle: {
|
|
78
|
-
outlineStyle: "solid",
|
|
79
|
-
outlineWidth: 2,
|
|
80
|
-
outlineColor: "$outlineColor"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
disabled: {
|
|
85
|
-
true: {
|
|
86
|
-
pointerEvents: "none",
|
|
87
|
-
userSelect: "none",
|
|
88
|
-
cursor: "not-allowed",
|
|
89
|
-
hoverStyle: {
|
|
90
|
-
borderColor: "$borderColor",
|
|
91
|
-
backgroundColor: "$background"
|
|
92
|
-
},
|
|
93
|
-
pressStyle: {
|
|
94
|
-
borderColor: "$borderColor",
|
|
95
|
-
backgroundColor: "$background"
|
|
96
|
-
},
|
|
97
|
-
focusStyle: {
|
|
98
|
-
outlineWidth: 0
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
size: {
|
|
103
|
-
"...size": function (val) {
|
|
104
|
-
var radiusToken = (0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) / 8;
|
|
105
|
-
return {
|
|
106
|
-
borderRadius: radiusToken
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
defaultVariants: {
|
|
112
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
113
|
-
}
|
|
114
|
-
}, {
|
|
115
|
-
accept: {
|
|
116
|
-
activeStyle: "style"
|
|
117
|
-
}
|
|
124
|
+
var CheckboxIndicator = (0, import_core.createStyledHOC)(CheckboxIndicatorFrame, function(props, forwardedRef) {
|
|
125
|
+
var { children, forceMount, activeStyle, ...indicatorProps } = props;
|
|
126
|
+
var { active } = import_CheckboxStyledContext.CheckboxStyledContext.useStyledContext();
|
|
127
|
+
var context = import_react.default.useContext(CheckboxContext);
|
|
128
|
+
if (forceMount || (0, import_checkbox_headless.isIndeterminate)(context.checked) || context.checked === true) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxIndicatorFrame, {
|
|
129
|
+
pointerEvents: "none",
|
|
130
|
+
...indicatorProps,
|
|
131
|
+
...active && activeStyle ? activeStyle : void 0,
|
|
132
|
+
ref: forwardedRef,
|
|
133
|
+
children
|
|
134
|
+
});
|
|
135
|
+
return null;
|
|
118
136
|
});
|
|
137
|
+
var Checkbox2 = (0, import_core.withStaticProperties)(CheckboxComponent, { Indicator: CheckboxIndicator });
|
|
138
|
+
|
|
119
139
|
//# sourceMappingURL=Checkbox.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Checkbox_exports","__export","CheckboxFrame","CheckboxIndicatorFrame","module","exports","import_core","require","import_get_token","import_stacks","import_CheckboxStyledContext","INDICATOR_NAME","styled","YStack","name","context","CheckboxStyledContext","variants","unstyled","false","defaultVariants","process","env","TAMAGUI_HEADLESS","accept","activeStyle","CHECKBOX_NAME","render","size","backgroundColor","alignItems","justifyContent","borderWidth","borderColor","hoverStyle","pressStyle","focusStyle","focusVisibleStyle","outlineStyle","outlineWidth","outlineColor","disabled","true","pointerEvents","userSelect","cursor","...size","val","radiusToken","getVariableValue","getSize","borderRadius"],"sources":["../../src/Checkbox.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,gBAAA;AAAAC,QAAA,CAAAD,gBAAA;EAAAE,aAAA,EAAAA,CAAA,KAAAA,aAAA;EAAAC,sBAAA,EAAAA,CAAA,KAAAA;AAAA;AAGAC,MAAA,CAAAC,OAAA,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AAcC,GAAA;QAAA,IAChBC,WAAA,OAAA1C,WAAA,CAAA2C,gBAAA,MAAAzC,gBAAA,CAAA0C,OAAA,EAAAH,GAAA;QACF;UACFI,YAAA,EAAAH;QAEA;MAAM;IAEF;EACA;EAAO5B,eACL;IAAcF,QAChB,EAAAG,OAAA,CAAAC,GAAA,CAAAC,gBAAA;EAAA;AACF;EACFC,MACF;IAEAC,WAAA;EAAiB;AAC4B","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Checkbox.native.js","names":[],"sources":["cjs/Checkbox.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Checkbox_exports = {};\n__export(Checkbox_exports, {\n\tCheckbox: () => Checkbox2,\n\tCheckboxContext: () => CheckboxContext,\n\tCheckboxFrame: () => CheckboxFrame,\n\tCheckboxIndicatorFrame: () => CheckboxIndicatorFrame\n});\nmodule.exports = __toCommonJS(Checkbox_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_checkbox_headless = require(\"@tamagui/checkbox-headless\");\nvar import_core = require(\"@tamagui/core\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_CheckboxStyledContext = require(\"./CheckboxStyledContext\");\nvar CheckboxIndicatorFrame = (0, import_core.styled)(import_core.View, {\n\tdisplayName: \"CheckboxIndicator\",\n\tcontext: import_CheckboxStyledContext.CheckboxStyledContext\n}, { accept: { activeStyle: \"style\" } });\nvar CheckboxFrame = (0, import_core.styled)(import_core.View, {\n\tdisplayName: \"Checkbox\",\n\trender: \"button\",\n\tcontext: import_CheckboxStyledContext.CheckboxStyledContext,\n\talignItems: \"center\",\n\tjustifyContent: \"center\",\n\tvariants: { disabled: { true: {\n\t\tpointerEvents: \"none\",\n\t\tuserSelect: \"none\"\n\t} } }\n}, { accept: { activeStyle: \"style\" } });\nvar CheckboxContext = /* @__PURE__ */ import_react.default.createContext({\n\tchecked: false,\n\tdisabled: false\n});\nvar CheckboxComponent = (0, import_core.createStyledHOC)(CheckboxFrame, function Checkbox(_props, forwardedRef) {\n\tvar { checked: checkedProp, defaultChecked, onCheckedChange, native, activeStyle, activeTheme, ...props } = _props;\n\tvar propsActive = (0, import_core.useProps)(props);\n\tvar styledContext = import_react.default.useContext(import_CheckboxStyledContext.CheckboxStyledContext.context);\n\tvar [checked = false, setChecked] = (0, import_use_controllable_state.useControllableState)({\n\t\tprop: checkedProp,\n\t\tdefaultProp: defaultChecked,\n\t\tonChange: onCheckedChange\n\t});\n\tvar { checkboxProps, checkboxRef, bubbleInput } = (0, import_checkbox_headless.useCheckbox)(\n\t\t// @ts-ignore\n\t\tpropsActive,\n\t\t[checked, setChecked],\n\t\tforwardedRef\n\t);\n\timport_react.default.useEffect(function() {\n\t\tif (!props.id) return;\n\t\tif (props.disabled) return;\n\t\treturn (0, import_focusable.registerFocusable)(props.id, {\n\t\t\tfocusAndSelect: function() {\n\t\t\t\tsetChecked === null || setChecked === void 0 || setChecked(function(value) {\n\t\t\t\t\treturn !value;\n\t\t\t\t});\n\t\t\t},\n\t\t\tfocus: function() {}\n\t\t});\n\t}, [props.id, props.disabled]);\n\tif ((0, import_core.shouldRenderNativePlatform)(native) === \"web\") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"input\", {\n\t\ttype: \"checkbox\",\n\t\tdefaultChecked: (0, import_checkbox_headless.isIndeterminate)(checked) ? false : checked,\n\t\ttabIndex: -1,\n\t\tref: checkboxRef,\n\t\tdisabled: checkboxProps.disabled,\n\t\tstyle: checkboxProps.style\n\t});\n\tvar memoizedContext = (0, import_react.useMemo)(function() {\n\t\treturn {\n\t\t\tchecked,\n\t\t\tdisabled: checkboxProps.disabled\n\t\t};\n\t}, [checked, checkboxProps.disabled]);\n\tvar isActive = !!checked;\n\tvar disabled = checkboxProps.disabled;\n\tvar _propsActive_size, _ref;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxContext.Provider, {\n\t\tvalue: memoizedContext,\n\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_CheckboxStyledContext.CheckboxStyledContext.Provider, {\n\t\t\tsize: (_ref = (_propsActive_size = propsActive.size) !== null && _propsActive_size !== void 0 ? _propsActive_size : styledContext === null || styledContext === void 0 ? void 0 : styledContext.size) !== null && _ref !== void 0 ? _ref : true,\n\t\t\tactive: isActive,\n\t\t\tdisabled,\n\t\t\tchildren: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxFrame, {\n\t\t\t\trender: \"button\",\n\t\t\t\tref: checkboxRef,\n\t\t\t\ttheme: activeTheme !== null && activeTheme !== void 0 ? activeTheme : null,\n\t\t\t\t...import_core.isWeb && { type: \"button\" },\n\t\t\t\tchecked,\n\t\t\t\tdisabled,\n\t\t\t\t...checkboxProps,\n\t\t\t\t...props,\n\t\t\t\t...isActive && activeStyle ? activeStyle : void 0,\n\t\t\t\tchildren: propsActive.children\n\t\t\t}), bubbleInput]\n\t\t})\n\t});\n});\nvar CheckboxIndicator = (0, import_core.createStyledHOC)(CheckboxIndicatorFrame, function(props, forwardedRef) {\n\tvar { children, forceMount, activeStyle, ...indicatorProps } = props;\n\tvar { active } = import_CheckboxStyledContext.CheckboxStyledContext.useStyledContext();\n\tvar context = import_react.default.useContext(CheckboxContext);\n\tif (forceMount || (0, import_checkbox_headless.isIndeterminate)(context.checked) || context.checked === true) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxIndicatorFrame, {\n\t\tpointerEvents: \"none\",\n\t\t...indicatorProps,\n\t\t...active && activeStyle ? activeStyle : void 0,\n\t\tref: forwardedRef,\n\t\tchildren\n\t});\n\treturn null;\n});\nvar Checkbox2 = (0, import_core.withStaticProperties)(CheckboxComponent, { Indicator: CheckboxIndicator });\n//# sourceMappingURL=Checkbox.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK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