react-better-html 1.1.94 → 1.1.96
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/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2487,6 +2487,7 @@ var Image_default = { Image: MemoizedImage }.Image;
|
|
|
2487
2487
|
|
|
2488
2488
|
// src/components/Button.tsx
|
|
2489
2489
|
import { memo as memo7, useCallback as useCallback4 } from "react";
|
|
2490
|
+
import { Link } from "react-router-dom";
|
|
2490
2491
|
import styled6, { css } from "styled-components";
|
|
2491
2492
|
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2492
2493
|
var ButtonElement = styled6.button.withConfig({
|
|
@@ -2604,14 +2605,14 @@ var ButtonComponent = function Button({
|
|
|
2604
2605
|
return /* @__PURE__ */ jsxs3(
|
|
2605
2606
|
ButtonElement,
|
|
2606
2607
|
{
|
|
2607
|
-
as: href ?
|
|
2608
|
+
as: href ? Link : "button",
|
|
2608
2609
|
theme: theme2,
|
|
2609
2610
|
colorTheme: betterHtmlContext2.colorTheme,
|
|
2610
2611
|
isSmall,
|
|
2611
2612
|
withText: text !== void 0,
|
|
2612
2613
|
isLoading: isLoadingElement,
|
|
2613
2614
|
disabled,
|
|
2614
|
-
href,
|
|
2615
|
+
to: href,
|
|
2615
2616
|
download,
|
|
2616
2617
|
target,
|
|
2617
2618
|
type: isSubmit && !isLoadingElement ? "submit" : "button",
|
|
@@ -3335,7 +3336,7 @@ var countries = [
|
|
|
3335
3336
|
phoneNumberFormat: "(XXX)XXX-XXXX"
|
|
3336
3337
|
},
|
|
3337
3338
|
{
|
|
3338
|
-
name: "
|
|
3339
|
+
name: "Andorra",
|
|
3339
3340
|
code: "AD",
|
|
3340
3341
|
timeZone: "Europe/Andorra",
|
|
3341
3342
|
phoneNumberExtension: "376"
|
|
@@ -5071,6 +5072,7 @@ var DropdownComponent = forwardRef7(function Dropdown({
|
|
|
5071
5072
|
cursor: !withSearch ? "pointer" : void 0,
|
|
5072
5073
|
placeholder: withSearch ? selectedOption ? selectedOption.label : readyPlaceholder : readyPlaceholder,
|
|
5073
5074
|
leftIcon,
|
|
5075
|
+
autoComplete: "off",
|
|
5074
5076
|
className: `react-better-html-dropdown${isOpen ? " react-better-html-dropdown-open" : ""}${isOpenLate ? " react-better-html-dropdown-open-late" : ""}${inputFieldClassName ? ` ${inputFieldClassName}` : ""}`,
|
|
5075
5077
|
onClick: !disabled ? setIsOpen.toggle : void 0,
|
|
5076
5078
|
onFocus: setIsFocused.setTrue,
|
|
@@ -6482,7 +6484,7 @@ var ToggleInput_default = {
|
|
|
6482
6484
|
};
|
|
6483
6485
|
|
|
6484
6486
|
// src/components/Form.tsx
|
|
6485
|
-
import { memo as memo17, useMemo as useMemo6 } from "react";
|
|
6487
|
+
import { Children, Fragment as Fragment4, memo as memo17, useMemo as useMemo6 } from "react";
|
|
6486
6488
|
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6487
6489
|
function Form({
|
|
6488
6490
|
form,
|
|
@@ -6494,6 +6496,7 @@ function Form({
|
|
|
6494
6496
|
gap,
|
|
6495
6497
|
isSubmitting,
|
|
6496
6498
|
isDestructive,
|
|
6499
|
+
withDividers,
|
|
6497
6500
|
onClickCancel,
|
|
6498
6501
|
onSubmit,
|
|
6499
6502
|
children,
|
|
@@ -6509,7 +6512,10 @@ function Form({
|
|
|
6509
6512
|
const SubmitButtonTag = isDestructive ? Button_default.destructive : Button_default;
|
|
6510
6513
|
const submitButtonIsDisabledFinal = submitButtonIsDisabled || submitButtonIsDisabledInternal;
|
|
6511
6514
|
return /* @__PURE__ */ jsx17(Div_default, { width: "100%", ...props, children: /* @__PURE__ */ jsxs12("form", { onSubmit: onSubmit ?? form?.onSubmit, children: [
|
|
6512
|
-
gap !== void 0 ? /* @__PURE__ */ jsx17(Div_default.column, { gap, children
|
|
6515
|
+
gap !== void 0 || withDividers ? /* @__PURE__ */ jsx17(Div_default.column, { gap: gap ?? (withDividers ? theme2.styles.space : theme2.styles.gap), children: withDividers ? Children.toArray(children).map((child, index) => /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
6516
|
+
child,
|
|
6517
|
+
index < Children.toArray(children).length - 1 && /* @__PURE__ */ jsx17(Divider_default.horizontal, {})
|
|
6518
|
+
] }, index)) : children }) : children,
|
|
6513
6519
|
submitButtonText && /* @__PURE__ */ jsxs12(
|
|
6514
6520
|
Div_default.row,
|
|
6515
6521
|
{
|
|
@@ -6656,7 +6662,7 @@ var ColorThemeSwitch_default = ColorThemeSwitch2;
|
|
|
6656
6662
|
// src/components/Table.tsx
|
|
6657
6663
|
import { forwardRef as forwardRef11, memo as memo20, useCallback as useCallback10, useMemo as useMemo7, useState as useState8 } from "react";
|
|
6658
6664
|
import styled10, { css as css2 } from "styled-components";
|
|
6659
|
-
import { Fragment as
|
|
6665
|
+
import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6660
6666
|
var defaultImageWidth = 120;
|
|
6661
6667
|
var TableStyledComponent = styled10.table.withConfig({
|
|
6662
6668
|
shouldForwardProp: (prop) => !["isStriped", "withHover", "withStickyHeader", "colorTheme", "theme"].includes(prop)
|
|
@@ -6743,7 +6749,7 @@ var TableComponent = forwardRef11(function Table({
|
|
|
6743
6749
|
return column.format ? column.format(item, index) : String(value ?? "");
|
|
6744
6750
|
}
|
|
6745
6751
|
case "element": {
|
|
6746
|
-
return column.render?.(item, index) ?? /* @__PURE__ */ jsx20(
|
|
6752
|
+
return column.render?.(item, index) ?? /* @__PURE__ */ jsx20(Fragment5, {});
|
|
6747
6753
|
}
|
|
6748
6754
|
case "image": {
|
|
6749
6755
|
const { type, keyName, ...props2 } = column;
|
|
@@ -6768,7 +6774,7 @@ var TableComponent = forwardRef11(function Table({
|
|
|
6768
6774
|
);
|
|
6769
6775
|
}
|
|
6770
6776
|
default: {
|
|
6771
|
-
return /* @__PURE__ */ jsx20(
|
|
6777
|
+
return /* @__PURE__ */ jsx20(Fragment5, {});
|
|
6772
6778
|
}
|
|
6773
6779
|
}
|
|
6774
6780
|
},
|