pixel-react 1.4.9 → 1.5.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/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +0 -2
- package/lib/components/MultiSelect/MultiSelect.stories.d.ts +0 -1
- package/lib/components/Select/Select.stories.d.ts +0 -1
- package/lib/index.esm.js +18 -15
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +18 -15
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Typography/Typography.scss +4 -4
- package/lib/assets/fonts/Poppins-Bold.ttf +0 -0
- package/lib/assets/fonts/Poppins-Medium.ttf +0 -0
- package/lib/assets/fonts/Poppins-Regular.ttf +0 -0
- package/lib/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/lib/components/AddButton/AddButton.d.ts +0 -5
- package/lib/components/AddButton/AddButton.stories.d.ts +0 -6
- package/lib/components/AddButton/index.d.ts +0 -1
- package/lib/components/AddButton/types.d.ts +0 -4
- package/lib/components/AttachImage/AttachImage.stories.d.ts +0 -7
- package/lib/components/Charts/BarChart/BarChart.stories.d.ts +0 -6
- package/lib/components/Charts/IconRadialChart/IconRadialChart.stories.d.ts +0 -8
- package/lib/components/Charts/LineChart/LineChart.stories.d.ts +0 -7
- package/lib/components/Charts/MultiRadialChart/MultiRadialChart.stories.d.ts +0 -8
- package/lib/components/ConnectingBranch/ConnectingBranch.stories.d.ts +0 -6
- package/lib/components/EditTextField/EditTextField.stories.d.ts +0 -10
- package/lib/components/Editor/Editor.stories.d.ts +0 -6
- package/lib/components/Excel/ContextMenu/ContextMenu.d.ts +0 -4
- package/lib/components/Excel/ExcelFile.stories.d.ts +0 -6
- package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +0 -14
- package/lib/components/ExcelFile/ImportExcelStyles.d.ts +0 -24
- package/lib/components/StatusCard/StatusCard.stories.d.ts +0 -11
- package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +0 -10
- /package/lib/components/ExcelFile/{ColorBarSelector → ColorBarselector}/ColorBarSelector.d.ts +0 -0
package/lib/index.js
CHANGED
@@ -822,7 +822,7 @@ const Icon = /*#__PURE__*/React.forwardRef(({
|
|
822
822
|
});
|
823
823
|
});
|
824
824
|
|
825
|
-
var css_248z$16 = "@font-face {\n font-family: \"Poppins\";\n font-weight: 400;\n src: local(\"Poppins-Regular\"), url(../../fonts/Poppins
|
825
|
+
var css_248z$16 = "@font-face {\n font-family: \"Poppins\";\n font-weight: 400;\n src: local(\"Poppins-Regular\"), url(../../assets/fonts/Poppins-Regular.woff2) format(\"woff2\");\n}\n@font-face {\n font-family: \"Poppins\";\n font-weight: 500;\n src: local(\"Poppins-Medium\"), url(../../assets/fonts/Poppins-Medium.woff2) format(\"woff2\");\n}\n@font-face {\n font-family: \"Poppins\";\n font-weight: 600;\n src: local(\"Poppins-SemiBold\"), url(../../assets/fonts/Poppins-SemiBold.woff2) format(\"woff2\");\n}\n@font-face {\n font-family: \"Poppins\";\n font-weight: 700;\n src: local(\"Poppins-Bold\"), url(../../assets/fonts/Poppins-Bold.woff2) format(\"woff2\");\n}\n.ff-text {\n font-family: \"Poppins\";\n font-size: 16px;\n}\n.ff-text--regular {\n font-weight: 400;\n}\n.ff-text--medium {\n font-weight: 500;\n}\n.ff-text--semi-bold {\n font-weight: 600;\n}\n.ff-text--bold {\n font-weight: 700;\n}\n.ff-text .required-asterisk {\n color: var(--input-error-text-color);\n padding-right: 4px;\n}";
|
826
826
|
styleInject(css_248z$16);
|
827
827
|
|
828
828
|
const Typography = ({
|
@@ -7441,7 +7441,7 @@ function createFormControl(props = {}) {
|
|
7441
7441
|
timer = setTimeout(callback, wait);
|
7442
7442
|
};
|
7443
7443
|
const _updateValid = async (shouldUpdateValid) => {
|
7444
|
-
if (!
|
7444
|
+
if (!_options.disabled && (_proxyFormState.isValid || shouldUpdateValid)) {
|
7445
7445
|
const isValid = _options.resolver
|
7446
7446
|
? isEmptyObject((await _executeSchema()).errors)
|
7447
7447
|
: await executeBuiltInValidation(_fields, true);
|
@@ -7453,7 +7453,7 @@ function createFormControl(props = {}) {
|
|
7453
7453
|
}
|
7454
7454
|
};
|
7455
7455
|
const _updateIsValidating = (names, isValidating) => {
|
7456
|
-
if (!
|
7456
|
+
if (!_options.disabled &&
|
7457
7457
|
(_proxyFormState.isValidating || _proxyFormState.validatingFields)) {
|
7458
7458
|
(names || Array.from(_names.mount)).forEach((name) => {
|
7459
7459
|
if (name) {
|
@@ -7469,7 +7469,7 @@ function createFormControl(props = {}) {
|
|
7469
7469
|
}
|
7470
7470
|
};
|
7471
7471
|
const _updateFieldArray = (name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {
|
7472
|
-
if (args && method && !
|
7472
|
+
if (args && method && !_options.disabled) {
|
7473
7473
|
_state.action = true;
|
7474
7474
|
if (shouldUpdateFieldsAndState && Array.isArray(get$1(_fields, name))) {
|
7475
7475
|
const fieldValues = method(get$1(_fields, name), args.argA, args.argB);
|
@@ -7533,7 +7533,7 @@ function createFormControl(props = {}) {
|
|
7533
7533
|
const output = {
|
7534
7534
|
name,
|
7535
7535
|
};
|
7536
|
-
if (!
|
7536
|
+
if (!_options.disabled) {
|
7537
7537
|
const disabledField = !!(get$1(_fields, name) &&
|
7538
7538
|
get$1(_fields, name)._f &&
|
7539
7539
|
get$1(_fields, name)._f.disabled);
|
@@ -7669,7 +7669,7 @@ function createFormControl(props = {}) {
|
|
7669
7669
|
}
|
7670
7670
|
_names.unMount = new Set();
|
7671
7671
|
};
|
7672
|
-
const _getDirty = (name, data) => !
|
7672
|
+
const _getDirty = (name, data) => !_options.disabled &&
|
7673
7673
|
(name && data && set$1(_formValues, name, data),
|
7674
7674
|
!deepEqual(getValues(), _defaultValues));
|
7675
7675
|
const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, {
|
@@ -7985,7 +7985,7 @@ function createFormControl(props = {}) {
|
|
7985
7985
|
};
|
7986
7986
|
const register = (name, options = {}) => {
|
7987
7987
|
let field = get$1(_fields, name);
|
7988
|
-
const disabledIsDefined = isBoolean(options.disabled) || isBoolean(
|
7988
|
+
const disabledIsDefined = isBoolean(options.disabled) || isBoolean(_options.disabled);
|
7989
7989
|
set$1(_fields, name, {
|
7990
7990
|
...(field || {}),
|
7991
7991
|
_f: {
|
@@ -8001,7 +8001,7 @@ function createFormControl(props = {}) {
|
|
8001
8001
|
field,
|
8002
8002
|
disabled: isBoolean(options.disabled)
|
8003
8003
|
? options.disabled
|
8004
|
-
:
|
8004
|
+
: _options.disabled,
|
8005
8005
|
name,
|
8006
8006
|
value: options.value,
|
8007
8007
|
});
|
@@ -8011,7 +8011,7 @@ function createFormControl(props = {}) {
|
|
8011
8011
|
}
|
8012
8012
|
return {
|
8013
8013
|
...(disabledIsDefined
|
8014
|
-
? { disabled: options.disabled ||
|
8014
|
+
? { disabled: options.disabled || _options.disabled }
|
8015
8015
|
: {}),
|
8016
8016
|
...(_options.progressive
|
8017
8017
|
? {
|
@@ -8095,6 +8095,12 @@ function createFormControl(props = {}) {
|
|
8095
8095
|
e.preventDefault && e.preventDefault();
|
8096
8096
|
e.persist && e.persist();
|
8097
8097
|
}
|
8098
|
+
if (_options.disabled) {
|
8099
|
+
if (onInvalid) {
|
8100
|
+
await onInvalid({ ..._formState.errors }, e);
|
8101
|
+
}
|
8102
|
+
return;
|
8103
|
+
}
|
8098
8104
|
let fieldValues = cloneObject(_formValues);
|
8099
8105
|
_subjects.state.next({
|
8100
8106
|
isSubmitting: true,
|
@@ -8273,7 +8279,9 @@ function createFormControl(props = {}) {
|
|
8273
8279
|
: fieldReference.ref;
|
8274
8280
|
if (fieldRef.focus) {
|
8275
8281
|
fieldRef.focus();
|
8276
|
-
options.shouldSelect &&
|
8282
|
+
options.shouldSelect &&
|
8283
|
+
isFunction$1(fieldRef.select) &&
|
8284
|
+
fieldRef.select();
|
8277
8285
|
}
|
8278
8286
|
}
|
8279
8287
|
};
|
@@ -8474,11 +8482,6 @@ function useForm(props = {}) {
|
|
8474
8482
|
values: control._getWatch(),
|
8475
8483
|
});
|
8476
8484
|
}, [props.shouldUnregister, control]);
|
8477
|
-
React.useEffect(() => {
|
8478
|
-
if (_formControl.current) {
|
8479
|
-
_formControl.current.watch = _formControl.current.watch.bind({});
|
8480
|
-
}
|
8481
|
-
}, [formState]);
|
8482
8485
|
_formControl.current.formState = getProxyFormState(formState, control);
|
8483
8486
|
return _formControl.current;
|
8484
8487
|
}
|