magneto365.ui 2.48.3 → 2.48.5

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/index.js CHANGED
@@ -6801,7 +6801,7 @@ var getDefaulSelected = function (selected) {
6801
6801
  return selected.map(function (select) { return select.value; }).join(', ');
6802
6802
  };
6803
6803
  var Component$a = function (_a) {
6804
- var onChange = _a.onChange, value = _a.value, className = _a.className, onClick = _a.onClick, _b = _a.open, open = _b === void 0 ? false : _b, _c = _a.actionIcon, actionIcon = _c === void 0 ? ArrowDown2 : _c, selected = _a.selected, _d = _a.getLabel, getLabel = _d === void 0 ? getDefaulSelected : _d, readOnly = _a.readOnly, disabled = _a.disabled, rest = __rest(_a, ["onChange", "value", "className", "onClick", "open", "actionIcon", "selected", "getLabel", "readOnly", "disabled"]);
6804
+ var _b = _a.onChange, onChange = _b === void 0 ? stubTrue : _b, _c = _a.value, value = _c === void 0 ? '' : _c, className = _a.className, _d = _a.onClick, onClick = _d === void 0 ? stubUndefined : _d, _e = _a.open, open = _e === void 0 ? false : _e, _f = _a.actionIcon, actionIcon = _f === void 0 ? ArrowDown2 : _f, _g = _a.selected, selected = _g === void 0 ? [] : _g, _h = _a.getLabel, getLabel = _h === void 0 ? getDefaulSelected : _h, readOnly = _a.readOnly, disabled = _a.disabled, _j = _a.placeholder, placeholder = _j === void 0 ? '' : _j, _k = _a.type, type = _k === void 0 ? 'text' : _k, rest = __rest(_a, ["onChange", "value", "className", "onClick", "open", "actionIcon", "selected", "getLabel", "readOnly", "disabled", "placeholder", "type"]);
6805
6805
  var ref = useRef({ onChange: onChange, id: generateID() });
6806
6806
  useEffect(function () {
6807
6807
  ref.current.onChange = onChange;
@@ -6817,17 +6817,17 @@ var Component$a = function (_a) {
6817
6817
  if (!readOnly) {
6818
6818
  return (React.createElement("div", { className: cx$5('select-input', className, {
6819
6819
  'select-input--with-icon': actionIcon !== undefined,
6820
- 'select-input--no-placeholder': rest.placeholder.length === 0,
6820
+ 'select-input--no-placeholder': placeholder.length === 0,
6821
6821
  'select-input--disabled': disabled
6822
6822
  }), onClick: function () { return (disabled ? null : onClick()); }, "data-name": "select-input", "data-selected": selected.length > 0, "data-is-open": open },
6823
- React.createElement(Input, __assign({ name: ref.current.id, disabled: disabled, value: open ? value : getLabel(selected), onChange: onChange, actionIcon: actionIcon }, rest))));
6823
+ React.createElement(Input, __assign({ name: ref.current.id, disabled: disabled, value: open ? value : getLabel(selected), onChange: onChange, actionIcon: actionIcon, placeholder: placeholder, type: type }, rest))));
6824
6824
  }
6825
- return (React.createElement("button", { className: cx$5('select-button', { 'select-button--disabled': disabled }, className), disabled: disabled, onClick: onClick, "data-name": "select-button", "data-selected": selected.length > 0, "data-is-open": open },
6825
+ return (React.createElement("button", { className: cx$5('select-button', { 'select-button--disabled': disabled }, className), disabled: disabled, onClick: onClick, "data-name": "select-button", "data-selected": selected.length > 0, "data-is-open": open, type: "button" },
6826
6826
  React.createElement("div", { className: cx$5('select-button__input') },
6827
- rest.placeholder.length > 0 ? (React.createElement("span", { className: cx$5('select-button__placeholder', {
6827
+ placeholder.length > 0 ? (React.createElement("span", { className: cx$5('select-button__placeholder', {
6828
6828
  'select-button__placeholder--open': open,
6829
6829
  'select-button__placeholder--selected': selected.length > 0
6830
- }) }, rest.placeholder)) : null,
6830
+ }) }, placeholder)) : null,
6831
6831
  selected.length > 0 ? (React.createElement("span", { className: cx$5('select-button__value', {
6832
6832
  'select-button__placeholder--open': open
6833
6833
  }) }, getLabel(selected))) : null),
@@ -6859,7 +6859,7 @@ var SelectClickout = function (_a) {
6859
6859
  };
6860
6860
  var SelectClickout$1 = withClickOut(SelectClickout);
6861
6861
 
6862
- var styles$a = {"select-drawer":"mg_select_drawer_select-drawer_1d398"};
6862
+ var styles$a = {"select-drawer":"mg_select_drawer_select-drawer_tv0qc"};
6863
6863
 
6864
6864
  var cx$3 = classNames.bind(styles$a);
6865
6865
  var SelectDrawer = function (_a) {
@@ -6868,15 +6868,22 @@ var SelectDrawer = function (_a) {
6868
6868
  return (React.createElement(MobileDrawer, { className: cx$3('select-drawer', className), isOpen: open, onClose: function () { return onSwitch(false); }, blockBackgroundClose: true }, children));
6869
6869
  };
6870
6870
 
6871
- var styles$9 = {"checkbox":"mg_checkbox_checkbox_1fdbz","checkbox--inline":"mg_checkbox_checkbox--inline_1fdbz","checkbox--block":"mg_checkbox_checkbox--block_1fdbz","checkbox--checked":"mg_checkbox_checkbox--checked_1fdbz","checkbox--background":"mg_checkbox_checkbox--background_1fdbz","custom-checked":"mg_checkbox_custom-checked_1fdbz"};
6871
+ var styles$9 = {"checkbox":"mg_checkbox_checkbox_1w9e7","checkbox--inline":"mg_checkbox_checkbox--inline_1w9e7","checkbox--block":"mg_checkbox_checkbox--block_1w9e7","checkbox--background":"mg_checkbox_checkbox--background_1w9e7","checkbox--checked":"mg_checkbox_checkbox--checked_1w9e7","custom-checked":"mg_checkbox_custom-checked_1w9e7","checkbox__box":"mg_checkbox_checkbox_box_1w9e7","checkbox__box--checked":"mg_checkbox_checkbox_box--checked_1w9e7"};
6872
6872
 
6873
6873
  var cx$2 = classNames.bind(styles$9);
6874
+ var defaultCheck = function (_a) {
6875
+ var type = _a.type, checked = _a.checked;
6876
+ if (type === 'background')
6877
+ return;
6878
+ return (React.createElement("div", { "aria-checked": checked, role: "checkbox", className: cx$2('checkbox__box', { 'checkbox__box--checked': checked }) }, checked ? React.createElement(React.Fragment, null, "\u2713") : null));
6879
+ };
6874
6880
  var Component$9 = function (_a) {
6875
- var id = _a.id, checked = _a.checked, _b = _a.onChange, onChange = _b === void 0 ? stubTrue : _b, children = _a.children, _c = _a.type, type = _c === void 0 ? 'box' : _c, className = _a.className, _d = _a.display, display = _d === void 0 ? 'inline' : _d, rest = __rest(_a, ["id", "checked", "onChange", "children", "type", "className", "display"]);
6881
+ var id = _a.id, checked = _a.checked, _b = _a.onChange, onChange = _b === void 0 ? stubTrue : _b, children = _a.children, _c = _a.type, type = _c === void 0 ? 'box' : _c, className = _a.className, _d = _a.display, display = _d === void 0 ? 'inline' : _d, _e = _a.renderCheck, renderCheck = _e === void 0 ? defaultCheck : _e, rest = __rest(_a, ["id", "checked", "onChange", "children", "type", "className", "display", "renderCheck"]);
6876
6882
  return (React.createElement("label", { className: cx$2('checkbox', "checkbox--".concat(display), className, {
6877
6883
  'checkbox--checked': checked,
6878
6884
  'checkbox--background': type === 'background'
6879
6885
  }), "data-name": "checkbox-container", htmlFor: id },
6886
+ renderCheck({ checked: checked, type: type }),
6880
6887
  React.createElement("input", __assign({ "data-name": "checkbox", checked: checked, onChange: function (_a) {
6881
6888
  var target = _a.target;
6882
6889
  return onChange(target.checked);