forstok-ui-lib 5.1.13 → 5.1.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "5.1.13",
3
+ "version": "5.1.15",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -9,8 +9,7 @@
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1",
11
11
  "build": "rollup -c --bundleConfigAsCjs",
12
- "patch": "npm run build && npm version patch && npm publish",
13
- "master": "git add . && git commit -m 'patch' && git push origin master"
12
+ "publish": "git add . && git commit -m 'patch' && git push origin master && npm run build && npm version patch && npm publish"
14
13
  },
15
14
  "repository": {
16
15
  "type": "git",
@@ -38,9 +38,10 @@ type TSelect = {
38
38
  'data-qa-id'?: string
39
39
  removeMessage?: TObject
40
40
  evCreateMessageQuestion?: TMessageQuestionFunction
41
+ isLoading?: boolean
41
42
  }
42
43
 
43
- const SelectComponent = ({ type, isError=false, mode, customOption, customLabel, MenuList, isCreateable=false, isClearable=false, selectKey, disabled, defaultValue, width, reset, setReset, isForceUpdate, setForceUpdate, isCheckAutoCopy, evChangeCustom, isField, evCreate, evChange, isMinOption, isMulti=false, options, name, placeholder, removeMessage, evCreateMessageQuestion, ...props }: TSelect) => {
44
+ const SelectComponent = ({ type, isError=false, mode, customOption, customLabel, MenuList, isCreateable=false, isClearable=false, selectKey, disabled, defaultValue, width, reset, setReset, isForceUpdate, setForceUpdate, isCheckAutoCopy, evChangeCustom, isField, evCreate, evChange, isMinOption, isMulti=false, options, name, placeholder, removeMessage, evCreateMessageQuestion, isLoading, ...props }: TSelect) => {
44
45
  const [valueState, setValue] = useState<typeof defaultValue>(defaultValue || null)
45
46
 
46
47
  useEffect(()=> {
@@ -240,18 +241,18 @@ const SelectComponent = ({ type, isError=false, mode, customOption, customLabel,
240
241
  color: (disabled ? '#ADADAD' : (mode === 'form' ? '#2d3c48' : 'initial')),
241
242
  opacity: disabled ? '.7' : 1,
242
243
  } as CSSObjectWithLabel),
243
- option: (provided: CSSObject, state: OptionProps<TOption, typeof isMulti>) => {
244
- console.log(state, disabled, "--- pr", provided)
245
- return ({
244
+ option: (provided: CSSObject, state: OptionProps<TOption, typeof isMulti>) => ({
246
245
  ...provided,
247
- // color: (disabled || state.isDisabled) ? '#ADADAD' : (state.isSelected ? '#ffffff' : '#000000'),
248
- // backgroundColor: (disabled || state.isDisabled) ? 'transparent' : (state.isSelected || state.isFocused ? '#fc5c64' : 'transparent'),
249
- // cursor: 'pointer',
250
- // '&:hover': {
251
- // backgroundColor: (disabled || state.isDisabled) ? 'transparent' : '#ec5b62',
252
- // color: (disabled || state.isDisabled) ? '#ADADAD' : '#ffffff'
253
- // }
254
- } as CSSObjectWithLabel)},
246
+ ...(!state.isDisabled && {
247
+ color: state.isSelected ? '#ffffff' : '#000000',
248
+ backgroundColor: state.isSelected || state.isFocused ? '#fc5c64' : 'transparent',
249
+ cursor: 'pointer',
250
+ '&:hover': {
251
+ backgroundColor: '#ec5b62',
252
+ color: '#ffffff'
253
+ }
254
+ })
255
+ } as CSSObjectWithLabel),
255
256
  menu: (provided: CSSObject) => ({
256
257
  ...provided,
257
258
  borderRadius: mode === 'filter' ? 'var(--sec-rd)' : 'var(--ter-rd)',
@@ -301,6 +302,7 @@ const SelectComponent = ({ type, isError=false, mode, customOption, customLabel,
301
302
  {...isMulti && { closeMenuOnSelect: false }}
302
303
  {...isMulti && { onBlur: handleBlur }}
303
304
  {...placeholder && { placeholder }}
305
+ {...isLoading && { isLoading: isLoading }}
304
306
  {...props} />
305
307
  :
306
308
  <ReactSelect
@@ -323,6 +325,7 @@ const SelectComponent = ({ type, isError=false, mode, customOption, customLabel,
323
325
  {...isMulti && { closeMenuOnSelect: false }}
324
326
  {...isMulti && { onBlur: handleBlur }}
325
327
  {...placeholder && { placeholder }}
328
+ {...isLoading && { isLoading: isLoading }}
326
329
  {...props} />
327
330
 
328
331
  return (