@fluentui/react-textarea 9.3.3 → 9.3.5
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/.swcrc +30 -0
- package/CHANGELOG.json +73 -1
- package/CHANGELOG.md +27 -2
- package/lib/Textarea.js.map +1 -1
- package/lib/TextareaField.js.map +1 -1
- package/lib/components/Textarea/Textarea.js.map +1 -1
- package/lib/components/Textarea/Textarea.types.js +1 -1
- package/lib/components/Textarea/Textarea.types.js.map +1 -1
- package/lib/components/Textarea/index.js.map +1 -1
- package/lib/components/Textarea/renderTextarea.js +1 -5
- package/lib/components/Textarea/renderTextarea.js.map +1 -1
- package/lib/components/Textarea/useTextarea.js +3 -2
- package/lib/components/Textarea/useTextarea.js.map +1 -1
- package/lib/components/Textarea/useTextareaStyles.js.map +1 -1
- package/lib/components/TextareaField/TextareaField.js +1 -2
- package/lib/components/TextareaField/TextareaField.js.map +1 -1
- package/lib/components/TextareaField/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Textarea.js +5 -4
- package/lib-commonjs/Textarea.js.map +1 -1
- package/lib-commonjs/TextareaField.js +5 -4
- package/lib-commonjs/TextareaField.js.map +1 -1
- package/lib-commonjs/components/Textarea/Textarea.js +19 -20
- package/lib-commonjs/components/Textarea/Textarea.js.map +1 -1
- package/lib-commonjs/components/Textarea/Textarea.types.js +5 -2
- package/lib-commonjs/components/Textarea/Textarea.types.js.map +1 -1
- package/lib-commonjs/components/Textarea/index.js +9 -8
- package/lib-commonjs/components/Textarea/index.js.map +1 -1
- package/lib-commonjs/components/Textarea/renderTextarea.js +13 -20
- package/lib-commonjs/components/Textarea/renderTextarea.js.map +1 -1
- package/lib-commonjs/components/Textarea/useTextarea.js +61 -67
- package/lib-commonjs/components/Textarea/useTextarea.js.map +1 -1
- package/lib-commonjs/components/Textarea/useTextareaStyles.js +744 -314
- package/lib-commonjs/components/Textarea/useTextareaStyles.js.map +1 -1
- package/lib-commonjs/components/TextareaField/TextareaField.js +17 -11
- package/lib-commonjs/components/TextareaField/TextareaField.js.map +1 -1
- package/lib-commonjs/components/TextareaField/index.js +5 -4
- package/lib-commonjs/components/TextareaField/index.js.map +1 -1
- package/lib-commonjs/index.js +21 -49
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -8
- package/lib-amd/Textarea.js +0 -6
- package/lib-amd/Textarea.js.map +0 -1
- package/lib-amd/TextareaField.js +0 -6
- package/lib-amd/TextareaField.js.map +0 -1
- package/lib-amd/components/Textarea/Textarea.js +0 -17
- package/lib-amd/components/Textarea/Textarea.js.map +0 -1
- package/lib-amd/components/Textarea/Textarea.types.js +0 -5
- package/lib-amd/components/Textarea/Textarea.types.js.map +0 -1
- package/lib-amd/components/Textarea/index.js +0 -10
- package/lib-amd/components/Textarea/index.js.map +0 -1
- package/lib-amd/components/Textarea/renderTextarea.js +0 -15
- package/lib-amd/components/Textarea/renderTextarea.js.map +0 -1
- package/lib-amd/components/Textarea/useTextarea.js +0 -61
- package/lib-amd/components/Textarea/useTextarea.js.map +0 -1
- package/lib-amd/components/Textarea/useTextareaStyles.js +0 -131
- package/lib-amd/components/Textarea/useTextareaStyles.js.map +0 -1
- package/lib-amd/components/TextareaField/TextareaField.js +0 -10
- package/lib-amd/components/TextareaField/TextareaField.js.map +0 -1
- package/lib-amd/components/TextareaField/index.js +0 -6
- package/lib-amd/components/TextareaField/index.js.map +0 -1
- package/lib-amd/index.js +0 -13
- package/lib-amd/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Textarea/renderTextarea.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Textarea\n */\nexport const renderTextarea_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(slots.textarea, slotProps.textarea));\n};\n//# sourceMappingURL=renderTextarea.js.map"],"names":["renderTextarea_unstable","state","slots","slotProps","getSlots","React","createElement","root","textarea"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,0BAA0BC,CAAAA,QAAS;IAC9C,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,EAAE,WAAW,GAAEF,OAAMC,aAAa,CAACJ,MAAMM,QAAQ,EAAEL,UAAUK,QAAQ;AACzI,GACA,0CAA0C"}
|
|
@@ -1,72 +1,66 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useTextarea_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useTextarea_unstable
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const [value, setValue] = react_utilities_1.useControllableState({
|
|
32
|
-
state: props.value,
|
|
33
|
-
defaultState: props.defaultValue,
|
|
34
|
-
initialState: undefined
|
|
35
|
-
});
|
|
36
|
-
const nativeProps = react_utilities_1.getPartitionedNativeProps({
|
|
37
|
-
props,
|
|
38
|
-
primarySlotTagName: 'textarea',
|
|
39
|
-
excludedPropNames: ['onChange', 'value', 'defaultValue']
|
|
40
|
-
});
|
|
41
|
-
const state = {
|
|
42
|
-
size,
|
|
43
|
-
appearance,
|
|
44
|
-
resize,
|
|
45
|
-
components: {
|
|
46
|
-
root: 'span',
|
|
47
|
-
textarea: 'textarea'
|
|
48
|
-
},
|
|
49
|
-
textarea: react_utilities_1.resolveShorthand(props.textarea, {
|
|
50
|
-
required: true,
|
|
51
|
-
defaultProps: {
|
|
52
|
-
ref,
|
|
53
|
-
...nativeProps.primary
|
|
54
|
-
}
|
|
55
|
-
}),
|
|
56
|
-
root: react_utilities_1.resolveShorthand(props.root, {
|
|
57
|
-
required: true,
|
|
58
|
-
defaultProps: nativeProps.root
|
|
59
|
-
})
|
|
60
|
-
};
|
|
61
|
-
state.textarea.value = value;
|
|
62
|
-
state.textarea.onChange = react_utilities_1.useEventCallback(ev => {
|
|
63
|
-
const newValue = ev.target.value;
|
|
64
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
|
|
65
|
-
value: newValue
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
13
|
+
const useTextarea_unstable = (props, ref)=>{
|
|
14
|
+
const overrides = (0, _reactSharedContexts.useOverrides_unstable)();
|
|
15
|
+
var _overrides_inputDefaultAppearance;
|
|
16
|
+
const { size ='medium' , appearance =(_overrides_inputDefaultAppearance = overrides.inputDefaultAppearance) !== null && _overrides_inputDefaultAppearance !== void 0 ? _overrides_inputDefaultAppearance : 'outline' , resize ='none' , onChange } = props;
|
|
17
|
+
if (process.env.NODE_ENV !== 'production' && (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')) {
|
|
18
|
+
// eslint-disable-next-line no-console
|
|
19
|
+
console.error("The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the" + ' future.');
|
|
20
|
+
}
|
|
21
|
+
const [value, setValue] = (0, _reactUtilities.useControllableState)({
|
|
22
|
+
state: props.value,
|
|
23
|
+
defaultState: props.defaultValue,
|
|
24
|
+
initialState: undefined
|
|
25
|
+
});
|
|
26
|
+
const nativeProps = (0, _reactUtilities.getPartitionedNativeProps)({
|
|
27
|
+
props,
|
|
28
|
+
primarySlotTagName: 'textarea',
|
|
29
|
+
excludedPropNames: [
|
|
30
|
+
'onChange',
|
|
31
|
+
'value',
|
|
32
|
+
'defaultValue'
|
|
33
|
+
]
|
|
66
34
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
35
|
+
const state = {
|
|
36
|
+
size,
|
|
37
|
+
appearance,
|
|
38
|
+
resize,
|
|
39
|
+
components: {
|
|
40
|
+
root: 'span',
|
|
41
|
+
textarea: 'textarea'
|
|
42
|
+
},
|
|
43
|
+
textarea: (0, _reactUtilities.resolveShorthand)(props.textarea, {
|
|
44
|
+
required: true,
|
|
45
|
+
defaultProps: {
|
|
46
|
+
ref,
|
|
47
|
+
...nativeProps.primary
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
root: (0, _reactUtilities.resolveShorthand)(props.root, {
|
|
51
|
+
required: true,
|
|
52
|
+
defaultProps: nativeProps.root
|
|
53
|
+
})
|
|
54
|
+
};
|
|
55
|
+
state.textarea.value = value;
|
|
56
|
+
state.textarea.onChange = (0, _reactUtilities.useEventCallback)((ev)=>{
|
|
57
|
+
const newValue = ev.target.value;
|
|
58
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
|
|
59
|
+
value: newValue
|
|
60
|
+
});
|
|
61
|
+
setValue(newValue);
|
|
62
|
+
});
|
|
63
|
+
return state;
|
|
64
|
+
}; //# sourceMappingURL=useTextarea.js.map
|
|
65
|
+
|
|
72
66
|
//# sourceMappingURL=useTextarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Textarea/useTextarea.js"],"sourcesContent":["import * as React from 'react';\nimport { getPartitionedNativeProps, resolveShorthand, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';\n/**\n * Create the state required to render Textarea.\n *\n * The returned state can be modified with hooks such as useTextareaStyles_unstable,\n * before being passed to renderTextarea_unstable.\n *\n * @param props - props from this instance of Textarea\n * @param ref - reference to root HTMLElement of Textarea\n */\nexport const useTextarea_unstable = (props, ref) => {\n const overrides = useOverrides();\n var _overrides_inputDefaultAppearance;\n const {\n size = 'medium',\n appearance = (_overrides_inputDefaultAppearance = overrides.inputDefaultAppearance) !== null && _overrides_inputDefaultAppearance !== void 0 ? _overrides_inputDefaultAppearance : 'outline',\n resize = 'none',\n onChange\n } = props;\n if (process.env.NODE_ENV !== 'production' && (appearance === 'filled-darker-shadow' || appearance === 'filled-lighter-shadow')) {\n // eslint-disable-next-line no-console\n console.error(\"The 'filled-darker-shadow' and 'filled-lighter-shadow' appearances are deprecated and will be removed in the\" + ' future.');\n }\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: undefined\n });\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'textarea',\n excludedPropNames: ['onChange', 'value', 'defaultValue']\n });\n const state = {\n size,\n appearance,\n resize,\n components: {\n root: 'span',\n textarea: 'textarea'\n },\n textarea: resolveShorthand(props.textarea, {\n required: true,\n defaultProps: {\n ref,\n ...nativeProps.primary\n }\n }),\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root\n })\n };\n state.textarea.value = value;\n state.textarea.onChange = useEventCallback(ev => {\n const newValue = ev.target.value;\n onChange === null || onChange === void 0 ? void 0 : onChange(ev, {\n value: newValue\n });\n setValue(newValue);\n });\n return state;\n};\n//# sourceMappingURL=useTextarea.js.map"],"names":["useTextarea_unstable","props","ref","overrides","useOverrides","_overrides_inputDefaultAppearance","size","appearance","inputDefaultAppearance","resize","onChange","process","env","NODE_ENV","console","error","value","setValue","useControllableState","state","defaultState","defaultValue","initialState","undefined","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","components","root","textarea","resolveShorthand","required","defaultProps","primary","useEventCallback","ev","newValue","target"],"mappings":";;;;+BAYaA;;aAAAA;;;6DAZU;gCAC6E;qCAC9C;AAU/C,MAAMA,uBAAuB,CAACC,OAAOC,MAAQ;IAClD,MAAMC,YAAYC,IAAAA,0CAAY;IAC9B,IAAIC;IACJ,MAAM,EACJC,MAAO,SAAQ,EACfC,YAAa,AAACF,CAAAA,oCAAoCF,UAAUK,sBAAsB,AAAD,MAAO,IAAI,IAAIH,sCAAsC,KAAK,IAAIA,oCAAoC,SAAS,CAAA,EAC5LI,QAAS,OAAM,EACfC,SAAQ,EACT,GAAGT;IACJ,IAAIU,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBAAiBN,CAAAA,eAAe,0BAA0BA,eAAe,uBAAsB,GAAI;QAC9H,sCAAsC;QACtCO,QAAQC,KAAK,CAAC,iHAAiH;IACjI,CAAC;IACD,MAAM,CAACC,OAAOC,SAAS,GAAGC,IAAAA,oCAAoB,EAAC;QAC7CC,OAAOlB,MAAMe,KAAK;QAClBI,cAAcnB,MAAMoB,YAAY;QAChCC,cAAcC;IAChB;IACA,MAAMC,cAAcC,IAAAA,yCAAyB,EAAC;QAC5CxB;QACAyB,oBAAoB;QACpBC,mBAAmB;YAAC;YAAY;YAAS;SAAe;IAC1D;IACA,MAAMR,QAAQ;QACZb;QACAC;QACAE;QACAmB,YAAY;YACVC,MAAM;YACNC,UAAU;QACZ;QACAA,UAAUC,IAAAA,gCAAgB,EAAC9B,MAAM6B,QAAQ,EAAE;YACzCE,UAAU,IAAI;YACdC,cAAc;gBACZ/B;gBACA,GAAGsB,YAAYU,OAAO;YACxB;QACF;QACAL,MAAME,IAAAA,gCAAgB,EAAC9B,MAAM4B,IAAI,EAAE;YACjCG,UAAU,IAAI;YACdC,cAAcT,YAAYK,IAAI;QAChC;IACF;IACAV,MAAMW,QAAQ,CAACd,KAAK,GAAGA;IACvBG,MAAMW,QAAQ,CAACpB,QAAQ,GAAGyB,IAAAA,gCAAgB,EAACC,CAAAA,KAAM;QAC/C,MAAMC,WAAWD,GAAGE,MAAM,CAACtB,KAAK;QAChCN,aAAa,IAAI,IAAIA,aAAa,KAAK,IAAI,KAAK,IAAIA,SAAS0B,IAAI;YAC/DpB,OAAOqB;QACT,EAAE;QACFpB,SAASoB;IACX;IACA,OAAOlB;AACT,GACA,uCAAuC"}
|