@oracle/oraclejet-preact 17.1.6 → 17.1.7
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/amd/CheckboxSetContext-2e486ea8.js +2 -0
- package/amd/CheckboxSetContext-2e486ea8.js.map +1 -0
- package/amd/InputDatePicker-6167ff45.js +2 -0
- package/amd/{InputDatePicker-97756bcd.js.map → InputDatePicker-6167ff45.js.map} +1 -1
- package/amd/Theme-redwood/theme.css +248 -248
- package/amd/Theme-stable/theme.css +316 -316
- package/amd/UNSAFE_CheckboxItem.js +1 -1
- package/amd/UNSAFE_CheckboxItem.js.map +1 -1
- package/amd/UNSAFE_CheckboxSet.js +1 -1
- package/amd/UNSAFE_CheckboxSet.js.map +1 -1
- package/amd/UNSAFE_InputDatePicker.js +1 -1
- package/cjs/CheckboxSetContext-c62db26d.js +12 -0
- package/cjs/CheckboxSetContext-c62db26d.js.map +1 -0
- package/cjs/MaxLengthCounter-a5370f66.js +27 -0
- package/{es/MaxLengthCounter-cead2dac.js.map → cjs/MaxLengthCounter-a5370f66.js.map} +1 -1
- package/cjs/{NavigationListItem-d9228979.js → NavigationListItem-7550547a.js} +14 -1
- package/cjs/{NavigationListItem-d9228979.js.map → NavigationListItem-7550547a.js.map} +1 -1
- package/cjs/{OverflowTabBar-081cc41e.js → OverflowTabBar-76c75781.js} +2 -2
- package/cjs/{OverflowTabBar-081cc41e.js.map → OverflowTabBar-76c75781.js.map} +1 -1
- package/cjs/{OverflowTabBarItem-57899880.js → OverflowTabBarItem-76059bad.js} +2 -2
- package/cjs/{OverflowTabBarItem-57899880.js.map → OverflowTabBarItem-76059bad.js.map} +1 -1
- package/cjs/{TextArea-792069d7.js → TextArea-096f18ad.js} +4 -22
- package/{es/TextArea-6f18b955.js.map → cjs/TextArea-096f18ad.js.map} +1 -1
- package/cjs/{TextAreaAutosize-1989de68.js → TextAreaAutosize-4d30faec.js} +3 -3
- package/cjs/{TextAreaAutosize-1989de68.js.map → TextAreaAutosize-4d30faec.js.map} +1 -1
- package/cjs/Theme-redwood/theme.css +164 -164
- package/cjs/Theme-stable/theme.css +965 -965
- package/cjs/UNSAFE_BaseButton/themes/stable/BaseButtonTheme.js +0 -1
- package/cjs/UNSAFE_BaseButton/themes/stable/BaseButtonTheme.js.map +1 -1
- package/cjs/UNSAFE_CheckboxItem.js +30 -80
- package/cjs/UNSAFE_CheckboxItem.js.map +1 -1
- package/cjs/UNSAFE_CheckboxSet.js +44 -15
- package/cjs/UNSAFE_CheckboxSet.js.map +1 -1
- package/cjs/UNSAFE_NavigationList.js +4 -4
- package/cjs/UNSAFE_OverflowTabBar.js +3 -3
- package/cjs/UNSAFE_TabBar.js +2 -2
- package/cjs/UNSAFE_TabBarCommon.js +2 -2
- package/cjs/UNSAFE_TabBarMixed.js +2 -2
- package/cjs/UNSAFE_TextArea.js +4 -3
- package/cjs/UNSAFE_TextArea.js.map +1 -1
- package/cjs/UNSAFE_TextAreaAutosize.js +3 -3
- package/es/CheckboxSetContext-1be56556.js +9 -0
- package/es/CheckboxSetContext-1be56556.js.map +1 -0
- package/es/{TextArea-6f18b955.js → TextArea-ea6aaf32.js} +25 -8
- package/{cjs/TextArea-792069d7.js.map → es/TextArea-ea6aaf32.js.map} +1 -1
- package/es/{TextAreaAutosize-4cf2754b.js → TextAreaAutosize-edc7dde7.js} +2 -2
- package/es/{TextAreaAutosize-4cf2754b.js.map → TextAreaAutosize-edc7dde7.js.map} +1 -1
- package/es/Theme-redwood/theme.css +577 -577
- package/es/Theme-stable/theme.css +426 -426
- package/es/UNSAFE_CheckboxItem.js +30 -80
- package/es/UNSAFE_CheckboxItem.js.map +1 -1
- package/es/UNSAFE_CheckboxSet.js +44 -10
- package/es/UNSAFE_CheckboxSet.js.map +1 -1
- package/es/UNSAFE_TextArea.js +2 -3
- package/es/UNSAFE_TextArea.js.map +1 -1
- package/es/UNSAFE_TextAreaAutosize.js +3 -3
- package/package.json +2 -2
- package/amd/CheckboxSet-e523552e.js +0 -2
- package/amd/CheckboxSet-e523552e.js.map +0 -1
- package/amd/InputDatePicker-97756bcd.js +0 -2
- package/cjs/CheckboxSet-368b907b.js +0 -53
- package/cjs/CheckboxSet-368b907b.js.map +0 -1
- package/es/CheckboxSet-569683fe.js +0 -49
- package/es/CheckboxSet-569683fe.js.map +0 -1
- package/es/MaxLengthCounter-cead2dac.js +0 -25
|
@@ -5,25 +5,31 @@ import './FormContext-4d71f9c7.js';
|
|
|
5
5
|
import { u as useFormContext } from './useFormContext-875cacd7.js';
|
|
6
6
|
import './FormFieldContext-68eb5946.js';
|
|
7
7
|
import { u as useFormFieldContext } from './useFormFieldContext-626574fd.js';
|
|
8
|
-
import { u as useCheckboxSetContext } from './CheckboxSet-569683fe.js';
|
|
9
8
|
import { C as CheckboxControl } from './CheckboxControl-f5e36d0d.js';
|
|
9
|
+
import { u as useCheckboxSetContext } from './CheckboxSetContext-1be56556.js';
|
|
10
10
|
import 'preact';
|
|
11
11
|
import 'preact/compat';
|
|
12
|
-
import './
|
|
13
|
-
import './
|
|
12
|
+
import './CheckboxRadioContext-fe425383.js';
|
|
13
|
+
import './HiddenAccessible-61197e7c.js';
|
|
14
|
+
import './HiddenAccessibleStyles.styles.css';
|
|
15
|
+
import './useComponentTheme-d2f9e47f.js';
|
|
16
|
+
import './logger-c92f309c.js';
|
|
17
|
+
import './useFocus-38c95977.js';
|
|
18
|
+
import './useToggle-8b7fcefe.js';
|
|
19
|
+
import './classNames-4e12b00d.js';
|
|
20
|
+
import './TabbableModeContext-7d8ad946.js';
|
|
21
|
+
import './useTabbableMode-a3a351d0.js';
|
|
14
22
|
import './useId-03dbfdf0.js';
|
|
15
|
-
import './CheckboxRadioField-bdda2573.js';
|
|
16
|
-
import './useCollectionFocusRing-d0c80397.js';
|
|
17
|
-
import './collectionUtils-d72c7c40.js';
|
|
18
|
-
import './keys-df361af9.js';
|
|
19
|
-
import './clientHints-c76a913b.js';
|
|
20
23
|
import './useTranslationBundle-6da03e52.js';
|
|
21
24
|
import './LayerHost-7a2149f5.js';
|
|
22
25
|
import './Common/themes/redwood/theme.js';
|
|
23
26
|
import './Common/themes/themeContract.css.js';
|
|
27
|
+
import './UserAssistanceStyles.styles.css';
|
|
28
|
+
import './UNSAFE_UserAssistance/themes/redwood/UserAssistanceBaseTheme.styles.css';
|
|
29
|
+
import './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css.js';
|
|
30
|
+
import './vanilla-extract-recipes-createRuntimeFn.esm-2aaf8c98.js';
|
|
24
31
|
import './Flex-2d51e914.js';
|
|
25
32
|
import './useTestId-af32a9eb.js';
|
|
26
|
-
import './classNames-4e12b00d.js';
|
|
27
33
|
import './boxalignment-7d41dd5e.js';
|
|
28
34
|
import './size-88f26574.js';
|
|
29
35
|
import './utils-d65cb4fb.js';
|
|
@@ -43,14 +49,6 @@ import './_curry3-0b4222d7.js';
|
|
|
43
49
|
import './_curry2-34316bcf.js';
|
|
44
50
|
import './_isObject-1fab0f5b.js';
|
|
45
51
|
import './FlexStyles.styles.css';
|
|
46
|
-
import './Label-ab276ca9.js';
|
|
47
|
-
import './useComponentTheme-d2f9e47f.js';
|
|
48
|
-
import './logger-c92f309c.js';
|
|
49
|
-
import './TabbableModeContext-7d8ad946.js';
|
|
50
|
-
import './UserAssistanceStyles.styles.css';
|
|
51
|
-
import './UNSAFE_UserAssistance/themes/redwood/UserAssistanceBaseTheme.styles.css';
|
|
52
|
-
import './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css.js';
|
|
53
|
-
import './vanilla-extract-recipes-createRuntimeFn.esm-2aaf8c98.js';
|
|
54
52
|
import './MessageBannerStyles.styles.css';
|
|
55
53
|
import './UNSAFE_MessageBanner/themes/redwood/MessageBannerBaseTheme.styles.css';
|
|
56
54
|
import './UNSAFE_MessageBanner/themes/redwood/MessageBannerVariants.css.js';
|
|
@@ -89,9 +87,8 @@ import './IconButton-451a225c.js';
|
|
|
89
87
|
import './BaseButton-5a3335d9.js';
|
|
90
88
|
import './usePress-97fc1cf1.js';
|
|
91
89
|
import './useHover-19340c22.js';
|
|
92
|
-
import './useToggle-8b7fcefe.js';
|
|
93
90
|
import './useActive-8aad4132.js';
|
|
94
|
-
import './
|
|
91
|
+
import './clientHints-c76a913b.js';
|
|
95
92
|
import './mergeProps-88ea8306.js';
|
|
96
93
|
import './UNSAFE_BaseButton/themes/redwood/BaseButtonTheme.js';
|
|
97
94
|
import './UNSAFE_BaseButton/themes/BaseButtonStyles.css.js';
|
|
@@ -112,7 +109,6 @@ import './UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutVariants.css.
|
|
|
112
109
|
import './ButtonLabelLayoutVariants.styles.css';
|
|
113
110
|
import './useTooltip-e258ea41.js';
|
|
114
111
|
import './useTooltipControlled-50d5dac9.js';
|
|
115
|
-
import './useFocus-38c95977.js';
|
|
116
112
|
import './useTouch-4828df25.js';
|
|
117
113
|
import './useAnimation-fe9990dc.js';
|
|
118
114
|
import './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentTheme.js';
|
|
@@ -126,7 +122,6 @@ import './getLocale-1c41e86a.js';
|
|
|
126
122
|
import './stringUtils-16f617bc.js';
|
|
127
123
|
import './TransitionGroup-5fd80dc9.js';
|
|
128
124
|
import './MessagesContext-76544845.js';
|
|
129
|
-
import './HiddenAccessibleStyles.styles.css';
|
|
130
125
|
import './ComponentMessageStyles.styles.css';
|
|
131
126
|
import './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageBaseTheme.styles.css';
|
|
132
127
|
import './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageVariants.css.js';
|
|
@@ -163,73 +158,19 @@ import './UNSAFE_Popup/themes/redwood/PopupVariants.css.js';
|
|
|
163
158
|
import './PopupStyles.styles.css';
|
|
164
159
|
import './UNSAFE_Separator/themes/SeparatorStyles.css.js';
|
|
165
160
|
import './SeparatorStyles.styles.css';
|
|
166
|
-
import './CompactLabelAssistance-61df6dbf.js';
|
|
167
|
-
import './CompactHelpSource-1686edf6.js';
|
|
168
|
-
import './Help-0cc26804.js';
|
|
169
|
-
import './Icon-4171c0d7.js';
|
|
170
|
-
import './UNSAFE_Icon/themes/IconStyle.css.js';
|
|
171
161
|
import './useFocusWithin-30b1e2d8.js';
|
|
172
|
-
import './UNSAFE_UserAssistance/themes/UserAssistanceStyles.css.js';
|
|
173
|
-
import './UNSAFE_Label/themes/redwood/LabelTheme.js';
|
|
174
|
-
import './UNSAFE_Label/themes/LabelStyles.css.js';
|
|
175
162
|
import './LabelStyles.styles.css';
|
|
176
|
-
import './UNSAFE_Label/themes/redwood/LabelBaseTheme.css.js';
|
|
177
163
|
import './UNSAFE_Label/themes/redwood/LabelBaseTheme.styles.css';
|
|
178
164
|
import './UNSAFE_Label/themes/redwood/LabelVariants.css.js';
|
|
179
|
-
import './
|
|
180
|
-
import './
|
|
181
|
-
import './
|
|
182
|
-
import './
|
|
183
|
-
import './TextFieldStyles.styles.css';
|
|
184
|
-
import './UNSAFE_TextField/themes/redwood/TextFieldBaseTheme.css.js';
|
|
185
|
-
import './UNSAFE_TextField/themes/redwood/TextFieldBaseTheme.styles.css';
|
|
186
|
-
import './UNSAFE_TextField/themes/redwood/TextFieldVariants.css.js';
|
|
187
|
-
import './TextFieldVariants.styles.css';
|
|
165
|
+
import './IconUserAssistance-7cfd1ed2.js';
|
|
166
|
+
import './Help-0cc26804.js';
|
|
167
|
+
import './Icon-4171c0d7.js';
|
|
168
|
+
import './UNSAFE_Icon/themes/IconStyle.css.js';
|
|
188
169
|
import './InlineHelp-9f4042ba.js';
|
|
189
170
|
import './InlineHelpSource-fcdcd122.js';
|
|
190
171
|
import './UNSAFE_UserAssistance/themes/redwood/UserAssistanceTheme.js';
|
|
172
|
+
import './UNSAFE_UserAssistance/themes/UserAssistanceStyles.css.js';
|
|
191
173
|
import './UNSAFE_UserAssistance/themes/redwood/UserAssistanceBaseTheme.css.js';
|
|
192
|
-
import './InlineUserAssistance-e6deb149.js';
|
|
193
|
-
import './ComponentMessageContainer-18e7fe34.js';
|
|
194
|
-
import './MessagesManager-a1c3e92e.js';
|
|
195
|
-
import './SuccessS-2ec87939.js';
|
|
196
|
-
import './ErrorS-988a89e6.js';
|
|
197
|
-
import './InformationS-8b708877.js';
|
|
198
|
-
import './WarningS-beea3870.js';
|
|
199
|
-
import './PRIVATE_Message/themes/MessageStyles.css.js';
|
|
200
|
-
import './soundUtils-88264cb5.js';
|
|
201
|
-
import './useMessagesContext-9e1dbe91.js';
|
|
202
|
-
import './Transition-f9501682.js';
|
|
203
|
-
import './HiddenAccessible-61197e7c.js';
|
|
204
|
-
import './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageTheme.js';
|
|
205
|
-
import './UNSAFE_ComponentMessage/themes/ComponentMessageStyles.css.js';
|
|
206
|
-
import './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageBaseTheme.css.js';
|
|
207
|
-
import './useInputGroupContext-1d19411e.js';
|
|
208
|
-
import './useMessageSeverity-65295e8f.js';
|
|
209
|
-
import './CheckboxRadioFieldStyles.styles.css';
|
|
210
|
-
import './LabelValueLayout-bcf482be.js';
|
|
211
|
-
import './LabelValueLayoutStyles.styles.css';
|
|
212
|
-
import './UNSAFE_RadioItem/themes/redwood/RadioTheme.js';
|
|
213
|
-
import './UNSAFE_RadioItem/themes/RadioStyles.css.js';
|
|
214
|
-
import './RadioStyles.styles.css';
|
|
215
|
-
import './UNSAFE_RadioItem/themes/redwood/RadioBaseTheme.css.js';
|
|
216
|
-
import './UNSAFE_RadioItem/themes/redwood/RadioBaseTheme.styles.css';
|
|
217
|
-
import './UNSAFE_RadioItem/themes/redwood/RadioVariants.css.js';
|
|
218
|
-
import './UNSAFE_TextField/themes/redwood/FormLayoutTheme.js';
|
|
219
|
-
import './UNSAFE_TextField/themes/FormLayoutStyles.css.js';
|
|
220
|
-
import './UNSAFE_TextField/themes/redwood/FormLayoutBaseTheme.css.js';
|
|
221
|
-
import './UNSAFE_TextField/themes/redwood/FormLayoutBaseTheme.styles.css';
|
|
222
|
-
import './UNSAFE_Checkbox/themes/redwood/CheckboxTheme.js';
|
|
223
|
-
import './UNSAFE_Checkbox/themes/CheckboxStyles.css.js';
|
|
224
|
-
import './CheckboxStyles.styles.css';
|
|
225
|
-
import './UNSAFE_Checkbox/themes/redwood/CheckboxBaseTheme.css.js';
|
|
226
|
-
import './UNSAFE_Checkbox/themes/redwood/CheckboxBaseTheme.styles.css';
|
|
227
|
-
import './UNSAFE_Checkbox/themes/redwood/CheckboxVariants.css.js';
|
|
228
|
-
import './CheckboxVariants.styles.css';
|
|
229
|
-
import './CheckboxRadioContext-fe425383.js';
|
|
230
|
-
import './LayoutStyles.css-a679044e.js';
|
|
231
|
-
import './LayoutStyles.styles.css';
|
|
232
|
-
import './IconUserAssistance-7cfd1ed2.js';
|
|
233
174
|
import './StyledCheckbox-b313aef0.js';
|
|
234
175
|
import './Check-ee5ae8f6.js';
|
|
235
176
|
import './CheckboxOff-706af6d9.js';
|
|
@@ -245,6 +186,15 @@ import './UNSAFE_Checkbox/themes/redwood/CheckboxIconVariants.css.js';
|
|
|
245
186
|
import './CheckboxIconVariants.styles.css';
|
|
246
187
|
import './StyledCheckbox.styles.css';
|
|
247
188
|
import './useCollectionInteractionContext-1bfaa545.js';
|
|
189
|
+
import './UNSAFE_Checkbox/themes/redwood/CheckboxTheme.js';
|
|
190
|
+
import './UNSAFE_Checkbox/themes/CheckboxStyles.css.js';
|
|
191
|
+
import './CheckboxStyles.styles.css';
|
|
192
|
+
import './UNSAFE_Checkbox/themes/redwood/CheckboxBaseTheme.css.js';
|
|
193
|
+
import './UNSAFE_Checkbox/themes/redwood/CheckboxBaseTheme.styles.css';
|
|
194
|
+
import './UNSAFE_Checkbox/themes/redwood/CheckboxVariants.css.js';
|
|
195
|
+
import './CheckboxVariants.styles.css';
|
|
196
|
+
import './LayoutStyles.css-a679044e.js';
|
|
197
|
+
import './LayoutStyles.styles.css';
|
|
248
198
|
|
|
249
199
|
/**
|
|
250
200
|
* CheckboxItem is a child component of CheckboxSet. It contains the checkbox, label, and assistive text.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNSAFE_CheckboxItem.js","sources":["../../src/UNSAFE_CheckboxItem/CheckboxItem.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { ComponentProps } from 'preact';\nimport { useCallback } from 'preact/hooks';\n\nimport { useFormContext } from '../hooks/UNSAFE_useFormContext';\nimport { useFormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { useCheckboxSetContext } from '../UNSAFE_CheckboxSet';\n\nimport { CheckboxControl } from '../PRIVATE_CheckboxControl/CheckboxControl';\nimport { InlineUserAssistance } from '#UNSAFE_UserAssistance';\n\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = {\n /**\n * Text that describes the checkbox item value.\n */\n children: string;\n /**\n * Text to provide guidance to help the user understand what data to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * Help source URL associated with the component.\n */\n helpSourceLink?: InlineUserAssistanceProps['helpSourceLink'];\n /**\n * Custom text to be rendered for the `helpSourceLink`.\n */\n helpSourceText?: InlineUserAssistanceProps['helpSourceText'];\n /**\n * Value of the checkbox item.\n */\n value: string | number;\n};\n\n/**\n * CheckboxItem is a child component of CheckboxSet. It contains the checkbox, label, and assistive text.\n */\nconst CheckboxItem = ({\n children,\n value,\n assistiveText,\n helpSourceLink,\n helpSourceText\n}: Props) => {\n const { isReadonly: isFormReadonly, isDisabled: isFormDisabled } = useFormContext();\n const { isDisabled: isFieldDisabled, isReadonly: isFieldReadonly } = useFormFieldContext();\n const { name, onCommit, value: groupValue } = useCheckboxSetContext();\n\n const isChecked = groupValue?.has(value);\n const isDisabled = isFieldDisabled ?? isFormDisabled;\n const isReadonly = isFieldReadonly ?? isFormReadonly;\n\n const onChangeHandler = useCallback(\n (e: Event) => {\n // return early on keyup if key isn't spacebar\n const { key } = e as KeyboardEvent;\n if (key !== undefined && key !== ' ') {\n return;\n }\n\n // create a new set from the previous and add or remove the changed value\n const newGroupValue = new Set(groupValue);\n newGroupValue.has(value) ? newGroupValue.delete(value) : newGroupValue.add(value);\n\n onCommit?.({\n previousValue: groupValue,\n value: newGroupValue.size > 0 ? newGroupValue : undefined\n });\n },\n [groupValue, onCommit, value]\n );\n\n return (\n <CheckboxControl\n name={name}\n value={value}\n {...(!isReadonly && !isDisabled\n ? { onChange: onChangeHandler, onKeyUp: onChangeHandler }\n : {})}\n assistiveText={assistiveText}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isChecked={isChecked}\n isDisabled={isDisabled}\n isReadonly={isReadonly}>\n {children}\n </CheckboxControl>\n );\n};\n\nexport { CheckboxItem };\n"],"names":["_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"UNSAFE_CheckboxItem.js","sources":["../../src/UNSAFE_CheckboxItem/CheckboxItem.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { ComponentProps } from 'preact';\nimport { useCallback } from 'preact/hooks';\n\nimport { useFormContext } from '../hooks/UNSAFE_useFormContext';\nimport { useFormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { useCheckboxSetContext } from '../UNSAFE_CheckboxSet';\n\nimport { CheckboxControl } from '../PRIVATE_CheckboxControl/CheckboxControl';\nimport { InlineUserAssistance } from '#UNSAFE_UserAssistance';\n\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = {\n /**\n * Text that describes the checkbox item value.\n */\n children: string;\n /**\n * Text to provide guidance to help the user understand what data to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * Help source URL associated with the component.\n */\n helpSourceLink?: InlineUserAssistanceProps['helpSourceLink'];\n /**\n * Custom text to be rendered for the `helpSourceLink`.\n */\n helpSourceText?: InlineUserAssistanceProps['helpSourceText'];\n /**\n * Value of the checkbox item.\n */\n value: string | number;\n};\n\n/**\n * CheckboxItem is a child component of CheckboxSet. It contains the checkbox, label, and assistive text.\n */\nconst CheckboxItem = ({\n children,\n value,\n assistiveText,\n helpSourceLink,\n helpSourceText\n}: Props) => {\n const { isReadonly: isFormReadonly, isDisabled: isFormDisabled } = useFormContext();\n const { isDisabled: isFieldDisabled, isReadonly: isFieldReadonly } = useFormFieldContext();\n const { name, onCommit, value: groupValue } = useCheckboxSetContext();\n\n const isChecked = groupValue?.has(value);\n const isDisabled = isFieldDisabled ?? isFormDisabled;\n const isReadonly = isFieldReadonly ?? isFormReadonly;\n\n const onChangeHandler = useCallback(\n (e: Event) => {\n // return early on keyup if key isn't spacebar\n const { key } = e as KeyboardEvent;\n if (key !== undefined && key !== ' ') {\n return;\n }\n\n // create a new set from the previous and add or remove the changed value\n const newGroupValue = new Set(groupValue);\n newGroupValue.has(value) ? newGroupValue.delete(value) : newGroupValue.add(value);\n\n onCommit?.({\n previousValue: groupValue,\n value: newGroupValue.size > 0 ? newGroupValue : undefined\n });\n },\n [groupValue, onCommit, value]\n );\n\n return (\n <CheckboxControl\n name={name}\n value={value}\n {...(!isReadonly && !isDisabled\n ? { onChange: onChangeHandler, onKeyUp: onChangeHandler }\n : {})}\n assistiveText={assistiveText}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isChecked={isChecked}\n isDisabled={isDisabled}\n isReadonly={isReadonly}>\n {children}\n </CheckboxControl>\n );\n};\n\nexport { CheckboxItem };\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AG,SAAS;AAC1D,SAAA,CAAC,CAAC;KACJ,EACD,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,CAAC,CAC9B,CAAC;AAEF,IAAA,QACEA,GAAC,CAAA,eAAe,EACd,EAAA,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACR,IAAC,CAAC,UAAU,IAAI,CAAC,UAAU;cAC3B,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE;AACzD,cAAE,EAAE,CAAC,EACP,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EAAA,QAAA,EACrB,QAAQ,EAAA,CACO,EAClB;AACJ;;;;"}
|
package/es/UNSAFE_CheckboxSet.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/* @oracle/oraclejet-preact: undefined */
|
|
2
|
-
|
|
3
|
-
import 'preact
|
|
4
|
-
import 'preact';
|
|
5
|
-
import 'preact/
|
|
6
|
-
import '
|
|
2
|
+
import { jsx } from 'preact/jsx-runtime';
|
|
3
|
+
import { toChildArray } from 'preact';
|
|
4
|
+
import { useMemo } from 'preact/hooks';
|
|
5
|
+
import { forwardRef } from 'preact/compat';
|
|
6
|
+
import { C as CheckboxSetContext } from './CheckboxSetContext-1be56556.js';
|
|
7
|
+
export { C as CheckboxSetContext, u as useCheckboxSetContext } from './CheckboxSetContext-1be56556.js';
|
|
7
8
|
import './FormContext-4d71f9c7.js';
|
|
8
|
-
import './useFormContext-875cacd7.js';
|
|
9
|
-
import './FormFieldContext-68eb5946.js';
|
|
10
|
-
import './useFormFieldContextProps-d07cd618.js';
|
|
9
|
+
import { u as useFormContext } from './useFormContext-875cacd7.js';
|
|
10
|
+
import { F as FormFieldContext } from './FormFieldContext-68eb5946.js';
|
|
11
|
+
import { u as useFormFieldContextProps } from './useFormFieldContextProps-d07cd618.js';
|
|
11
12
|
import './CheckboxSetStyles.styles.css';
|
|
12
|
-
import './useId-03dbfdf0.js';
|
|
13
|
-
import './CheckboxRadioField-bdda2573.js';
|
|
13
|
+
import { u as useId } from './useId-03dbfdf0.js';
|
|
14
|
+
import { C as CheckboxRadioField } from './CheckboxRadioField-bdda2573.js';
|
|
14
15
|
import './useCollectionFocusRing-d0c80397.js';
|
|
15
16
|
import './collectionUtils-d72c7c40.js';
|
|
16
17
|
import './keys-df361af9.js';
|
|
@@ -228,4 +229,37 @@ import './CheckboxVariants.styles.css';
|
|
|
228
229
|
import './CheckboxRadioContext-fe425383.js';
|
|
229
230
|
import './LayoutStyles.css-a679044e.js';
|
|
230
231
|
import './LayoutStyles.styles.css';
|
|
232
|
+
|
|
233
|
+
var styles = {ul:'CheckboxSetStyles_styles_ul__68p6630'};
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* A CheckboxSet set allows the user to select one or more options from a set.
|
|
237
|
+
*/
|
|
238
|
+
const CheckboxSet = forwardRef(({ 'aria-describedby': ariaDescribedBy, assistiveText, columnSpan, direction = 'column', helpSourceLink, helpSourceText, isDisabled: propIsDisabled, isReadonly: propIsReadonly, isRequired = false, label, labelEdge: propLabelEdge, labelStartWidth: propLabelStartWidth, messages, onCommit, userAssistanceDensity: propUserAssistanceDensity, value, children, testId }, ref) => {
|
|
239
|
+
const hasValue = value !== undefined ? value.size > 0 : false;
|
|
240
|
+
const baseId = useId();
|
|
241
|
+
const { isDisabled: isFormDisabled, isReadonly: isFormReadonly, labelEdge: formLabelEdge, labelStartWidth: formLabelStartWidth, userAssistanceDensity: formUserAssistanceDensity } = useFormContext();
|
|
242
|
+
// default to FormContext values if component properties are not specified
|
|
243
|
+
const isDisabled = propIsDisabled ?? isFormDisabled;
|
|
244
|
+
const isReadonly = propIsReadonly ?? isFormReadonly;
|
|
245
|
+
const labelEdge = propLabelEdge ?? formLabelEdge;
|
|
246
|
+
const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;
|
|
247
|
+
const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;
|
|
248
|
+
const formFieldContext = useFormFieldContextProps({
|
|
249
|
+
hasValue,
|
|
250
|
+
isDisabled,
|
|
251
|
+
isReadonly
|
|
252
|
+
});
|
|
253
|
+
const checkboxSetContext = useMemo(() => ({
|
|
254
|
+
name: baseId,
|
|
255
|
+
value,
|
|
256
|
+
onCommit
|
|
257
|
+
}), [baseId, onCommit, value]);
|
|
258
|
+
// wrap each CheckboxItem in an <li> tag and the entire set with <ul>
|
|
259
|
+
const childrenArray = toChildArray(children).filter(Boolean);
|
|
260
|
+
const wrappedChildren = childrenArray.map((item) => jsx("li", { children: item }));
|
|
261
|
+
return (jsx(FormFieldContext.Provider, { value: formFieldContext, children: jsx(CheckboxRadioField, { "aria-describedby": ariaDescribedBy, assistiveText: assistiveText, baseId: baseId, columnSpan: columnSpan, direction: direction, helpSourceLink: helpSourceLink, helpSourceText: helpSourceText, isDisabled: isDisabled, isReadonly: isReadonly, isRequired: isRequired, label: label, labelEdge: labelEdge, labelStartWidth: labelStartWidth, parentComponentVariant: "checkboxSet", messages: messages, userAssistanceDensity: userAssistanceDensity, hasValue: hasValue, role: "group", testId: testId, ref: ref, children: jsx(CheckboxSetContext.Provider, { value: checkboxSetContext, children: jsx("ul", { className: styles.ul, children: wrappedChildren }) }) }) }));
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
export { CheckboxSet };
|
|
231
265
|
//# sourceMappingURL=UNSAFE_CheckboxSet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNSAFE_CheckboxSet.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UNSAFE_CheckboxSet.js","sources":["../../src/UNSAFE_CheckboxSet/CheckboxSet.tsx"],"sourcesContent":["import { ComponentChildren, ComponentProps, Ref, toChildArray } from 'preact';\nimport { useMemo } from 'preact/hooks';\nimport { forwardRef } from 'preact/compat';\n\nimport { CheckboxSetContext } from './CheckboxSetContext';\nimport { CheckboxRadioField } from '#PRIVATE_CheckboxRadioField';\nimport { InlineUserAssistance, UserAssistanceDensityType } from '#UNSAFE_UserAssistance';\nimport { useFormContext } from '#hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '#hooks/UNSAFE_useFormFieldContext';\nimport { useFormFieldContextProps } from '#hooks/UNSAFE_useFormFieldContextProps';\nimport { FlexboxProps } from '#utils/UNSAFE_interpolations/flexbox';\nimport { Size } from '#utils/UNSAFE_size';\nimport { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { styles } from './CheckboxSetStyles.css';\nimport { AriaAttributesSignalExcluded } from '#utils/UNSAFE_attributeUtils';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { LayoutColumnSpan } from '#utils/UNSAFE_styles/Layout';\nimport { TestIdProps } from '#hooks/UNSAFE_useTestId';\n\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = {\n /**\n * The ID of an element (or space separated IDs of multiple elements) that\n * describes the input.\n */\n 'aria-describedby'?: AriaAttributesSignalExcluded['aria-describedby'];\n /**\n * Text to provide guidance to help the user understand what data to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * set of CheckboxItems\n */\n children: ComponentChildren;\n /**\n * Specifies how many columns to span in a FormLayout with direction === 'row'\n */\n columnSpan?: LayoutColumnSpan;\n /**\n * layout direction of the children elements\n */\n direction?: FlexboxProps['direction'];\n /**\n * Help source URL associated with the component.\n */\n helpSourceLink?: InlineUserAssistanceProps['helpSourceLink'];\n /**\n * Custom text to be rendered for the <code>helpSourceLink</code>.\n */\n helpSourceText?: InlineUserAssistanceProps['helpSourceText'];\n /**\n * Specifies whether the checkbox set requires a selection to be made.\n */\n isRequired?: boolean;\n /**\n * Specifies if the checkbox set is read-only.\n */\n isReadonly?: boolean;\n /**\n * Specifies if the checkbox set is disabled.\n */\n isDisabled?: boolean;\n /**\n * Label text for the group of checkbox items.\n */\n label: string;\n /**\n * Specifies where the label is positioned relative to the field.\n */\n labelEdge?: 'none' | 'top' | 'start' | 'inside';\n /**\n * Specifies the width of the label when <code>labelEdge</code> is <code>\"start\"</code>.\n */\n labelStartWidth?: Size;\n /**\n * Messages to show on screen that are associated with the component.\n */\n messages?: InlineUserAssistanceProps['messages'];\n /**\n * Callback invoked each time the user changes selected option.\n */\n onCommit: (detail: ValueUpdateDetail<Set<string | number>>) => void;\n /**\n * Specifies the density of the user assistance presentation. It can be set to:\n * <ul>\n * <li><code>'reflow'</code>: Show inline. Layout will reflow when text is displayed.</li>\n * <li><code>'efficient'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * <li><code>'compact'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * </ul>\n */\n userAssistanceDensity?: UserAssistanceDensityType;\n /**\n * Value of the selected checkbox option.\n */\n value?: Set<string | number>;\n} & TestIdProps;\n/**\n * A CheckboxSet set allows the user to select one or more options from a set.\n */\nexport const CheckboxSet = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n assistiveText,\n columnSpan,\n direction = 'column',\n helpSourceLink,\n helpSourceText,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n isRequired = false,\n label,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n messages,\n onCommit,\n userAssistanceDensity: propUserAssistanceDensity,\n value,\n children,\n testId\n }: Props,\n ref?: Ref<FocusableHandle>\n ) => {\n const hasValue = value !== undefined ? value.size > 0 : false;\n const baseId = useId();\n\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n userAssistanceDensity: formUserAssistanceDensity\n } = useFormContext();\n\n // default to FormContext values if component properties are not specified\n const isDisabled = propIsDisabled ?? isFormDisabled;\n const isReadonly = propIsReadonly ?? isFormReadonly;\n const labelEdge = propLabelEdge ?? formLabelEdge;\n const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n\n const formFieldContext = useFormFieldContextProps({\n hasValue,\n isDisabled,\n isReadonly\n });\n\n const checkboxSetContext = useMemo(\n () => ({\n name: baseId,\n value,\n onCommit\n }),\n [baseId, onCommit, value]\n );\n\n // wrap each CheckboxItem in an <li> tag and the entire set with <ul>\n const childrenArray = toChildArray(children).filter(Boolean);\n const wrappedChildren = childrenArray.map((item) => <li>{item}</li>);\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <CheckboxRadioField\n aria-describedby={ariaDescribedBy}\n assistiveText={assistiveText}\n baseId={baseId}\n columnSpan={columnSpan}\n direction={direction}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n isRequired={isRequired}\n label={label}\n labelEdge={labelEdge}\n labelStartWidth={labelStartWidth}\n parentComponentVariant=\"checkboxSet\"\n messages={messages}\n userAssistanceDensity={userAssistanceDensity}\n hasValue={hasValue}\n role=\"group\"\n testId={testId}\n ref={ref}>\n <CheckboxSetContext.Provider value={checkboxSetContext}>\n <ul className={styles.ul}>{wrappedChildren}</ul>\n </CheckboxSetContext.Provider>\n </CheckboxRadioField>\n </FormFieldContext.Provider>\n );\n }\n);\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoGA;;AAEG;AACI,MAAM,WA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thCounter } from './MaxLengthCounter-cead2dac.js';
|
|
2
|
+
export { M as MaxLengthCounter, T as TextArea } from './TextArea-ea6aaf32.js';
|
|
4
3
|
import 'preact/jsx-runtime';
|
|
5
4
|
import 'preact/compat';
|
|
6
5
|
import './FormContext-4d71f9c7.js';
|
|
@@ -261,7 +260,7 @@ import './CompactUserAssistance-3a10afd4.js';
|
|
|
261
260
|
import './Separator-93c70737.js';
|
|
262
261
|
import './useLengthFilter-f72f45ac.js';
|
|
263
262
|
import './lengthFilter-d249a7ab.js';
|
|
263
|
+
import './MaxLengthCounterStyles.styles.css';
|
|
264
264
|
import './useCurrentValueReducer-bdf796fa.js';
|
|
265
265
|
import './useSelectableTextField-949184a5.js';
|
|
266
|
-
import './MaxLengthCounterStyles.styles.css';
|
|
267
266
|
//# sourceMappingURL=UNSAFE_TextArea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNSAFE_TextArea.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UNSAFE_TextArea.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* @oracle/oraclejet-preact: undefined */
|
|
2
|
-
export { T as TextAreaAutosize } from './TextAreaAutosize-
|
|
2
|
+
export { T as TextAreaAutosize } from './TextAreaAutosize-edc7dde7.js';
|
|
3
3
|
import 'preact/jsx-runtime';
|
|
4
4
|
import 'preact/compat';
|
|
5
5
|
import './FormContext-4d71f9c7.js';
|
|
@@ -261,7 +261,7 @@ import './Separator-93c70737.js';
|
|
|
261
261
|
import './useLengthFilter-f72f45ac.js';
|
|
262
262
|
import './lengthFilter-d249a7ab.js';
|
|
263
263
|
import './useCurrentValueReducer-bdf796fa.js';
|
|
264
|
-
import './
|
|
265
|
-
import './MaxLengthCounter-cead2dac.js';
|
|
264
|
+
import './TextArea-ea6aaf32.js';
|
|
266
265
|
import './MaxLengthCounterStyles.styles.css';
|
|
266
|
+
import './useSelectableTextField-949184a5.js';
|
|
267
267
|
//# sourceMappingURL=UNSAFE_TextAreaAutosize.js.map
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"scripts": {},
|
|
6
6
|
"devDependencies": {},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@oracle/oraclejet-testing": "17.1.
|
|
8
|
+
"@oracle/oraclejet-testing": "17.1.7",
|
|
9
9
|
"csstype": "3.1.1"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
]
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
"version": "17.1.
|
|
36
|
+
"version": "17.1.7"
|
|
37
37
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
define(['exports', 'preact/jsx-runtime', 'preact', 'preact/hooks', 'preact/compat', './FormContext-5130e198', './useFormContext-30acdd33', './FormFieldContext-3c44aaaa', './useFormFieldContextProps-4e36b4c3', 'css!./CheckboxSetStyles.styles.css', './useId-c9578d26', './CheckboxRadioField-005a110c'], (function(e,s,t,i,o,a,l,r,n,d,c,u){"use strict";const x=t.createContext({});var b="CheckboxSetStyles_styles_ul__68p6630";const h=o.forwardRef((({"aria-describedby":e,assistiveText:o,columnSpan:a,direction:d="column",helpSourceLink:h,helpSourceText:m,isDisabled:C,isReadonly:p,isRequired:S=!1,label:y,labelEdge:F,labelStartWidth:k,messages:v,onCommit:R,userAssistanceDensity:D,value:f,children:g,testId:j},I)=>{const A=void 0!==f&&f.size>0,P=c.useId(),{isDisabled:T,isReadonly:_,labelEdge:E,labelStartWidth:V,userAssistanceDensity:W}=l.useFormContext(),q=C??T,L=p??_,w=F??E,z=k??V,B=D??W,M=n.useFormFieldContextProps({hasValue:A,isDisabled:q,isReadonly:L}),N=i.useMemo((()=>({name:P,value:f,onCommit:R})),[P,R,f]),G=t.toChildArray(g).filter(Boolean).map((e=>s.jsx("li",{children:e})));return s.jsx(r.FormFieldContext.Provider,{value:M,children:s.jsx(u.CheckboxRadioField,{"aria-describedby":e,assistiveText:o,baseId:P,columnSpan:a,direction:d,helpSourceLink:h,helpSourceText:m,isDisabled:q,isReadonly:L,isRequired:S,label:y,labelEdge:w,labelStartWidth:z,parentComponentVariant:"checkboxSet",messages:v,userAssistanceDensity:B,hasValue:A,role:"group",testId:j,ref:I,children:s.jsx(x.Provider,{value:N,children:s.jsx("ul",{className:b,children:G})})})})}));e.CheckboxSet=h,e.CheckboxSetContext=x,e.useCheckboxSetContext=()=>i.useContext(x)}));
|
|
2
|
-
//# sourceMappingURL=CheckboxSet-e523552e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxSet-e523552e.js","sources":["../../src/UNSAFE_CheckboxSet/CheckboxSetContext.ts","../../src/UNSAFE_CheckboxSet/CheckboxSet.tsx"],"sourcesContent":["import { createContext } from 'preact';\nimport { useContext } from 'preact/hooks';\n\nimport { ValueUpdateDetail } from '../utils/UNSAFE_valueUpdateDetail';\n\ntype CheckboxSetContextValue = {\n name: string;\n value?: Set<string | number>;\n onCommit?: (detail: ValueUpdateDetail<Set<string | number>>) => void;\n};\n\nconst CheckboxSetContext = createContext<CheckboxSetContextValue>({} as CheckboxSetContextValue);\nconst useCheckboxSetContext = () => useContext(CheckboxSetContext);\n\nexport { CheckboxSetContext, useCheckboxSetContext };\n","import { ComponentChildren, ComponentProps, Ref, toChildArray } from 'preact';\nimport { useMemo } from 'preact/hooks';\nimport { forwardRef } from 'preact/compat';\n\nimport { CheckboxSetContext } from './CheckboxSetContext';\nimport { CheckboxRadioField } from '#PRIVATE_CheckboxRadioField';\nimport { InlineUserAssistance, UserAssistanceDensityType } from '#UNSAFE_UserAssistance';\nimport { useFormContext } from '#hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '#hooks/UNSAFE_useFormFieldContext';\nimport { useFormFieldContextProps } from '#hooks/UNSAFE_useFormFieldContextProps';\nimport { FlexboxProps } from '#utils/UNSAFE_interpolations/flexbox';\nimport { Size } from '#utils/UNSAFE_size';\nimport { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { styles } from './CheckboxSetStyles.css';\nimport { AriaAttributesSignalExcluded } from '#utils/UNSAFE_attributeUtils';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { LayoutColumnSpan } from '#utils/UNSAFE_styles/Layout';\nimport { TestIdProps } from '#hooks/UNSAFE_useTestId';\n\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = {\n /**\n * The ID of an element (or space separated IDs of multiple elements) that\n * describes the input.\n */\n 'aria-describedby'?: AriaAttributesSignalExcluded['aria-describedby'];\n /**\n * Text to provide guidance to help the user understand what data to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * set of CheckboxItems\n */\n children: ComponentChildren;\n /**\n * Specifies how many columns to span in a FormLayout with direction === 'row'\n */\n columnSpan?: LayoutColumnSpan;\n /**\n * layout direction of the children elements\n */\n direction?: FlexboxProps['direction'];\n /**\n * Help source URL associated with the component.\n */\n helpSourceLink?: InlineUserAssistanceProps['helpSourceLink'];\n /**\n * Custom text to be rendered for the <code>helpSourceLink</code>.\n */\n helpSourceText?: InlineUserAssistanceProps['helpSourceText'];\n /**\n * Specifies whether the checkbox set requires a selection to be made.\n */\n isRequired?: boolean;\n /**\n * Specifies if the checkbox set is read-only.\n */\n isReadonly?: boolean;\n /**\n * Specifies if the checkbox set is disabled.\n */\n isDisabled?: boolean;\n /**\n * Label text for the group of checkbox items.\n */\n label: string;\n /**\n * Specifies where the label is positioned relative to the field.\n */\n labelEdge?: 'none' | 'top' | 'start' | 'inside';\n /**\n * Specifies the width of the label when <code>labelEdge</code> is <code>\"start\"</code>.\n */\n labelStartWidth?: Size;\n /**\n * Messages to show on screen that are associated with the component.\n */\n messages?: InlineUserAssistanceProps['messages'];\n /**\n * Callback invoked each time the user changes selected option.\n */\n onCommit: (detail: ValueUpdateDetail<Set<string | number>>) => void;\n /**\n * Specifies the density of the user assistance presentation. It can be set to:\n * <ul>\n * <li><code>'reflow'</code>: Show inline. Layout will reflow when text is displayed.</li>\n * <li><code>'efficient'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * <li><code>'compact'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * </ul>\n */\n userAssistanceDensity?: UserAssistanceDensityType;\n /**\n * Value of the selected checkbox option.\n */\n value?: Set<string | number>;\n} & TestIdProps;\n/**\n * A CheckboxSet set allows the user to select one or more options from a set.\n */\nexport const CheckboxSet = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n assistiveText,\n columnSpan,\n direction = 'column',\n helpSourceLink,\n helpSourceText,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n isRequired = false,\n label,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n messages,\n onCommit,\n userAssistanceDensity: propUserAssistanceDensity,\n value,\n children,\n testId\n }: Props,\n ref?: Ref<FocusableHandle>\n ) => {\n const hasValue = value !== undefined ? value.size > 0 : false;\n const baseId = useId();\n\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n userAssistanceDensity: formUserAssistanceDensity\n } = useFormContext();\n\n // default to FormContext values if component properties are not specified\n const isDisabled = propIsDisabled ?? isFormDisabled;\n const isReadonly = propIsReadonly ?? isFormReadonly;\n const labelEdge = propLabelEdge ?? formLabelEdge;\n const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n\n const formFieldContext = useFormFieldContextProps({\n hasValue,\n isDisabled,\n isReadonly\n });\n\n const checkboxSetContext = useMemo(\n () => ({\n name: baseId,\n value,\n onCommit\n }),\n [baseId, onCommit, value]\n );\n\n // wrap each CheckboxItem in an <li> tag and the entire set with <ul>\n const childrenArray = toChildArray(children).filter(Boolean);\n const wrappedChildren = childrenArray.map((item) => <li>{item}</li>);\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <CheckboxRadioField\n aria-describedby={ariaDescribedBy}\n assistiveText={assistiveText}\n baseId={baseId}\n columnSpan={columnSpan}\n direction={direction}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n isRequired={isRequired}\n label={label}\n labelEdge={labelEdge}\n labelStartWidth={labelStartWidth}\n parentComponentVariant=\"checkboxSet\"\n messages={messages}\n userAssistanceDensity={userAssistanceDensity}\n hasValue={hasValue}\n role=\"group\"\n testId={testId}\n ref={ref}>\n <CheckboxSetContext.Provider value={checkboxSetContext}>\n <ul className={styles.ul}>{wrappedChildren}</ul>\n </CheckboxSetContext.Provider>\n </CheckboxRadioField>\n </FormFieldContext.Provider>\n );\n }\n);\n"],"names":["CheckboxSetContext","createContext","CheckboxSet","forwardRef","ariaDescribedBy","assistiveText","columnSpan","direction","helpSourceLink","helpSourceText","isDisabled","propIsDisabled","isReadonly","propIsReadonly","isRequired","label","labelEdge","propLabelEdge","labelStartWidth","propLabelStartWidth","messages","onCommit","userAssistanceDensity","propUserAssistanceDensity","value","children","testId","ref","hasValue","undefined","size","baseId","useId","isFormDisabled","isFormReadonly","formLabelEdge","formLabelStartWidth","formUserAssistanceDensity","useFormContext","formFieldContext","useFormFieldContextProps","checkboxSetContext","useMemo","name","wrappedChildren","toChildArray","filter","Boolean","map","item","_jsx","FormFieldContext","Provider","CheckboxRadioField","parentComponentVariant","role","jsx","className","styles","useContext"],"mappings":"6UAWA,MAAMA,EAAqBC,EAAaA,cAA0B,iDC4F3D,MAAMC,EAAcC,EAAUA,YACnC,EAEI,mBAAoBC,EACpBC,gBACAC,aACAC,YAAY,SACZC,iBACAC,iBACAC,WAAYC,EACZC,WAAYC,EACZC,cAAa,EACbC,QACAC,UAAWC,EACXC,gBAAiBC,EACjBC,WACAC,WACAC,sBAAuBC,EACvBC,QACAC,WACAC,UAEFC,KAEA,MAAMC,OAAqBC,IAAVL,GAAsBA,EAAMM,KAAO,EAC9CC,EAASC,EAAAA,SAGbtB,WAAYuB,EACZrB,WAAYsB,EACZlB,UAAWmB,EACXjB,gBAAiBkB,EACjBd,sBAAuBe,GACrBC,EAAcA,iBAGZ5B,EAAaC,GAAkBsB,EAC/BrB,EAAaC,GAAkBqB,EAC/BlB,EAAYC,GAAiBkB,EAC7BjB,EAAkBC,GAAuBiB,EACzCd,EAAwBC,GAA6Bc,EAErDE,EAAmBC,EAAAA,yBAAyB,CAChDZ,WACAlB,aACAE,eAGI6B,EAAqBC,EAAAA,SACzB,KAAO,CACLC,KAAMZ,EACNP,QACAH,cAEF,CAACU,EAAQV,EAAUG,IAKfoB,EADgBC,EAAAA,aAAapB,GAAUqB,OAAOC,SACdC,KAAKC,GAASC,MAAA,KAAA,CAAAzB,SAAKwB,MAEzD,OACEC,EAAAA,IAACC,EAAAA,iBAAiBC,UAAS5B,MAAOe,EAAgBd,SAChDyB,EAAAA,IAACG,EAAAA,uCACmBjD,EAClBC,cAAeA,EACf0B,OAAQA,EACRzB,WAAYA,EACZC,UAAWA,EACXC,eAAgBA,EAChBC,eAAgBA,EAChBC,WAAYA,EACZE,WAAYA,EACZE,WAAYA,EACZC,MAAOA,EACPC,UAAWA,EACXE,gBAAiBA,EACjBoC,uBAAuB,cACvBlC,SAAUA,EACVE,sBAAuBA,EACvBM,SAAUA,EACV2B,KAAK,QACL7B,OAAQA,EACRC,IAAKA,EACLF,SAAAyB,EAAAM,IAACxD,EAAmBoD,SAAQ,CAAC5B,MAAOiB,EAAkBhB,SACpDyB,EAAAA,UAAIO,UAAWC,EAASjC,SAAGmB,SAIjC,mEDpLwB,IAAMe,EAAAA,WAAW3D"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
define(['exports', 'preact/jsx-runtime', 'preact/compat', 'preact/hooks', './Calendar-9b725f49', './InputDateMask-9aba967d', './HiddenAccessible-037ef42d', './IconButton-81c8463f', './clientHints-030d25aa', './FormFieldContext-3c44aaaa', './logger-0f873e29', './TabbableModeContext-a9c97640', './useTranslationBundle-516b1b83', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-2a480664', './Flex-56ecdf4c', 'css!./MessageBannerStyles.styles.css', 'module', './UNSAFE_MessageBanner/themes/redwood/MessageBannerVariants.css', 'preact', './LayerHost-e95c5f30', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-3b34c2bc', 'css!./IconStyle.styles.css', 'css!./MessageStyles.styles.css', './MessageFormattingUtils-2e19d8de', './TransitionGroup-3b9d81b6', './MessagesContext-602a69a2', 'css!./HiddenAccessibleStyles.styles.css', 'css!./ComponentMessageStyles.styles.css', 'module', './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageVariants.css', './Popup-956e6d7d', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './InputGroupContext-372087af', 'module', './UNSAFE_Popup/themes/redwood/PopupVariants.css', './UNSAFE_InputDatePicker/themes/InputDatePickerDropdownStyles.css', './Sheet-e6308643', './DatePicker-d7802b3e', './SectionedContent-6031f8f7', './stringUtils-0ae982c2', './FormContext-5130e198', './useFormContext-30acdd33', './useId-c9578d26', './getFormatParse-c1655d39', './maskUtils-550b6ac2', './calendarDateUtils-ee8bb928'], (function(e,s,t,a,n,o,r,i,l,d,c,u,m,p,h,y,f,b,C,D,S,k,x,A,v,g,F,T,V,I,w,P,U,M,R,j,_,B,H,E,N,L,O,Y,Z,W,z,G,q,J,K,Q,X,$,ee){"use strict";const se=({anchorRef:e,assistiveText:t,dayFormatter:n,daysOutsideMonth:o,helpSourceLink:r,helpSourceText:i,isDisabled:l,isOpen:c,isReadonly:u,label:p,onClose:h,onCommit:y,max:b,messages:C,min:D,monthAndYearPicker:S,testId:k,todayButton:x,todayTimeZone:A,userAssistanceDensity:v,value:g,weekDisplay:F})=>{const[T,V]=a.useState(!1),[I,w]=a.useState(c),P=a.useCallback((e=>{V(e.placement.startsWith("top"))}),[]);I!==c&&(w(c),c||V(!1));const U=te(),{datePicker_label:M}=m.useTranslationBundle("@oracle/oraclejet-preact"),R=M(),j=s.jsx(z.DatePicker,{dayFormatter:n,daysOutsideMonth:o,height:U?void 0:"auto",onCommit:y,max:b,min:D,maxWidth:U?"100%":void 0,width:"100%",monthAndYearPicker:S,testId:k,todayTimeZone:A,todayButton:x,value:g,weekDisplay:F}),_=!c||T&&!U||l||u||!(t||r||C&&C.length>0)||"efficient"!==v&&"reflow"!==v?void 0:s.jsx(d.FormFieldContext.Provider,{value:{isFocused:!0},children:s.jsx("div",{class:Z.userAssistanceStyles,children:s.jsx(f.InlineUserAssistance,{assistiveText:t,fieldLabel:p,helpSourceLink:r,helpSourceText:i,messages:C,userAssistanceDensity:v})})}),B=k?k+(U?"_sheet":"_dropdown"):void 0,H=s.jsx("div",{class:Z.dropdownStyles,children:s.jsx(G.SectionedContent,{"aria-label":R,footer:_,hasFocusTrap:!0,main:j,role:"dialog",testId:B})});return U?s.jsx(W.Sheet,{initialFocus:"firstFocusable",isOpen:c,onClose:h,children:s.jsx(G.SectionedContent,{"aria-label":R,footer:_,hasFocusTrap:!0,main:j,role:"dialog",testId:B})}):s.jsx(G.StickyPositioningDropdown,{anchorRef:e,initialFocus:"firstFocusable",isOpen:c,onClose:h,onPosition:P,sizeOptions:{isMaxWidthAdjusted:!1,isMaxHeightAdjusted:!0},children:H})},te=()=>"phone"===l.getClientHints().deviceType,ae=e=>e&&ee.isCompleteCalendarDate(e)?e:void 0,ne=(e,s)=>{switch(s.type){case"dateChanged":return{...e,dateValue:s.data,completeDateValue:ae(s.data)};case"dateSelected":return{...e,dateValue:s.data,completeDateValue:s.data};case"reset":return{completeDateValue:ae(s.data),dateValue:s.data};default:return e}},oe=({onCommit:e,onInput:s,value:t})=>{const[n,o]=a.useState(!1),r=a.useRef(null),i=a.useRef(null),l=a.useRef(!1),d=a.useRef(),c=a.useRef(t),u=a.useRef(t),m=a.useRef(t),p=a.useRef(!1),{state:h,dispatch:y}=(({value:e})=>{const[s,t]=a.useReducer(ne,{completeDateValue:ae(e),dateValue:e});return{state:s,dispatch:t}})({value:t});$.calendarDatesAreDifferent(m.current,t)&&(m.current=t,$.calendarDatesAreDifferent(t,h.dateValue)&&(y({type:"reset",data:t}),u.current=t,c.current=t)),a.useEffect((()=>{$.calendarDatesAreDifferent(h.dateValue,u.current)&&(s({previousValue:u.current,value:h.dateValue}),u.current=h.dateValue),p.current&&$.calendarDatesAreDifferent(h.dateValue,c.current)&&(e?.({previousValue:c.current,value:h.dateValue}),c.current=h.dateValue,p.current=!1)}),[e,s,h.dateValue]);const f=a.useCallback((e=>{y({type:"dateChanged",data:e.value})}),[y]),b=a.useCallback((()=>{$.calendarDatesAreDifferent(c.current,h.dateValue)&&(e?.({value:h.dateValue,previousValue:c.current}),c.current=h.dateValue)}),[e,h.dateValue]),C=a.useCallback((()=>{l.current||o((e=>!e)),l.current=!1}),[]),D=a.useCallback((e=>{"outsideMousedown"===e.reason?(l.current=!0,clearTimeout(d.current),d.current=setTimeout((()=>{l.current=!1}),200)):"dismissed"!==e.reason&&"keyboardDismissed"!==e.reason||r.current?.focus(),o(!1)}),[]);return{calendarIconActionHandler:C,datePickerCommitHandler:a.useCallback((e=>{r.current?.focus(),p.current=!0,y({type:"dateSelected",data:e.value}),o(!1)}),[y]),dropdownCloseHandler:D,completeDateValue:h.completeDateValue,dateValue:h.dateValue,iconRef:r,isOpen:n,maskCommitHandler:b,maskInputHandler:f,maskRef:i}},re=t.forwardRef((({"aria-describedby":e,assistiveText:t,dayFormatter:l,daysOutsideMonth:d,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,label:y,max:f,messages:b,min:C,monthAndYearPicker:D,todayTimeZone:S,todayButton:k,value:x,onCommit:A,onInput:v,testId:g,userAssistanceDensity:F,weekDisplay:T,...V},I)=>{const{calendarIconActionHandler:w,datePickerCommitHandler:P,completeDateValue:U,dateValue:M,dropdownCloseHandler:R,iconRef:j,isOpen:_,maskCommitHandler:B,maskInputHandler:H,maskRef:E}=oe({onCommit:A,onInput:v,value:x}),N=a.useRef(null),{inputDatePicker_selectDate:L,inputDatePicker_instruction:O}=m.useTranslationBundle("@oracle/oraclejet-preact"),Y=L(),{userAssistanceDensity:Z}=K.useFormContext(),W=F??Z;a.useImperativeHandle(I,(()=>({focus:()=>{E.current?.focus()},blur:()=>{E.current?.blur()}})));const z=Q.useId(),G=O(),J=p||h?void 0:s.jsx(r.HiddenAccessible,{id:z,isHidden:!0,children:G}),X=p||h?e:q.merge([e,z]),$=s.jsx(i.IconButton,{"aria-haspopup":"dialog","aria-label":Y,isDisabled:p,ref:j,size:"sm",testId:g?g+"_calendarIcon":void 0,variant:"ghost",onAction:w,children:s.jsx(n.SvgCalendar,{})}),ee=_;return s.jsxs(s.Fragment,{children:[s.jsx(o.InputDateMaskContext.Provider,{value:{isDropdownOpen:_,isInputDatePickerParent:!0},children:s.jsx(o.InputDateMask,{"aria-describedby":X,assistiveText:t,endContent:$,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,label:y,onCommit:B,onInput:H,mainFieldRef:N,messages:b,testId:g,ref:E,userAssistanceDensity:F,value:M,...V})}),J,ee&&s.jsx(se,{anchorRef:N,assistiveText:t,dayFormatter:l,daysOutsideMonth:d,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,isOpen:_,label:y,onClose:R,onCommit:P,max:f,messages:b,min:C,monthAndYearPicker:D,testId:g?g+"_datePicker":void 0,todayTimeZone:S,todayButton:k,userAssistanceDensity:W,value:U,weekDisplay:T})]})}));e.InputDatePicker=re}));
|
|
2
|
-
//# sourceMappingURL=InputDatePicker-97756bcd.js.map
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/* @oracle/oraclejet-preact: undefined */
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var jsxRuntime = require('preact/jsx-runtime');
|
|
5
|
-
var preact = require('preact');
|
|
6
|
-
var hooks = require('preact/hooks');
|
|
7
|
-
var compat = require('preact/compat');
|
|
8
|
-
require('./FormContext-9452bd30.js');
|
|
9
|
-
var useFormContext = require('./useFormContext-4c3091dc.js');
|
|
10
|
-
var FormFieldContext = require('./FormFieldContext-8418dc68.js');
|
|
11
|
-
var useFormFieldContextProps = require('./useFormFieldContextProps-8c04ed0f.js');
|
|
12
|
-
|
|
13
|
-
var useId = require('./useId-6c0eeb27.js');
|
|
14
|
-
var CheckboxRadioField = require('./CheckboxRadioField-0242222e.js');
|
|
15
|
-
|
|
16
|
-
const CheckboxSetContext = preact.createContext({});
|
|
17
|
-
const useCheckboxSetContext = () => hooks.useContext(CheckboxSetContext);
|
|
18
|
-
|
|
19
|
-
var styles = {ul:'CheckboxSetStyles_styles_ul__68p6630'};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* A CheckboxSet set allows the user to select one or more options from a set.
|
|
23
|
-
*/
|
|
24
|
-
const CheckboxSet = compat.forwardRef(({ 'aria-describedby': ariaDescribedBy, assistiveText, columnSpan, direction = 'column', helpSourceLink, helpSourceText, isDisabled: propIsDisabled, isReadonly: propIsReadonly, isRequired = false, label, labelEdge: propLabelEdge, labelStartWidth: propLabelStartWidth, messages, onCommit, userAssistanceDensity: propUserAssistanceDensity, value, children, testId }, ref) => {
|
|
25
|
-
const hasValue = value !== undefined ? value.size > 0 : false;
|
|
26
|
-
const baseId = useId.useId();
|
|
27
|
-
const { isDisabled: isFormDisabled, isReadonly: isFormReadonly, labelEdge: formLabelEdge, labelStartWidth: formLabelStartWidth, userAssistanceDensity: formUserAssistanceDensity } = useFormContext.useFormContext();
|
|
28
|
-
// default to FormContext values if component properties are not specified
|
|
29
|
-
const isDisabled = propIsDisabled ?? isFormDisabled;
|
|
30
|
-
const isReadonly = propIsReadonly ?? isFormReadonly;
|
|
31
|
-
const labelEdge = propLabelEdge ?? formLabelEdge;
|
|
32
|
-
const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;
|
|
33
|
-
const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;
|
|
34
|
-
const formFieldContext = useFormFieldContextProps.useFormFieldContextProps({
|
|
35
|
-
hasValue,
|
|
36
|
-
isDisabled,
|
|
37
|
-
isReadonly
|
|
38
|
-
});
|
|
39
|
-
const checkboxSetContext = hooks.useMemo(() => ({
|
|
40
|
-
name: baseId,
|
|
41
|
-
value,
|
|
42
|
-
onCommit
|
|
43
|
-
}), [baseId, onCommit, value]);
|
|
44
|
-
// wrap each CheckboxItem in an <li> tag and the entire set with <ul>
|
|
45
|
-
const childrenArray = preact.toChildArray(children).filter(Boolean);
|
|
46
|
-
const wrappedChildren = childrenArray.map((item) => jsxRuntime.jsx("li", { children: item }));
|
|
47
|
-
return (jsxRuntime.jsx(FormFieldContext.FormFieldContext.Provider, { value: formFieldContext, children: jsxRuntime.jsx(CheckboxRadioField.CheckboxRadioField, { "aria-describedby": ariaDescribedBy, assistiveText: assistiveText, baseId: baseId, columnSpan: columnSpan, direction: direction, helpSourceLink: helpSourceLink, helpSourceText: helpSourceText, isDisabled: isDisabled, isReadonly: isReadonly, isRequired: isRequired, label: label, labelEdge: labelEdge, labelStartWidth: labelStartWidth, parentComponentVariant: "checkboxSet", messages: messages, userAssistanceDensity: userAssistanceDensity, hasValue: hasValue, role: "group", testId: testId, ref: ref, children: jsxRuntime.jsx(CheckboxSetContext.Provider, { value: checkboxSetContext, children: jsxRuntime.jsx("ul", { className: styles.ul, children: wrappedChildren }) }) }) }));
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
exports.CheckboxSet = CheckboxSet;
|
|
51
|
-
exports.CheckboxSetContext = CheckboxSetContext;
|
|
52
|
-
exports.useCheckboxSetContext = useCheckboxSetContext;
|
|
53
|
-
//# sourceMappingURL=CheckboxSet-368b907b.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxSet-368b907b.js","sources":["../../src/UNSAFE_CheckboxSet/CheckboxSetContext.ts","../../src/UNSAFE_CheckboxSet/CheckboxSet.tsx"],"sourcesContent":["import { createContext } from 'preact';\nimport { useContext } from 'preact/hooks';\n\nimport { ValueUpdateDetail } from '../utils/UNSAFE_valueUpdateDetail';\n\ntype CheckboxSetContextValue = {\n name: string;\n value?: Set<string | number>;\n onCommit?: (detail: ValueUpdateDetail<Set<string | number>>) => void;\n};\n\nconst CheckboxSetContext = createContext<CheckboxSetContextValue>({} as CheckboxSetContextValue);\nconst useCheckboxSetContext = () => useContext(CheckboxSetContext);\n\nexport { CheckboxSetContext, useCheckboxSetContext };\n","import { ComponentChildren, ComponentProps, Ref, toChildArray } from 'preact';\nimport { useMemo } from 'preact/hooks';\nimport { forwardRef } from 'preact/compat';\n\nimport { CheckboxSetContext } from './CheckboxSetContext';\nimport { CheckboxRadioField } from '#PRIVATE_CheckboxRadioField';\nimport { InlineUserAssistance, UserAssistanceDensityType } from '#UNSAFE_UserAssistance';\nimport { useFormContext } from '#hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '#hooks/UNSAFE_useFormFieldContext';\nimport { useFormFieldContextProps } from '#hooks/UNSAFE_useFormFieldContextProps';\nimport { FlexboxProps } from '#utils/UNSAFE_interpolations/flexbox';\nimport { Size } from '#utils/UNSAFE_size';\nimport { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { styles } from './CheckboxSetStyles.css';\nimport { AriaAttributesSignalExcluded } from '#utils/UNSAFE_attributeUtils';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { LayoutColumnSpan } from '#utils/UNSAFE_styles/Layout';\nimport { TestIdProps } from '#hooks/UNSAFE_useTestId';\n\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = {\n /**\n * The ID of an element (or space separated IDs of multiple elements) that\n * describes the input.\n */\n 'aria-describedby'?: AriaAttributesSignalExcluded['aria-describedby'];\n /**\n * Text to provide guidance to help the user understand what data to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * set of CheckboxItems\n */\n children: ComponentChildren;\n /**\n * Specifies how many columns to span in a FormLayout with direction === 'row'\n */\n columnSpan?: LayoutColumnSpan;\n /**\n * layout direction of the children elements\n */\n direction?: FlexboxProps['direction'];\n /**\n * Help source URL associated with the component.\n */\n helpSourceLink?: InlineUserAssistanceProps['helpSourceLink'];\n /**\n * Custom text to be rendered for the <code>helpSourceLink</code>.\n */\n helpSourceText?: InlineUserAssistanceProps['helpSourceText'];\n /**\n * Specifies whether the checkbox set requires a selection to be made.\n */\n isRequired?: boolean;\n /**\n * Specifies if the checkbox set is read-only.\n */\n isReadonly?: boolean;\n /**\n * Specifies if the checkbox set is disabled.\n */\n isDisabled?: boolean;\n /**\n * Label text for the group of checkbox items.\n */\n label: string;\n /**\n * Specifies where the label is positioned relative to the field.\n */\n labelEdge?: 'none' | 'top' | 'start' | 'inside';\n /**\n * Specifies the width of the label when <code>labelEdge</code> is <code>\"start\"</code>.\n */\n labelStartWidth?: Size;\n /**\n * Messages to show on screen that are associated with the component.\n */\n messages?: InlineUserAssistanceProps['messages'];\n /**\n * Callback invoked each time the user changes selected option.\n */\n onCommit: (detail: ValueUpdateDetail<Set<string | number>>) => void;\n /**\n * Specifies the density of the user assistance presentation. It can be set to:\n * <ul>\n * <li><code>'reflow'</code>: Show inline. Layout will reflow when text is displayed.</li>\n * <li><code>'efficient'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * <li><code>'compact'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * </ul>\n */\n userAssistanceDensity?: UserAssistanceDensityType;\n /**\n * Value of the selected checkbox option.\n */\n value?: Set<string | number>;\n} & TestIdProps;\n/**\n * A CheckboxSet set allows the user to select one or more options from a set.\n */\nexport const CheckboxSet = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n assistiveText,\n columnSpan,\n direction = 'column',\n helpSourceLink,\n helpSourceText,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n isRequired = false,\n label,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n messages,\n onCommit,\n userAssistanceDensity: propUserAssistanceDensity,\n value,\n children,\n testId\n }: Props,\n ref?: Ref<FocusableHandle>\n ) => {\n const hasValue = value !== undefined ? value.size > 0 : false;\n const baseId = useId();\n\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n userAssistanceDensity: formUserAssistanceDensity\n } = useFormContext();\n\n // default to FormContext values if component properties are not specified\n const isDisabled = propIsDisabled ?? isFormDisabled;\n const isReadonly = propIsReadonly ?? isFormReadonly;\n const labelEdge = propLabelEdge ?? formLabelEdge;\n const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n\n const formFieldContext = useFormFieldContextProps({\n hasValue,\n isDisabled,\n isReadonly\n });\n\n const checkboxSetContext = useMemo(\n () => ({\n name: baseId,\n value,\n onCommit\n }),\n [baseId, onCommit, value]\n );\n\n // wrap each CheckboxItem in an <li> tag and the entire set with <ul>\n const childrenArray = toChildArray(children).filter(Boolean);\n const wrappedChildren = childrenArray.map((item) => <li>{item}</li>);\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <CheckboxRadioField\n aria-describedby={ariaDescribedBy}\n assistiveText={assistiveText}\n baseId={baseId}\n columnSpan={columnSpan}\n direction={direction}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n isRequired={isRequired}\n label={label}\n labelEdge={labelEdge}\n labelStartWidth={labelStartWidth}\n parentComponentVariant=\"checkboxSet\"\n messages={messages}\n userAssistanceDensity={userAssistanceDensity}\n hasValue={hasValue}\n role=\"group\"\n testId={testId}\n ref={ref}>\n <CheckboxSetContext.Provider value={checkboxSetContext}>\n <ul className={styles.ul}>{wrappedChildren}</ul>\n </CheckboxSetContext.Provider>\n </CheckboxRadioField>\n </FormFieldContext.Provider>\n );\n }\n);\n"],"names":["createContext","useContext","forwardRef","useId","useFormContext","useFormFieldContextProps","useMemo","toChildArray","_jsx","FormFieldContext","CheckboxRadioField"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAM,kBAAkB,GAAGA,oBAAa,CAA0B,EAA6B,EAAE;AAC3F,MAAA,qBAAqB,GAAG,MAAMC,gBAAU,CAAC,kBAAkB;;;;ACwFjE;;AAEG;AACI,MAAM,WAAW,GAAGC,iBAAU,CACnC,CACE,EACE,kBAAkB,EAAE,eAAe,EACnC,aAAa,EACb,UAAU,EACV,SAAS,GAAG,QAAQ,EACpB,cAAc,EACd,cAAc,EACd,UAAU,EAAE,cAAc,EAC1B,UAAU,EAAE,cAAc,EAC1B,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,SAAS,EAAE,aAAa,EACxB,eAAe,EAAE,mBAAmB,EACpC,QAAQ,EACR,QAAQ,EACR,qBAAqB,EAAE,yBAAyB,EAChD,KAAK,EACL,QAAQ,EACR,MAAM,EACA,EACR,GAA0B,KACxB;AACF,IAA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wBACC,eAAe,EACjC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,sBAAsB,EAAC,aAAa,EACpC,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,qBAAqB,EAC5C,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,EACZ,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,GAAG,EACR,QAAA,EAAAF,cAAA,CAAC,kBAAkB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,kBAAkB,EAAA,QAAA,EACpDA,uBAAI,SAAS,EAAE,MAAM,CAAC,EAAE,EAAA,QAAA,EAAG,eAAe,EAAA,CAAM,EACpB,CAAA,EAAA,CACX,EACK,CAAA,EAC5B;AACJ,CAAC;;;;;;"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/* @oracle/oraclejet-preact: undefined */
|
|
2
|
-
import { jsx } from 'preact/jsx-runtime';
|
|
3
|
-
import { createContext, toChildArray } from 'preact';
|
|
4
|
-
import { useContext, useMemo } from 'preact/hooks';
|
|
5
|
-
import { forwardRef } from 'preact/compat';
|
|
6
|
-
import './FormContext-4d71f9c7.js';
|
|
7
|
-
import { u as useFormContext } from './useFormContext-875cacd7.js';
|
|
8
|
-
import { F as FormFieldContext } from './FormFieldContext-68eb5946.js';
|
|
9
|
-
import { u as useFormFieldContextProps } from './useFormFieldContextProps-d07cd618.js';
|
|
10
|
-
import './CheckboxSetStyles.styles.css';
|
|
11
|
-
import { u as useId } from './useId-03dbfdf0.js';
|
|
12
|
-
import { C as CheckboxRadioField } from './CheckboxRadioField-bdda2573.js';
|
|
13
|
-
|
|
14
|
-
const CheckboxSetContext = createContext({});
|
|
15
|
-
const useCheckboxSetContext = () => useContext(CheckboxSetContext);
|
|
16
|
-
|
|
17
|
-
var styles = {ul:'CheckboxSetStyles_styles_ul__68p6630'};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* A CheckboxSet set allows the user to select one or more options from a set.
|
|
21
|
-
*/
|
|
22
|
-
const CheckboxSet = forwardRef(({ 'aria-describedby': ariaDescribedBy, assistiveText, columnSpan, direction = 'column', helpSourceLink, helpSourceText, isDisabled: propIsDisabled, isReadonly: propIsReadonly, isRequired = false, label, labelEdge: propLabelEdge, labelStartWidth: propLabelStartWidth, messages, onCommit, userAssistanceDensity: propUserAssistanceDensity, value, children, testId }, ref) => {
|
|
23
|
-
const hasValue = value !== undefined ? value.size > 0 : false;
|
|
24
|
-
const baseId = useId();
|
|
25
|
-
const { isDisabled: isFormDisabled, isReadonly: isFormReadonly, labelEdge: formLabelEdge, labelStartWidth: formLabelStartWidth, userAssistanceDensity: formUserAssistanceDensity } = useFormContext();
|
|
26
|
-
// default to FormContext values if component properties are not specified
|
|
27
|
-
const isDisabled = propIsDisabled ?? isFormDisabled;
|
|
28
|
-
const isReadonly = propIsReadonly ?? isFormReadonly;
|
|
29
|
-
const labelEdge = propLabelEdge ?? formLabelEdge;
|
|
30
|
-
const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;
|
|
31
|
-
const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;
|
|
32
|
-
const formFieldContext = useFormFieldContextProps({
|
|
33
|
-
hasValue,
|
|
34
|
-
isDisabled,
|
|
35
|
-
isReadonly
|
|
36
|
-
});
|
|
37
|
-
const checkboxSetContext = useMemo(() => ({
|
|
38
|
-
name: baseId,
|
|
39
|
-
value,
|
|
40
|
-
onCommit
|
|
41
|
-
}), [baseId, onCommit, value]);
|
|
42
|
-
// wrap each CheckboxItem in an <li> tag and the entire set with <ul>
|
|
43
|
-
const childrenArray = toChildArray(children).filter(Boolean);
|
|
44
|
-
const wrappedChildren = childrenArray.map((item) => jsx("li", { children: item }));
|
|
45
|
-
return (jsx(FormFieldContext.Provider, { value: formFieldContext, children: jsx(CheckboxRadioField, { "aria-describedby": ariaDescribedBy, assistiveText: assistiveText, baseId: baseId, columnSpan: columnSpan, direction: direction, helpSourceLink: helpSourceLink, helpSourceText: helpSourceText, isDisabled: isDisabled, isReadonly: isReadonly, isRequired: isRequired, label: label, labelEdge: labelEdge, labelStartWidth: labelStartWidth, parentComponentVariant: "checkboxSet", messages: messages, userAssistanceDensity: userAssistanceDensity, hasValue: hasValue, role: "group", testId: testId, ref: ref, children: jsx(CheckboxSetContext.Provider, { value: checkboxSetContext, children: jsx("ul", { className: styles.ul, children: wrappedChildren }) }) }) }));
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
export { CheckboxSet as C, CheckboxSetContext as a, useCheckboxSetContext as u };
|
|
49
|
-
//# sourceMappingURL=CheckboxSet-569683fe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxSet-569683fe.js","sources":["../../src/UNSAFE_CheckboxSet/CheckboxSetContext.ts","../../src/UNSAFE_CheckboxSet/CheckboxSet.tsx"],"sourcesContent":["import { createContext } from 'preact';\nimport { useContext } from 'preact/hooks';\n\nimport { ValueUpdateDetail } from '../utils/UNSAFE_valueUpdateDetail';\n\ntype CheckboxSetContextValue = {\n name: string;\n value?: Set<string | number>;\n onCommit?: (detail: ValueUpdateDetail<Set<string | number>>) => void;\n};\n\nconst CheckboxSetContext = createContext<CheckboxSetContextValue>({} as CheckboxSetContextValue);\nconst useCheckboxSetContext = () => useContext(CheckboxSetContext);\n\nexport { CheckboxSetContext, useCheckboxSetContext };\n","import { ComponentChildren, ComponentProps, Ref, toChildArray } from 'preact';\nimport { useMemo } from 'preact/hooks';\nimport { forwardRef } from 'preact/compat';\n\nimport { CheckboxSetContext } from './CheckboxSetContext';\nimport { CheckboxRadioField } from '#PRIVATE_CheckboxRadioField';\nimport { InlineUserAssistance, UserAssistanceDensityType } from '#UNSAFE_UserAssistance';\nimport { useFormContext } from '#hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '#hooks/UNSAFE_useFormFieldContext';\nimport { useFormFieldContextProps } from '#hooks/UNSAFE_useFormFieldContextProps';\nimport { FlexboxProps } from '#utils/UNSAFE_interpolations/flexbox';\nimport { Size } from '#utils/UNSAFE_size';\nimport { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { styles } from './CheckboxSetStyles.css';\nimport { AriaAttributesSignalExcluded } from '#utils/UNSAFE_attributeUtils';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { LayoutColumnSpan } from '#utils/UNSAFE_styles/Layout';\nimport { TestIdProps } from '#hooks/UNSAFE_useTestId';\n\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = {\n /**\n * The ID of an element (or space separated IDs of multiple elements) that\n * describes the input.\n */\n 'aria-describedby'?: AriaAttributesSignalExcluded['aria-describedby'];\n /**\n * Text to provide guidance to help the user understand what data to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * set of CheckboxItems\n */\n children: ComponentChildren;\n /**\n * Specifies how many columns to span in a FormLayout with direction === 'row'\n */\n columnSpan?: LayoutColumnSpan;\n /**\n * layout direction of the children elements\n */\n direction?: FlexboxProps['direction'];\n /**\n * Help source URL associated with the component.\n */\n helpSourceLink?: InlineUserAssistanceProps['helpSourceLink'];\n /**\n * Custom text to be rendered for the <code>helpSourceLink</code>.\n */\n helpSourceText?: InlineUserAssistanceProps['helpSourceText'];\n /**\n * Specifies whether the checkbox set requires a selection to be made.\n */\n isRequired?: boolean;\n /**\n * Specifies if the checkbox set is read-only.\n */\n isReadonly?: boolean;\n /**\n * Specifies if the checkbox set is disabled.\n */\n isDisabled?: boolean;\n /**\n * Label text for the group of checkbox items.\n */\n label: string;\n /**\n * Specifies where the label is positioned relative to the field.\n */\n labelEdge?: 'none' | 'top' | 'start' | 'inside';\n /**\n * Specifies the width of the label when <code>labelEdge</code> is <code>\"start\"</code>.\n */\n labelStartWidth?: Size;\n /**\n * Messages to show on screen that are associated with the component.\n */\n messages?: InlineUserAssistanceProps['messages'];\n /**\n * Callback invoked each time the user changes selected option.\n */\n onCommit: (detail: ValueUpdateDetail<Set<string | number>>) => void;\n /**\n * Specifies the density of the user assistance presentation. It can be set to:\n * <ul>\n * <li><code>'reflow'</code>: Show inline. Layout will reflow when text is displayed.</li>\n * <li><code>'efficient'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * <li><code>'compact'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * </ul>\n */\n userAssistanceDensity?: UserAssistanceDensityType;\n /**\n * Value of the selected checkbox option.\n */\n value?: Set<string | number>;\n} & TestIdProps;\n/**\n * A CheckboxSet set allows the user to select one or more options from a set.\n */\nexport const CheckboxSet = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n assistiveText,\n columnSpan,\n direction = 'column',\n helpSourceLink,\n helpSourceText,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n isRequired = false,\n label,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n messages,\n onCommit,\n userAssistanceDensity: propUserAssistanceDensity,\n value,\n children,\n testId\n }: Props,\n ref?: Ref<FocusableHandle>\n ) => {\n const hasValue = value !== undefined ? value.size > 0 : false;\n const baseId = useId();\n\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n userAssistanceDensity: formUserAssistanceDensity\n } = useFormContext();\n\n // default to FormContext values if component properties are not specified\n const isDisabled = propIsDisabled ?? isFormDisabled;\n const isReadonly = propIsReadonly ?? isFormReadonly;\n const labelEdge = propLabelEdge ?? formLabelEdge;\n const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n\n const formFieldContext = useFormFieldContextProps({\n hasValue,\n isDisabled,\n isReadonly\n });\n\n const checkboxSetContext = useMemo(\n () => ({\n name: baseId,\n value,\n onCommit\n }),\n [baseId, onCommit, value]\n );\n\n // wrap each CheckboxItem in an <li> tag and the entire set with <ul>\n const childrenArray = toChildArray(children).filter(Boolean);\n const wrappedChildren = childrenArray.map((item) => <li>{item}</li>);\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <CheckboxRadioField\n aria-describedby={ariaDescribedBy}\n assistiveText={assistiveText}\n baseId={baseId}\n columnSpan={columnSpan}\n direction={direction}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n isRequired={isRequired}\n label={label}\n labelEdge={labelEdge}\n labelStartWidth={labelStartWidth}\n parentComponentVariant=\"checkboxSet\"\n messages={messages}\n userAssistanceDensity={userAssistanceDensity}\n hasValue={hasValue}\n role=\"group\"\n testId={testId}\n ref={ref}>\n <CheckboxSetContext.Provider value={checkboxSetContext}>\n <ul className={styles.ul}>{wrappedChildren}</ul>\n </CheckboxSetContext.Provider>\n </CheckboxRadioField>\n </FormFieldContext.Provider>\n );\n }\n);\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;AAWA,MAAM,kBAAkB,GAAG,aAAa,CAA0B,EAA6B,EAAE;AAC3F,MAAA,qBAAqB,GAAG,MAAM,UAAU,CAAC,kBAAkB;;;;ACwFjE;;AAEG;AACI,MAAM,WAAW,GAAG,UAAU,CACnC,CACE,EACE,kBAAkB,EAAE,eAAe,EACnC,aAAa,EACb,UAAU,EACV,SAAS,GAAG,QAAQ,EACpB,cAAc,EACd,cAAc,EACd,UAAU,EAAE,cAAc,EAC1B,UAAU,EAAE,cAAc,EAC1B,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,SAAS,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AAK,IAAI,EAAA,CAAM,CAAC,CAAC;IAErE,QACEA,GAAC,CAAA,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,gBAAgB,EAAA,QAAA,EAChDA,GAAC,CAAA,kBAAkB,wBACC,eAAe,EACjC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,sBAAsB,EAAC,aAAa,EACpC,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,qBAAqB,EAC5C,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,EACZ,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,GAAG,EACR,QAAA,EAAAA,GAAA,CAAC,kBAAkB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,kBAAkB,EAAA,QAAA,EACpDA,YAAI,SAAS,EAAE,MAAM,CAAC,EAAE,EAAA,QAAA,EAAG,eAAe,EAAA,CAAM,EACpB,CAAA,EAAA,CACX,EACK,CAAA,EAC5B;AACJ,CAAC;;;;"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* @oracle/oraclejet-preact: undefined */
|
|
2
|
-
import { jsx, jsxs } from 'preact/jsx-runtime';
|
|
3
|
-
import { useCallback } from 'preact/hooks';
|
|
4
|
-
import { c as classNames } from './classNames-4e12b00d.js';
|
|
5
|
-
import { u as usePress } from './usePress-97fc1cf1.js';
|
|
6
|
-
import './FormFieldContext-68eb5946.js';
|
|
7
|
-
import { u as useFormFieldContext } from './useFormFieldContext-626574fd.js';
|
|
8
|
-
import './MaxLengthCounterStyles.styles.css';
|
|
9
|
-
|
|
10
|
-
var hide = 'MaxLengthCounterStyles_hide__7dy9j71';
|
|
11
|
-
var maxLengthCounterBase = 'MaxLengthCounterStyles_maxLengthCounterBase__7dy9j70';
|
|
12
|
-
var spanStyles = 'MaxLengthCounterStyles_spanStyles__7dy9j72';
|
|
13
|
-
|
|
14
|
-
const noop = () => { };
|
|
15
|
-
function MaxLengthCounter({ maxLength, valueLength = 0, onClick }) {
|
|
16
|
-
const { isFocused } = useFormFieldContext();
|
|
17
|
-
// We don't want mousedown on this component to do anything, so prevent the default behavior.
|
|
18
|
-
const killEvent = useCallback((event) => event.preventDefault(), []);
|
|
19
|
-
const textClasses = classNames([!isFocused && hide]);
|
|
20
|
-
const { pressProps } = usePress(onClick ?? noop);
|
|
21
|
-
return (jsx("div", { class: maxLengthCounterBase, onMouseDown: killEvent, ...pressProps, children: jsxs("span", { class: textClasses, children: [jsx("span", { class: spanStyles, children: valueLength }), jsx("span", { class: spanStyles, children: "/" }), jsx("span", { class: spanStyles, children: maxLength })] }) }));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { MaxLengthCounter as M };
|
|
25
|
-
//# sourceMappingURL=MaxLengthCounter-cead2dac.js.map
|