Skip to content

Commit

Permalink
[#165] Update dist to implement EyeSuffix
Browse files Browse the repository at this point in the history
  • Loading branch information
ifirmawan committed Dec 11, 2024
1 parent cc5cbbb commit 8926507
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 14 deletions.
72 changes: 66 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,32 @@ Icon.displayName = 'AntdIcon';
Icon.getTwoToneColor = getTwoToneColor;
Icon.setTwoToneColor = setTwoToneColor;

// This icon file is generated automatically.
var EyeInvisibleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { "tag": "path", "attrs": { "d": "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, "name": "eye-invisible", "theme": "outlined" };

var EyeInvisibleOutlined$1 = function EyeInvisibleOutlined$1(props, ref) {
return /*#__PURE__*/React.createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
ref: ref,
icon: EyeInvisibleOutlined
}));
};

EyeInvisibleOutlined$1.displayName = 'EyeInvisibleOutlined';
var EyeInvisibleOutlined$2 = /*#__PURE__*/React.forwardRef(EyeInvisibleOutlined$1);

// This icon file is generated automatically.
var EyeOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };

var EyeOutlined$1 = function EyeOutlined$1(props, ref) {
return /*#__PURE__*/React.createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
ref: ref,
icon: EyeOutlined
}));
};

EyeOutlined$1.displayName = 'EyeOutlined';
var EyeOutlined$2 = /*#__PURE__*/React.forwardRef(EyeOutlined$1);

// This icon file is generated automatically.
var InboxOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z" } }] }, "name": "inbox", "theme": "outlined" };

Expand Down Expand Up @@ -35724,6 +35750,24 @@ var DataApiUrl = function DataApiUrl(_ref) {
}) : 'Loading'));
};

var EyeSuffix = function EyeSuffix(_ref) {
var showString = _ref.showString,
setShowString = _ref.setShowString,
hiddenString = _ref.hiddenString;
return hiddenString ? /*#__PURE__*/React__default.createElement("span", {
role: "button",
"aria-label": "toggle show/hidden text",
tabIndex: 0,
onClick: function onClick() {
return setShowString(!showString);
},
style: {
cursor: 'pointer',
opacity: '.5'
}
}, showString ? /*#__PURE__*/React__default.createElement(EyeInvisibleOutlined$2, null) : /*#__PURE__*/React__default.createElement(EyeOutlined$2, null)) : null;
};

var _excluded$3 = ["uiText", "id", "required", "hiddenString"];
var InputConfirm = function InputConfirm(_ref) {
var uiText = _ref.uiText,
Expand All @@ -35732,6 +35776,11 @@ var InputConfirm = function InputConfirm(_ref) {
_ref$hiddenString = _ref.hiddenString,
hiddenString = _ref$hiddenString === void 0 ? false : _ref$hiddenString,
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
var _useState = React.useState(hiddenString),
showString = _useState[0],
setShowString = _useState[1];
var form = antd.Form.useFormInstance();
var getFieldValue = form.getFieldValue;
return /*#__PURE__*/React__default.createElement(antd.Form.Item, {
name: "confirm_" + id,
dependencies: [id],
Expand All @@ -35750,11 +35799,14 @@ var InputConfirm = function InputConfirm(_ref) {
};
}]
}, /*#__PURE__*/React__default.createElement(antd.Input, _extends({
sytle: {
width: '100%'
},
type: hiddenString ? 'password' : 'text',
placeholder: uiText === null || uiText === void 0 ? void 0 : uiText.inputConfirmPlaceholder
type: showString ? 'password' : 'text',
placeholder: uiText === null || uiText === void 0 ? void 0 : uiText.inputConfirmPlaceholder,
suffix: /*#__PURE__*/React__default.createElement(EyeSuffix, {
showString: showString,
setShowString: setShowString,
hiddenString: hiddenString
}),
defaultValue: getFieldValue(id)
}, props)));
};

Expand Down Expand Up @@ -37163,6 +37215,9 @@ var TypeInput = function TypeInput(_ref) {
var _useState = React.useState(true),
showPrefix = _useState[0],
setShowPrefix = _useState[1];
var _useState2 = React.useState(hiddenString),
showString = _useState2[0],
setShowString = _useState2[1];
var extraBefore = extra ? extra.filter(function (ex) {
return ex.placement === 'before';
}) : [];
Expand Down Expand Up @@ -37225,7 +37280,12 @@ var TypeInput = function TypeInput(_ref) {
addonBefore: addonBefore,
prefix: fieldIcons && showPrefix && !currentValue && /*#__PURE__*/React__default.createElement(InputFieldIcon, null),
disabled: meta_uuid || disabled,
type: hiddenString ? 'password' : 'text'
type: showString ? 'password' : 'text',
suffix: /*#__PURE__*/React__default.createElement(EyeSuffix, {
showString: showString,
setShowString: setShowString,
hiddenString: hiddenString
})
})), !!(extraAfter !== null && extraAfter !== void 0 && extraAfter.length) && extraAfter.map(function (ex, exi) {
return /*#__PURE__*/React__default.createElement(Extra, _extends({
key: exi,
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

72 changes: 66 additions & 6 deletions dist/index.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,32 @@ Icon.displayName = 'AntdIcon';
Icon.getTwoToneColor = getTwoToneColor;
Icon.setTwoToneColor = setTwoToneColor;

// This icon file is generated automatically.
var EyeInvisibleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { "tag": "path", "attrs": { "d": "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, "name": "eye-invisible", "theme": "outlined" };

var EyeInvisibleOutlined$1 = function EyeInvisibleOutlined$1(props, ref) {
return /*#__PURE__*/createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
ref: ref,
icon: EyeInvisibleOutlined
}));
};

EyeInvisibleOutlined$1.displayName = 'EyeInvisibleOutlined';
var EyeInvisibleOutlined$2 = /*#__PURE__*/forwardRef(EyeInvisibleOutlined$1);

// This icon file is generated automatically.
var EyeOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };

var EyeOutlined$1 = function EyeOutlined$1(props, ref) {
return /*#__PURE__*/createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
ref: ref,
icon: EyeOutlined
}));
};

