@fluentui/react-field 0.0.0-nightly-20230223-2115.1 → 0.0.0-nightly-20230227-0424.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +13 -13
- package/CHANGELOG.md +9 -9
- package/lib/Field.js.map +1 -1
- package/lib/components/Field/Field.js.map +1 -1
- package/lib/components/Field/Field.types.js +1 -1
- package/lib/components/Field/Field.types.js.map +1 -1
- package/lib/components/Field/index.js.map +1 -1
- package/lib/components/Field/renderField.js +11 -2
- package/lib/components/Field/renderField.js.map +1 -1
- package/lib/components/Field/useField.js +9 -8
- package/lib/components/Field/useField.js.map +1 -1
- package/lib/components/Field/useFieldStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/util/makeDeprecatedField.js +7 -5
- package/lib/util/makeDeprecatedField.js.map +1 -1
- package/lib-commonjs/Field.js +4 -5
- package/lib-commonjs/Field.js.map +1 -1
- package/lib-commonjs/components/Field/Field.js +12 -16
- package/lib-commonjs/components/Field/Field.js.map +1 -1
- package/lib-commonjs/components/Field/Field.types.js +2 -5
- package/lib-commonjs/components/Field/Field.types.js.map +1 -1
- package/lib-commonjs/components/Field/index.js +8 -9
- package/lib-commonjs/components/Field/index.js.map +1 -1
- package/lib-commonjs/components/Field/renderField.js +26 -15
- package/lib-commonjs/components/Field/renderField.js.map +1 -1
- package/lib-commonjs/components/Field/useField.js +102 -94
- package/lib-commonjs/components/Field/useField.js.map +1 -1
- package/lib-commonjs/components/Field/useFieldStyles.js +96 -137
- package/lib-commonjs/components/Field/useFieldStyles.js.map +1 -1
- package/lib-commonjs/index.js +49 -21
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/util/makeDeprecatedField.js +72 -56
- package/lib-commonjs/util/makeDeprecatedField.js.map +1 -1
- package/package.json +8 -8
- package/.swcrc +0 -33
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,oBAAK;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,8BAAe;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,mCAAoB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,sCAAuB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,gCAAiB;EAAA;AAAA;AAGjG;AACA;AAASF;EAAAC;EAAAC;IAAA,yDAA4B;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,gDAAmB;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"","sources":["../../../../../../../packages/react-components/react-field/src/index.ts"],"sourcesContent":["export { Field, fieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from './Field';\nexport type { FieldProps, FieldSlots, FieldState } from './Field';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { getDeprecatedFieldClassNames, makeDeprecatedField } from './util/makeDeprecatedField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { DeprecatedFieldProps } from './util/makeDeprecatedField';\n"]}
|
@@ -1,63 +1,79 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
|
+
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
3
|
-
|
4
|
-
});
|
5
|
-
function _export(target, all) {
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
7
|
-
enumerable: true,
|
8
|
-
get: all[name]
|
9
|
-
});
|
10
|
-
}
|
11
|
-
_export(exports, {
|
12
|
-
makeDeprecatedField: ()=>makeDeprecatedField,
|
13
|
-
getDeprecatedFieldClassNames: ()=>getDeprecatedFieldClassNames
|
4
|
+
value: true
|
14
5
|
});
|
15
|
-
|
16
|
-
|
17
|
-
const
|
18
|
-
const
|
19
|
-
const _field = require("../Field");
|
6
|
+
exports.getDeprecatedFieldClassNames = exports.makeDeprecatedField = void 0;
|
7
|
+
/* eslint-disable deprecation/deprecation */
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
|
+
const Field_1 = /*#__PURE__*/require("../Field");
|
20
10
|
/**
|
21
11
|
* Partition the props used by the Field itself, from the props that are passed to the underlying field component.
|
22
|
-
*/
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
12
|
+
*/
|
13
|
+
function getPartitionedFieldProps(props) {
|
14
|
+
const {
|
15
|
+
className,
|
16
|
+
control,
|
17
|
+
hint,
|
18
|
+
label,
|
19
|
+
orientation,
|
20
|
+
required,
|
21
|
+
root,
|
22
|
+
size,
|
23
|
+
style,
|
24
|
+
validationMessage,
|
25
|
+
validationMessageIcon,
|
26
|
+
validationState = 'none',
|
27
|
+
...restOfProps
|
28
|
+
} = props;
|
29
|
+
return [{
|
30
|
+
className,
|
31
|
+
hint,
|
32
|
+
label,
|
33
|
+
orientation,
|
34
|
+
required,
|
35
|
+
size,
|
36
|
+
style,
|
37
|
+
validationMessage,
|
38
|
+
validationMessageIcon,
|
39
|
+
validationState,
|
40
|
+
...root
|
41
|
+
}, {
|
42
|
+
required,
|
43
|
+
size,
|
44
|
+
...restOfProps,
|
45
|
+
...control
|
46
|
+
}];
|
45
47
|
}
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
48
|
+
/**
|
49
|
+
* @deprecated Only for use to make deprecated [Control]Field shim components.
|
50
|
+
* @internal
|
51
|
+
*/
|
52
|
+
function makeDeprecatedField(Control, options = {}) {
|
53
|
+
const {
|
54
|
+
mapProps = props => props,
|
55
|
+
displayName = `${Control.displayName}Field`
|
56
|
+
} = options;
|
57
|
+
const DeprecatedField = React.forwardRef((props, ref) => {
|
58
|
+
const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));
|
59
|
+
return React.createElement(Field_1.Field, {
|
60
|
+
...fieldProps
|
61
|
+
}, React.createElement(Control, {
|
62
|
+
...controlProps,
|
63
|
+
ref: ref
|
64
|
+
}));
|
65
|
+
});
|
66
|
+
DeprecatedField.displayName = displayName;
|
67
|
+
return DeprecatedField;
|
57
68
|
}
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
69
|
+
exports.makeDeprecatedField = makeDeprecatedField;
|
70
|
+
/**
|
71
|
+
* @deprecated Only for use to make deprecated [Control]Field shim components.
|
72
|
+
* @internal
|
73
|
+
*/
|
74
|
+
const getDeprecatedFieldClassNames = controlRootClassName => ({
|
75
|
+
...Field_1.fieldClassNames,
|
76
|
+
control: controlRootClassName
|
77
|
+
});
|
78
|
+
exports.getDeprecatedFieldClassNames = getDeprecatedFieldClassNames;
|
63
79
|
//# sourceMappingURL=makeDeprecatedField.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;AAqBA;;;AAGA,SAASA,wBAAwB,CAC/BC,KAAiF;EAEjF,MAAM;IACJC,SAAS;IACTC,OAAO;IACPC,IAAI;IACJC,KAAK;IACLC,WAAW;IACXC,QAAQ;IACRC,IAAI;IACJC,IAAI;IACJC,KAAK;IACLC,iBAAiB;IACjBC,qBAAqB;IACrBC,eAAe,GAAG,MAAM;IACxB,GAAGC;EAAW,CACf,GAAGb,KAAK;EAET,OAAO,CACL;IACEC,SAAS;IACTE,IAAI;IACJC,KAAK;IACLC,WAAW;IACXC,QAAQ;IACRE,IAAI;IACJC,KAAK;IACLC,iBAAiB;IACjBC,qBAAqB;IACrBC,eAAe;IACf,GAAGL;GACJ,EACD;IACED,QAAQ;IACRE,IAAI;IACJ,GAAGK,WAAW;IACd,GAAGX;GACJ,CACF;AACH;AAEA;;;;AAIA,SAAgBY,mBAAmB,CACjCC,OAA0C,EAC1CC,UAGI,EAAE;EAEN,MAAM;IAAEC,QAAQ,GAAGjB,KAAK,IAAIA,KAAK;IAAEkB,WAAW,GAAG,GAAGH,OAAO,CAACG,WAAW;EAAO,CAAE,GAAGF,OAAO;EAE1F,MAAMG,eAAe,GAAGC,KAAK,CAACC,UAAU,CAAC,CAACrB,KAAK,EAAEsB,GAAG,KAAI;IACtD,MAAM,CAACC,UAAU,EAAEC,YAAY,CAAC,GAAGzB,wBAAwB,CAACkB,QAAQ,CAACjB,KAAK,CAAC,CAAC;IAC5E,OACEoB,oBAACK,aAAK;MAAA,GAAKF;IAAU,GAEnBH,oBAACL,OAAO;MAAA,GAAMS,YAAoB;MAAEF,GAAG,EAAEA;IAAU,EAAI,CACjD;EAEZ,CAAC,CAA4D;EAE7DH,eAAe,CAACD,WAAW,GAAGA,WAAW;EAEzC,OAAOC,eAAe;AACxB;AAtBAO;AAwBA;;;;AAIO,MAAMC,4BAA4B,GAAIC,oBAA4B,KAAM;EAC7E,GAAGH,uBAAe;EAClBvB,OAAO,EAAE0B;CACV,CAAC;AAHWF,oCAA4B","names":["getPartitionedFieldProps","props","className","control","hint","label","orientation","required","root","size","style","validationMessage","validationMessageIcon","validationState","restOfProps","makeDeprecatedField","Control","options","mapProps","displayName","DeprecatedField","React","forwardRef","ref","fieldProps","controlProps","Field_1","exports","getDeprecatedFieldClassNames","controlRootClassName"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-field/src/util/makeDeprecatedField.tsx"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport * as React from 'react';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from '../Field';\nimport { Field, fieldClassNames } from '../Field';\n\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport type DeprecatedFieldProps<ControlProps> = ControlProps & {\n root?: FieldProps;\n control?: ControlProps;\n} & Pick<\n FieldProps,\n | 'className'\n | 'hint'\n | 'label'\n | 'orientation'\n | 'style'\n | 'validationMessage'\n | 'validationMessageIcon'\n | 'validationState'\n >;\n\n/**\n * Partition the props used by the Field itself, from the props that are passed to the underlying field component.\n */\nfunction getPartitionedFieldProps<ControlProps>(\n props: DeprecatedFieldProps<ControlProps> & Pick<FieldProps, 'required' | 'size'>,\n) {\n const {\n className,\n control,\n hint,\n label,\n orientation,\n required,\n root,\n size,\n style,\n validationMessage,\n validationMessageIcon,\n validationState = 'none',\n ...restOfProps\n } = props;\n\n return [\n {\n className,\n hint,\n label,\n orientation,\n required,\n size,\n style,\n validationMessage,\n validationMessageIcon,\n validationState,\n ...root,\n },\n {\n required,\n size,\n ...restOfProps,\n ...control,\n },\n ];\n}\n\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport function makeDeprecatedField<ControlProps>(\n Control: React.ComponentType<ControlProps>,\n options: {\n mapProps?: (props: DeprecatedFieldProps<ControlProps>) => DeprecatedFieldProps<ControlProps>;\n displayName?: string;\n } = {},\n) {\n const { mapProps = props => props, displayName = `${Control.displayName}Field` } = options;\n\n const DeprecatedField = React.forwardRef((props, ref) => {\n const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));\n return (\n <Field {...fieldProps}>\n {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}\n <Control {...(controlProps as any)} ref={ref as any} />\n </Field>\n );\n }) as ForwardRefComponent<DeprecatedFieldProps<ControlProps>>;\n\n DeprecatedField.displayName = displayName;\n\n return DeprecatedField;\n}\n\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport const getDeprecatedFieldClassNames = (controlRootClassName: string) => ({\n ...fieldClassNames,\n control: controlRootClassName,\n});\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-field",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20230227-0424.1",
|
4
4
|
"description": "Fluent UI Field components",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -22,23 +22,23 @@
|
|
22
22
|
"storybook": "start-storybook",
|
23
23
|
"test": "jest --passWithNoTests",
|
24
24
|
"type-check": "tsc -b tsconfig.json",
|
25
|
-
"generate-api": "just-scripts
|
25
|
+
"generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
28
|
"@fluentui/eslint-plugin": "*",
|
29
29
|
"@fluentui/react-conformance": "*",
|
30
|
-
"@fluentui/react-conformance-griffel": "0.0.0-nightly-
|
30
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20230227-0424.1",
|
31
31
|
"@fluentui/scripts-api-extractor": "*",
|
32
32
|
"@fluentui/scripts-tasks": "*"
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
|
-
"@fluentui/react-context-selector": "0.0.0-nightly-
|
35
|
+
"@fluentui/react-context-selector": "0.0.0-nightly-20230227-0424.1",
|
36
36
|
"@fluentui/react-icons": "^2.0.175",
|
37
|
-
"@fluentui/react-label": "0.0.0-nightly-
|
38
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
39
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
37
|
+
"@fluentui/react-label": "0.0.0-nightly-20230227-0424.1",
|
38
|
+
"@fluentui/react-theme": "0.0.0-nightly-20230227-0424.1",
|
39
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20230227-0424.1",
|
40
40
|
"@griffel/react": "^1.5.2",
|
41
|
-
"
|
41
|
+
"tslib": "^2.1.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
44
|
"@types/react": ">=16.8.0 <19.0.0",
|
package/.swcrc
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "https://json.schemastore.org/swcrc",
|
3
|
-
"env": {
|
4
|
-
"targets": {
|
5
|
-
"chrome": "84",
|
6
|
-
"edge": "84",
|
7
|
-
"firefox": "75",
|
8
|
-
"opera": "73",
|
9
|
-
"safari": "14.1"
|
10
|
-
}
|
11
|
-
},
|
12
|
-
"exclude": [
|
13
|
-
"/testing",
|
14
|
-
"/**/*.cy.ts",
|
15
|
-
"/**/*.cy.tsx",
|
16
|
-
"/**/*.spec.ts",
|
17
|
-
"/**/*.spec.tsx",
|
18
|
-
"/**/*.test.ts",
|
19
|
-
"/**/*.test.tsx"
|
20
|
-
],
|
21
|
-
"jsc": {
|
22
|
-
"parser": {
|
23
|
-
"syntax": "typescript",
|
24
|
-
"tsx": true,
|
25
|
-
"decorators": false,
|
26
|
-
"dynamicImport": false
|
27
|
-
},
|
28
|
-
"target": "es2019",
|
29
|
-
"externalHelpers": true
|
30
|
-
},
|
31
|
-
"minify": false,
|
32
|
-
"sourceMaps": true
|
33
|
-
}
|