wini-web-components 1.6.3 → 1.7.1
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/component/calendar/calendar.js +5 -5
- package/dist/component/date-picker/date-picker.js +1 -1
- package/dist/component/input-multi-select/input-multi-select.js +3 -3
- package/dist/component/progress-bar/progress-bar.js +1 -1
- package/dist/component/progress-circle/progress-circle.js +1 -1
- package/dist/component/radio-button/radio-button.js +1 -1
- package/dist/component/select1/select1.js +3 -3
- package/dist/component/switch/switch.js +2 -2
- package/dist/component/tag/tag.d.ts +1 -1
- package/dist/component/tag/tag.js +1 -2
- package/dist/component/wini-icon/winicon.d.ts +11 -0
- package/dist/component/wini-icon/winicon.js +15 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -106,13 +106,13 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
106
106
|
var additionProps = {};
|
|
107
107
|
var selected = false;
|
|
108
108
|
if (dateNumber + 1 === exports.today.getDate() && _this.state.selectMonth === exports.today.getMonth() && _this.state.selectYear === exports.today.getFullYear()) {
|
|
109
|
-
style = { borderColor: 'var(--infor-color)' };
|
|
109
|
+
style = { borderColor: 'var(--infor-main-color)' };
|
|
110
110
|
}
|
|
111
111
|
if (!(0, exports.inRangeTime)(timeValue, exports.startDate, exports.endDate)) {
|
|
112
112
|
additionProps = { 'in-range': 'false' };
|
|
113
113
|
}
|
|
114
114
|
else if (!(0, exports.inRangeTime)(timeValue, (_a = _this.props.min) !== null && _a !== void 0 ? _a : exports.startDate, (_b = _this.props.max) !== null && _b !== void 0 ? _b : exports.endDate)) {
|
|
115
|
-
style = __assign(__assign({}, style), { color: 'var(--disabled-
|
|
115
|
+
style = __assign(__assign({}, style), { color: 'var(--neutral-text-disabled-color)', pointerEvents: 'none' });
|
|
116
116
|
}
|
|
117
117
|
else if (_this.state.value.valueOf() === timeValue.valueOf()) {
|
|
118
118
|
additionProps = __assign({}, additionProps);
|
|
@@ -178,7 +178,7 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
178
178
|
var style = {};
|
|
179
179
|
var selected = false;
|
|
180
180
|
if (_this.state.selectYear === exports.today.getFullYear() && exports.today.getMonth() === i) {
|
|
181
|
-
style = { borderColor: 'var(--infor-color)' };
|
|
181
|
+
style = { borderColor: 'var(--infor-main-color)' };
|
|
182
182
|
}
|
|
183
183
|
if (!(0, exports.inRangeTime)(timeValue, exports.startDate, exports.endDate)) {
|
|
184
184
|
additionProps = { 'in-range': 'false' };
|
|
@@ -186,7 +186,7 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
186
186
|
else if (!(0, exports.inRangeTime)(new Date(_this.state.selectYear, _this.state.selectMonth), (_a = _this.props.min) !== null && _a !== void 0 ? _a : exports.startDate, (_b = _this.props.max) !== null && _b !== void 0 ? _b : exports.endDate)) {
|
|
187
187
|
if (_this.state.selectYear === ((_c = _this.state.selectDate) === null || _c === void 0 ? void 0 : _c.getFullYear()) && _this.state.selectDate.getMonth() === i) {
|
|
188
188
|
style = {
|
|
189
|
-
color: 'var(--disabled-
|
|
189
|
+
color: 'var(--neutral-text-disabled-color)',
|
|
190
190
|
pointerEvents: 'none'
|
|
191
191
|
};
|
|
192
192
|
}
|
|
@@ -216,7 +216,7 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
216
216
|
var style = {};
|
|
217
217
|
var selected = false;
|
|
218
218
|
if (yearNumber === exports.today.getFullYear()) {
|
|
219
|
-
style = { borderColor: 'var(--infor-color)' };
|
|
219
|
+
style = { borderColor: 'var(--infor-main-color)' };
|
|
220
220
|
}
|
|
221
221
|
else if (yearNumber < (((_a = _this.props.min) !== null && _a !== void 0 ? _a : exports.startDate).getFullYear()) || yearNumber > (((_b = _this.props.max) !== null && _b !== void 0 ? _b : exports.endDate).getFullYear())) {
|
|
222
222
|
additionProps = { 'in-range': 'false' };
|
|
@@ -337,7 +337,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
337
337
|
}
|
|
338
338
|
}, footer: (this.props.pickerType === index_1.CalendarType.DATETIME || !this.props.hideButtonToday) && react_1.default.createElement("div", { className: 'row picker-popup-footer' },
|
|
339
339
|
this.props.pickerType === undefined || this.props.pickerType === index_1.CalendarType.DATE || this.props.pickerType === index_1.CalendarType.DATETIME ?
|
|
340
|
-
react_1.default.createElement("button", { type: 'button', className: 'row button-text-3', style: { color: 'var(--infor-color)', width: 'fit-content' }, onClick: function () {
|
|
340
|
+
react_1.default.createElement("button", { type: 'button', className: 'row button-text-3', style: { color: 'var(--infor-main-color)', width: 'fit-content' }, onClick: function () {
|
|
341
341
|
var _a;
|
|
342
342
|
var format = (_a = _this.props.formatDate) !== null && _a !== void 0 ? _a : (_this.props.pickerType === index_1.CalendarType.DATETIME ? 'dd/mm/yyyy hh:mm' : 'dd/mm/yyyy');
|
|
343
343
|
_this.setState(__assign(__assign({}, _this.state), { isOpen: false, value: dateToString(calendar_1.today, format) }));
|
|
@@ -280,8 +280,8 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
280
280
|
if (_this.state.value.length)
|
|
281
281
|
_this.setState(__assign(__assign({}, _this.state), { isOpen: true, value: [] }));
|
|
282
282
|
} },
|
|
283
|
-
react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faXmarkCircle, style: { fontSize: '1.6rem', color: "var(--neutral-text-color
|
|
284
|
-
react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: this.state.isOpen ? free_solid_svg_icons_1.faChevronUp : free_solid_svg_icons_1.faChevronDown, style: { fontSize: '1.1rem', color: "var(--neutral-text-color
|
|
283
|
+
react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faXmarkCircle, style: { fontSize: '1.6rem', color: "var(--neutral-text-subtitle-color)" } })) : react_1.default.createElement("div", { className: 'row', style: { display: (this.containerRef.current && this.containerRef.current.getBoundingClientRect().width >= 120) ? "flex" : "none" } },
|
|
284
|
+
react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: this.state.isOpen ? free_solid_svg_icons_1.faChevronUp : free_solid_svg_icons_1.faChevronDown, style: { fontSize: '1.1rem', color: "var(--neutral-text-subtitle-color)" } })),
|
|
285
285
|
this.state.isOpen &&
|
|
286
286
|
react_dom_1.default.createPortal(react_1.default.createElement("div", { className: "select-multi-popup col ".concat((_e = this.props.popupClassName) !== null && _e !== void 0 ? _e : ""), style: (_f = this.state.style) !== null && _f !== void 0 ? _f : {
|
|
287
287
|
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
@@ -305,7 +305,7 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
305
305
|
_this.setState(__assign(__assign({}, _this.state), { value: newValue }));
|
|
306
306
|
if (_this.props.onChange)
|
|
307
307
|
_this.props.onChange(newValue);
|
|
308
|
-
}, className: 'button-text-3', style: { color: _list.length ? 'var(--infor-color)' : '#00204D99', } }, _list.length && isSelectedAll ? 'Bỏ chọn tất cả' : 'Chọn tất cả');
|
|
308
|
+
}, className: 'button-text-3', style: { color: _list.length ? 'var(--infor-main-color)' : '#00204D99', } }, _list.length && isSelectedAll ? 'Bỏ chọn tất cả' : 'Chọn tất cả');
|
|
309
309
|
})()),
|
|
310
310
|
react_1.default.createElement("div", { className: 'col select-body' },
|
|
311
311
|
((_g = this.state.search) !== null && _g !== void 0 ? _g : this.state.options).filter(function (e) { return !e.parentId; }).map(function (item) { return _this.renderOptions(item); }),
|
|
@@ -22,7 +22,7 @@ var react_fontawesome_1 = require("@fortawesome/react-fontawesome");
|
|
|
22
22
|
var free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
|
|
23
23
|
var index_1 = require("../../index");
|
|
24
24
|
function ProgressBar(_a) {
|
|
25
|
-
var id = _a.id, _b = _a.status, status = _b === void 0 ? index_1.ComponentStatus.INFOR : _b, _c = _a.percent, percent = _c === void 0 ? 100 : _c, titleText = _a.titleText, title = _a.title, _d = _a.hideTitle, hideTitle = _d === void 0 ? false : _d, _e = _a.progressBarOnly, progressBarOnly = _e === void 0 ? false : _e, _f = _a.fullColor, fullColor = _f === void 0 ? 'var(--neutral-background-
|
|
25
|
+
var id = _a.id, _b = _a.status, status = _b === void 0 ? index_1.ComponentStatus.INFOR : _b, _c = _a.percent, percent = _c === void 0 ? 100 : _c, titleText = _a.titleText, title = _a.title, _d = _a.hideTitle, hideTitle = _d === void 0 ? false : _d, _e = _a.progressBarOnly, progressBarOnly = _e === void 0 ? false : _e, _f = _a.fullColor, fullColor = _f === void 0 ? 'var(--neutral-main-background-color)' : _f, _g = _a.percentColor, percentColor = _g === void 0 ? 'var(--infor-main-color)' : _g, style = _a.style, progressBarStyle = _a.progressBarStyle;
|
|
26
26
|
var _h = (0, react_1.useState)(true), openDetails = _h[0], setOpenDetails = _h[1];
|
|
27
27
|
return react_2.default.createElement("div", { id: id, className: "progress-bar-container col", style: style ? __assign({ padding: progressBarOnly ? '0' : '1.6rem 2.4rem' }, style) : { padding: progressBarOnly ? '0' : '1.6rem 2.4rem' } },
|
|
28
28
|
(hideTitle || progressBarOnly) ? null : (title !== null && title !== void 0 ? title : react_2.default.createElement("div", { className: "progress-bar-title row" },
|
|
@@ -24,7 +24,7 @@ function ProgressCircle(_a) {
|
|
|
24
24
|
var strokeOffset = (1 - ((percent !== null && percent !== void 0 ? percent : 0) / 100)) * diameter;
|
|
25
25
|
return react_1.default.createElement("svg", { id: id, width: "100%", height: "100%", viewBox: "0 0 60 60", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: __assign({ width: 60, height: 60 }, (style !== null && style !== void 0 ? style : {})) },
|
|
26
26
|
react_1.default.createElement("path", { d: "M 30,30 m 0,-".concat(radius, " a ").concat(radius, ",").concat(radius, " 0 1 1 0,").concat(2 * radius, " a ").concat(radius, ",").concat(radius, " 0 1 1 0,-").concat(2 * radius), style: { fill: "none", stroke: strokeColor !== null && strokeColor !== void 0 ? strokeColor : "#E6EAF0", strokeWidth: strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : '4px', } }),
|
|
27
|
-
react_1.default.createElement("path", { d: "M 30,30 m 0,-".concat(radius, " a ").concat(radius, ",").concat(radius, " 0 1 1 0,").concat(2 * radius, " a ").concat(radius, ",").concat(radius, " 0 1 1 0,-").concat(2 * radius), style: { fill: fillColor !== null && fillColor !== void 0 ? fillColor : "none", stroke: percentColor !== null && percentColor !== void 0 ? percentColor : "var(--infor-color)", strokeWidth: strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : '4px', strokeLinecap: 'round', strokeDasharray: "".concat(diameter, "px ").concat(diameter, "px"), strokeDashoffset: "".concat(strokeOffset, "px") } }),
|
|
27
|
+
react_1.default.createElement("path", { d: "M 30,30 m 0,-".concat(radius, " a ").concat(radius, ",").concat(radius, " 0 1 1 0,").concat(2 * radius, " a ").concat(radius, ",").concat(radius, " 0 1 1 0,-").concat(2 * radius), style: { fill: fillColor !== null && fillColor !== void 0 ? fillColor : "none", stroke: percentColor !== null && percentColor !== void 0 ? percentColor : "var(--infor-main-color)", strokeWidth: strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : '4px', strokeLinecap: 'round', strokeDasharray: "".concat(diameter, "px ").concat(diameter, "px"), strokeDashoffset: "".concat(strokeOffset, "px") } }),
|
|
28
28
|
react_1.default.createElement("text", { x: "50%", y: "50%", fill: "#00204D", dy: ".3em", textAnchor: "middle", fontSize: 16, fontWeight: '600', style: textStyle }, percent !== null && percent !== void 0 ? percent : 0,
|
|
29
29
|
"%"));
|
|
30
30
|
}
|
|
@@ -41,7 +41,7 @@ var RadioButton = /** @class */ (function (_super) {
|
|
|
41
41
|
var _a, _b, _c;
|
|
42
42
|
var convertStyle = {
|
|
43
43
|
'--off-color': (_a = this.props.offColor) !== null && _a !== void 0 ? _a : '#ccd7e6',
|
|
44
|
-
'--active-color': (_b = this.props.activeColor) !== null && _b !== void 0 ? _b : 'var(--infor-color)',
|
|
44
|
+
'--active-color': (_b = this.props.activeColor) !== null && _b !== void 0 ? _b : 'var(--infor-main-color)',
|
|
45
45
|
'--size': this.props.size ? (typeof this.props.size === 'number') ? "".concat(this.props.size, "px") : this.props.size : '20px'
|
|
46
46
|
};
|
|
47
47
|
if (this.props.style) {
|
|
@@ -207,7 +207,7 @@ var Select1 = /** @class */ (function (_super) {
|
|
|
207
207
|
children = ((_a = this.state.search) !== null && _a !== void 0 ? _a : this.state.options).filter(function (e) { return e.parentId === item.id; });
|
|
208
208
|
//
|
|
209
209
|
return react_1.default.createElement("div", { key: item.id, className: 'col', style: { width: '100%' } },
|
|
210
|
-
react_1.default.createElement("div", { className: "".concat(select1_module_css_1.default['select-tile'], " row ").concat(item.disabled ? select1_module_css_1.default["disabled"] : ""), style: { paddingLeft: item.parentId ? '4.4rem' : undefined, backgroundColor: this.state.selected === item.id ? "var(--selected-background)" : undefined }, onClick: children.length ? function () {
|
|
210
|
+
react_1.default.createElement("div", { className: "".concat(select1_module_css_1.default['select-tile'], " row ").concat(item.disabled ? select1_module_css_1.default["disabled"] : ""), style: { paddingLeft: item.parentId ? '4.4rem' : undefined, backgroundColor: this.state.selected === item.id ? "var(--neutral-selected-background-color)" : undefined }, onClick: children.length ? function () {
|
|
211
211
|
if (_this.state.search) {
|
|
212
212
|
_this.setState(__assign(__assign({}, _this.state), { search: _this.state.search.map(function (e) {
|
|
213
213
|
if (e.id === item.id)
|
|
@@ -297,11 +297,11 @@ var Select1 = /** @class */ (function (_super) {
|
|
|
297
297
|
if (_this.state.value)
|
|
298
298
|
_this.setState(__assign(__assign({}, _this.state), { isOpen: true, value: undefined }));
|
|
299
299
|
} },
|
|
300
|
-
react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faXmarkCircle, style: { fontSize: '1.6rem', color: "var(--neutral-text-color
|
|
300
|
+
react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faXmarkCircle, style: { fontSize: '1.6rem', color: "var(--neutral-text-subtitle-color)" } })) : react_1.default.createElement("div", { ref: function (iconRef) {
|
|
301
301
|
if ((iconRef === null || iconRef === void 0 ? void 0 : iconRef.parentElement) && iconRef.parentElement.getBoundingClientRect().width < 120)
|
|
302
302
|
iconRef.style.display = "none";
|
|
303
303
|
}, className: 'row' },
|
|
304
|
-
react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: this.state.isOpen ? free_solid_svg_icons_1.faChevronUp : free_solid_svg_icons_1.faChevronDown, style: { fontSize: '1.1rem', color: "var(--neutral-text-color
|
|
304
|
+
react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: this.state.isOpen ? free_solid_svg_icons_1.faChevronUp : free_solid_svg_icons_1.faChevronDown, style: { fontSize: '1.1rem', color: "var(--neutral-text-subtitle-color)" } })),
|
|
305
305
|
this.state.isOpen &&
|
|
306
306
|
react_dom_1.default.createPortal(react_1.default.createElement("div", { className: "".concat(select1_module_css_1.default['select1-popup'], " col ").concat((_e = this.props.popupClassName) !== null && _e !== void 0 ? _e : ""), style: (_f = this.state.style) !== null && _f !== void 0 ? _f : {
|
|
307
307
|
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
@@ -52,8 +52,8 @@ var Switch = /** @class */ (function (_super) {
|
|
|
52
52
|
var _this = this;
|
|
53
53
|
var _a, _b, _c, _d;
|
|
54
54
|
var propStyle = {
|
|
55
|
-
'--off-bg': (_a = this.props.offBackground) !== null && _a !== void 0 ? _a : 'var(--neutral-background-
|
|
56
|
-
'--on-bg': (_b = this.props.onBackground) !== null && _b !== void 0 ? _b : 'var(--infor-color)',
|
|
55
|
+
'--off-bg': (_a = this.props.offBackground) !== null && _a !== void 0 ? _a : 'var(--neutral-main-background-color)',
|
|
56
|
+
'--on-bg': (_b = this.props.onBackground) !== null && _b !== void 0 ? _b : 'var(--infor-main-color)',
|
|
57
57
|
'--dot-color': (_c = this.props.dotColor) !== null && _c !== void 0 ? _c : '#ffffff',
|
|
58
58
|
'--size': this.props.size ? (typeof this.props.size === 'number') ? "".concat(this.props.size, "px") : this.props.size : '2rem'
|
|
59
59
|
};
|
|
@@ -8,7 +8,7 @@ interface TagProps {
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
style?: CSSProperties;
|
|
10
10
|
className?: string;
|
|
11
|
-
status
|
|
11
|
+
status?: ComponentStatus;
|
|
12
12
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
13
13
|
}
|
|
14
14
|
export declare class Tag extends React.Component<TagProps> {
|
|
@@ -22,7 +22,6 @@ exports.Tag = void 0;
|
|
|
22
22
|
var react_1 = __importDefault(require("react"));
|
|
23
23
|
var text_1 = require("../text/text");
|
|
24
24
|
var tag_module_css_1 = __importDefault(require("./tag.module.css"));
|
|
25
|
-
var component_status_1 = require("../component-status");
|
|
26
25
|
var Tag = /** @class */ (function (_super) {
|
|
27
26
|
__extends(Tag, _super);
|
|
28
27
|
function Tag() {
|
|
@@ -30,7 +29,7 @@ var Tag = /** @class */ (function (_super) {
|
|
|
30
29
|
}
|
|
31
30
|
Tag.prototype.render = function () {
|
|
32
31
|
var _a, _b;
|
|
33
|
-
return react_1.default.createElement("div", { id: this.props.id, "tag-type": (_a = this.state) !== null && _a !== void 0 ? _a :
|
|
32
|
+
return react_1.default.createElement("div", { id: this.props.id, "tag-type": (_a = this.state) !== null && _a !== void 0 ? _a : 'default', className: "".concat(tag_module_css_1.default['tag-container'], " row ").concat(this.props.onClick ? tag_module_css_1.default['type-button'] : '', " ").concat(this.props.disabled ? tag_module_css_1.default['disabled'] : "", " ").concat((_b = this.props.className) !== null && _b !== void 0 ? _b : "button-text-2", " "), style: this.props.style, onClick: this.props.onClick },
|
|
34
33
|
this.props.prefix,
|
|
35
34
|
react_1.default.createElement(text_1.Text, { maxLine: 1, className: tag_module_css_1.default['tag-label'] }, this.props.title),
|
|
36
35
|
this.props.suffix);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CSSProperties, ReactNode } from "react";
|
|
3
|
+
interface WiniconProps {
|
|
4
|
+
svg: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
size?: number | string;
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
10
|
+
export default function Winicon({ svg, className, style, size, color }: WiniconProps): React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
function Winicon(_a) {
|
|
8
|
+
var svg = _a.svg, className = _a.className, style = _a.style, size = _a.size, color = _a.color;
|
|
9
|
+
var modifiedSvg = react_1.default.cloneElement(svg, {
|
|
10
|
+
size: size,
|
|
11
|
+
fill: color, // Apply color to the fill attribute of the SVG
|
|
12
|
+
});
|
|
13
|
+
return react_1.default.createElement("div", { className: "wini-icon ".concat(className !== null && className !== void 0 ? className : ''), style: style }, modifiedSvg);
|
|
14
|
+
}
|
|
15
|
+
exports.default = Winicon;
|