namirasoft-site-react 1.4.549 → 1.4.550

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,6 +1,6 @@
1
1
  import { IBaseComponentProps } from "../props/IBaseComponentProps";
2
2
  import { IImageProps } from "../props/IImageProps";
3
- import React from "react";
3
+ import { ButtonHTMLAttributes, Component } from "react";
4
4
  import { NSLoadingProps } from "./NSLoading";
5
5
  export interface NSButtonOnClickProps<ParameterType = any> {
6
6
  action: (onFinshied: () => void, parameters?: ParameterType) => void;
@@ -12,11 +12,12 @@ export interface NSButtonProps<ParameterType = any> extends IBaseComponentProps
12
12
  onClick: NSButtonOnClickProps<ParameterType>;
13
13
  disabled?: boolean;
14
14
  loading?: NSLoadingProps;
15
+ attributes?: ButtonHTMLAttributes<HTMLButtonElement>;
15
16
  }
16
17
  export interface NSButtonState {
17
18
  clicked: boolean;
18
19
  }
19
- export declare class NSButton extends React.Component<NSButtonProps, NSButtonState> {
20
+ export declare class NSButton extends Component<NSButtonProps, NSButtonState> {
20
21
  constructor(props: NSButtonProps);
21
22
  performClick(): void;
22
23
  render(): React.ReactNode;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Styles from "./NSButton.module.css";
3
- import React from "react";
3
+ import { Component } from "react";
4
4
  import { NSLoading } from "./NSLoading";
5
- export class NSButton extends React.Component {
5
+ export class NSButton extends Component {
6
6
  constructor(props) {
7
7
  super(props);
8
8
  this.state = { clicked: false };
@@ -26,9 +26,7 @@ export class NSButton extends React.Component {
26
26
  var _a, _b;
27
27
  if (this.state.clicked)
28
28
  return _jsx(NSLoading, Object.assign({ small: true, hideTitle: true, hideDescription: true }, this.props.loading));
29
- return (_jsxs("button", { id: this.props.id, className: `${this.props.disabled ? Styles.ns_button_disabled : Styles.ns_button} ${(_b = (_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")) !== null && _b !== void 0 ? _b : ""}`, style: this.props.style, onClick: () => {
30
- this.performClick();
31
- }, disabled: this.props.disabled, children: [this.props.icon && _jsx("img", Object.assign({}, this.props.icon, { alt: "Icon", width: 24, height: 24 })), this.props.title] }));
29
+ return (_jsxs("button", Object.assign({ id: this.props.id }, this.props.attributes, { disabled: this.props.disabled, style: this.props.style, className: `${this.props.disabled ? Styles.ns_button_disabled : Styles.ns_button} ${(_b = (_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")) !== null && _b !== void 0 ? _b : ""}`, onClick: () => this.performClick(), children: [this.props.icon && _jsx("img", Object.assign({}, this.props.icon, { alt: "Icon", width: 24, height: 24 })), this.props.title] })));
32
30
  }
33
31
  }
34
32
  ;
@@ -1 +1 @@
1
- {"version":3,"file":"NSButton.js","sourceRoot":"","sources":["../../src/components/NSButton.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAG3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AAsBxD,MAAM,OAAO,QAAS,SAAQ,KAAK,CAAC,SAAuC;IAEvE,YAAY,KAAoB;QAE5B,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IACD,YAAY;;QAER,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,KAAK,KAAK;YACxC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QACrC,IACA,CAAC;YACG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE;gBAE3B,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,C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K,CAAC,QAAQ,EAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,0CAAE,IAAI,CAAC,GAAG,CAAC,mCAAI,EAAE,EAAE,EAC3H,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,aAEjC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,8BAAS,IAAI,CAAC,KAAK,CAAC,IAAI,IAAE,GAAG,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EACjF,IAAI,CAAC,KAAK,CAAC,KAAK,KACX,CACb,CAAC;IACN,CAAC;CACJ;AAAA,CAAC"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.549",
11
+ "version": "1.4.550",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/main.js",
@@ -1,7 +1,7 @@
1
1
  import Styles from "./NSButton.module.css";
2
2
  import { IBaseComponentProps } from "../props/IBaseComponentProps";
3
3
  import { IImageProps } from "../props/IImageProps";
4
- import React from "react";
4
+ import { ButtonHTMLAttributes, Component } from "react";
5
5
  import { NSLoading, NSLoadingProps } from "./NSLoading";
6
6
 
7
7
  export interface NSButtonOnClickProps<ParameterType = any>
@@ -17,6 +17,7 @@ export interface NSButtonProps<ParameterType = any> extends IBaseComponentProps
17
17
  onClick: NSButtonOnClickProps<ParameterType>;
18
18
  disabled?: boolean;
19
19
  loading?: NSLoadingProps
20
+ attributes?: ButtonHTMLAttributes<HTMLButtonElement>
20
21
  }
21
22
 
22
23
  export interface NSButtonState
@@ -24,7 +25,7 @@ export interface NSButtonState
24
25
  clicked: boolean;
25
26
  }
26
27
 
27
- export class NSButton extends React.Component<NSButtonProps, NSButtonState>
28
+ export class NSButton extends Component<NSButtonProps, NSButtonState>
28
29
  {
29
30
  constructor(props: NSButtonProps)
30
31
  {
@@ -60,13 +61,11 @@ export class NSButton extends React.Component<NSButtonProps, NSButtonState>
60
61
 
61
62
  return (
62
63
  <button id={this.props.id}
63
- className={`${this.props.disabled ? Styles.ns_button_disabled : Styles.ns_button} ${this.props.classList?.join(" ") ?? ""}`}
64
- style={this.props.style}
65
- onClick={() =>
66
- {
67
- this.performClick();
68
- }}
64
+ {...this.props.attributes}
69
65
  disabled={this.props.disabled}
66
+ style={this.props.style}
67
+ className={`${this.props.disabled ? Styles.ns_button_disabled : Styles.ns_button} ${this.props.classList?.join(" ") ?? ""}`}
68
+ onClick={() => this.performClick()}
70
69
  >
71
70
  {this.props.icon && <img {...this.props.icon} alt="Icon" width={24} height={24} />}
72
71
  {this.props.title}