namirasoft-site-react 1.4.53 → 1.4.56

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.
Files changed (97) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/App.js.map +1 -1
  3. package/dist/components/NSBoxBoolean.d.ts +3 -3
  4. package/dist/components/NSBoxBoolean.js +8 -4
  5. package/dist/components/NSBoxBoolean.js.map +1 -1
  6. package/dist/components/NSBoxBoolean.module.css +17 -4
  7. package/dist/components/NSBoxBooleans.d.ts +2 -2
  8. package/dist/components/NSBoxBooleans.js +6 -4
  9. package/dist/components/NSBoxBooleans.js.map +1 -1
  10. package/dist/components/NSBoxCombo.d.ts +3 -3
  11. package/dist/components/NSBoxCombo.js +8 -4
  12. package/dist/components/NSBoxCombo.js.map +1 -1
  13. package/dist/components/NSBoxDate.d.ts +2 -2
  14. package/dist/components/NSBoxDate.js +4 -2
  15. package/dist/components/NSBoxDate.js.map +1 -1
  16. package/dist/components/NSBoxDateTime.d.ts +2 -2
  17. package/dist/components/NSBoxDateTime.js +4 -2
  18. package/dist/components/NSBoxDateTime.js.map +1 -1
  19. package/dist/components/NSBoxDouble.d.ts +2 -2
  20. package/dist/components/NSBoxDouble.js +4 -2
  21. package/dist/components/NSBoxDouble.js.map +1 -1
  22. package/dist/components/NSBoxDuration.d.ts +2 -2
  23. package/dist/components/NSBoxDuration.js +4 -2
  24. package/dist/components/NSBoxDuration.js.map +1 -1
  25. package/dist/components/NSBoxEmail.d.ts +2 -2
  26. package/dist/components/NSBoxEmail.js +8 -7
  27. package/dist/components/NSBoxEmail.js.map +1 -1
  28. package/dist/components/NSBoxEntity.d.ts +4 -4
  29. package/dist/components/NSBoxEntity.js +11 -7
  30. package/dist/components/NSBoxEntity.js.map +1 -1
  31. package/dist/components/NSBoxEnum.d.ts +2 -2
  32. package/dist/components/NSBoxEnum.js +4 -4
  33. package/dist/components/NSBoxEnum.js.map +1 -1
  34. package/dist/components/NSBoxIPV4.d.ts +2 -2
  35. package/dist/components/NSBoxIPV4.js +4 -2
  36. package/dist/components/NSBoxIPV4.js.map +1 -1
  37. package/dist/components/NSBoxIPV6.d.ts +2 -2
  38. package/dist/components/NSBoxIPV6.js +4 -2
  39. package/dist/components/NSBoxIPV6.js.map +1 -1
  40. package/dist/components/NSBoxInteger.d.ts +2 -2
  41. package/dist/components/NSBoxInteger.js +4 -2
  42. package/dist/components/NSBoxInteger.js.map +1 -1
  43. package/dist/components/NSBoxPassword.d.ts +2 -2
  44. package/dist/components/NSBoxPassword.js +4 -2
  45. package/dist/components/NSBoxPassword.js.map +1 -1
  46. package/dist/components/NSBoxPrice.d.ts +2 -2
  47. package/dist/components/NSBoxPrice.js +4 -2
  48. package/dist/components/NSBoxPrice.js.map +1 -1
  49. package/dist/components/NSBoxRadio.d.ts +3 -3
  50. package/dist/components/NSBoxRadio.js +6 -4
  51. package/dist/components/NSBoxRadio.js.map +1 -1
  52. package/dist/components/NSBoxSearch.d.ts +2 -2
  53. package/dist/components/NSBoxSearch.js +4 -2
  54. package/dist/components/NSBoxSearch.js.map +1 -1
  55. package/dist/components/NSBoxString.d.ts +2 -2
  56. package/dist/components/NSBoxString.js +4 -2
  57. package/dist/components/NSBoxString.js.map +1 -1
  58. package/dist/components/NSBoxTextArea.d.ts +2 -2
  59. package/dist/components/NSBoxTextArea.js +4 -2
  60. package/dist/components/NSBoxTextArea.js.map +1 -1
  61. package/dist/components/NSBoxTime.d.ts +2 -2
  62. package/dist/components/NSBoxTime.js +4 -2
  63. package/dist/components/NSBoxTime.js.map +1 -1
  64. package/dist/components/NSPageSelectionModal.js +1 -1
  65. package/dist/components/NSPageSelectionModal.js.map +1 -1
  66. package/dist/components/NSTabPage.module.css +1 -1
  67. package/dist/components/NSTag.d.ts +3 -2
  68. package/dist/components/NSTag.js +4 -4
  69. package/dist/components/NSTag.js.map +1 -1
  70. package/package.json +2 -2
  71. package/src/App.css +28 -0
  72. package/src/App.tsx +5 -1
  73. package/src/components/NSBoxBoolean.module.css +17 -4
  74. package/src/components/NSBoxBoolean.tsx +9 -5
  75. package/src/components/NSBoxBooleans.tsx +7 -5
  76. package/src/components/NSBoxCombo.tsx +9 -5
  77. package/src/components/NSBoxDate.tsx +5 -3
  78. package/src/components/NSBoxDateTime.tsx +5 -3
  79. package/src/components/NSBoxDouble.tsx +5 -3
  80. package/src/components/NSBoxDuration.tsx +5 -3
  81. package/src/components/NSBoxEmail.tsx +8 -8
  82. package/src/components/NSBoxEntity.tsx +12 -8
  83. package/src/components/NSBoxEnum.tsx +5 -5
  84. package/src/components/NSBoxIPV4.tsx +5 -3
  85. package/src/components/NSBoxIPV6.tsx +5 -3
  86. package/src/components/NSBoxInteger.tsx +5 -3
  87. package/src/components/NSBoxPassword.tsx +5 -3
  88. package/src/components/NSBoxPhone.tsx +3 -3
  89. package/src/components/NSBoxPrice.tsx +5 -3
  90. package/src/components/NSBoxRadio.tsx +10 -6
  91. package/src/components/NSBoxSearch.tsx +5 -3
  92. package/src/components/NSBoxString.tsx +5 -3
  93. package/src/components/NSBoxTextArea.tsx +5 -3
  94. package/src/components/NSBoxTime.tsx +5 -3
  95. package/src/components/NSPageSelectionModal.tsx +205 -205
  96. package/src/components/NSTabPage.module.css +1 -1
  97. package/src/components/NSTag.tsx +5 -5
