@allxsmith/bestax-bulma 5.27.1 → 5.27.2
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/esm/form/Autocomplete.js.map +1 -1
- package/dist/esm/form/Checkboxes.js +1 -0
- package/dist/esm/form/Checkboxes.js.map +1 -1
- package/dist/esm/form/DateInput.js +2 -1
- package/dist/esm/form/DateInput.js.map +1 -1
- package/dist/esm/form/DateRangeInput.js +1 -0
- package/dist/esm/form/DateRangeInput.js.map +1 -1
- package/dist/esm/form/DateTimeInput.js +2 -1
- package/dist/esm/form/DateTimeInput.js.map +1 -1
- package/dist/esm/form/Field.js +18 -4
- package/dist/esm/form/Field.js.map +1 -1
- package/dist/esm/form/File.js +4 -1
- package/dist/esm/form/File.js.map +1 -1
- package/dist/esm/form/FormContext.js +27 -3
- package/dist/esm/form/FormContext.js.map +1 -1
- package/dist/esm/form/Input.js +1 -1
- package/dist/esm/form/Input.js.map +1 -1
- package/dist/esm/form/Numberinput.js +3 -1
- package/dist/esm/form/Numberinput.js.map +1 -1
- package/dist/esm/form/Radios.js +1 -0
- package/dist/esm/form/Radios.js.map +1 -1
- package/dist/esm/form/Rate.js +1 -0
- package/dist/esm/form/Rate.js.map +1 -1
- package/dist/esm/form/Select.js +1 -1
- package/dist/esm/form/Select.js.map +1 -1
- package/dist/esm/form/Slider.js +4 -2
- package/dist/esm/form/Slider.js.map +1 -1
- package/dist/esm/form/Taginput.js +4 -5
- package/dist/esm/form/Taginput.js.map +1 -1
- package/dist/esm/form/TextArea.js +1 -1
- package/dist/esm/form/TextArea.js.map +1 -1
- package/dist/esm/form/TimeInput.js +2 -1
- package/dist/esm/form/TimeInput.js.map +1 -1
- package/dist/esm/form/useAutoLabelId.js +42 -8
- package/dist/esm/form/useAutoLabelId.js.map +1 -1
- package/dist/esm/helpers/Config.js.map +1 -1
- package/dist/esm/helpers/Theme.js.map +1 -1
- package/dist/index.cjs +112 -28
- package/dist/index.cjs.map +1 -1
- package/dist/types/form/Autocomplete.d.ts +1 -1
- package/dist/types/form/Checkboxes.d.ts +1 -1
- package/dist/types/form/DateInput.d.ts +1 -1
- package/dist/types/form/DateRangeInput.d.ts +1 -1
- package/dist/types/form/DateTimeInput.d.ts +1 -1
- package/dist/types/form/Field.d.ts +2 -2
- package/dist/types/form/File.d.ts +1 -1
- package/dist/types/form/FormContext.d.ts +24 -2
- package/dist/types/form/Numberinput.d.ts +1 -1
- package/dist/types/form/Radios.d.ts +1 -1
- package/dist/types/form/Rate.d.ts +1 -1
- package/dist/types/form/Slider.d.ts +1 -1
- package/dist/types/form/Taginput.d.ts +1 -1
- package/dist/types/form/TimeInput.d.ts +1 -1
- package/dist/types/form/useAutoLabelId.d.ts +25 -4
- package/dist/types/helpers/Config.d.ts +3 -4
- package/dist/types/helpers/Theme.d.ts +44 -40
- package/dist/types-cjs/form/Autocomplete.d.ts +1 -1
- package/dist/types-cjs/form/Checkboxes.d.ts +1 -1
- package/dist/types-cjs/form/DateInput.d.ts +1 -1
- package/dist/types-cjs/form/DateRangeInput.d.ts +1 -1
- package/dist/types-cjs/form/DateTimeInput.d.ts +1 -1
- package/dist/types-cjs/form/Field.d.ts +2 -2
- package/dist/types-cjs/form/File.d.ts +1 -1
- package/dist/types-cjs/form/FormContext.d.ts +24 -2
- package/dist/types-cjs/form/Numberinput.d.ts +1 -1
- package/dist/types-cjs/form/Radios.d.ts +1 -1
- package/dist/types-cjs/form/Rate.d.ts +1 -1
- package/dist/types-cjs/form/Slider.d.ts +1 -1
- package/dist/types-cjs/form/Taginput.d.ts +1 -1
- package/dist/types-cjs/form/TimeInput.d.ts +1 -1
- package/dist/types-cjs/form/useAutoLabelId.d.ts +25 -4
- package/dist/types-cjs/helpers/Config.d.ts +3 -4
- package/dist/types-cjs/helpers/Theme.d.ts +44 -40
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9068,12 +9068,36 @@ const FieldLabelIdContext = React.createContext(undefined);
|
|
|
9068
9068
|
* The id a labeled Field wants its single composed control to adopt (#495).
|
|
9069
9069
|
* `undefined` outside a Field, in unlabeled/grouped/addons Fields, or when the
|
|
9070
9070
|
* user took over the association with an explicit `labelProps.htmlFor`.
|
|
9071
|
-
* Consumed
|
|
9072
|
-
*
|
|
9071
|
+
* Consumed by the single-control bases (InputBase, SelectBase, TextAreaBase)
|
|
9072
|
+
* and, through `useAutoLabelId`, by the convenience inputs that render an
|
|
9073
|
+
* input of their own (#939). Internal; not part of the public API.
|
|
9073
9074
|
*/
|
|
9074
9075
|
const useFieldLabelId = () => React.useContext(FieldLabelIdContext);
|
|
9075
9076
|
/** Provider for the Field label-target id — used internally by Field. */
|
|
9076
9077
|
const FieldLabelIdProvider = FieldLabelIdContext.Provider;
|
|
9078
|
+
const FieldLabelElementIdContext = React.createContext(undefined);
|
|
9079
|
+
/**
|
|
9080
|
+
* The id of a labeled Field's own `<label>`, for a group control (Radios,
|
|
9081
|
+
* Checkboxes, Rate, DateRangeInput) to point `aria-labelledby` at, since a group cannot take
|
|
9082
|
+
* the label's `htmlFor` (#939). Set under the same conditions as
|
|
9083
|
+
* {@link useFieldLabelId}. Consumed through `useAutoLabelledBy`.
|
|
9084
|
+
* Internal; not part of the public API.
|
|
9085
|
+
*/
|
|
9086
|
+
const useFieldLabelElementId = () => React.useContext(FieldLabelElementIdContext);
|
|
9087
|
+
/** Provider for the Field label's own id, used internally by Field. */
|
|
9088
|
+
const FieldLabelElementIdProvider = FieldLabelElementIdContext.Provider;
|
|
9089
|
+
const FieldLabelForContext = React.createContext(undefined);
|
|
9090
|
+
/**
|
|
9091
|
+
* What the nearest labeled Field's `<label>` points `htmlFor` at: the id it
|
|
9092
|
+
* generated, or the caller's own `labelProps.htmlFor`. An unlabeled Field
|
|
9093
|
+
* passes it through, so a control in the inner Field of a horizontal layout
|
|
9094
|
+
* can tell the outer label names it. Only ever compared with a control's own
|
|
9095
|
+
* id, never adopted, so it hands out no id. Internal; not part of the public
|
|
9096
|
+
* API.
|
|
9097
|
+
*/
|
|
9098
|
+
const useFieldLabelFor = () => React.useContext(FieldLabelForContext);
|
|
9099
|
+
/** Provider for the Field label's `htmlFor` target, used internally by Field. */
|
|
9100
|
+
const FieldLabelForProvider = FieldLabelForContext.Provider;
|
|
9077
9101
|
const RadiosContext = React.createContext(undefined);
|
|
9078
9102
|
const CheckboxesContext = React.createContext(undefined);
|
|
9079
9103
|
/**
|
|
@@ -9374,13 +9398,27 @@ const FieldComponent = ({ horizontal, grouped, hasAddons, narrow, label, labelSi
|
|
|
9374
9398
|
const targetId = label && !userWiredLabel && !grouped && !hasAddons
|
|
9375
9399
|
? generatedId
|
|
9376
9400
|
: undefined;
|
|
9401
|
+
// A group control (Radios, Checkboxes, Rate, DateRangeInput) cannot take
|
|
9402
|
+
// that `for`, so it points `aria-labelledby` at the label itself (#939).
|
|
9403
|
+
// The label gets an id whenever the association is on, unless the caller
|
|
9404
|
+
// gave it one.
|
|
9405
|
+
const labelId = labelProps?.id ?? (targetId ? `${targetId}-label` : undefined);
|
|
9406
|
+
// What the rendered label's `for` points at, generated or the caller's, so
|
|
9407
|
+
// a control can tell when a label wired by hand names it. An unlabeled
|
|
9408
|
+
// Field passes on its parent's.
|
|
9409
|
+
const inheritedLabelFor = useFieldLabelFor();
|
|
9410
|
+
const labelFor = label
|
|
9411
|
+
? userWiredLabel
|
|
9412
|
+
? labelProps.htmlFor
|
|
9413
|
+
: targetId
|
|
9414
|
+
: inheritedLabelFor;
|
|
9377
9415
|
let renderedLabel = null;
|
|
9378
9416
|
if (label) {
|
|
9379
9417
|
if (horizontal) {
|
|
9380
|
-
renderedLabel = (jsxRuntime.jsx(FieldLabel, { size: effectiveLabelSize, children: jsxRuntime.jsx("label", { htmlFor: targetId, ...labelProps, className: classNames(labelClass, labelProps?.className), style: labelProps?.style, children: label }) }));
|
|
9418
|
+
renderedLabel = (jsxRuntime.jsx(FieldLabel, { size: effectiveLabelSize, children: jsxRuntime.jsx("label", { htmlFor: targetId, ...labelProps, id: labelId, className: classNames(labelClass, labelProps?.className), style: labelProps?.style, children: label }) }));
|
|
9381
9419
|
}
|
|
9382
9420
|
else {
|
|
9383
|
-
renderedLabel = (jsxRuntime.jsx("label", { htmlFor: targetId, ...labelProps, className: classNames(labelClass, labelProps?.className), style: { display: 'block', ...(labelProps?.style || {}) }, children: label }));
|
|
9421
|
+
renderedLabel = (jsxRuntime.jsx("label", { htmlFor: targetId, ...labelProps, id: labelId, className: classNames(labelClass, labelProps?.className), style: { display: 'block', ...(labelProps?.style || {}) }, children: label }));
|
|
9384
9422
|
}
|
|
9385
9423
|
}
|
|
9386
9424
|
// If horizontal, wrap children in FieldBody (unless the user already provided
|
|
@@ -9403,7 +9441,7 @@ const FieldComponent = ({ horizontal, grouped, hasAddons, narrow, label, labelSi
|
|
|
9403
9441
|
content = jsxRuntime.jsx(FieldBody, { children: children });
|
|
9404
9442
|
}
|
|
9405
9443
|
}
|
|
9406
|
-
return (jsxRuntime.jsx(FieldProvider, { value: true, children: jsxRuntime.jsx(FieldLabelIdProvider, { value: targetId, children: jsxRuntime.jsxs("div", { className: fieldClass, ...rest, children: [renderedLabel, content] }) }) }));
|
|
9444
|
+
return (jsxRuntime.jsx(FieldProvider, { value: true, children: jsxRuntime.jsx(FieldLabelIdProvider, { value: targetId, children: jsxRuntime.jsx(FieldLabelElementIdProvider, { value: targetId ? labelId : undefined, children: jsxRuntime.jsx(FieldLabelForProvider, { value: labelFor, children: jsxRuntime.jsxs("div", { className: fieldClass, ...rest, children: [renderedLabel, content] }) }) }) }) }));
|
|
9407
9445
|
};
|
|
9408
9446
|
FieldLabel.displayName = 'FieldLabel';
|
|
9409
9447
|
FieldBody.displayName = 'FieldBody';
|
|
@@ -9419,27 +9457,42 @@ const Field = withSubComponents(FieldComponent, {
|
|
|
9419
9457
|
* A user-supplied `id` is used as the target instead of the generated one, and
|
|
9420
9458
|
* an explicit `htmlFor` key in labelProps — even set to `undefined` — disables
|
|
9421
9459
|
* generation entirely: the user has taken over the association (#495 presence
|
|
9422
|
-
* semantics).
|
|
9460
|
+
* semantics). When the control renders no label of its own, it adopts the id
|
|
9461
|
+
* a labeled Field around it offers, the way the bases do, so that Field's
|
|
9462
|
+
* label names it (#939); a user `id` still wins there.
|
|
9463
|
+
* Internal; not part of the public API.
|
|
9423
9464
|
*/
|
|
9424
|
-
function useAutoLabelId({ label, id, labelProps, rendersLabel, }) {
|
|
9465
|
+
function useAutoLabelId({ label, id, labelProps, rendersLabel, hasInput = true, }) {
|
|
9425
9466
|
// Called unconditionally per the rules of hooks; SSR-safe on React 18 and 19.
|
|
9426
9467
|
const generatedId = React.useId();
|
|
9468
|
+
// Read outside the control's own Field, so it is set only when an outer
|
|
9469
|
+
// Field holds the control, which then renders no label of its own.
|
|
9470
|
+
const fieldLabelId = useFieldLabelId();
|
|
9471
|
+
// What an outer Field's label points at, even when wired by hand.
|
|
9472
|
+
const fieldLabelFor = useFieldLabelFor();
|
|
9427
9473
|
// Truthiness mirrors Field's own `if (label)` render gate.
|
|
9428
9474
|
const active = !!label && rendersLabel;
|
|
9429
9475
|
// Presence, not truthiness: `htmlFor: undefined` is an explicit opt-out and
|
|
9430
9476
|
// must not leave an orphan generated id on the control.
|
|
9431
9477
|
const userWired = !!labelProps && 'htmlFor' in labelProps;
|
|
9432
|
-
const
|
|
9478
|
+
const adopted = !active && hasInput ? fieldLabelId : undefined;
|
|
9479
|
+
const controlId = id ?? (active && !userWired ? generatedId : adopted);
|
|
9480
|
+
const ownLabelProps = { htmlFor: controlId, ...labelProps };
|
|
9433
9481
|
// Inactive with a label still means an own Field may render it (pickers'
|
|
9434
9482
|
// inline mode, Taginput at maxTags) — the explicit `htmlFor: undefined`
|
|
9435
9483
|
// tells Field the association is owned here, so it must not generate one
|
|
9436
9484
|
// that would dangle (#495 presence semantics).
|
|
9437
9485
|
const fieldLabelProps = active
|
|
9438
|
-
?
|
|
9486
|
+
? ownLabelProps
|
|
9439
9487
|
: label
|
|
9440
9488
|
? { htmlFor: undefined, ...labelProps }
|
|
9441
9489
|
: labelProps;
|
|
9442
|
-
|
|
9490
|
+
const labelTarget = active ? ownLabelProps.htmlFor : fieldLabelFor;
|
|
9491
|
+
return {
|
|
9492
|
+
controlId,
|
|
9493
|
+
fieldLabelProps,
|
|
9494
|
+
labelled: !!controlId && labelTarget === controlId,
|
|
9495
|
+
};
|
|
9443
9496
|
}
|
|
9444
9497
|
/**
|
|
9445
9498
|
* Group-input counterpart of {@link useAutoLabelId} (#494): a group of
|
|
@@ -9448,18 +9501,36 @@ function useAutoLabelId({ label, id, labelProps, rendersLabel, }) {
|
|
|
9448
9501
|
* `aria-labelledby`. A user-supplied `labelProps.id` is used as the target
|
|
9449
9502
|
* instead of generating one. Any caller `htmlFor` is stripped — a group label
|
|
9450
9503
|
* names the group, never a single control — so the merged labelProps always
|
|
9451
|
-
* carry an explicit `htmlFor: undefined`.
|
|
9504
|
+
* carry an explicit `htmlFor: undefined`. When the group renders no label of
|
|
9505
|
+
* its own, it points at the label of a labeled Field around it instead
|
|
9506
|
+
* (#939). A caller who named the group with `aria-label` or
|
|
9507
|
+
* `aria-labelledby` gets no `aria-labelledby` from either label, so their
|
|
9508
|
+
* name wins wherever the label sits.
|
|
9452
9509
|
* Internal; not part of the public API.
|
|
9453
9510
|
*/
|
|
9454
|
-
function useAutoLabelledBy({ label, labelProps, rendersLabel, }) {
|
|
9511
|
+
function useAutoLabelledBy({ label, labelProps, rendersLabel, callerProps, }) {
|
|
9455
9512
|
// Called unconditionally per the rules of hooks; SSR-safe on React 18 and 19.
|
|
9456
9513
|
const generatedId = React.useId();
|
|
9514
|
+
// Set only when an outer Field holds the group (see useAutoLabelId).
|
|
9515
|
+
const fieldLabelElementId = useFieldLabelElementId();
|
|
9457
9516
|
const active = !!label && rendersLabel;
|
|
9458
9517
|
const labelId = labelProps?.id ?? (active ? generatedId : undefined);
|
|
9459
9518
|
const fieldLabelProps = active
|
|
9460
9519
|
? { ...labelProps, id: labelId, htmlFor: undefined }
|
|
9461
9520
|
: labelProps;
|
|
9462
|
-
|
|
9521
|
+
const aria = callerProps;
|
|
9522
|
+
// Presence for aria-labelledby: the caller's key replaces the attribute
|
|
9523
|
+
// through the spread whatever its value, and pointing it at a label would
|
|
9524
|
+
// only take a Rate's fallback name away. Checked before either label, so
|
|
9525
|
+
// the caller's name wins over the group's own `label` as it does over a
|
|
9526
|
+
// Field's, the way an aria-label beats a `<label for>` on a single input.
|
|
9527
|
+
const callerNamed = !!aria['aria-label'] || 'aria-labelledby' in aria;
|
|
9528
|
+
const ariaLabelledBy = callerNamed
|
|
9529
|
+
? undefined
|
|
9530
|
+
: active
|
|
9531
|
+
? labelId
|
|
9532
|
+
: fieldLabelElementId;
|
|
9533
|
+
return { ariaLabelledBy, fieldLabelProps };
|
|
9463
9534
|
}
|
|
9464
9535
|
|
|
9465
9536
|
/**
|
|
@@ -9502,6 +9573,7 @@ const CheckboxesComponent = ({ label, labelSize, labelProps, horizontal, message
|
|
|
9502
9573
|
label,
|
|
9503
9574
|
labelProps,
|
|
9504
9575
|
rendersLabel: ownField,
|
|
9576
|
+
callerProps: props,
|
|
9505
9577
|
});
|
|
9506
9578
|
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
9507
9579
|
...props,
|
|
@@ -9598,9 +9670,12 @@ label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName,
|
|
|
9598
9670
|
rendersLabel: ownField,
|
|
9599
9671
|
});
|
|
9600
9672
|
const { classPrefix } = useConfig();
|
|
9673
|
+
// The input takes `controlId`, so `id` stays out of the spread, where an
|
|
9674
|
+
// undefined `id` key would wipe the id the label points at.
|
|
9675
|
+
const { id: _id, ...inputProps } = props;
|
|
9601
9676
|
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
9602
9677
|
color,
|
|
9603
|
-
...
|
|
9678
|
+
...inputProps,
|
|
9604
9679
|
});
|
|
9605
9680
|
// Mutually exclusive alignment
|
|
9606
9681
|
let alignmentClass;
|
|
@@ -9772,6 +9847,7 @@ const RadiosComponent = ({ label, labelSize, labelProps, horizontal, message, me
|
|
|
9772
9847
|
label,
|
|
9773
9848
|
labelProps,
|
|
9774
9849
|
rendersLabel: ownField,
|
|
9850
|
+
callerProps: props,
|
|
9775
9851
|
});
|
|
9776
9852
|
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
9777
9853
|
...props,
|
|
@@ -10264,7 +10340,9 @@ const Slider = React.forwardRef((props, ref) => {
|
|
|
10264
10340
|
// --- Single slider ---
|
|
10265
10341
|
const sliderElement = !range ? (jsxRuntime.jsxs("div", { ref: wrapperRef, className: combinedClasses, style: wrapperStyle, children: [jsxRuntime.jsx("input", { ref: combinedRef, type: "range", min: min, max: max, step: step, value: currentSingle, disabled: disabled, onChange: handleSingleChange, onKeyDown: handleKeyDown, onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), onFocus: () => setShowTooltip(true), onBlur: () => setShowTooltip(false), className: prefixedClassNames(classPrefix, 'slider-input'), style: {
|
|
10266
10342
|
'--slider-progress': `${progressSingle}%`,
|
|
10267
|
-
}, "aria-valuenow": currentSingle, "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel, ...getAriaProps(currentSingle),
|
|
10343
|
+
}, "aria-valuenow": currentSingle, "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel, ...getAriaProps(currentSingle), ...rest,
|
|
10344
|
+
// After the spread: an undefined `id` key in rest would wipe it.
|
|
10345
|
+
id: controlId }), tooltipMode !== 'hidden' && (jsxRuntime.jsx("output", { ref: outputRef, className: prefixedClassNames(classPrefix, 'slider-output', {
|
|
10268
10346
|
'is-visible': showTipLow,
|
|
10269
10347
|
'is-flipped': flipped,
|
|
10270
10348
|
'is-flipped-left': isVertical && verticalFlippedLeft,
|
|
@@ -10292,7 +10370,7 @@ const Slider = React.forwardRef((props, ref) => {
|
|
|
10292
10370
|
: {
|
|
10293
10371
|
'--slider-progress-low': `${progressLow}%`,
|
|
10294
10372
|
'--slider-progress-high': `${progressHigh}%`,
|
|
10295
|
-
} }), jsxRuntime.jsx("input", { ref: combinedRef, type: "range", min: min, max: max, step: step, value: currentRange[0], disabled: disabled, onChange: handleRangeLowChange, onKeyDown: handleKeyDown, onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), onFocus: () => setShowTooltip(true), onBlur: () => setShowTooltip(false), className: prefixedClassNames(classPrefix, 'slider-input', 'slider-input-low'), "aria-valuenow": currentRange[0], "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel?.[0] ?? 'Minimum value', ...getAriaProps(currentRange[0]), id: controlId, ...
|
|
10373
|
+
} }), jsxRuntime.jsx("input", { ref: combinedRef, type: "range", min: min, max: max, step: step, value: currentRange[0], disabled: disabled, onChange: handleRangeLowChange, onKeyDown: handleKeyDown, onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), onFocus: () => setShowTooltip(true), onBlur: () => setShowTooltip(false), className: prefixedClassNames(classPrefix, 'slider-input', 'slider-input-low'), "aria-valuenow": currentRange[0], "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel?.[0] ?? 'Minimum value', ...getAriaProps(currentRange[0]), ...rest, id: controlId, ...(nameLow !== undefined ? { name: nameLow } : {}) }), jsxRuntime.jsx("input", { ref: inputHighRef, type: "range", min: min, max: max, step: step, value: currentRange[1], disabled: disabled, onChange: handleRangeHighChange, onMouseEnter: () => setShowTooltipHigh(true), onMouseLeave: () => setShowTooltipHigh(false), onFocus: () => setShowTooltipHigh(true), onBlur: () => setShowTooltipHigh(false), className: prefixedClassNames(classPrefix, 'slider-input', 'slider-input-high'), "aria-valuenow": currentRange[1], "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel?.[1] ?? 'Maximum value', ...getAriaProps(currentRange[1]), name: nameHigh }), tooltipMode !== 'hidden' && (jsxRuntime.jsx("output", { ref: outputRef, className: prefixedClassNames(classPrefix, 'slider-output', 'slider-output-low', {
|
|
10296
10374
|
'is-visible': showTipLow,
|
|
10297
10375
|
'is-flipped': flipped,
|
|
10298
10376
|
'is-flipped-left': isVertical && verticalFlippedLeft,
|
|
@@ -10485,7 +10563,9 @@ label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName,
|
|
|
10485
10563
|
}
|
|
10486
10564
|
};
|
|
10487
10565
|
// Shared input element
|
|
10488
|
-
const inputControl = (jsxRuntime.jsx("div", { className: expandedControlClasses, children: jsxRuntime.jsx("input", { ref: combinedRef, type: "number", className: inputClasses, value: currentValue ?? '', min: min, max: max, step: step, disabled: disabled, readOnly: !editable, onChange: handleInputChange, onKeyDown: handleKeyDown, "aria-valuenow": currentValue ?? undefined, "aria-valuemin": min, "aria-valuemax": max,
|
|
10566
|
+
const inputControl = (jsxRuntime.jsx("div", { className: expandedControlClasses, children: jsxRuntime.jsx("input", { ref: combinedRef, type: "number", className: inputClasses, value: currentValue ?? '', min: min, max: max, step: step, disabled: disabled, readOnly: !editable, onChange: handleInputChange, onKeyDown: handleKeyDown, "aria-valuenow": currentValue ?? undefined, "aria-valuemin": min, "aria-valuemax": max, ...rest,
|
|
10567
|
+
// After the spread: an undefined `id` key in rest would wipe it.
|
|
10568
|
+
id: controlId }) }));
|
|
10489
10569
|
// Stepper variant
|
|
10490
10570
|
if (isStepper) {
|
|
10491
10571
|
const stepperElement = (jsxRuntime.jsxs("div", { className: combinedClasses, children: [inputControl, jsxRuntime.jsx("div", { className: controlClasses, children: jsxRuntime.jsxs("div", { className: stepperClasses, children: [jsxRuntime.jsx("button", { type: "button", className: stepperButtonClasses, onClick: handleIncrement, disabled: disabled || isAtMax, tabIndex: -1, "aria-label": "Increase value", children: jsxRuntime.jsx(ArrowDropUp, {}) }), jsxRuntime.jsx("button", { type: "button", className: stepperButtonClasses, onClick: handleDecrement, disabled: disabled || isAtMin, tabIndex: -1, "aria-label": "Decrease value", children: jsxRuntime.jsx(ArrowDropDown, {}) })] }) })] }));
|
|
@@ -10583,6 +10663,7 @@ const Rate = React.forwardRef(({ label, labelSize, labelProps, horizontal, messa
|
|
|
10583
10663
|
label,
|
|
10584
10664
|
labelProps,
|
|
10585
10665
|
rendersLabel: ownField,
|
|
10666
|
+
callerProps: props,
|
|
10586
10667
|
});
|
|
10587
10668
|
const { bulmaHelperClasses, rest } = useBulmaClasses(props);
|
|
10588
10669
|
const starBaseId = React.useId();
|
|
@@ -11115,12 +11196,13 @@ label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName,
|
|
|
11115
11196
|
const tags = controlledValue !== undefined ? controlledValue : internalTags;
|
|
11116
11197
|
const isMaxReached = maxTags !== undefined && tags.length >= maxTags;
|
|
11117
11198
|
// At the tag limit the text input is not rendered, so there is nothing to
|
|
11118
|
-
// wire
|
|
11119
|
-
const { controlId, fieldLabelProps } = useAutoLabelId({
|
|
11199
|
+
// wire a label to, its own or a surrounding Field's.
|
|
11200
|
+
const { controlId, fieldLabelProps, labelled } = useAutoLabelId({
|
|
11120
11201
|
label,
|
|
11121
11202
|
id,
|
|
11122
11203
|
labelProps,
|
|
11123
11204
|
rendersLabel: ownField && !isMaxReached,
|
|
11205
|
+
hasInput: !isMaxReached,
|
|
11124
11206
|
});
|
|
11125
11207
|
// Get display value from tag
|
|
11126
11208
|
const getDisplayValue = (tag) => {
|
|
@@ -11386,9 +11468,7 @@ label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName,
|
|
|
11386
11468
|
e.stopPropagation();
|
|
11387
11469
|
removeTag(index);
|
|
11388
11470
|
}, "aria-label": ariaCloseLabel || `Remove ${displayVal}` }))] }, index));
|
|
11389
|
-
}), !isMaxReached && (jsxRuntime.jsx("input", { ref: combinedRef, type: "text", className: inputClasses, id: controlId, value: inputValue, placeholder: tags.length === 0 ? placeholder : undefined, disabled: disabled, readOnly: readonly, maxLength: maxlength, onChange: handleInputChange, onFocus: handleFocus, onKeyDown: handleKeyDown, onPaste: handlePaste, "aria-label":
|
|
11390
|
-
? undefined
|
|
11391
|
-
: 'Add tag' }))] }), loading && (jsxRuntime.jsx("span", { className: iconRightClass, children: jsxRuntime.jsx("span", { className: loaderClass }) }))] }), isActive && filteredData.length > 0 && (jsxRuntime.jsx("div", { className: dropdownMenuClasses, children: jsxRuntime.jsx("div", { ref: dropdownRef, className: dropdownContentClasses, role: "listbox", children: filteredData.map((item, index) => (jsxRuntime.jsx("a", { className: pcn('dropdown-item', {
|
|
11471
|
+
}), !isMaxReached && (jsxRuntime.jsx("input", { ref: combinedRef, type: "text", className: inputClasses, id: controlId, value: inputValue, placeholder: tags.length === 0 ? placeholder : undefined, disabled: disabled, readOnly: readonly, maxLength: maxlength, onChange: handleInputChange, onFocus: handleFocus, onKeyDown: handleKeyDown, onPaste: handlePaste, "aria-label": labelled ? undefined : 'Add tag' }))] }), loading && (jsxRuntime.jsx("span", { className: iconRightClass, children: jsxRuntime.jsx("span", { className: loaderClass }) }))] }), isActive && filteredData.length > 0 && (jsxRuntime.jsx("div", { className: dropdownMenuClasses, children: jsxRuntime.jsx("div", { ref: dropdownRef, className: dropdownContentClasses, role: "listbox", children: filteredData.map((item, index) => (jsxRuntime.jsx("a", { className: pcn('dropdown-item', {
|
|
11392
11472
|
'is-active': index === highlightedIndex,
|
|
11393
11473
|
}), onClick: () => addTag(item), onMouseEnter: () => setHighlightedIndex(index), role: "option", "aria-selected": index === highlightedIndex, children: item }, index))) }) })), showCounter && jsxRuntime.jsx("small", { className: counterClasses, children: counterText }), name &&
|
|
11394
11474
|
tags.map((tag, i) => (jsxRuntime.jsx("input", { type: "hidden", name: name, value: getDisplayValue(tag), form: form }, `tag-input-${i}`)))] }));
|
|
@@ -11577,7 +11657,7 @@ fieldClassName, controlClassName,
|
|
|
11577
11657
|
const helpClass = usePrefixedClassNames('help', {
|
|
11578
11658
|
[`is-${messageColor}`]: !!messageColor,
|
|
11579
11659
|
});
|
|
11580
|
-
let content = jsxRuntime.jsx(InputBase, { ref: ref, id: controlId
|
|
11660
|
+
let content = jsxRuntime.jsx(InputBase, { ref: ref, ...inputProps, id: controlId });
|
|
11581
11661
|
if (ownControl) {
|
|
11582
11662
|
content = (jsxRuntime.jsx(Control, { iconLeft: iconLeft, iconRight: iconRight, iconLeftName: iconLeftName, iconRightName: iconRightName, iconLeftSize: iconLeftSize, iconRightSize: iconRightSize, hasIconsLeft: hasIconsLeft, hasIconsRight: hasIconsRight, isLoading: isLoading, isExpanded: isExpanded, size: controlSize, className: controlClassName, children: content }));
|
|
11583
11663
|
}
|
|
@@ -11646,7 +11726,7 @@ fieldClassName, controlClassName,
|
|
|
11646
11726
|
const helpClass = usePrefixedClassNames('help', {
|
|
11647
11727
|
[`is-${messageColor}`]: !!messageColor,
|
|
11648
11728
|
});
|
|
11649
|
-
let content = jsxRuntime.jsx(SelectBase, { ref: ref, id: controlId
|
|
11729
|
+
let content = jsxRuntime.jsx(SelectBase, { ref: ref, ...selectProps, id: controlId });
|
|
11650
11730
|
if (ownControl) {
|
|
11651
11731
|
content = (jsxRuntime.jsx(Control, { iconLeft: iconLeft, iconLeftName: iconLeftName, iconLeftSize: iconLeftSize, hasIconsLeft: hasIconsLeft, isExpanded: isExpanded, size: controlSize, className: controlClassName, children: content }));
|
|
11652
11732
|
}
|
|
@@ -11711,7 +11791,7 @@ fieldClassName, controlClassName,
|
|
|
11711
11791
|
const helpClass = usePrefixedClassNames('help', {
|
|
11712
11792
|
[`is-${messageColor}`]: !!messageColor,
|
|
11713
11793
|
});
|
|
11714
|
-
let content = jsxRuntime.jsx(TextAreaBase, { ref: ref, id: controlId
|
|
11794
|
+
let content = jsxRuntime.jsx(TextAreaBase, { ref: ref, ...textAreaProps, id: controlId });
|
|
11715
11795
|
if (ownControl) {
|
|
11716
11796
|
content = (jsxRuntime.jsx(Control, { isLoading: controlIsLoading, size: controlSize, className: controlClassName, children: content }));
|
|
11717
11797
|
}
|
|
@@ -14280,13 +14360,14 @@ const DateInput = React.forwardRef((props, ref) => {
|
|
|
14280
14360
|
labelProps,
|
|
14281
14361
|
// Inline mode renders a bare calendar with no input to label.
|
|
14282
14362
|
rendersLabel: ownField && !baseProps.inline,
|
|
14363
|
+
hasInput: !baseProps.inline,
|
|
14283
14364
|
});
|
|
14284
14365
|
const helpClass = usePrefixedClassNames('help', {
|
|
14285
14366
|
[`is-${messageColor}`]: !!messageColor,
|
|
14286
14367
|
});
|
|
14287
14368
|
// The base hides its launcher while the Control it sits in is loading,
|
|
14288
14369
|
// whether that is the one rendered below or an enclosing one.
|
|
14289
|
-
let content = (jsxRuntime.jsx(DateInputBase, { ref: ref, id: controlId
|
|
14370
|
+
let content = (jsxRuntime.jsx(DateInputBase, { ref: ref, ...baseProps, id: controlId }));
|
|
14290
14371
|
if (ownControl) {
|
|
14291
14372
|
content = (jsxRuntime.jsx(Control, { iconLeft: iconLeft, iconRight: iconRight, iconLeftName: iconLeftName, iconRightName: iconRightName, iconLeftSize: iconLeftSize, iconRightSize: iconRightSize, hasIconsLeft: hasIconsLeft || !!iconLeftName, hasIconsRight: hasIconsRight, isLoading: isLoading, isExpanded: isExpanded, size: controlSize, className: controlClassName, children: content }));
|
|
14292
14373
|
}
|
|
@@ -15429,13 +15510,14 @@ const TimeInput = React.forwardRef((props, ref) => {
|
|
|
15429
15510
|
labelProps,
|
|
15430
15511
|
// Inline mode renders a bare panel with no input to label.
|
|
15431
15512
|
rendersLabel: ownField && !baseProps.inline,
|
|
15513
|
+
hasInput: !baseProps.inline,
|
|
15432
15514
|
});
|
|
15433
15515
|
const helpClass = usePrefixedClassNames('help', {
|
|
15434
15516
|
[`is-${messageColor}`]: !!messageColor,
|
|
15435
15517
|
});
|
|
15436
15518
|
// The base hides its launcher while the Control it sits in is loading,
|
|
15437
15519
|
// whether that is the one rendered below or an enclosing one.
|
|
15438
|
-
let content = (jsxRuntime.jsx(TimeInputBase, { ref: ref, id: controlId
|
|
15520
|
+
let content = (jsxRuntime.jsx(TimeInputBase, { ref: ref, ...baseProps, id: controlId }));
|
|
15439
15521
|
if (ownControl) {
|
|
15440
15522
|
content = (jsxRuntime.jsx(Control, { iconLeft: iconLeft, iconRight: iconRight, iconLeftName: iconLeftName, iconRightName: iconRightName, iconLeftSize: iconLeftSize, iconRightSize: iconRightSize, hasIconsLeft: hasIconsLeft || !!iconLeftName, hasIconsRight: hasIconsRight, isLoading: isLoading, isExpanded: isExpanded, size: controlSize, className: controlClassName, children: content }));
|
|
15441
15523
|
}
|
|
@@ -15817,13 +15899,14 @@ const DateTimeInput = React.forwardRef((props, ref) => {
|
|
|
15817
15899
|
labelProps,
|
|
15818
15900
|
// Inline mode renders a bare picker with no input to label.
|
|
15819
15901
|
rendersLabel: ownField && !baseProps.inline,
|
|
15902
|
+
hasInput: !baseProps.inline,
|
|
15820
15903
|
});
|
|
15821
15904
|
const helpClass = usePrefixedClassNames('help', {
|
|
15822
15905
|
[`is-${messageColor}`]: !!messageColor,
|
|
15823
15906
|
});
|
|
15824
15907
|
// The base hides its launcher while the Control it sits in is loading,
|
|
15825
15908
|
// whether that is the one rendered below or an enclosing one.
|
|
15826
|
-
let content = (jsxRuntime.jsx(DateTimeInputBase, { ref: ref, id: controlId
|
|
15909
|
+
let content = (jsxRuntime.jsx(DateTimeInputBase, { ref: ref, ...baseProps, id: controlId }));
|
|
15827
15910
|
if (ownControl) {
|
|
15828
15911
|
content = (jsxRuntime.jsx(Control, { iconLeft: iconLeft, iconRight: iconRight, iconLeftName: iconLeftName, iconRightName: iconRightName, iconLeftSize: iconLeftSize, iconRightSize: iconRightSize, hasIconsLeft: hasIconsLeft || !!iconLeftName, hasIconsRight: hasIconsRight, isLoading: isLoading, isExpanded: isExpanded, size: controlSize, className: controlClassName, children: content }));
|
|
15829
15912
|
}
|
|
@@ -16167,6 +16250,7 @@ const DateRangeInput = React.forwardRef((props, ref) => {
|
|
|
16167
16250
|
label,
|
|
16168
16251
|
labelProps,
|
|
16169
16252
|
rendersLabel: ownField,
|
|
16253
|
+
callerProps: baseProps,
|
|
16170
16254
|
});
|
|
16171
16255
|
const helpClass = usePrefixedClassNames('help', {
|
|
16172
16256
|
[`is-${messageColor}`]: !!messageColor,
|