@fluentui/react-field 0.0.0-nightly-20230316-0427.1 → 0.0.0-nightly-20230317-1454.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/.swcrc +39 -0
- package/CHANGELOG.json +40 -13
- package/CHANGELOG.md +20 -9
- package/lib/Field.js +1 -1
- package/lib/Field.js.map +1 -1
- package/lib/components/Field/Field.js +5 -5
- 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 +5 -5
- package/lib/components/Field/index.js.map +1 -1
- package/lib/components/Field/renderField.js +3 -13
- package/lib/components/Field/renderField.js.map +1 -1
- package/lib/components/Field/useField.js +28 -29
- package/lib/components/Field/useField.js.map +1 -1
- package/lib/components/Field/useFieldStyles.js +7 -7
- package/lib/components/Field/useFieldStyles.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/util/makeDeprecatedField.js +4 -7
- package/lib/util/makeDeprecatedField.js.map +1 -1
- package/lib-commonjs/Field.js +5 -4
- package/lib-commonjs/Field.js.map +1 -1
- package/lib-commonjs/components/Field/Field.js +16 -12
- package/lib-commonjs/components/Field/Field.js.map +1 -1
- package/lib-commonjs/components/Field/Field.types.js +5 -2
- package/lib-commonjs/components/Field/Field.types.js.map +1 -1
- package/lib-commonjs/components/Field/index.js +9 -8
- package/lib-commonjs/components/Field/index.js.map +1 -1
- package/lib-commonjs/components/Field/renderField.js +13 -26
- package/lib-commonjs/components/Field/renderField.js.map +1 -1
- package/lib-commonjs/components/Field/useField.js +94 -102
- package/lib-commonjs/components/Field/useField.js.map +1 -1
- package/lib-commonjs/components/Field/useFieldStyles.js +138 -97
- package/lib-commonjs/components/Field/useFieldStyles.js.map +1 -1
- package/lib-commonjs/index.js +21 -49
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/util/makeDeprecatedField.js +53 -71
- package/lib-commonjs/util/makeDeprecatedField.js.map +1 -1
- package/package.json +8 -8
@@ -1,113 +1,154 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
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
|
+
fieldClassNames: ()=>fieldClassNames,
|
13
|
+
useFieldStyles_unstable: ()=>useFieldStyles_unstable
|
5
14
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
validationMessageIcon: `fui-Field__validationMessageIcon`,
|
14
|
-
hint: `fui-Field__hint`
|
15
|
+
const _react = require("@griffel/react");
|
16
|
+
const fieldClassNames = {
|
17
|
+
root: `fui-Field`,
|
18
|
+
label: `fui-Field__label`,
|
19
|
+
validationMessage: `fui-Field__validationMessage`,
|
20
|
+
validationMessageIcon: `fui-Field__validationMessageIcon`,
|
21
|
+
hint: `fui-Field__hint`
|
15
22
|
};
|
16
23
|
// Size of the icon in the validation message
|
17
|
-
const iconSize =
|
24
|
+
const iconSize = "12px";
|
18
25
|
/**
|
19
26
|
* Styles for the root slot
|
20
|
-
*/
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
*/ const useRootStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
28
|
+
base: {
|
29
|
+
mc9l5x: "f13qh94s"
|
30
|
+
},
|
31
|
+
horizontal: {
|
32
|
+
Budl1dq: "f2wwaib",
|
33
|
+
wkccdc: "f1645dqt"
|
34
|
+
},
|
35
|
+
horizontalNoLabel: {
|
36
|
+
uwmqm3: [
|
37
|
+
"f15jqgz8",
|
38
|
+
"fggqkej"
|
39
|
+
],
|
40
|
+
Budl1dq: "f1c2z91y"
|
41
|
+
}
|
33
42
|
}, {
|
34
|
-
|
43
|
+
d: [
|
44
|
+
".f13qh94s{display:grid;}",
|
45
|
+
".f2wwaib{grid-template-columns:33% 1fr;}",
|
46
|
+
".f1645dqt{grid-template-rows:auto auto auto 1fr;}",
|
47
|
+
".f15jqgz8{padding-left:33%;}",
|
48
|
+
".fggqkej{padding-right:33%;}",
|
49
|
+
".f1c2z91y{grid-template-columns:1fr;}"
|
50
|
+
]
|
35
51
|
});
|
36
|
-
const useLabelStyles = /*#__PURE__*/
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
52
|
+
const useLabelStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
53
|
+
base: {
|
54
|
+
z8tnut: "fclwglc",
|
55
|
+
Byoj8tv: "fywfov9"
|
56
|
+
},
|
57
|
+
large: {
|
58
|
+
z8tnut: "f1sl3k7w",
|
59
|
+
Byoj8tv: "f1brlhvm"
|
60
|
+
},
|
61
|
+
vertical: {
|
62
|
+
jrapky: "fyacil5"
|
63
|
+
},
|
64
|
+
verticalLarge: {
|
65
|
+
jrapky: "f8l5zjj"
|
66
|
+
},
|
67
|
+
horizontal: {
|
68
|
+
t21cq0: [
|
69
|
+
"fkujibs",
|
70
|
+
"f199hnxi"
|
71
|
+
],
|
72
|
+
Ijaq50: "f16hsg94",
|
73
|
+
nk6f5a: "f1nzqi2z"
|
74
|
+
}
|
56
75
|
}, {
|
57
|
-
|
76
|
+
d: [
|
77
|
+
".fclwglc{padding-top:var(--spacingVerticalXXS);}",
|
78
|
+
".fywfov9{padding-bottom:var(--spacingVerticalXXS);}",
|
79
|
+
".f1sl3k7w{padding-top:1px;}",
|
80
|
+
".f1brlhvm{padding-bottom:1px;}",
|
81
|
+
".fyacil5{margin-bottom:var(--spacingVerticalXXS);}",
|
82
|
+
".f8l5zjj{margin-bottom:var(--spacingVerticalXS);}",
|
83
|
+
".fkujibs{margin-right:var(--spacingHorizontalM);}",
|
84
|
+
".f199hnxi{margin-left:var(--spacingHorizontalM);}",
|
85
|
+
".f16hsg94{grid-row-start:1;}",
|
86
|
+
".f1nzqi2z{grid-row-end:-1;}"
|
87
|
+
]
|
58
88
|
});
|
59
|
-
const useSecondaryTextBaseClassName = /*#__PURE__*/
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
89
|
+
const useSecondaryTextBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r5c4z9l", null, [
|
90
|
+
".r5c4z9l{margin-top:var(--spacingVerticalXXS);color:var(--colorNeutralForeground3);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}"
|
91
|
+
]);
|
92
|
+
const useSecondaryTextStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
93
|
+
error: {
|
94
|
+
sj55zd: "f1hcrxcs"
|
95
|
+
},
|
96
|
+
withIcon: {
|
97
|
+
uwmqm3: [
|
98
|
+
"frawy03",
|
99
|
+
"fg4c52"
|
100
|
+
]
|
101
|
+
}
|
67
102
|
}, {
|
68
|
-
|
103
|
+
d: [
|
104
|
+
".f1hcrxcs{color:var(--colorPaletteRedForeground1);}",
|
105
|
+
".frawy03{padding-left:calc(12px + var(--spacingHorizontalXS));}",
|
106
|
+
".fg4c52{padding-right:calc(12px + var(--spacingHorizontalXS));}"
|
107
|
+
]
|
69
108
|
});
|
70
|
-
const useValidationMessageIconBaseClassName = /*#__PURE__*/
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
109
|
+
const useValidationMessageIconBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("ra7h1uk", "r1rh6bd7", [
|
110
|
+
".ra7h1uk{display:inline-block;font-size:12px;margin-left:calc(-12px - var(--spacingHorizontalXS));margin-right:var(--spacingHorizontalXS);line-height:0;vertical-align:-1px;}",
|
111
|
+
".r1rh6bd7{display:inline-block;font-size:12px;margin-right:calc(-12px - var(--spacingHorizontalXS));margin-left:var(--spacingHorizontalXS);line-height:0;vertical-align:-1px;}"
|
112
|
+
]);
|
113
|
+
const useValidationMessageIconStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
114
|
+
error: {
|
115
|
+
sj55zd: "f1hcrxcs"
|
116
|
+
},
|
117
|
+
warning: {
|
118
|
+
sj55zd: "f1k5f75o"
|
119
|
+
},
|
120
|
+
success: {
|
121
|
+
sj55zd: "ffmvakt"
|
122
|
+
}
|
81
123
|
}, {
|
82
|
-
|
124
|
+
d: [
|
125
|
+
".f1hcrxcs{color:var(--colorPaletteRedForeground1);}",
|
126
|
+
".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}",
|
127
|
+
".ffmvakt{color:var(--colorPaletteGreenForeground1);}"
|
128
|
+
]
|
83
129
|
});
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
const
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
if (state.hint) {
|
109
|
-
state.hint.className = react_1.mergeClasses(exports.fieldClassNames.hint, secondaryTextBaseClassName, state.hint.className);
|
110
|
-
}
|
111
|
-
};
|
112
|
-
exports.useFieldStyles_unstable = useFieldStyles_unstable;
|
130
|
+
const useFieldStyles_unstable = (state)=>{
|
131
|
+
const { validationState } = state;
|
132
|
+
const horizontal = state.orientation === "horizontal";
|
133
|
+
const rootStyles = useRootStyles();
|
134
|
+
state.root.className = (0, _react.mergeClasses)(fieldClassNames.root, rootStyles.base, horizontal && rootStyles.horizontal, horizontal && !state.label && rootStyles.horizontalNoLabel, state.root.className);
|
135
|
+
const labelStyles = useLabelStyles();
|
136
|
+
if (state.label) {
|
137
|
+
state.label.className = (0, _react.mergeClasses)(fieldClassNames.label, labelStyles.base, horizontal && labelStyles.horizontal, !horizontal && labelStyles.vertical, state.label.size === "large" && labelStyles.large, !horizontal && state.label.size === "large" && labelStyles.verticalLarge, state.label.className);
|
138
|
+
}
|
139
|
+
const validationMessageIconBaseClassName = useValidationMessageIconBaseClassName();
|
140
|
+
const validationMessageIconStyles = useValidationMessageIconStyles();
|
141
|
+
if (state.validationMessageIcon) {
|
142
|
+
state.validationMessageIcon.className = (0, _react.mergeClasses)(fieldClassNames.validationMessageIcon, validationMessageIconBaseClassName, validationState !== "none" && validationMessageIconStyles[validationState], state.validationMessageIcon.className);
|
143
|
+
}
|
144
|
+
const secondaryTextBaseClassName = useSecondaryTextBaseClassName();
|
145
|
+
const secondaryTextStyles = useSecondaryTextStyles();
|
146
|
+
if (state.validationMessage) {
|
147
|
+
state.validationMessage.className = (0, _react.mergeClasses)(fieldClassNames.validationMessage, secondaryTextBaseClassName, validationState === "error" && secondaryTextStyles.error, !!state.validationMessageIcon && secondaryTextStyles.withIcon, state.validationMessage.className);
|
148
|
+
}
|
149
|
+
if (state.hint) {
|
150
|
+
state.hint.className = (0, _react.mergeClasses)(fieldClassNames.hint, secondaryTextBaseClassName, state.hint.className);
|
151
|
+
}
|
152
|
+
}; //# sourceMappingURL=useFieldStyles.js.map
|
153
|
+
|
113
154
|
//# sourceMappingURL=useFieldStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/Field/useFieldStyles.js"],"sourcesContent":["import { tokens, typographyStyles } from \"@fluentui/react-theme\";\nimport { __resetStyles, __styles, mergeClasses } from \"@griffel/react\";\nexport const fieldClassNames = {\n root: `fui-Field`,\n label: `fui-Field__label`,\n validationMessage: `fui-Field__validationMessage`,\n validationMessageIcon: `fui-Field__validationMessageIcon`,\n hint: `fui-Field__hint`\n};\n// Size of the icon in the validation message\nconst iconSize = \"12px\";\n/**\n * Styles for the root slot\n */\nconst useRootStyles = /*#__PURE__*/__styles({\n base: {\n mc9l5x: \"f13qh94s\"\n },\n horizontal: {\n Budl1dq: \"f2wwaib\",\n wkccdc: \"f1645dqt\"\n },\n horizontalNoLabel: {\n uwmqm3: [\"f15jqgz8\", \"fggqkej\"],\n Budl1dq: \"f1c2z91y\"\n }\n}, {\n d: [\".f13qh94s{display:grid;}\", \".f2wwaib{grid-template-columns:33% 1fr;}\", \".f1645dqt{grid-template-rows:auto auto auto 1fr;}\", \".f15jqgz8{padding-left:33%;}\", \".fggqkej{padding-right:33%;}\", \".f1c2z91y{grid-template-columns:1fr;}\"]\n});\nconst useLabelStyles = /*#__PURE__*/__styles({\n base: {\n z8tnut: \"fclwglc\",\n Byoj8tv: \"fywfov9\"\n },\n large: {\n z8tnut: \"f1sl3k7w\",\n Byoj8tv: \"f1brlhvm\"\n },\n vertical: {\n jrapky: \"fyacil5\"\n },\n verticalLarge: {\n jrapky: \"f8l5zjj\"\n },\n horizontal: {\n t21cq0: [\"fkujibs\", \"f199hnxi\"],\n Ijaq50: \"f16hsg94\",\n nk6f5a: \"f1nzqi2z\"\n }\n}, {\n d: [\".fclwglc{padding-top:var(--spacingVerticalXXS);}\", \".fywfov9{padding-bottom:var(--spacingVerticalXXS);}\", \".f1sl3k7w{padding-top:1px;}\", \".f1brlhvm{padding-bottom:1px;}\", \".fyacil5{margin-bottom:var(--spacingVerticalXXS);}\", \".f8l5zjj{margin-bottom:var(--spacingVerticalXS);}\", \".fkujibs{margin-right:var(--spacingHorizontalM);}\", \".f199hnxi{margin-left:var(--spacingHorizontalM);}\", \".f16hsg94{grid-row-start:1;}\", \".f1nzqi2z{grid-row-end:-1;}\"]\n});\nconst useSecondaryTextBaseClassName = /*#__PURE__*/__resetStyles(\"r5c4z9l\", null, [\".r5c4z9l{margin-top:var(--spacingVerticalXXS);color:var(--colorNeutralForeground3);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}\"]);\nconst useSecondaryTextStyles = /*#__PURE__*/__styles({\n error: {\n sj55zd: \"f1hcrxcs\"\n },\n withIcon: {\n uwmqm3: [\"frawy03\", \"fg4c52\"]\n }\n}, {\n d: [\".f1hcrxcs{color:var(--colorPaletteRedForeground1);}\", \".frawy03{padding-left:calc(12px + var(--spacingHorizontalXS));}\", \".fg4c52{padding-right:calc(12px + var(--spacingHorizontalXS));}\"]\n});\nconst useValidationMessageIconBaseClassName = /*#__PURE__*/__resetStyles(\"ra7h1uk\", \"r1rh6bd7\", [\".ra7h1uk{display:inline-block;font-size:12px;margin-left:calc(-12px - var(--spacingHorizontalXS));margin-right:var(--spacingHorizontalXS);line-height:0;vertical-align:-1px;}\", \".r1rh6bd7{display:inline-block;font-size:12px;margin-right:calc(-12px - var(--spacingHorizontalXS));margin-left:var(--spacingHorizontalXS);line-height:0;vertical-align:-1px;}\"]);\nconst useValidationMessageIconStyles = /*#__PURE__*/__styles({\n error: {\n sj55zd: \"f1hcrxcs\"\n },\n warning: {\n sj55zd: \"f1k5f75o\"\n },\n success: {\n sj55zd: \"ffmvakt\"\n }\n}, {\n d: [\".f1hcrxcs{color:var(--colorPaletteRedForeground1);}\", \".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}\", \".ffmvakt{color:var(--colorPaletteGreenForeground1);}\"]\n});\n/**\n * Apply styling to the Field slots based on the state\n */\nexport const useFieldStyles_unstable = state => {\n const {\n validationState\n } = state;\n const horizontal = state.orientation === \"horizontal\";\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(fieldClassNames.root, rootStyles.base, horizontal && rootStyles.horizontal, horizontal && !state.label && rootStyles.horizontalNoLabel, state.root.className);\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(fieldClassNames.label, labelStyles.base, horizontal && labelStyles.horizontal, !horizontal && labelStyles.vertical, state.label.size === \"large\" && labelStyles.large, !horizontal && state.label.size === \"large\" && labelStyles.verticalLarge, state.label.className);\n }\n const validationMessageIconBaseClassName = useValidationMessageIconBaseClassName();\n const validationMessageIconStyles = useValidationMessageIconStyles();\n if (state.validationMessageIcon) {\n state.validationMessageIcon.className = mergeClasses(fieldClassNames.validationMessageIcon, validationMessageIconBaseClassName, validationState !== \"none\" && validationMessageIconStyles[validationState], state.validationMessageIcon.className);\n }\n const secondaryTextBaseClassName = useSecondaryTextBaseClassName();\n const secondaryTextStyles = useSecondaryTextStyles();\n if (state.validationMessage) {\n state.validationMessage.className = mergeClasses(fieldClassNames.validationMessage, secondaryTextBaseClassName, validationState === \"error\" && secondaryTextStyles.error, !!state.validationMessageIcon && secondaryTextStyles.withIcon, state.validationMessage.className);\n }\n if (state.hint) {\n state.hint.className = mergeClasses(fieldClassNames.hint, secondaryTextBaseClassName, state.hint.className);\n }\n};\n//# sourceMappingURL=useFieldStyles.js.map"],"names":["fieldClassNames","useFieldStyles_unstable","root","label","validationMessage","validationMessageIcon","hint","iconSize","useRootStyles","__styles","base","mc9l5x","horizontal","Budl1dq","wkccdc","horizontalNoLabel","uwmqm3","d","useLabelStyles","z8tnut","Byoj8tv","large","vertical","jrapky","verticalLarge","t21cq0","Ijaq50","nk6f5a","useSecondaryTextBaseClassName","__resetStyles","useSecondaryTextStyles","error","sj55zd","withIcon","useValidationMessageIconBaseClassName","useValidationMessageIconStyles","warning","success","state","validationState","orientation","rootStyles","className","mergeClasses","labelStyles","size","validationMessageIconBaseClassName","validationMessageIconStyles","secondaryTextBaseClassName","secondaryTextStyles"],"mappings":";;;;;;;;;;;IAEaA,eAAe,MAAfA;IA8EAC,uBAAuB,MAAvBA;;uBA/EyC;AAC/C,MAAMD,kBAAkB;IAC7BE,MAAM,CAAC,SA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AAMjC,qBAAqB,CAACqC,SAAS;IACnP,CAAC;IACD,MAAMM,6BAA6BpB;IACnC,MAAMqB,sBAAsBnB;IAC5B,IAAIQ,MAAMlC,iBAAiB,EAAE;QAC3BkC,MAAMlC,iBAAiB,CAACsC,SAAS,GAAGC,IAAAA,mBAAY,EAAC3C,gBAAgBI,iBAAiB,EAAE4C,4BAA4BT,oBAAoB,WAAWU,oBAAoBlB,KAAK,EAAE,CAAC,CAACO,MAAMjC,qBAAqB,IAAI4C,oBAAoBhB,QAAQ,EAAEK,MAAMlC,iBAAiB,CAACsC,SAAS;IAC5Q,CAAC;IACD,IAAIJ,MAAMhC,IAAI,EAAE;QACdgC,MAAMhC,IAAI,CAACoC,SAAS,GAAGC,IAAAA,mBAAY,EAAC3C,gBAAgBM,IAAI,EAAE0C,4BAA4BV,MAAMhC,IAAI,CAACoC,SAAS;IAC5G,CAAC;AACH,GACA,0CAA0C"}
|
package/lib-commonjs/index.js
CHANGED
@@ -1,52 +1,24 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
5
|
-
});
|
6
|
-
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
});
|
26
|
-
Object.defineProperty(exports, "useFieldStyles_unstable", {
|
27
|
-
enumerable: true,
|
28
|
-
get: function () {
|
29
|
-
return Field_1.useFieldStyles_unstable;
|
30
|
-
}
|
31
|
-
});
|
32
|
-
Object.defineProperty(exports, "useField_unstable", {
|
33
|
-
enumerable: true,
|
34
|
-
get: function () {
|
35
|
-
return Field_1.useField_unstable;
|
36
|
-
}
|
37
|
-
});
|
38
|
-
// eslint-disable-next-line deprecation/deprecation
|
39
|
-
var makeDeprecatedField_1 = /*#__PURE__*/require("./util/makeDeprecatedField");
|
40
|
-
Object.defineProperty(exports, "getDeprecatedFieldClassNames", {
|
41
|
-
enumerable: true,
|
42
|
-
get: function () {
|
43
|
-
return makeDeprecatedField_1.getDeprecatedFieldClassNames;
|
44
|
-
}
|
45
|
-
});
|
46
|
-
Object.defineProperty(exports, "makeDeprecatedField", {
|
47
|
-
enumerable: true,
|
48
|
-
get: function () {
|
49
|
-
return makeDeprecatedField_1.makeDeprecatedField;
|
50
|
-
}
|
51
|
-
});
|
3
|
+
value: true
|
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
|
+
Field: ()=>_field.Field,
|
13
|
+
fieldClassNames: ()=>_field.fieldClassNames,
|
14
|
+
renderField_unstable: ()=>_field.renderField_unstable,
|
15
|
+
useFieldStyles_unstable: ()=>_field.useFieldStyles_unstable,
|
16
|
+
useField_unstable: ()=>_field.useField_unstable,
|
17
|
+
getDeprecatedFieldClassNames: ()=>_makeDeprecatedField.getDeprecatedFieldClassNames,
|
18
|
+
makeDeprecatedField: ()=>_makeDeprecatedField.makeDeprecatedField
|
19
|
+
});
|
20
|
+
const _field = require("./Field");
|
21
|
+
const _makeDeprecatedField = require("./util/makeDeprecatedField");
|
22
|
+
//# sourceMappingURL=index.js.map
|
23
|
+
|
52
24
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { Field, fieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from \"./Field\";\n// eslint-disable-next-line deprecation/deprecation\nexport { getDeprecatedFieldClassNames, makeDeprecatedField } from \"./util/makeDeprecatedField\";\n//# sourceMappingURL=index.js.map"],"names":["Field","fieldClassNames","renderField_unstable","useFieldStyles_unstable","useField_unstable","getDeprecatedFieldClassNames","makeDeprecatedField"],"mappings":";;;;;;;;;;;IAASA,KAAK,MAALA,YAAK;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,oBAAoB,MAApBA,2BAAoB;IAAEC,uBAAuB,MAAvBA,8BAAuB;IAAEC,iBAAiB,MAAjBA,wBAAiB;IAExFC,4BAA4B,MAA5BA,iDAA4B;IAAEC,mBAAmB,MAAnBA,wCAAmB;;uBAF+C;qCAEvC;CAClE,iCAAiC"}
|
@@ -1,79 +1,61 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
1
|
+
/* eslint-disable deprecation/deprecation */ "use strict";
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
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
|
5
14
|
});
|
6
|
-
|
7
|
-
|
8
|
-
const
|
9
|
-
const Field_1 = /*#__PURE__*/require("../Field");
|
15
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
16
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
17
|
+
const _field = require("../Field");
|
10
18
|
/**
|
11
19
|
* Partition the props used by the Field itself, from the props that are passed to the underlying field component.
|
12
|
-
*/
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
size,
|
36
|
-
style,
|
37
|
-
validationMessage,
|
38
|
-
validationMessageIcon,
|
39
|
-
validationState,
|
40
|
-
...root
|
41
|
-
}, {
|
42
|
-
required,
|
43
|
-
size,
|
44
|
-
...restOfProps,
|
45
|
-
...control
|
46
|
-
}];
|
20
|
+
*/ function getPartitionedFieldProps(props) {
|
21
|
+
const { className , control , hint , label , orientation , required , root , size , style , validationMessage , validationMessageIcon , validationState ="none" , ...restOfProps } = props;
|
22
|
+
return [
|
23
|
+
{
|
24
|
+
className,
|
25
|
+
hint,
|
26
|
+
label,
|
27
|
+
orientation,
|
28
|
+
required,
|
29
|
+
size,
|
30
|
+
style,
|
31
|
+
validationMessage,
|
32
|
+
validationMessageIcon,
|
33
|
+
validationState,
|
34
|
+
...root
|
35
|
+
},
|
36
|
+
{
|
37
|
+
required,
|
38
|
+
size,
|
39
|
+
...restOfProps,
|
40
|
+
...control
|
41
|
+
}
|
42
|
+
];
|
47
43
|
}
|
48
|
-
/**
|
49
|
-
* @deprecated Only for use to make deprecated [Control]Field shim components.
|
50
|
-
* @internal
|
51
|
-
*/
|
52
44
|
function makeDeprecatedField(Control, options = {}) {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
ref: ref
|
64
|
-
}));
|
65
|
-
});
|
66
|
-
DeprecatedField.displayName = displayName;
|
67
|
-
return DeprecatedField;
|
45
|
+
const { mapProps =(props)=>props , displayName =`${Control.displayName}Field` } = options;
|
46
|
+
const DeprecatedField = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
47
|
+
const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));
|
48
|
+
return /*#__PURE__*/ _react.createElement(_field.Field, fieldProps, /*#__PURE__*/ _react.createElement(Control, {
|
49
|
+
...controlProps,
|
50
|
+
ref: ref
|
51
|
+
}));
|
52
|
+
});
|
53
|
+
DeprecatedField.displayName = displayName;
|
54
|
+
return DeprecatedField;
|
68
55
|
}
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
const getDeprecatedFieldClassNames = controlRootClassName => ({
|
75
|
-
...Field_1.fieldClassNames,
|
76
|
-
control: controlRootClassName
|
77
|
-
});
|
78
|
-
exports.getDeprecatedFieldClassNames = getDeprecatedFieldClassNames;
|
56
|
+
const getDeprecatedFieldClassNames = (controlRootClassName)=>({
|
57
|
+
..._field.fieldClassNames,
|
58
|
+
control: controlRootClassName
|
59
|
+
}); //# sourceMappingURL=makeDeprecatedField.js.map
|
60
|
+
|
79
61
|
//# sourceMappingURL=makeDeprecatedField.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/util/makeDeprecatedField.js"],"sourcesContent":["/* eslint-disable deprecation/deprecation */import * as React from \"react\";\nimport { Field, fieldClassNames } from \"../Field\";\n/**\n * Partition the props used by the Field itself, from the props that are passed to the underlying field component.\n */\nfunction getPartitionedFieldProps(props) {\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 return [{\n className,\n hint,\n label,\n orientation,\n required,\n size,\n style,\n validationMessage,\n validationMessageIcon,\n validationState,\n ...root\n }, {\n required,\n size,\n ...restOfProps,\n ...control\n }];\n}\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport function makeDeprecatedField(Control, options = {}) {\n const {\n mapProps = props => props,\n displayName = `${Control.displayName}Field`\n } = options;\n const DeprecatedField = /*#__PURE__*/React.forwardRef((props, ref) => {\n const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));\n return /*#__PURE__*/React.createElement(Field, fieldProps, /*#__PURE__*/React.createElement(Control, {\n ...controlProps,\n ref: ref\n }));\n });\n DeprecatedField.displayName = displayName;\n return DeprecatedField;\n}\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport const getDeprecatedFieldClassNames = controlRootClassName => ({\n ...fieldClassNames,\n control: controlRootClassName\n});\n//# sourceMappingURL=makeDeprecatedField.js.map"],"names":["makeDeprecatedField","getDeprecatedFieldClassNames","getPartitionedFieldProps","props","className","control","hint","label","orientation","required","root","size","style","validationMessage","validationMessageIcon","validationState","restOfProps","Control","options","mapProps","displayName","DeprecatedField","React","forwardRef","ref","fieldProps","controlProps","createElement","Field","controlRootClassName","fieldClassNames"],"mappings":"AAAA,0CAA0C;;;;;;;;;;;IA4C1BA,mBAAmB,MAAnBA;IAmBHC,4BAA4B,MAA5BA;;;6DA/DsD;uBAC5B;AACvC;;CAEC,GACD,SAASC,yBAAyBC,KAAK,EAAE;IACvC,MAAM,EACJC,UAAS,EACTC,QAAO,EACPC,KAAI,EACJC,MAAK,EACLC,YAAW,EACXC,SAAQ,EACRC,KAAI,EACJC,KAAI,EACJC,MAAK,EACLC,kBAAiB,EACjBC,sBAAqB,EACrBC,iBAAkB,OAAM,EACxB,GAAGC,aACJ,GAAGb;IACJ,OAAO;QAAC;YACNC;YACAE;YACAC;YACAC;YACAC;YACAE;YACAC;YACAC;YACAC;YACAC;YACA,GAAGL,IAAI;QACT;QAAG;YACDD;YACAE;YACA,GAAGK,WAAW;YACd,GAAGX,OAAO;QACZ;KAAE;AACJ;AAKO,SAASL,oBAAoBiB,OAAO,EAAEC,UAAU,CAAC,CAAC,EAAE;IACzD,MAAM,EACJC,UAAWhB,CAAAA,QAASA,MAAK,EACzBiB,aAAc,CAAC,EAAEH,QAAQG,WAAW,CAAC,KAAK,CAAC,CAAA,EAC5C,GAAGF;IACJ,MAAMG,kBAAkB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACpB,OAAOqB,MAAQ;QACpE,MAAM,CAACC,YAAYC,aAAa,GAAGxB,yBAAyBiB,SAAShB;QACrE,OAAO,WAAW,GAAEmB,OAAMK,aAAa,CAACC,YAAK,EAAEH,YAAY,WAAW,GAAEH,OAAMK,aAAa,CAACV,SAAS;YACnG,GAAGS,YAAY;YACfF,KAAKA;QACP;IACF;IACAH,gBAAgBD,WAAW,GAAGA;IAC9B,OAAOC;AACT;AAKO,MAAMpB,+BAA+B4B,CAAAA,uBAAyB,CAAA;QACnE,GAAGC,sBAAe;QAClBzB,SAASwB;IACX,CAAA,GACA,+CAA+C"}
|
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-20230317-1454.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": "
|
25
|
+
"generate-api": "just-scripts generate-api"
|
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-20230317-1454.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-20230317-1454.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-20230317-1454.1",
|
38
|
+
"@fluentui/react-theme": "0.0.0-nightly-20230317-1454.1",
|
39
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20230317-1454.1",
|
40
40
|
"@griffel/react": "^1.5.2",
|
41
|
-
"
|
41
|
+
"@swc/helpers": "^0.4.14"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
44
|
"@types/react": ">=16.8.0 <19.0.0",
|