@@ -15,8 +15,8 @@ export interface INSBoxPhoneProps extends IBaseComponentProps, IValidationProps,
15
15
  title: string;
16
16
  placeholder?: string;
17
17
  defaultValue?: string;
18
- onChanged?: (e: NSBoxPhone) => void;
19
- onClicked?: (e: NSBoxPhone) => void;
18
+ onChanged?: (e: NSBoxPhone) => void; //todo: Useless onChanged
19
+ onClicked?: (e: NSBoxPhone) => void; //todo: Useless onClicked
20
20
  }
21
21
 
22
22
  export interface INSBoxPhoneState
@@ -62,7 +62,7 @@ export class NSBoxPhone extends React.Component<INSBoxPhoneProps, INSBoxPhoneSta
62
62
  return '+' + cleanedNumber.replace(/^\++/, '');
63
63
  }
64
64
 
65
- setValue(value: string): void
65
+ setValue(value: string): void //todo: Pass Callback give type error
66
66
  {
67
67
  this.setState({ value });
68
68
  }
@@ -13,7 +13,7 @@ export interface INSBoxPriceProps extends IBaseComponentProps, IValidationProps,
13
13
  title: string;
14
14
  placeholder?: number;
15
15
  defaultValue?: number;
16
- onChanged?: (e: NSBoxPrice) => void;
16
+ onChanged?: (e: NSBoxPrice, callback?: () => void) => void;
17
17
  onClicked?: (e: NSBoxPrice) => void;
