@xaypay/tui 0.0.73 → 0.0.75

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.
@@ -12,6 +12,7 @@ export const NewAutocomplete = ({
12
12
  getItem,
13
13
  required,
14
14
  disabled,
15
+ selected,
15
16
  errorSize,
16
17
  labelSize,
17
18
  errorColor,
@@ -140,7 +141,7 @@ export const NewAutocomplete = ({
140
141
  const optionList = (
141
142
  <>
142
143
  {
143
- show && innerOptions
144
+ show && innerOptions && !disabled
144
145
  ?
145
146
  innerOptions.length > 0
146
147
  ?
@@ -248,7 +249,7 @@ export const NewAutocomplete = ({
248
249
  }
249
250
 
250
251
  options && setInnerOptions(options);
251
- }, [options, options.length, getItem]);
252
+ }, [options, options?.length, getItem]);
252
253
 
253
254
  useEffect(() => {
254
255
  if (!change) {
@@ -256,6 +257,14 @@ export const NewAutocomplete = ({
256
257
  }
257
258
  }, [change]);
258
259
 
260
+ useEffect(() => {
261
+ if (selected) {
262
+ setInnerValue(selected);
263
+ } else {
264
+ setInnerValue('');
265
+ }
266
+ }, [selected, selected?.length]);
267
+
259
268
  return (
260
269
  <>
261
270
  {
@@ -354,6 +363,7 @@ NewAutocomplete.propTypes = {
354
363
  label: PropTypes.string,
355
364
  required: PropTypes.bool,
356
365
  disabled: PropTypes.bool,
366
+ selected: PropTypes.string,
357
367
  errorSize: PropTypes.string,
358
368
  labelSize: PropTypes.string,
359
369
  errorColor: PropTypes.string,
@@ -194,7 +194,7 @@ export const Select = ({
194
194
  });
195
195
  setExistOptions(modifiedOptions);
196
196
  }
197
- }, [options, multiple, selected, selected.length]);
197
+ }, [options, multiple, selected, selected?.length]);
198
198
 
199
199
  return (
200
200
  <div className={classProps}>
@@ -564,4 +564,20 @@ import StackAlt from './assets/stackalt.svg';
564
564
  hiddenBackgroundColor: 'rgba(60, 57, 62, 0.4)', // for file place background color when hover on file place and there is a choosen file
565
565
  listItemBackgroundErrorColor: 'rgba(255, 0, 0, 0.7)', // for file multiple mode error background color
566
566
  }
567
+ ```
568
+
569
+ ### Modal
570
+ ```
571
+ {
572
+ radius: '14px', // for modal border radius
573
+ headerSize: '20px', // for modal header font size
574
+ imageWidth: '600px', // for modal image width on images mode
575
+ headerWeight: '600', // for modal header font weight
576
+ imageHeight: '300px', // for modal image height on images mode
577
+ headerHeight: '27px', // for modal header height
578
+ headerColor: '#00236a', // for modal header color
579
+ backgroundColor: 'white', // for modal background color
580
+ padding: '10px 20px 20px', // for modal padding
581
+ layerBackgroundColor: 'rgba(0,0,0,0.4)', // for modal parent layer background color
582
+ }
567
583
  ```
@@ -11,6 +11,7 @@ import StackAlt from './assets/stackalt.svg';
11
11
  import fileImage from './static/file-usage.png';
12
12
  import captcha from './static/captcha-usage.png';
13
13
  import inputImage from './static/input-usage.png';
14
+ import modalImage from './static/modal-usage.png';
14
15
  import buttonImage from './static/button-usage.png';
15
16
  import selectImage from './static/select-usage.png';
16
17
  import toastImage from './static/toaster-usage.png';
@@ -165,4 +166,7 @@ import autocompleteImage from './static/autocomplete-usage.png';
165
166
  <img src={fileImage} alt="file image" />
166
167
 
167
168
  ### NewFile in Single Mode
168
- <img src={fileSingleImage} alt="file image" />
169
+ <img src={fileSingleImage} alt="file image" />
170
+
171
+ ### Modal
172
+ <img src={modalImage} alt="file image" />
package/tui.config.js CHANGED
@@ -361,5 +361,18 @@ module.exports = {
361
361
  putFileHere: 'Տեղադրել ֆայլը այստեղ', // for file place text
362
362
  hiddenBackgroundColor: 'rgba(60, 57, 62, 0.4)', // for file place background color when hover on file place and there is a choosen file
363
363
  listItemBackgroundErrorColor: 'rgba(255, 0, 0, 0.7)', // for file multiple mode error background color
364
+ },
365
+ // default properties for <Modal /> component
366
+ MODAL: {
367
+ radius: '14px', // for modal border radius
368
+ headerSize: '20px', // for modal header font size
369
+ imageWidth: '600px', // for modal image width on images mode
370
+ headerWeight: '600', // for modal header font weight
371
+ imageHeight: '300px', // for modal image height on images mode
372
+ headerHeight: '27px', // for modal header height
373
+ headerColor: '#00236a', // for modal header color
374
+ backgroundColor: 'white', // for modal background color
375
+ padding: '10px 20px 20px', // for modal padding
376
+ layerBackgroundColor: 'rgba(0,0,0,0.4)', // for modal parent layer background color
364
377
  }
365
378
  };