EyeOutlined$1.displayName = 'EyeOutlined';
var EyeOutlined$2 = /*#__PURE__*/forwardRef(EyeOutlined$1);

// This icon file is generated automatically.
var InboxOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z" } }] }, "name": "inbox", "theme": "outlined" };

Expand Down Expand Up @@ -35721,6 +35747,24 @@ var DataApiUrl = function DataApiUrl(_ref) {
}) : 'Loading'));
};

var EyeSuffix = function EyeSuffix(_ref) {
var showString = _ref.showString,
setShowString = _ref.setShowString,
hiddenString = _ref.hiddenString;
return hiddenString ? /*#__PURE__*/React__default.createElement("span", {
role: "button",
"aria-label": "toggle show/hidden text",
tabIndex: 0,
onClick: function onClick() {
return setShowString(!showString);
},
style: {
cursor: 'pointer',
opacity: '.5'
}
}, showString ? /*#__PURE__*/React__default.createElement(EyeInvisibleOutlined$2, null) : /*#__PURE__*/React__default.createElement(EyeOutlined$2, null)) : null;
};

var _excluded$3 = ["uiText", "id", "required", "hiddenString"];
var InputConfirm = function InputConfirm(_ref) {
var uiText = _ref.uiText,
Expand All @@ -35729,6 +35773,11 @@ var InputConfirm = function InputConfirm(_ref) {
_ref$hiddenString = _ref.hiddenString,
hiddenString = _ref$hiddenString === void 0 ? false : _ref$hiddenString,
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
var _useState = useState(hiddenString),
showString = _useState[0],
setShowString = _useState[1];
var form = Form.useFormInstance();
var getFieldValue = form.getFieldValue;
return /*#__PURE__*/React__default.createElement(Form.Item, {
name: "confirm_" + id,
dependencies: [id],
Expand All @@ -35747,11 +35796,14 @@ var InputConfirm = function InputConfirm(_ref) {
};
}]
}, /*#__PURE__*/React__default.createElement(Input, _extends({
sytle: {
width: '100%'
},
type: hiddenString ? 'password' : 'text',
placeholder: uiText === null || uiText === void 0 ? void 0 : uiText.inputConfirmPlaceholder
type: showString ? 'password' : 'text',
placeholder: uiText === null || uiText === void 0 ? void 0 : uiText.inputConfirmPlaceholder,
suffix: /*#__PURE__*/React__default.createElement(EyeSuffix, {
showString: showString,
setShowString: setShowString,
hiddenString: hiddenString
}),
defaultValue: getFieldValue(id)
}, props)));
};

Expand Down Expand Up @@ -37160,6 +37212,9 @@ var TypeInput = function TypeInput(_ref) {
var _useState = useState(true),
showPrefix = _useState[0],
setShowPrefix = _useState[1];
var _useState2 = useState(hiddenString),
showString = _useState2[0],
setShowString = _useState2[1];
var extraBefore = extra ? extra.filter(function (ex) {
return ex.placement === 'before';
}) : [];
Expand Down Expand Up @@ -37222,7 +37277,12 @@ var TypeInput = function TypeInput(_ref) {
addonBefore: addonBefore,
prefix: fieldIcons && showPrefix && !currentValue && /*#__PURE__*/React__default.createElement(InputFieldIcon, null),
disabled: meta_uuid || disabled,
type: hiddenString ? 'password' : 'text'
type: showString ? 'password' : 'text',
suffix: /*#__PURE__*/React__default.createElement(EyeSuffix, {
showString: showString,
setShowString: setShowString,
hiddenString: hiddenString
})
})), !!(extraAfter !== null && extraAfter !== void 0 && extraAfter.length) && extraAfter.map(function (ex, exi) {
return /*#__PURE__*/React__default.createElement(Extra, _extends({
key: exi,
Expand Down
2 changes: 1 addition & 1 deletion dist/index.modern.js.map

Large diffs are not rendered by default.

0 comments on commit 8926507

Please sign in to comment.