18
18
  }
19
19
 
@@ -53,12 +53,14 @@ export class NSBoxPrice extends React.Component<INSBoxPriceProps, INSBoxPriceSta
53
53
  }
54
54
  return this.state.value;
55
55
  }
56
- setValue(value: number | undefined): void
56
+ setValue(value: number | undefined, callback?: () => void): void
57
57
  {
58
58
  this.setState({ value }, () =>
59
59
  {
60
60
  if (this.props.onChanged)
61
- this.props.onChanged(this);
61
+ this.props.onChanged(this, callback);
62
+ else if (callback)
63
+ callback();
62
64
  });
63
65
  }
64
66
  private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
@@ -12,8 +12,8 @@ export interface INSBoxRadioProps extends IBaseComponentProps, IValidationProps,
12
12
  placeholder?: string;
13
13
  defaultValue?: boolean;
14
14
  isSelected?: boolean;
15
- onChanged?: (e: NSBoxRadio) => void;
16
- onClick?: () => void;
15
+ onChanged?: (e: NSBoxRadio, callback?: () => void) => void;
16
+ onClicked?: () => void;
17
17
  }
18
18
 
19
19
  export interface NSBoxBooleanState
@@ -52,20 +52,23 @@ export class NSBoxRadio extends React.Component<INSBoxRadioProps, NSBoxBooleanSt
52
52
  return this.state.value;
53
53
  }
54
54
 
55
- setValue(value: boolean): void
55
+ setValue(value: boolean, callback?: () => void): void
56
56
  {
57
57
  this.setState({ value }, () =>
58
58
  {
59
59
  if (this.props.onChanged)
60
- this.props.onChanged(this);
60
+ this.props.onChanged(this, callback);
61
+ else if (callback)
62
+ callback();
61
63
  });
62
64
  }
63
65
 
64
66
  private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
65
67
  {
66
68
  this.setValue(e.target.checked);
67
- if (this.props.onClick)
68
- this.props.onClick();
69
+ //todo: onClicked should call here or pass as attribute to input element -> line: 99 ?
70
+ if (this.props.onClicked)
71
+ this.props.onClicked();
69
72
  }
70
73
 
71
74
  override componentDidUpdate(prevProps: INSBoxRadioProps)
@@ -94,6 +97,7 @@ export class NSBoxRadio extends React.Component<INSBoxRadioProps, NSBoxBooleanSt
94
97
  className={Styles.ns_input}
95
98
  checked={this.state.value}
96
99
  onChange={this.onChanged}
100
+ // onClick={this.props.onClicked}
97
101
  />
98
102
  <span className={Styles.ns_input_title}>
99
103
  {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title}
@@ -13,7 +13,7 @@ export interface INSBoxSearchProps extends IBaseComponentProps, IValidationProps
13
13
  title: string;
14
14
  placeholder?: string;
15
15
  defaultValue?: string;
16
- onChanged?: (e: NSBoxSearch) => void;
16
+ onChanged?: (e: NSBoxSearch, callback?: () => void) => void;
17
17
  onClicked?: (e: NSBoxSearch) => void;
18
18
  }
19
19
 
@@ -55,12 +55,14 @@ export class NSBoxSearch extends React.Component<INSBoxSearchProps, INSBoxSearch
55
55
  }
56
56
  return this.state.value;
57
57
  }
58
- setValue(value: string): void
58
+ setValue(value: string, callback?: () => void): void
59
59
  {
60
60
  this.setState({ value }, () =>
61
61
  {
62
62
  if (this.props.onChanged)
63
- this.props.onChanged(this);
63
+ this.props.onChanged(this, callback);
64
+ else if (callback)
65
+ callback();
64
66
  });
65
67
  }
66
68
  private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
