@rocket.chat/fuselage-forms 0.1.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Field/Field.js +5 -31
- package/dist/cjs/Field/Field.js.map +1 -1
- package/dist/cjs/Field/FieldContext.js +58 -60
- package/dist/cjs/Field/FieldContext.js.map +1 -1
- package/dist/cjs/Field/FieldDescription.js +6 -29
- package/dist/cjs/Field/FieldDescription.js.map +1 -1
- package/dist/cjs/Field/FieldError.js +6 -29
- package/dist/cjs/Field/FieldError.js.map +1 -1
- package/dist/cjs/Field/FieldHint.js +6 -29
- package/dist/cjs/Field/FieldHint.js.map +1 -1
- package/dist/cjs/Field/FieldProvider.js +25 -26
- package/dist/cjs/Field/FieldProvider.js.map +1 -1
- package/dist/cjs/Field/Label/FieldLabel.js +10 -25
- package/dist/cjs/Field/Label/FieldLabel.js.map +1 -1
- package/dist/cjs/Field/Label/HiddenLabel.js +6 -29
- package/dist/cjs/Field/Label/HiddenLabel.js.map +1 -1
- package/dist/cjs/Field/Label/LabelFor.js +6 -29
- package/dist/cjs/Field/Label/LabelFor.js.map +1 -1
- package/dist/cjs/Field/Label/ReferencedLabel.js +6 -29
- package/dist/cjs/Field/Label/ReferencedLabel.js.map +1 -1
- package/dist/cjs/Field/Label/index.js +4 -7
- package/dist/cjs/Field/Label/index.js.map +1 -1
- package/dist/cjs/Field/index.js +5 -8
- package/dist/cjs/Field/index.js.map +1 -1
- package/dist/cjs/Inputs/WrappedInputComponents.d.ts +29 -2175
- package/dist/cjs/Inputs/WrappedInputComponents.d.ts.map +1 -1
- package/dist/cjs/Inputs/WrappedInputComponents.js +5 -7
- package/dist/cjs/Inputs/WrappedInputComponents.js.map +1 -1
- package/dist/cjs/Inputs/withLabelHelpers.js +15 -29
- package/dist/cjs/Inputs/withLabelHelpers.js.map +1 -1
- package/dist/esm/Field/Field.js +10 -28
- package/dist/esm/Field/Field.js.map +1 -1
- package/dist/esm/Field/FieldContext.js +68 -61
- package/dist/esm/Field/FieldContext.js.map +1 -1
- package/dist/esm/Field/FieldDescription.js +9 -30
- package/dist/esm/Field/FieldDescription.js.map +1 -1
- package/dist/esm/Field/FieldError.js +9 -30
- package/dist/esm/Field/FieldError.js.map +1 -1
- package/dist/esm/Field/FieldHint.js +9 -30
- package/dist/esm/Field/FieldHint.js.map +1 -1
- package/dist/esm/Field/FieldProvider.js +29 -28
- package/dist/esm/Field/FieldProvider.js.map +1 -1
- package/dist/esm/Field/Label/FieldLabel.js +15 -22
- package/dist/esm/Field/Label/FieldLabel.js.map +1 -1
- package/dist/esm/Field/Label/HiddenLabel.js +9 -30
- package/dist/esm/Field/Label/HiddenLabel.js.map +1 -1
- package/dist/esm/Field/Label/LabelFor.js +9 -30
- package/dist/esm/Field/Label/LabelFor.js.map +1 -1
- package/dist/esm/Field/Label/ReferencedLabel.js +9 -30
- package/dist/esm/Field/Label/ReferencedLabel.js.map +1 -1
- package/dist/esm/Field/Label/index.js +14 -4
- package/dist/esm/Field/Label/index.js.map +1 -1
- package/dist/esm/Field/index.js +37 -8
- package/dist/esm/Field/index.js.map +1 -1
- package/dist/esm/Inputs/WrappedInputComponents.d.ts +29 -2175
- package/dist/esm/Inputs/WrappedInputComponents.d.ts.map +1 -1
- package/dist/esm/Inputs/WrappedInputComponents.js +19 -18
- package/dist/esm/Inputs/WrappedInputComponents.js.map +1 -1
- package/dist/esm/Inputs/index.js +17 -1
- package/dist/esm/Inputs/index.js.map +1 -1
- package/dist/esm/Inputs/withLabelHelpers.js +20 -30
- package/dist/esm/Inputs/withLabelHelpers.js.map +1 -1
- package/dist/esm/index.js +18 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrappedInputComponents.d.ts","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WrappedInputComponents.d.ts","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":"AAAA,OAAO,EAcL,MAAM,IAAI,eAAe,EAC1B,MAAM,uBAAuB,CAAC;AAW/B,eAAO,MAAM,SAAS;;;;;;CAAkC,CAAC;AACzD,eAAO,MAAM,UAAU;;;;;;CAAmC,CAAC;AAC3D,eAAO,MAAM,aAAa;;;CAAsC,CAAC;AACjE,eAAO,MAAM,WAAW;;;;;;CAAoC,CAAC;AAC7D,eAAO,MAAM,aAAa;;;;;;CAAiC,CAAC;AAC5D,eAAO,MAAM,cAAc;;;;;;;CAAuC,CAAC;AACnE,eAAO,MAAM,WAAW;;;CAAoC,CAAC;AAC7D,eAAO,MAAM,QAAQ;;;CAAiC,CAAC;AAGvD,eAAO,MAAM,MAAM;;;;;;;;;;CAAsC,CAAC;AAC1D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAA2C,CAAC;AACpE,eAAO,MAAM,MAAM,EAEd,OAAO,eAAe,CAAC;AAG5B,eAAO,MAAM,QAAQ;;;;;;CAA6C,CAAC;AACnE,eAAO,MAAM,YAAY;;;;;CAAiD,CAAC;AAC3E,eAAO,MAAM,WAAW;;;;;CAAgD,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RadioButton = exports.ToggleSwitch = exports.CheckBox = exports.Select = exports.UrlInput = exports.NumberInput = exports.TelephoneInput = exports.TextAreaInput = exports.SearchInput = exports.PasswordInput = exports.EmailInput = exports.TextInput = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// TODO: Some inputs are still not supported due to requiring a different a11y approach
|
|
7
|
-
// with id
|
|
3
|
+
exports.RadioButton = exports.ToggleSwitch = exports.CheckBox = exports.Slider = exports.MultiSelect = exports.Select = exports.UrlInput = exports.NumberInput = exports.TelephoneInput = exports.TextAreaInput = exports.SearchInput = exports.PasswordInput = exports.EmailInput = exports.TextInput = void 0;
|
|
4
|
+
const fuselage_1 = require("@rocket.chat/fuselage");
|
|
5
|
+
const withLabelHelpers_1 = require("./withLabelHelpers");
|
|
8
6
|
exports.TextInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TextInput);
|
|
9
7
|
exports.EmailInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.EmailInput);
|
|
10
8
|
exports.PasswordInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.PasswordInput);
|
|
@@ -13,9 +11,9 @@ exports.TextAreaInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TextAreaI
|
|
|
13
11
|
exports.TelephoneInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TelephoneInput);
|
|
14
12
|
exports.NumberInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.NumberInput);
|
|
15
13
|
exports.UrlInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.UrlInput);
|
|
16
|
-
// with aria-labelledby
|
|
17
14
|
exports.Select = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Select);
|
|
18
|
-
|
|
15
|
+
exports.MultiSelect = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.MultiSelect);
|
|
16
|
+
exports.Slider = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Slider);
|
|
19
17
|
exports.CheckBox = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.CheckBox);
|
|
20
18
|
exports.ToggleSwitch = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.ToggleSwitch);
|
|
21
19
|
exports.RadioButton = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.RadioButton);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrappedInputComponents.js","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"WrappedInputComponents.js","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":";;;AAAA,oDAe+B;AAE/B,yDAI4B;AAKf,QAAA,SAAS,GAAG,IAAA,8BAAW,EAAC,oBAAkB,CAAC,CAAC;AAC5C,QAAA,UAAU,GAAG,IAAA,8BAAW,EAAC,qBAAmB,CAAC,CAAC;AAC9C,QAAA,aAAa,GAAG,IAAA,8BAAW,EAAC,wBAAsB,CAAC,CAAC;AACpD,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC,sBAAoB,CAAC,CAAC;AAChD,QAAA,aAAa,GAAG,IAAA,8BAAW,EAAC,wBAAiB,CAAC,CAAC;AAC/C,QAAA,cAAc,GAAG,IAAA,8BAAW,EAAC,yBAAuB,CAAC,CAAC;AACtD,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC,sBAAoB,CAAC,CAAC;AAChD,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC,mBAAiB,CAAC,CAAC;AAG1C,QAAA,MAAM,GAAG,IAAA,qCAAkB,EAAC,iBAAe,CAAC,CAAC;AAC7C,QAAA,WAAW,GAAG,IAAA,qCAAkB,EAAC,sBAAoB,CAAC,CAAC;AACvD,QAAA,MAAM,GAAG,IAAA,qCAAkB,EACtC,iBAAe,CACU,CAAC;AAGf,QAAA,QAAQ,GAAG,IAAA,0CAAuB,EAAC,mBAAiB,CAAC,CAAC;AACtD,QAAA,YAAY,GAAG,IAAA,0CAAuB,EAAC,uBAAqB,CAAC,CAAC;AAC9D,QAAA,WAAW,GAAG,IAAA,0CAAuB,EAAC,sBAAoB,CAAC,CAAC"}
|
|
@@ -1,47 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.withLabelId = withLabelId;
|
|
15
4
|
exports.withAriaLabelledBy = withAriaLabelledBy;
|
|
16
5
|
exports.withVisuallyHiddenLabel = withVisuallyHiddenLabel;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_aria_1 = require("react-aria");
|
|
8
|
+
const FieldContext_1 = require("../Field/FieldContext");
|
|
20
9
|
function withLabelId(Component) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return (0, jsx_runtime_1.jsx)(Component, __assign({}, props, labelProps));
|
|
10
|
+
const WrappedComponent = function (props) {
|
|
11
|
+
const labelProps = (0, FieldContext_1.useFieldReferencedByInput)();
|
|
12
|
+
return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
|
|
25
13
|
};
|
|
26
|
-
WrappedComponent.displayName =
|
|
14
|
+
WrappedComponent.displayName = `withLabelId(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
27
15
|
return WrappedComponent;
|
|
28
16
|
}
|
|
29
17
|
function withAriaLabelledBy(Component) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return (0, jsx_runtime_1.jsx)(Component, __assign({}, props, labelProps));
|
|
18
|
+
const WrappedComponent = function (props) {
|
|
19
|
+
const labelProps = (0, FieldContext_1.useFieldReferencedByLabel)();
|
|
20
|
+
return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
|
|
34
21
|
};
|
|
35
|
-
WrappedComponent.displayName =
|
|
22
|
+
WrappedComponent.displayName = `withAriaLabelledBy(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
36
23
|
return WrappedComponent;
|
|
37
24
|
}
|
|
38
25
|
function withVisuallyHiddenLabel(Component) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return ((0, jsx_runtime_1.jsx)(Component, __assign({}, props, labelProps, { ref: labelRef, labelChildren: (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: label }) })));
|
|
26
|
+
const WrappedComponent = function (props) {
|
|
27
|
+
const [label, labelProps, labelRef] = (0, FieldContext_1.useFieldWrappedByInputLabel)();
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps, ref: labelRef, labelChildren: (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: label }) }));
|
|
43
29
|
};
|
|
44
|
-
WrappedComponent.displayName =
|
|
30
|
+
WrappedComponent.displayName = `withVisuallyHiddenLabel(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
45
31
|
return WrappedComponent;
|
|
46
32
|
}
|
|
47
33
|
//# sourceMappingURL=withLabelHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLabelHelpers.js","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withLabelHelpers.js","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":";;AA+DS,kCAAW;AAAE,gDAAkB;AAAE,0DAAuB;;AA5DjE,2CAA4C;AAE5C,wDAI+B;AAI/B,SAAS,WAAW,CAClB,SAA0D;IAE1D,MAAM,gBAAgB,GAAG,UAAU,KAAa;QAC9C,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,uBAAC,SAAS,OAAK,KAAK,KAAM,UAAU,GAAI,CAAC;IAClD,CAAC,CAAC;IAEF,gBAAgB,CAAC,WAAW,GAAG,eAAe,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,gBAAgB,GAAG,CAAC;IAE7G,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAID,SAAS,kBAAkB,CACzB,SAA4D;IAE5D,MAAM,gBAAgB,GAAG,UAAU,KAAa;QAC9C,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,uBAAC,SAAS,OAAK,KAAK,KAAM,UAAU,GAAI,CAAC;IAClD,CAAC,CAAC;IAEF,gBAAgB,CAAC,WAAW,GAAG,sBAAsB,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,gBAAgB,GAAG,CAAC;IAEpH,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAID,SAAS,uBAAuB,CAC9B,SAAgE;IAEhE,MAAM,gBAAgB,GAAG,UAAU,KAAa;QAC9C,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,GAAG,IAAA,0CAA2B,GAAE,CAAC;QACpE,OAAO,CACL,uBAAC,SAAS,OACJ,KAAK,KACL,UAAU,EACd,GAAG,EAAE,QAAQ,EACb,aAAa,EAAE,uBAAC,2BAAc,cAAE,KAAK,GAAkB,GACvD,CACH,CAAC;IACJ,CAAC,CAAC;IAEF,gBAAgB,CAAC,WAAW,GAAG,2BAA2B,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,gBAAgB,GAAG,CAAC;IAEzH,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
package/dist/esm/Field/Field.js
CHANGED
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
4
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { Field as FieldComponent } from '@rocket.chat/fuselage';
|
|
25
|
-
import FieldProvider from './FieldProvider';
|
|
26
|
-
function Field(_a) {
|
|
27
|
-
var children = _a.children, props = __rest(_a, ["children"]);
|
|
28
|
-
return (_jsx(FieldProvider, { children: _jsx(FieldComponent, __assign({}, props, { children: children })) }));
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const fuselage_1 = require("@rocket.chat/fuselage");
|
|
8
|
+
const FieldProvider_1 = __importDefault(require("./FieldProvider"));
|
|
9
|
+
function Field({ children, ...props }) {
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(FieldProvider_1.default, { children: (0, jsx_runtime_1.jsx)(fuselage_1.Field, { ...props, children: children }) }));
|
|
29
11
|
}
|
|
30
|
-
|
|
12
|
+
exports.default = Field;
|
|
31
13
|
//# sourceMappingURL=Field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../src/Field/Field.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../src/Field/Field.tsx"],"names":[],"mappings":";;;;;;AAAA,oDAAgE;AAGhE,oEAA4C;AAM5C,SAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAc;IAC/C,OAAO,CACL,uBAAC,uBAAa,cACZ,uBAAC,gBAAc,OAAK,KAAK,YAAG,QAAQ,GAAkB,GACxC,CACjB,CAAC;AACJ,CAAC;AAED,kBAAe,KAAK,CAAC"}
|
|
@@ -1,116 +1,123 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { useSafeRefCallback } from '@rocket.chat/fuselage-hooks';
|
|
13
|
-
import { createContext, useCallback, useContext, useEffect, useMemo, } from 'react';
|
|
14
|
-
export var FieldContext = createContext({
|
|
15
|
-
setDescriptor: function () { },
|
|
16
|
-
setLabel: function () { },
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFieldWrappedByInputLabel = exports.useFieldReferencedByLabel = exports.useFieldReferencedByInput = exports.useFieldDescriptorId = exports.useFieldFieldType = exports.useFieldLabel = exports.FieldContext = void 0;
|
|
4
|
+
const fuselage_hooks_1 = require("@rocket.chat/fuselage-hooks");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
exports.FieldContext = (0, react_1.createContext)({
|
|
7
|
+
setDescriptor: () => { },
|
|
8
|
+
setLabel: () => { },
|
|
17
9
|
descriptors: new Set(),
|
|
18
10
|
label: null,
|
|
19
11
|
id: '',
|
|
20
12
|
fieldType: 'referencedByLabel',
|
|
21
|
-
setFieldType:
|
|
22
|
-
emitAction:
|
|
23
|
-
onAction:
|
|
13
|
+
setFieldType: () => { },
|
|
14
|
+
emitAction: () => { },
|
|
15
|
+
onAction: () => { },
|
|
24
16
|
});
|
|
25
|
-
|
|
17
|
+
const getTextFromNode = (node) => {
|
|
26
18
|
if (!node.textContent) {
|
|
27
19
|
return null;
|
|
28
20
|
}
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
const text = [];
|
|
22
|
+
const treeWalker = node.ownerDocument.createTreeWalker(node, NodeFilter.SHOW_TEXT);
|
|
31
23
|
while (treeWalker.nextNode()) {
|
|
32
24
|
text.push(treeWalker.currentNode.textContent);
|
|
33
25
|
}
|
|
34
26
|
return text.join(' ');
|
|
35
27
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
const useFieldLabel = () => {
|
|
29
|
+
const { setLabel, id, emitAction } = (0, react_1.useContext)(exports.FieldContext);
|
|
30
|
+
const setLabelRef = (0, fuselage_hooks_1.useSafeRefCallback)((0, react_1.useCallback)((node) => {
|
|
39
31
|
if (!node) {
|
|
40
32
|
return;
|
|
41
33
|
}
|
|
42
34
|
setLabel(getTextFromNode(node));
|
|
43
|
-
|
|
35
|
+
const onClick = () => emitAction();
|
|
44
36
|
node.addEventListener('click', onClick);
|
|
45
|
-
return
|
|
37
|
+
return () => node.removeEventListener('click', onClick);
|
|
46
38
|
}, [setLabel, emitAction]));
|
|
47
|
-
return [setLabelRef,
|
|
39
|
+
return [setLabelRef, `${id}-label`];
|
|
48
40
|
};
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
exports.useFieldLabel = useFieldLabel;
|
|
42
|
+
const useFieldFieldType = () => {
|
|
43
|
+
const { fieldType } = (0, react_1.useContext)(exports.FieldContext);
|
|
51
44
|
return fieldType;
|
|
52
45
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
exports.useFieldFieldType = useFieldFieldType;
|
|
47
|
+
const useFieldDescriptorId = (type) => {
|
|
48
|
+
const { setDescriptor, id } = (0, react_1.useContext)(exports.FieldContext);
|
|
49
|
+
(0, react_1.useEffect)(() => {
|
|
56
50
|
setDescriptor(type);
|
|
57
|
-
return
|
|
51
|
+
return () => setDescriptor(type, true);
|
|
58
52
|
}, [type, setDescriptor]);
|
|
59
|
-
return
|
|
53
|
+
return `${id}-${type}`;
|
|
60
54
|
};
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
exports.useFieldDescriptorId = useFieldDescriptorId;
|
|
56
|
+
const describedByOrder = ['description', 'error', 'hint'];
|
|
57
|
+
const getDescribedBy = (descriptors, id) => {
|
|
63
58
|
return describedByOrder
|
|
64
|
-
.map(
|
|
65
|
-
return descriptors.has(type) ?
|
|
59
|
+
.map((type) => {
|
|
60
|
+
return descriptors.has(type) ? `${id}-${type}` : undefined;
|
|
66
61
|
})
|
|
67
62
|
.filter(Boolean)
|
|
68
63
|
.join(' ');
|
|
69
64
|
};
|
|
70
|
-
|
|
71
|
-
return
|
|
65
|
+
const getInputId = (id, descriptors) => {
|
|
66
|
+
return `${id}-label${descriptors.has('placeholder') ? ` ${id}-placeholder` : ''}`;
|
|
72
67
|
};
|
|
73
|
-
|
|
68
|
+
const getAriaInvalid = (descriptors) => {
|
|
74
69
|
if (descriptors.has('error')) {
|
|
75
70
|
return { 'aria-invalid': 'true' };
|
|
76
71
|
}
|
|
77
72
|
return { 'aria-invalid': 'false' };
|
|
78
73
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
useEffect(function () {
|
|
74
|
+
const useFieldReferencedByInput = () => {
|
|
75
|
+
const { id, descriptors, setFieldType } = (0, react_1.useContext)(exports.FieldContext);
|
|
76
|
+
(0, react_1.useEffect)(() => {
|
|
83
77
|
setFieldType('referencedByInput');
|
|
84
78
|
}, [setFieldType]);
|
|
85
|
-
return
|
|
79
|
+
return (0, react_1.useMemo)(() => ({
|
|
80
|
+
'id': getInputId(id, descriptors),
|
|
81
|
+
'aria-describedby': getDescribedBy(descriptors, id),
|
|
82
|
+
...getAriaInvalid(descriptors),
|
|
83
|
+
}), [descriptors, id]);
|
|
86
84
|
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
exports.useFieldReferencedByInput = useFieldReferencedByInput;
|
|
86
|
+
const useFieldReferencedByLabel = () => {
|
|
87
|
+
const { id, descriptors, setFieldType } = (0, react_1.useContext)(exports.FieldContext);
|
|
88
|
+
(0, react_1.useEffect)(() => {
|
|
91
89
|
setFieldType('referencedByLabel');
|
|
92
90
|
}, [setFieldType]);
|
|
93
|
-
return
|
|
91
|
+
return (0, react_1.useMemo)(() => ({
|
|
92
|
+
'aria-labelledby': getInputId(id, descriptors),
|
|
93
|
+
'aria-describedby': getDescribedBy(descriptors, id),
|
|
94
|
+
...getAriaInvalid(descriptors),
|
|
95
|
+
}), [descriptors, id]);
|
|
94
96
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
exports.useFieldReferencedByLabel = useFieldReferencedByLabel;
|
|
98
|
+
const useFieldWrappedByInputLabel = () => {
|
|
99
|
+
const { id, label, descriptors, setFieldType, onAction } = (0, react_1.useContext)(exports.FieldContext);
|
|
100
|
+
(0, react_1.useEffect)(() => {
|
|
99
101
|
setFieldType('wrappedByLabel');
|
|
100
102
|
}, [setFieldType]);
|
|
101
|
-
|
|
103
|
+
const refCallback = (0, fuselage_hooks_1.useSafeRefCallback)((0, react_1.useCallback)((node) => {
|
|
102
104
|
if (!node) {
|
|
103
105
|
return;
|
|
104
106
|
}
|
|
105
|
-
onAction(
|
|
107
|
+
onAction(() => {
|
|
106
108
|
node.focus();
|
|
107
109
|
node.click();
|
|
108
110
|
});
|
|
109
111
|
}, [onAction]));
|
|
110
|
-
return
|
|
112
|
+
return (0, react_1.useMemo)(() => [
|
|
111
113
|
label,
|
|
112
|
-
|
|
114
|
+
{
|
|
115
|
+
'aria-describedby': getDescribedBy(descriptors, id),
|
|
116
|
+
'id': getInputId(id, descriptors),
|
|
117
|
+
...getAriaInvalid(descriptors),
|
|
118
|
+
},
|
|
113
119
|
refCallback,
|
|
114
|
-
]
|
|
120
|
+
], [label, descriptors, id, refCallback]);
|
|
115
121
|
};
|
|
122
|
+
exports.useFieldWrappedByInputLabel = useFieldWrappedByInputLabel;
|
|
116
123
|
//# sourceMappingURL=FieldContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldContext.js","sourceRoot":"","sources":["../../../src/Field/FieldContext.ts"],"names":[],"mappings":"
|
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Q,CAAC,CACX,CACF,CAAC;IAEF,OAAO,IAAA,eAAO,EACZ,GAAG,EAAE,CAAC;QACJ,KAAK;QACL;YACE,kBAAkB,EAAE,cAAc,CAAC,WAAW,EAAE,EAAE,CAAC;YACnD,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,WAAW,CAAC;YACjC,GAAG,cAAc,CAAC,WAAW,CAAC;SAC/B;QACD,WAAW;KACZ,EACD,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,CAAC,CACtC,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,2BAA2B,+BA4CtC"}
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const fuselage_1 = require("@rocket.chat/fuselage");
|
|
5
|
+
const FieldContext_1 = require("./FieldContext");
|
|
6
|
+
const FieldDescription = ({ children, ...props }) => {
|
|
7
|
+
const id = (0, FieldContext_1.useFieldDescriptorId)('description');
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(fuselage_1.FieldDescription, { ...props, id: id, children: children }));
|
|
11
9
|
};
|
|
12
|
-
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { FieldDescription as FieldDescriptionComponent } from '@rocket.chat/fuselage';
|
|
25
|
-
import { useFieldDescriptorId } from './FieldContext';
|
|
26
|
-
var FieldDescription = function (_a) {
|
|
27
|
-
var children = _a.children, props = __rest(_a, ["children"]);
|
|
28
|
-
var id = useFieldDescriptorId('description');
|
|
29
|
-
return (_jsx(FieldDescriptionComponent, __assign({}, props, { id: id, children: children })));
|
|
30
|
-
};
|
|
31
|
-
export default FieldDescription;
|
|
10
|
+
exports.default = FieldDescription;
|
|
32
11
|
//# sourceMappingURL=FieldDescription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldDescription.js","sourceRoot":"","sources":["../../../src/Field/FieldDescription.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FieldDescription.js","sourceRoot":"","sources":["../../../src/Field/FieldDescription.tsx"],"names":[],"mappings":";;;AAAA,oDAAsF;AAGtF,iDAAsD;AAMtD,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAyB,EAAE,EAAE;IACzE,MAAM,EAAE,GAAG,IAAA,mCAAoB,EAAC,aAAa,CAAC,CAAC;IAE/C,OAAO,CACL,uBAAC,2BAAyB,OAAK,KAAK,EAAE,EAAE,EAAE,EAAE,YACzC,QAAQ,GACiB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const fuselage_1 = require("@rocket.chat/fuselage");
|
|
5
|
+
const FieldContext_1 = require("./FieldContext");
|
|
6
|
+
const FieldError = ({ children, ...props }) => {
|
|
7
|
+
const id = (0, FieldContext_1.useFieldDescriptorId)('error');
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(fuselage_1.FieldError, { ...props, id: id, children: children }));
|
|
11
9
|
};
|
|
12
|
-
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { FieldError as FieldErrorComponent } from '@rocket.chat/fuselage';
|
|
25
|
-
import { useFieldDescriptorId } from './FieldContext';
|
|
26
|
-
var FieldError = function (_a) {
|
|
27
|
-
var children = _a.children, props = __rest(_a, ["children"]);
|
|
28
|
-
var id = useFieldDescriptorId('error');
|
|
29
|
-
return (_jsx(FieldErrorComponent, __assign({}, props, { id: id, children: children })));
|
|
30
|
-
};
|
|
31
|
-
export default FieldError;
|
|
10
|
+
exports.default = FieldError;
|
|
32
11
|
//# sourceMappingURL=FieldError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldError.js","sourceRoot":"","sources":["../../../src/Field/FieldError.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FieldError.js","sourceRoot":"","sources":["../../../src/Field/FieldError.tsx"],"names":[],"mappings":";;;AAAA,oDAA0E;AAG1E,iDAAsD;AAMtD,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB,EAAE,EAAE;IAC7D,MAAM,EAAE,GAAG,IAAA,mCAAoB,EAAC,OAAO,CAAC,CAAC;IAEzC,OAAO,CACL,uBAAC,qBAAmB,OAAK,KAAK,EAAE,EAAE,EAAE,EAAE,YACnC,QAAQ,GACW,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const fuselage_1 = require("@rocket.chat/fuselage");
|
|
5
|
+
const FieldContext_1 = require("./FieldContext");
|
|
6
|
+
const FieldHint = ({ children, ...props }) => {
|
|
7
|
+
const id = (0, FieldContext_1.useFieldDescriptorId)('hint');
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(fuselage_1.FieldHint, { ...props, id: id, children: children }));
|
|
11
9
|
};
|
|
12
|
-
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { FieldHint as FieldHintComponent } from '@rocket.chat/fuselage';
|
|
25
|
-
import { useFieldDescriptorId } from './FieldContext';
|
|
26
|
-
var FieldHint = function (_a) {
|
|
27
|
-
var children = _a.children, props = __rest(_a, ["children"]);
|
|
28
|
-
var id = useFieldDescriptorId('hint');
|
|
29
|
-
return (_jsx(FieldHintComponent, __assign({}, props, { id: id, children: children })));
|
|
30
|
-
};
|
|
31
|
-
export default FieldHint;
|
|
10
|
+
exports.default = FieldHint;
|
|
32
11
|
//# sourceMappingURL=FieldHint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldHint.js","sourceRoot":"","sources":["../../../src/Field/FieldHint.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FieldHint.js","sourceRoot":"","sources":["../../../src/Field/FieldHint.tsx"],"names":[],"mappings":";;;AAAA,oDAAwE;AAGxE,iDAAsD;AAMtD,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkB,EAAE,EAAE;IAC3D,MAAM,EAAE,GAAG,IAAA,mCAAoB,EAAC,MAAM,CAAC,CAAC;IAExC,OAAO,CACL,uBAAC,oBAAkB,OAAK,KAAK,EAAE,EAAE,EAAE,EAAE,YAClC,QAAQ,GACU,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|