@edvisor/product-language 0.7.2 → 0.7.3
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/index.js +53 -20
- package/lib/components/input-field/input-field.d.ts +1 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -6578,7 +6578,17 @@ class ControlsSlot$1 extends Slot {}
|
|
|
6578
6578
|
const InputFrame = /*#__PURE__*/styled.label.withConfig({
|
|
6579
6579
|
displayName: "input-field__InputFrame",
|
|
6580
6580
|
componentId: "sc-1yq0rb7-5"
|
|
6581
|
-
})(["width:100%;padding:", " ", " ", " ", ";flex-direction:
|
|
6581
|
+
})(["width:100%;padding:", " ", " ", " ", ";display:flex;flex-direction:", ";", ""], Padding.xs, Padding.none, Padding.none, Padding.none, ({
|
|
6582
|
+
label,
|
|
6583
|
+
labelPosition
|
|
6584
|
+
}) => isDefined(label) && !isEmpty(label) && labelPosition === "side"
|
|
6585
|
+
/* labelPositionType.SIDE */
|
|
6586
|
+
? 'row' : 'column', ({
|
|
6587
|
+
label,
|
|
6588
|
+
labelPosition
|
|
6589
|
+
}) => isDefined(label) && !isEmpty(label) && labelPosition === "side"
|
|
6590
|
+
/* labelPositionType.SIDE */
|
|
6591
|
+
&& css(["width:fit-content;white-space:pre;"]));
|
|
6582
6592
|
const ControlsFrame = /*#__PURE__*/styled(Flex).withConfig({
|
|
6583
6593
|
displayName: "input-field__ControlsFrame",
|
|
6584
6594
|
componentId: "sc-1yq0rb7-6"
|
|
@@ -6586,7 +6596,11 @@ const ControlsFrame = /*#__PURE__*/styled(Flex).withConfig({
|
|
|
6586
6596
|
const InputLabel = /*#__PURE__*/styled(Label$1).withConfig({
|
|
6587
6597
|
displayName: "input-field__InputLabel",
|
|
6588
6598
|
componentId: "sc-1yq0rb7-7"
|
|
6589
|
-
})(["margin-bottom:", ";"], Margin.xxs
|
|
6599
|
+
})(["margin-bottom:", ";", ""], Margin.xxs, ({
|
|
6600
|
+
labelPosition
|
|
6601
|
+
}) => labelPosition === "side"
|
|
6602
|
+
/* labelPositionType.SIDE */
|
|
6603
|
+
&& css(["padding-right:", ";"], Padding.xs));
|
|
6590
6604
|
const InputField$1 = forwardRef((props, ref) => {
|
|
6591
6605
|
const {
|
|
6592
6606
|
children,
|
|
@@ -6594,9 +6608,12 @@ const InputField$1 = forwardRef((props, ref) => {
|
|
|
6594
6608
|
suffix,
|
|
6595
6609
|
label,
|
|
6596
6610
|
className,
|
|
6597
|
-
style
|
|
6611
|
+
style,
|
|
6612
|
+
labelPosition = "top"
|
|
6613
|
+
/* labelPositionType.TOP */
|
|
6614
|
+
|
|
6598
6615
|
} = props,
|
|
6599
|
-
inputProps = __rest(props, ["children", "prefix", "suffix", "label", "className", "style"]);
|
|
6616
|
+
inputProps = __rest(props, ["children", "prefix", "suffix", "label", "className", "style", "labelPosition"]);
|
|
6600
6617
|
|
|
6601
6618
|
const icon = getSlot(IconSlot, children);
|
|
6602
6619
|
const controls = getSlot(ControlsSlot$1, children);
|
|
@@ -6606,11 +6623,15 @@ const InputField$1 = forwardRef((props, ref) => {
|
|
|
6606
6623
|
className: className,
|
|
6607
6624
|
style: style
|
|
6608
6625
|
}, {
|
|
6609
|
-
children: [jsxs(InputFrame, {
|
|
6626
|
+
children: [jsxs(InputFrame, Object.assign({
|
|
6627
|
+
label: label,
|
|
6628
|
+
labelPosition: labelPosition
|
|
6629
|
+
}, {
|
|
6610
6630
|
children: [jsx(If, Object.assign({
|
|
6611
6631
|
is: label
|
|
6612
6632
|
}, {
|
|
6613
6633
|
children: jsxs(InputLabel, Object.assign({
|
|
6634
|
+
labelPosition: labelPosition,
|
|
6614
6635
|
subtle: true,
|
|
6615
6636
|
subdued: true
|
|
6616
6637
|
}, {
|
|
@@ -6639,7 +6660,7 @@ const InputField$1 = forwardRef((props, ref) => {
|
|
|
6639
6660
|
}))
|
|
6640
6661
|
}))]
|
|
6641
6662
|
})]
|
|
6642
|
-
}), jsx(If, Object.assign({
|
|
6663
|
+
})), jsx(If, Object.assign({
|
|
6643
6664
|
is: icon
|
|
6644
6665
|
}, {
|
|
6645
6666
|
children: jsx(ControlsFrame, Object.assign({
|
|
@@ -8700,7 +8721,7 @@ const Button = props => {
|
|
|
8700
8721
|
const ValueContainer = /*#__PURE__*/styled(SpaceBetween).withConfig({
|
|
8701
8722
|
displayName: "value__ValueContainer",
|
|
8702
8723
|
componentId: "sc-1aps7dx-0"
|
|
8703
|
-
})(["pointer-events:", ";padding:", " ", "
|
|
8724
|
+
})(["pointer-events:", ";padding:", " ", ";background:", ";cursor:default;border:1px solid ", ";border-radius:6px;outline-offset:-2px;", " ", ""], props => is(props.disabled) ? 'none' : 'auto', Padding.xs, Padding.none, props => is(props.invalid) ? Surface.Critical.Subdued : Surface.Default.Default, props => is(props.invalid) ? Borders.Critical.Default : Borders.Default.Default, props => is(props.menuIsOpen) && css(["outline:2px solid ", ";"], Focused.Default), props => !is(props.disabled) && !is(props.invalid) && `
|
|
8704
8725
|
|
|
8705
8726
|
&:focus {
|
|
8706
8727
|
outline: 2px solid ${Focused.Default}
|
|
@@ -8713,7 +8734,7 @@ const ValueContainer = /*#__PURE__*/styled(SpaceBetween).withConfig({
|
|
|
8713
8734
|
const ValueWrapper$1 = /*#__PURE__*/styled(Flex).withConfig({
|
|
8714
8735
|
displayName: "value__ValueWrapper",
|
|
8715
8736
|
componentId: "sc-1aps7dx-1"
|
|
8716
|
-
})(["width:100%;
|
|
8737
|
+
})(["width:100%;display:", ";"], ({
|
|
8717
8738
|
label,
|
|
8718
8739
|
labelPosition
|
|
8719
8740
|
}) => isDefined(label) && !isEmpty(label) && labelPosition === "top"
|
|
@@ -8722,7 +8743,15 @@ const ValueWrapper$1 = /*#__PURE__*/styled(Flex).withConfig({
|
|
|
8722
8743
|
const ValueLabel = /*#__PURE__*/styled(Label$1).withConfig({
|
|
8723
8744
|
displayName: "value__ValueLabel",
|
|
8724
8745
|
componentId: "sc-1aps7dx-2"
|
|
8725
|
-
})(["padding-left:", ";margin-bottom:", ";width:fit-content;white-space:pre;", ""], Padding.xs,
|
|
8746
|
+
})(["padding-left:", ";margin-bottom:", ";display:flex;align-self:", ";width:fit-content;white-space:pre;", ""], Padding.xs, ({
|
|
8747
|
+
labelPosition
|
|
8748
|
+
}) => labelPosition === "top"
|
|
8749
|
+
/* labelPositionType.TOP */
|
|
8750
|
+
? Margin.xxs : Margin.none, ({
|
|
8751
|
+
labelPosition
|
|
8752
|
+
}) => labelPosition === "top"
|
|
8753
|
+
/* labelPositionType.TOP */
|
|
8754
|
+
? 'flex-start' : 'center', ({
|
|
8726
8755
|
labelPosition
|
|
8727
8756
|
}) => labelPosition === "top"
|
|
8728
8757
|
/* labelPositionType.TOP */
|
|
@@ -8734,7 +8763,7 @@ const ValueLeft = /*#__PURE__*/styled(Flex).withConfig({
|
|
|
8734
8763
|
const ValueRight = /*#__PURE__*/styled(Flex).withConfig({
|
|
8735
8764
|
displayName: "value__ValueRight",
|
|
8736
8765
|
componentId: "sc-1aps7dx-4"
|
|
8737
|
-
})(["padding-right:", ";pointer
|
|
8766
|
+
})(["padding-right:", ";cursor:pointer;"], Padding.xxs);
|
|
8738
8767
|
const Placeholder = /*#__PURE__*/styled(Label$1).withConfig({
|
|
8739
8768
|
displayName: "value__Placeholder",
|
|
8740
8769
|
componentId: "sc-1aps7dx-5"
|
|
@@ -8858,22 +8887,22 @@ const Value = props => {
|
|
|
8858
8887
|
}
|
|
8859
8888
|
};
|
|
8860
8889
|
|
|
8861
|
-
const onClear =
|
|
8862
|
-
|
|
8890
|
+
const onClear = event => {
|
|
8891
|
+
event.stopPropagation();
|
|
8863
8892
|
props.onClear();
|
|
8864
8893
|
};
|
|
8865
8894
|
|
|
8866
|
-
const onSearch =
|
|
8895
|
+
const onSearch = event => {
|
|
8867
8896
|
if (is(props.searchable)) {
|
|
8868
|
-
props.onSearch(
|
|
8897
|
+
props.onSearch(event.currentTarget.innerText.trim());
|
|
8869
8898
|
} else {
|
|
8870
|
-
|
|
8899
|
+
event.preventDefault();
|
|
8871
8900
|
}
|
|
8872
8901
|
};
|
|
8873
8902
|
|
|
8874
|
-
const onKeyDown =
|
|
8875
|
-
if (!is(searchable) &&
|
|
8876
|
-
|
|
8903
|
+
const onKeyDown = event => {
|
|
8904
|
+
if (!is(searchable) && event.key !== keys.TAB || event.key === keys.ENTER || event.key === keys.ARROW_UP || event.key === keys.ARROW_DOWN) {
|
|
8905
|
+
event.preventDefault();
|
|
8877
8906
|
}
|
|
8878
8907
|
};
|
|
8879
8908
|
|
|
@@ -9039,7 +9068,9 @@ const SelectImpl = (props, selectRef) => {
|
|
|
9039
9068
|
|
|
9040
9069
|
function addDocumentListener() {
|
|
9041
9070
|
removeDocumentListener();
|
|
9042
|
-
document === null || document === void 0 ? void 0 : document.addEventListener('click', onDocumentClick
|
|
9071
|
+
document === null || document === void 0 ? void 0 : document.addEventListener('click', onDocumentClick, {
|
|
9072
|
+
capture: true
|
|
9073
|
+
});
|
|
9043
9074
|
}
|
|
9044
9075
|
|
|
9045
9076
|
function onOptionSelect(selectValue, option) {
|
|
@@ -9052,7 +9083,9 @@ const SelectImpl = (props, selectRef) => {
|
|
|
9052
9083
|
}
|
|
9053
9084
|
|
|
9054
9085
|
function removeDocumentListener() {
|
|
9055
|
-
document === null || document === void 0 ? void 0 : document.removeEventListener('click', onDocumentClick
|
|
9086
|
+
document === null || document === void 0 ? void 0 : document.removeEventListener('click', onDocumentClick, {
|
|
9087
|
+
capture: true
|
|
9088
|
+
});
|
|
9056
9089
|
}
|
|
9057
9090
|
|
|
9058
9091
|
function onKeyDown({
|
|
@@ -16,6 +16,7 @@ interface IInputFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
16
16
|
prefix?: string;
|
|
17
17
|
suffix?: string;
|
|
18
18
|
label?: string;
|
|
19
|
+
labelPosition?: string;
|
|
19
20
|
}
|
|
20
21
|
export declare const InputField: import("react").ForwardRefExoticComponent<IInputFieldProps & import("react").RefAttributes<HTMLInputElement>> & {
|
|
21
22
|
Icon: typeof IconSlot;
|