@@ -13,7 +13,7 @@ export interface INSBoxStringProps extends IBaseComponentProps, IValidationProps
13
13
  title: string;
14
14
  placeholder?: string;
15
15
  defaultValue?: string;
16
- onChanged?: (e: NSBoxString) => void;
16
+ onChanged?: (e: NSBoxString, callback?: () => void) => void;
17
17
  onClicked?: (e: NSBoxString) => void;
18
18
  getError?: (value: string) => string | null;
19
19
  }
@@ -60,12 +60,14 @@ export class NSBoxString extends React.Component<INSBoxStringProps, INSBoxString
60
60
  }
61
61
  return this.state.value;
62
62
  }
63
- setValue(value: string): void
63
+ setValue(value: string, callback?: () => void): void
64
64
  {
65
65
  this.setState({ value }, () =>
66
66
  {
67
67
  if (this.props.onChanged)
68
- this.props.onChanged(this);
68
+ this.props.onChanged(this, callback);
69
+ else if (callback)
70
+ callback();
69
71
  });
70
72
  }
71
73
  private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
@@ -14,7 +14,7 @@ export interface INSBoxTextAreaProps extends IBaseComponentProps, IValidationPro
14
14
  title: string;
15
15
  placeholder?: string;
16
16
  defaultValue?: string;
17
- onChanged?: (e: NSBoxTextArea) => void;
17
+ onChanged?: (e: NSBoxTextArea, callback?: () => void) => void;
18
18
  onClicked?: (e: NSBoxTextArea) => void;
19
19
  cols?: number;
20
20
  rows?: number;
@@ -58,12 +58,14 @@ export class NSBoxTextArea extends React.Component<INSBoxTextAreaProps, INSBoxTe
58
58
  }
59
59
  return this.state.value;
60
60
  }
61
- setValue(value: string): void
61
+ setValue(value: string, callback?: () => void): void
62
62
  {
63
63
  this.setState({ value }, () =>
64
64
  {
65
65
  if (this.props.onChanged)
66
- this.props.onChanged(this);
66
+ this.props.onChanged(this, callback);
67
+ else if (callback)
68
+ callback();
67
69
  }
68
70
  );
69
71
  }
@@ -13,7 +13,7 @@ export interface INSBoxTimeProps extends IBaseComponentProps, IValidationProps,
13
13
  title: string;
14
14
  placeholder?: string;
15
15
  defaultValue?: string;
16
- onChanged?: (e: NSBoxTime) => void;
16
+ onChanged?: (e: NSBoxTime, callback?: () => void) => void;
17
17
  onClicked?: (e: NSBoxTime) => void;
18
18
  }
19
19
 
@@ -54,12 +54,14 @@ export class NSBoxTime extends React.Component<INSBoxTimeProps, INSBoxTimeState>
54
54
  }
55
55
  return this.state.value;
56
56
  }
57
- setValue(value: string): void
57
+ setValue(value: string, callback?: () => void): void
58
58
  {
59
59
  this.setState({ value }, () =>
60
60
  {
61
61
  if (this.props.onChanged)
62
- this.props.onChanged(this);
62
+ this.props.onChanged(this, callback);
63
+ else if (callback)
64
+ callback();
63
65
  });
64
66
  }
65
67
  private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
@@ -7,223 +7,223 @@ import { NSBoxRadio } from './NSBoxRadio';
7
7
 
8
8
  export interface NSPageSelectionModalProps<RowType>
9
9
  {
10
- current_page: number;
11
- max_page: number;
12
- onClose: () => void;
13
- getItems: (page: number, selected: boolean) => Promise<RowType[]>;
10
+ current_page: number;
11
+ max_page: number;
12
+ onClose: () => void;
13
+ getItems: (page: number, selected: boolean) => Promise<RowType[]>;
14
14
  onFinish: (items: RowType[]) => void;
15
15
  icon?: string;
16
16
  }
17
17
 
18
18
  interface NSPageSelectionModalState
