elseware-ui 3.0.3 → 3.0.4
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.css +0 -38
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +131 -99
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +131 -99
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.d.mts +2 -2
- package/dist/index.native.d.ts +2 -2
- package/dist/index.native.js +71 -52
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +71 -52
- package/dist/index.native.mjs.map +1 -1
- package/dist/{resolveGlobalConfigs-CL-Puk7Y.d.mts → resolveGlobalConfigs-PbcnVEZr.d.mts} +3 -1
- package/dist/{resolveGlobalConfigs-CL-Puk7Y.d.ts → resolveGlobalConfigs-PbcnVEZr.d.ts} +3 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode, SelectHTMLAttributes, InputHTMLAttributes, JSX, Dispatch, SetStateAction, ImgHTMLAttributes, ComponentPropsWithoutRef, HTMLAttributes, TdHTMLAttributes, TableHTMLAttributes, ThHTMLAttributes, FC, ComponentType, MouseEvent, HTMLAttributeAnchorTarget, BlockquoteHTMLAttributes, AnchorHTMLAttributes, OlHTMLAttributes, LiHTMLAttributes, DetailsHTMLAttributes, ClassAttributes, TextareaHTMLAttributes, FocusEventHandler, MutableRefObject } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export { d as ButtonIcon, e as ButtonMode,
|
|
3
|
+
import { m as BaseComponentProps, V as Variant, A as Appearance, S as Shape, n as Size, O as OctilePosition, T as TitleBannerLevel, L as ListBulletType, o as ListDirection, p as ListAlign, q as CurrencyCode, s as SpinnerType, t as SpinnerDirection, v as TextDecoration, B as ButtonProps, C as CheckboxProps, w as Shape$1, F as FormProps, a as FormResponseProps, I as InputProps, b as InputLabelProps, c as InputResponseProps, x as ToastStatus, y as ToastPosition, z as Target, D as TextVariant, G as Decoration, R as RouteTabMode, H as Variant$1 } from './resolveGlobalConfigs-PbcnVEZr.mjs';
|
|
4
|
+
export { d as ButtonIcon, e as ButtonMode, J as CardinalPosition, f as CheckboxColumns, g as CheckboxOption, K as CornerPosition, E as EUIComponentDefaults, h as EUIConfigs, i as EUIProvider, j as EUIRoute, k as FormChangeMeta, l as FormChildren, M as HorizontalPosition, N as HyperRefTarget, P as VerticalPosition, r as resolveWithGlobal, u as useEUIConfig } from './resolveGlobalConfigs-PbcnVEZr.mjs';
|
|
5
5
|
import * as d3 from 'd3';
|
|
6
6
|
import * as formik from 'formik';
|
|
7
7
|
import { FieldHookConfig, FormikValues } from 'formik';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode, SelectHTMLAttributes, InputHTMLAttributes, JSX, Dispatch, SetStateAction, ImgHTMLAttributes, ComponentPropsWithoutRef, HTMLAttributes, TdHTMLAttributes, TableHTMLAttributes, ThHTMLAttributes, FC, ComponentType, MouseEvent, HTMLAttributeAnchorTarget, BlockquoteHTMLAttributes, AnchorHTMLAttributes, OlHTMLAttributes, LiHTMLAttributes, DetailsHTMLAttributes, ClassAttributes, TextareaHTMLAttributes, FocusEventHandler, MutableRefObject } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export { d as ButtonIcon, e as ButtonMode,
|
|
3
|
+
import { m as BaseComponentProps, V as Variant, A as Appearance, S as Shape, n as Size, O as OctilePosition, T as TitleBannerLevel, L as ListBulletType, o as ListDirection, p as ListAlign, q as CurrencyCode, s as SpinnerType, t as SpinnerDirection, v as TextDecoration, B as ButtonProps, C as CheckboxProps, w as Shape$1, F as FormProps, a as FormResponseProps, I as InputProps, b as InputLabelProps, c as InputResponseProps, x as ToastStatus, y as ToastPosition, z as Target, D as TextVariant, G as Decoration, R as RouteTabMode, H as Variant$1 } from './resolveGlobalConfigs-PbcnVEZr.js';
|
|
4
|
+
export { d as ButtonIcon, e as ButtonMode, J as CardinalPosition, f as CheckboxColumns, g as CheckboxOption, K as CornerPosition, E as EUIComponentDefaults, h as EUIConfigs, i as EUIProvider, j as EUIRoute, k as FormChangeMeta, l as FormChildren, M as HorizontalPosition, N as HyperRefTarget, P as VerticalPosition, r as resolveWithGlobal, u as useEUIConfig } from './resolveGlobalConfigs-PbcnVEZr.js';
|
|
5
5
|
import * as d3 from 'd3';
|
|
6
6
|
import * as formik from 'formik';
|
|
7
7
|
import { FieldHookConfig, FormikValues } from 'formik';
|
package/dist/index.js
CHANGED
|
@@ -7788,6 +7788,17 @@ var InputListGroup = ({
|
|
|
7788
7788
|
function isMultiCheckbox(props) {
|
|
7789
7789
|
return Array.isArray(props.options);
|
|
7790
7790
|
}
|
|
7791
|
+
function resolveCheckboxColumns(columns) {
|
|
7792
|
+
return columns ?? 1;
|
|
7793
|
+
}
|
|
7794
|
+
function chunkCheckboxOptions(options, columns) {
|
|
7795
|
+
const resolvedColumns = resolveCheckboxColumns(columns);
|
|
7796
|
+
const chunkSize = Math.ceil(options.length / resolvedColumns);
|
|
7797
|
+
return Array.from(
|
|
7798
|
+
{ length: resolvedColumns },
|
|
7799
|
+
(_2, columnIndex) => options.slice(columnIndex * chunkSize, (columnIndex + 1) * chunkSize)
|
|
7800
|
+
).filter((columnOptions) => columnOptions.length > 0);
|
|
7801
|
+
}
|
|
7791
7802
|
function useResolvedCheckboxConfig({
|
|
7792
7803
|
label,
|
|
7793
7804
|
placeholder,
|
|
@@ -7946,6 +7957,7 @@ function Checkbox(checkboxProps) {
|
|
|
7946
7957
|
const activeFieldName = isMulti ? multiField.name : singleField.name;
|
|
7947
7958
|
const activeMeta = isMulti ? multiMeta : singleMeta;
|
|
7948
7959
|
const multiProps = isMultiCheckbox(checkboxProps) ? checkboxProps : null;
|
|
7960
|
+
const optionColumns = multiProps ? chunkCheckboxOptions(multiProps.options, multiProps.columns) : [];
|
|
7949
7961
|
const singleChecked = singleField.value;
|
|
7950
7962
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(checkboxGroupClassName, groupClassName), children: [
|
|
7951
7963
|
!isMulti && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(checkboxOptionRowClassName, optionClassName), children: [
|
|
@@ -7989,67 +8001,74 @@ function Checkbox(checkboxProps) {
|
|
|
7989
8001
|
}
|
|
7990
8002
|
) : null
|
|
7991
8003
|
] }),
|
|
7992
|
-
isMulti && multiProps
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
8007
|
-
|
|
8008
|
-
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
|
|
8047
|
-
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8004
|
+
isMulti && multiProps ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full flex-row gap-6", children: optionColumns.map((columnOptions, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8005
|
+
"div",
|
|
8006
|
+
{
|
|
8007
|
+
className: "flex min-w-0 flex-1 flex-col gap-2",
|
|
8008
|
+
children: columnOptions.map((option) => {
|
|
8009
|
+
const values = multiField.value ?? [];
|
|
8010
|
+
const checked = values.includes(option.value);
|
|
8011
|
+
const optionDisabled = disabled || option.disabled === true;
|
|
8012
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8013
|
+
"div",
|
|
8014
|
+
{
|
|
8015
|
+
className: cn(checkboxOptionRowClassName, optionClassName),
|
|
8016
|
+
children: [
|
|
8017
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative inline-flex h-5 w-5 shrink-0 items-center justify-center", children: [
|
|
8018
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8019
|
+
"input",
|
|
8020
|
+
{
|
|
8021
|
+
id: option.value,
|
|
8022
|
+
name: multiField.name,
|
|
8023
|
+
type: "checkbox",
|
|
8024
|
+
checked,
|
|
8025
|
+
disabled: optionDisabled,
|
|
8026
|
+
onBlur: multiField.onBlur,
|
|
8027
|
+
onChange: () => {
|
|
8028
|
+
multiHelpers.setValue(
|
|
8029
|
+
checked ? values.filter((value) => value !== option.value) : [...values, option.value]
|
|
8030
|
+
);
|
|
8031
|
+
},
|
|
8032
|
+
className: getIndicatorClassName({
|
|
8033
|
+
checked,
|
|
8034
|
+
className,
|
|
8035
|
+
disabled: optionDisabled,
|
|
8036
|
+
indicatorClassName,
|
|
8037
|
+
checkedIndicatorClassName,
|
|
8038
|
+
resolvedShape,
|
|
8039
|
+
variantCheckedClassName: variantStyles.checkedClassName
|
|
8040
|
+
})
|
|
8041
|
+
}
|
|
8042
|
+
),
|
|
8043
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8044
|
+
Tick,
|
|
8045
|
+
{
|
|
8046
|
+
checked,
|
|
8047
|
+
checkedIconClassName,
|
|
8048
|
+
iconClassName: variantStyles.iconClassName
|
|
8049
|
+
}
|
|
8050
|
+
)
|
|
8051
|
+
] }),
|
|
8052
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8053
|
+
"label",
|
|
8054
|
+
{
|
|
8055
|
+
htmlFor: option.value,
|
|
8056
|
+
className: cn(
|
|
8057
|
+
checkboxLabelClassName,
|
|
8058
|
+
optionDisabled && "cursor-not-allowed opacity-60",
|
|
8059
|
+
labelClassName
|
|
8060
|
+
),
|
|
8061
|
+
children: option.label
|
|
8062
|
+
}
|
|
8063
|
+
)
|
|
8064
|
+
]
|
|
8065
|
+
},
|
|
8066
|
+
option.value
|
|
8067
|
+
);
|
|
8068
|
+
})
|
|
8069
|
+
},
|
|
8070
|
+
`${multiField.name}-column-${columnIndex}`
|
|
8071
|
+
)) }) : null,
|
|
8053
8072
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8054
8073
|
InputResponse,
|
|
8055
8074
|
{
|
|
@@ -8445,6 +8464,7 @@ function MultiImageInput({
|
|
|
8445
8464
|
);
|
|
8446
8465
|
const [imageUrls, setImageUrls] = React26.useState(fieldImageUrls);
|
|
8447
8466
|
const imageInputRef = React26.useRef(null);
|
|
8467
|
+
const replaceInputRefs = React26.useRef({});
|
|
8448
8468
|
const [draggedIndex, setDraggedIndex] = React26.useState(null);
|
|
8449
8469
|
const [replacingIndex, setReplacingIndex] = React26.useState(null);
|
|
8450
8470
|
const isOrganizerBusy = replacingIndex !== null;
|
|
@@ -8538,6 +8558,9 @@ function MultiImageInput({
|
|
|
8538
8558
|
moveImage(draggedIndex, index3);
|
|
8539
8559
|
setDraggedIndex(null);
|
|
8540
8560
|
};
|
|
8561
|
+
const openReplacePicker = (index3) => {
|
|
8562
|
+
replaceInputRefs.current[index3]?.click();
|
|
8563
|
+
};
|
|
8541
8564
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
8542
8565
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row flex-wrap gap-5 w-full", children: [
|
|
8543
8566
|
imageUrls.map((url, index3) => {
|
|
@@ -8564,65 +8587,74 @@ function MultiImageInput({
|
|
|
8564
8587
|
] }),
|
|
8565
8588
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute right-2 top-2 flex gap-1", children: [
|
|
8566
8589
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8567
|
-
|
|
8590
|
+
Button_web_default,
|
|
8568
8591
|
{
|
|
8569
|
-
type: "button",
|
|
8570
8592
|
title: "Move image left",
|
|
8571
|
-
|
|
8593
|
+
accessibilityLabel: "Move image left",
|
|
8572
8594
|
disabled: index3 === 0 || isOrganizerBusy,
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8595
|
+
glow: false,
|
|
8596
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(index_js.MdKeyboardArrowLeft, {}),
|
|
8597
|
+
onPress: () => moveImage(index3, index3 - 1),
|
|
8598
|
+
size: "xs",
|
|
8599
|
+
className: "h-8 w-8 bg-black/60 p-0 text-xl text-white hover:bg-black/80 disabled:opacity-40"
|
|
8576
8600
|
}
|
|
8577
8601
|
),
|
|
8578
8602
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8579
|
-
|
|
8603
|
+
Button_web_default,
|
|
8580
8604
|
{
|
|
8581
|
-
type: "button",
|
|
8582
8605
|
title: "Move image right",
|
|
8583
|
-
|
|
8606
|
+
accessibilityLabel: "Move image right",
|
|
8584
8607
|
disabled: index3 === imageUrls.length - 1 || isOrganizerBusy,
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8608
|
+
glow: false,
|
|
8609
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(index_js.MdKeyboardArrowRight, {}),
|
|
8610
|
+
onPress: () => moveImage(index3, index3 + 1),
|
|
8611
|
+
size: "xs",
|
|
8612
|
+
className: "h-8 w-8 bg-black/60 p-0 text-xl text-white hover:bg-black/80 disabled:opacity-40"
|
|
8588
8613
|
}
|
|
8589
8614
|
)
|
|
8590
8615
|
] }),
|
|
8591
8616
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute bottom-2 left-2 right-2 flex items-center justify-between gap-2", children: [
|
|
8592
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8593
|
-
"
|
|
8617
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8618
|
+
"input",
|
|
8594
8619
|
{
|
|
8620
|
+
ref: (input) => {
|
|
8621
|
+
replaceInputRefs.current[index3] = input;
|
|
8622
|
+
},
|
|
8623
|
+
type: "file",
|
|
8624
|
+
className: "hidden",
|
|
8625
|
+
accept: "image/*",
|
|
8626
|
+
disabled: isOrganizerBusy,
|
|
8627
|
+
onChange: (event) => void handleReplaceImage(index3, event)
|
|
8628
|
+
}
|
|
8629
|
+
),
|
|
8630
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8631
|
+
Button_web_default,
|
|
8632
|
+
{
|
|
8633
|
+
block: true,
|
|
8634
|
+
appearance: "solid",
|
|
8595
8635
|
title: "Change image",
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
),
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
type: "file",
|
|
8605
|
-
className: "hidden",
|
|
8606
|
-
accept: "image/*",
|
|
8607
|
-
disabled: isOrganizerBusy,
|
|
8608
|
-
onChange: (event) => void handleReplaceImage(index3, event)
|
|
8609
|
-
}
|
|
8610
|
-
),
|
|
8611
|
-
/* @__PURE__ */ jsxRuntime.jsx(index_js.MdUpload, {}),
|
|
8612
|
-
"Change"
|
|
8613
|
-
]
|
|
8636
|
+
accessibilityLabel: "Change image",
|
|
8637
|
+
disabled: isOrganizerBusy,
|
|
8638
|
+
glow: false,
|
|
8639
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(index_js.MdUpload, {}),
|
|
8640
|
+
onPress: () => openReplacePicker(index3),
|
|
8641
|
+
size: "sm",
|
|
8642
|
+
text: "Change",
|
|
8643
|
+
variant: "success"
|
|
8614
8644
|
}
|
|
8615
8645
|
),
|
|
8616
8646
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8617
|
-
|
|
8647
|
+
Button_web_default,
|
|
8618
8648
|
{
|
|
8619
|
-
|
|
8649
|
+
appearance: "solid",
|
|
8620
8650
|
title: "Delete image",
|
|
8621
|
-
|
|
8651
|
+
accessibilityLabel: "Delete image",
|
|
8622
8652
|
disabled: isOrganizerBusy,
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8653
|
+
glow: false,
|
|
8654
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(index_js.MdOutlineDelete, {}),
|
|
8655
|
+
onPress: () => removeImage(index3),
|
|
8656
|
+
size: "sm",
|
|
8657
|
+
variant: "danger"
|
|
8626
8658
|
}
|
|
8627
8659
|
)
|
|
8628
8660
|
] }),
|