wini-web-components 1.7.1 → 1.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.
@@ -1,5 +1,4 @@
1
1
  import React, { CSSProperties } from "react";
2
- import './rating.css';
3
2
  interface RatingProps {
4
3
  id?: string;
5
4
  /**
@@ -7,7 +6,7 @@ interface RatingProps {
7
6
  */
8
7
  value?: number;
9
8
  size?: number | string;
10
- onChange?: (e: number) => {};
9
+ onChange?: (e: number) => void;
11
10
  className?: string;
12
11
  style?: CSSProperties;
13
12
  strokeColor?: string;
@@ -20,10 +20,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.Rating = void 0;
22
22
  var react_1 = __importDefault(require("react"));
23
- require("./rating.css");
24
- var autoKeyId = function () { return ("".concat(1e7 + -1e3 + -4e3 + -8e3 + -1e11)).replace(/[018]/g, function (c) {
25
- return (parseFloat(c) ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (parseFloat(c) / 4)))).toString(16);
26
- }); };
23
+ var rating_module_css_1 = __importDefault(require("./rating.module.css"));
24
+ var autoKeyId = function () { return window.crypto.randomUUID().replace(/-/g, ''); };
27
25
  var Rating = /** @class */ (function (_super) {
28
26
  __extends(Rating, _super);
29
27
  function Rating() {
@@ -44,7 +42,7 @@ var Rating = /** @class */ (function (_super) {
44
42
  Rating.prototype.render = function () {
45
43
  var _this = this;
46
44
  var _a;
47
- return react_1.default.createElement("div", { id: this.props.id, className: "row rating-container ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : ''), style: this.props.style }, Array.from({ length: 5 }).map(function (_, i) {
45
+ return react_1.default.createElement("div", { id: this.props.id, className: "row ".concat(rating_module_css_1.default['rating-container'], " ").concat((_a = this.props.className) !== null && _a !== void 0 ? _a : ''), style: this.props.style }, Array.from({ length: 5 }).map(function (_, i) {
48
46
  var _a, _b, _c, _d, _e;
49
47
  var uniqueId = 'rating-star-grad-0';
50
48
  var stopValue = 0;
@@ -279,7 +279,7 @@ var Select1 = /** @class */ (function (_super) {
279
279
  var _this = this;
280
280
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
281
281
  var _value = this.state.options.find(function (e) { return e.id === _this.state.value; });
282
- return react_1.default.createElement("div", { id: this.props.id, className: "".concat(select1_module_css_1.default['select1-container'], " row ").concat(this.props.disabled ? select1_module_css_1.default['disabled'] : '', " ").concat(((_a = this.props.helperText) === null || _a === void 0 ? void 0 : _a.length) && select1_module_css_1.default['helper-text'], " ").concat((_b = this.props.className) !== null && _b !== void 0 ? _b : 'body-3'), "helper-text": this.props.helperText, style: this.props.style ? __assign(__assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' }, onClick: function () {
282
+ return react_1.default.createElement("div", { id: this.props.id, ref: this.containerRef, className: "".concat(select1_module_css_1.default['select1-container'], " row ").concat(this.props.disabled ? select1_module_css_1.default['disabled'] : '', " ").concat(((_a = this.props.helperText) === null || _a === void 0 ? void 0 : _a.length) && select1_module_css_1.default['helper-text'], " ").concat((_b = this.props.className) !== null && _b !== void 0 ? _b : 'body-3'), "helper-text": this.props.helperText, style: this.props.style ? __assign(__assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' }, onClick: function () {
283
283
  var _a, _b, _c;
284
284
  if (!_this.state.isOpen) {
285
285
  _this.setState(__assign(__assign({}, _this.state), { isOpen: true, style: undefined, offset: (_b = (_a = _this.containerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect() }));