19
19
  {
20
- selectedRadio: string;
20
+ selectedRadio: string;
21
21
  }
22
22
 
23
23
  export class NSPageSelectionModal<RowType> extends Component<NSPageSelectionModalProps<RowType>, NSPageSelectionModalState>
24
24
  {
25
- private toastRef: React.RefObject<HTMLDivElement> = createRef();
26
- private NSBoxBoolean_CurrentPage: React.RefObject<NSBoxRadio> = createRef();
27
- private NSBoxBoolean_SelectedItems: React.RefObject<NSBoxRadio> = createRef();
28
- private NSBoxBoolean_CustomPage: React.RefObject<NSBoxRadio> = createRef();
29
- private NSBoxBoolean_AllPage: React.RefObject<NSBoxRadio> = createRef();
30
- private NSBoxString_Pages: React.RefObject<NSBoxString> = createRef();
25
+ private toastRef: React.RefObject<HTMLDivElement> = createRef();
26
+ private NSBoxBoolean_CurrentPage: React.RefObject<NSBoxRadio> = createRef();
27
+ private NSBoxBoolean_SelectedItems: React.RefObject<NSBoxRadio> = createRef();
28
+ private NSBoxBoolean_CustomPage: React.RefObject<NSBoxRadio> = createRef();
29
+ private NSBoxBoolean_AllPage: React.RefObject<NSBoxRadio> = createRef();
30
+ private NSBoxString_Pages: React.RefObject<NSBoxString> = createRef();
31
31
 
32
- constructor(props: NSPageSelectionModalProps<RowType>)
33
- {
34
- super(props);
35
- this.state = {
36
- selectedRadio: 'current_page'
37
- };
38
- this.onClickOutside = this.onClickOutside.bind(this);
39
- this.handleRadioChange = this.handleRadioChange.bind(this);
40
- }
41
- override componentDidMount(): void
42
- {
43
- document.addEventListener('mousedown', this.onClickOutside);
44
- }
45
- override componentWillUnmount(): void
46
- {
47
- document.removeEventListener('mousedown', this.onClickOutside);
48
- }
49
- parseCustomPage(pages_value: string): number[]
50
- {
51
- let ans: number[] = [];
52
- let pages = pages_value.split(',').map(p => p.trim()).filter(p => p);
53
- for (let i = 0; i < pages.length; i++)
54
- {
55
- const element = pages[i];
56
- if (element.includes("-"))
57
- {
58
- let ps = element.split('-').map(p => p.trim());
59
- if (ps.length === 2)
60
- {
61
- let from = parseInt(ps[0]);
62
- let to = parseInt(ps[1]);
63
- for (let p = from; p <= to; p++)
64
- ans.push(p);
65
- }
66
- else
67
- throw new Error("Parse Error for : " + element);
68
- }
69
- else
70
- {
71
- let p = parseInt(element);
72
- ans.push(p);
73
- }
74
- }
75
- ans.forEach(p =>
76
- {
77
- if (p < 1)
78
- throw new Error("Page number must be more than equal to 1");
79
- if (p > this.props.max_page)
80
- throw new Error("Page number must be less than equal to " + this.props.max_page);
81
- })
82
- return ans;
83
- }
84
- private onClickOutside(event: MouseEvent)
85
- {
86
- if (this.toastRef.current && !this.toastRef.current.contains(event.target as Node))
87
- {
88
- this.props.onClose();
89
- }
90
- }
91
- private handleRadioChange(selectedRadio: string)
92
- {
93
- this.setState({ selectedRadio });
94
- }
95
- override render()
96
- {
97
- return (
98
- <>
99
- {
100
- <>
101
- <div className={Styles.ns_print_container} ref={this.toastRef}>
102
- <div className={Styles.ns_header_print}>
103
- <img
104
- src="https://static.namirasoft.com/image/concept/close/blue.svg"
105
- alt="Close"
106
- width={24}
107
- height={24}
108
- onClick={(e) =>
109
- {
110
- e.stopPropagation();
111
- this.props.onClose();
112
- }}
113
- className={Styles.ns_close_icon}
114
- />
115
- <div className={Styles.ns_print_title}>
116
- <img
117
- src={this.props.icon && this.props.icon}
118
- alt="Print"
119
- width={24}
120
- height={24}
121
- />
122
- <h2 className='m-0'>Page Selection</h2>
123
- </div>
124
- <NSSpace size={NSSpaceSizeType.SMALL} />
125
- <p className={Styles.ns_print_description}>Please select which pages you want to continue with</p>
126
- <NSSpace size={NSSpaceSizeType.SMALL} />
32
+ constructor(props: NSPageSelectionModalProps<RowType>)
33
+ {
34
+ super(props);
35
+ this.state = {
36
+ selectedRadio: 'current_page'
37
+ };
38
+ this.onClickOutside = this.onClickOutside.bind(this);
39
+ this.handleRadioChange = this.handleRadioChange.bind(this);
40
+ }
41
+ override componentDidMount(): void
42
+ {
43
+ document.addEventListener('mousedown', this.onClickOutside);
44
+ }
45
+ override componentWillUnmount(): void
46
+ {
47
+ document.removeEventListener('mousedown', this.onClickOutside);
48
+ }
49
+ parseCustomPage(pages_value: string): number[]
50
+ {
51
+ let ans: number[] = [];
52
+ let pages = pages_value.split(',').map(p => p.trim()).filter(p => p);
53
+ for (let i = 0; i < pages.length; i++)
54
+ {
55
+ const element = pages[i];
56
+ if (element.includes("-"))
57
+ {
58
+ let ps = element.split('-').map(p => p.trim());
59
+ if (ps.length === 2)
60
+ {
61
+ let from = parseInt(ps[0]);
62
+ let to = parseInt(ps[1]);
63
+ for (let p = from; p <= to; p++)
64
+ ans.push(p);
65
+ }
66
+ else
67
+ throw new Error("Parse Error for : " + element);
68
+ }
69
+ else
70
+ {
71
+ let p = parseInt(element);
72
+ ans.push(p);
73
+ }
74
+ }
75
+ ans.forEach(p =>
76
+ {
77
+ if (p < 1)
78
+ throw new Error("Page number must be more than equal to 1");
79
+ if (p > this.props.max_page)
80
+ throw new Error("Page number must be less than equal to " + this.props.max_page);
81
+ })
82
+ return ans;
83
+ }
84
+ private onClickOutside(event: MouseEvent)
85
+ {
86
+ if (this.toastRef.current && !this.toastRef.current.contains(event.target as Node))
87
+ {
88
+ this.props.onClose();
89
+ }
90
+ }
91
+ private handleRadioChange(selectedRadio: string)
92
+ {
93
+ this.setState({ selectedRadio });
94
+ }
95
+ override render()
96
+ {
97
+ return (
98
+ <>
99
+ {
100
+ <>
101
+ <div className={Styles.ns_print_container} ref={this.toastRef}>
102
+ <div className={Styles.ns_header_print}>
103
+ <img
104
+ src="https://static.namirasoft.com/image/concept/close/blue.svg"
105
+ alt="Close"
106
+ width={24}
107
+ height={24}
108
+ onClick={(e) =>
109
+ {
110
+ e.stopPropagation();
111
+ this.props.onClose();
112
+ }}
113
+ className={Styles.ns_close_icon}
114
+ />
115
+ <div className={Styles.ns_print_title}>
116
+ <img
117
+ src={this.props.icon && this.props.icon}
118
+ alt="Print"
119
+ width={24}
120
+ height={24}
121
+ />
122
+ <h2 className='m-0'>Page Selection</h2>
123
+ </div>
124
+ <NSSpace size={NSSpaceSizeType.SMALL} />
125
+ <p className={Styles.ns_print_description}>Please select which pages you want to continue with</p>
126
+ <NSSpace size={NSSpaceSizeType.SMALL} />
127
127
  <div className={Styles.ns_parent_checkboxs}>
128
128
  {/* todo: input id for check when click on labels */}
129
- <NSBoxRadio
130
- defaultValue={true}
131
- ref={this.NSBoxBoolean_CurrentPage}
132
- title={"Current page"}
133
- required={false}
134
- name={"PageSelection"}
135
- isSelected={this.state.selectedRadio === 'current_page'}
136
- onClick={() => this.handleRadioChange('current_page')}
137
- />
138
- <NSBoxRadio
139
- ref={this.NSBoxBoolean_SelectedItems}
140
- title={"Only Selected Items"}
141
- required={false}
142
- name={"PageSelection"}
143
- isSelected={this.state.selectedRadio === 'selected_items'}
144
- onClick={() => this.handleRadioChange('selected_items')}
145
- />
146
- <NSBoxRadio
147
- ref={this.NSBoxBoolean_CustomPage}
148
- title={"Custom Pages"}
149
- required={false}
150
- name={"PageSelection"}
151
- isSelected={this.state.selectedRadio === 'custom_page'}
152
- onClick={() => this.handleRadioChange('custom_page')}
153
- />
154
- <NSBoxRadio
155
- ref={this.NSBoxBoolean_AllPage}
156
- title={"All Pages"}
157
- required={false}
158
- name={"PageSelection"}
159
- isSelected={this.state.selectedRadio === 'all_page'}
160
- onClick={() => this.handleRadioChange('all_page')}
161
- />
162
- </div>
163
- <NSSpace size={NSSpaceSizeType.MICRO} />
164
- {this.state.selectedRadio === 'custom_page' && (
165
- <NSBoxString ref={this.NSBoxString_Pages} classList={[Styles.ns_w_box_string]} required={false} title="Custom Pages"
166
- getError={value =>
167
- {
168
- try
169
- {
170
- this.parseCustomPage(value);
171
- return null;
172
- } catch (error: any)
173
- {
174
- return error.message;
175
- }
176
- }} />
177
- )}
178
- <NSSpace size={NSSpaceSizeType.SMALL} />
179
- <NSButtonBlue style={{ width: "100%" }} title='Apply' onClick={async () =>
180
- {
181
- try
182
- {
183
- let items: RowType[] = [];
184
- if (this.NSBoxBoolean_CurrentPage.current?.getValue())
185
- {
186
- let is = await this.props.getItems(this.props.current_page, false);
187
- items.push(...is);
188
- }
189
- else if (this.NSBoxBoolean_SelectedItems.current?.getValue())
190
- {
191
- let is = await this.props.getItems(this.props.current_page, true);
192
- items.push(...is);
193
- }
194
- else if (this.NSBoxBoolean_CustomPage.current?.getValue())
195
- {
196
- let pages_value = this.NSBoxString_Pages.current?.getValue() ?? "";
197
- let pages = this.parseCustomPage(pages_value);
129
+ <NSBoxRadio
130
+ defaultValue={true}
131
+ ref={this.NSBoxBoolean_CurrentPage}
132
+ title={"Current page"}
133
+ required={false}
134
+ name={"PageSelection"}
135
+ isSelected={this.state.selectedRadio === 'current_page'}
136
+ onClicked={() => this.handleRadioChange('current_page')}
137
+ />
138
+ <NSBoxRadio
139
+ ref={this.NSBoxBoolean_SelectedItems}
140
+ title={"Only Selected Items"}
141
+ required={false}
142
+ name={"PageSelection"}
143
+ isSelected={this.state.selectedRadio === 'selected_items'}
144
+ onClicked={() => this.handleRadioChange('selected_items')}
145
+ />
146
+ <NSBoxRadio
147
+ ref={this.NSBoxBoolean_CustomPage}
148
+ title={"Custom Pages"}
149
+ required={false}
150
+ name={"PageSelection"}
151
+ isSelected={this.state.selectedRadio === 'custom_page'}
152
+ onClicked={() => this.handleRadioChange('custom_page')}
153
+ />
154
+ <NSBoxRadio
155
+ ref={this.NSBoxBoolean_AllPage}
156
+ title={"All Pages"}
157
+ required={false}
158
+ name={"PageSelection"}
159
+ isSelected={this.state.selectedRadio === 'all_page'}
160
+ onClicked={() => this.handleRadioChange('all_page')}
161
+ />
162
+ </div>
163
+ <NSSpace size={NSSpaceSizeType.MICRO} />
164
+ {this.state.selectedRadio === 'custom_page' && (
165
+ <NSBoxString ref={this.NSBoxString_Pages} classList={[Styles.ns_w_box_string]} required={false} title="Custom Pages"
166
+ getError={value =>
167
+ {
168
+ try
169
+ {
170
+ this.parseCustomPage(value);
171
+ return null;
172
+ } catch (error: any)
173
+ {
174
+ return error.message;
175
+ }
176
+ }} />
177
+ )}
178
+ <NSSpace size={NSSpaceSizeType.SMALL} />
179
+ <NSButtonBlue style={{ width: "100%" }} title='Apply' onClick={async () =>
180
+ {
181
+ try
182
+ {
183
+ let items: RowType[] = [];
184
+ if (this.NSBoxBoolean_CurrentPage.current?.getValue())
185
+ {
186
+ let is = await this.props.getItems(this.props.current_page, false);
187
+ items.push(...is);
188
+ }
189
+ else if (this.NSBoxBoolean_SelectedItems.current?.getValue())
190
+ {
191
+ let is = await this.props.getItems(this.props.current_page, true);
192
+ items.push(...is);
193
+ }
194
+ else if (this.NSBoxBoolean_CustomPage.current?.getValue())
195
+ {
196
+ let pages_value = this.NSBoxString_Pages.current?.getValue() ?? "";
197
+ let pages = this.parseCustomPage(pages_value);
198
198
 
199
- for (let p = 0; p < pages.length; p++)
200
- {
201
- let is = await this.props.getItems(pages[p], false);
202
- items.push(...is);
203
- }
204
- }
205
- else if (this.NSBoxBoolean_AllPage.current?.getValue())
206
- {
207
- for (let p = 1; p <= this.props.max_page; p++)
208
- {
209
- let is = await this.props.getItems(p, false);
210
- items.push(...is);
211
- }
212
- }
213
- else
214
- { }
215
- this.props.onFinish(items);
216
- } catch (error)
217
- {
218
- // todo
219
- }
220
- }} />
221
- </div>
222
- </div>
223
- <div className={Styles.ns_toast_background}></div>
224
- </>
225
- }
226
- </>
227
- );
228
- }
199
+ for (let p = 0; p < pages.length; p++)
200
+ {
201
+ let is = await this.props.getItems(pages[p], false);
202
+ items.push(...is);
203
+ }
204
+ }
205
+ else if (this.NSBoxBoolean_AllPage.current?.getValue())
206
+ {
207
+ for (let p = 1; p <= this.props.max_page; p++)
208
+ {
209
+ let is = await this.props.getItems(p, false);
210
+ items.push(...is);
211
+ }
212
+ }
213
+ else
214
+ { }
215
+ this.props.onFinish(items);
216
+ } catch (error)
217
+ {
218
+ // todo
219
+ }
220
+ }} />
221
+ </div>
222
+ </div>
223
+ <div className={Styles.ns_toast_background}></div>
224
+ </>
225
+ }
226
+ </>
227
+ );
228
+ }
229
229
  }
@@ -54,7 +54,7 @@
54
54
  padding: 16px;
55
55
  border-radius: 0 8px 8px 8px;
56
56
  background-color: #fff;
57
- display: grid;
57
+ display: grid !important;
58
58
  gap: 0;
59
59
  border-right: 1px solid #ccc;
60
60
  }