armtek-uikit-react 1.0.137 → 1.0.139

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/assets/fonts.scss CHANGED
@@ -4,12 +4,14 @@
4
4
  font-family: 'Material Symbols Outlined';
5
5
  font-style: normal;
6
6
  font-weight: 400;
7
+ font-display: swap;
7
8
  src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v133/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOej.woff2) format('woff2');
8
9
  }
9
10
 
10
11
  @font-face {
11
12
  font-family: 'Material Symbols Outlined';
12
13
  font-style: normal;
14
+ font-display: swap;
13
15
  font-weight: 700;
14
16
  src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v134/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzazHD_dY43zj-jCxv3fzvRNU22ZXGJpEpjC_1p-p_4MrImHCIJIZrDBIG-ej.woff2) format('woff2');
15
17
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"armtek-uikit-react","version":"1.0.137","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
1
+ {"name":"armtek-uikit-react","version":"1.0.139","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
package/types/theme.d.ts CHANGED
@@ -8,5 +8,6 @@ export type ThemeType = 'light' | 'dark';
8
8
  export type ColorType = 'primary' | 'secondary' | 'neutral';
9
9
  export type OptionType = {
10
10
  text: string;
11
- value?: string;
11
+ value: string;
12
+ disabled?: boolean;
12
13
  };
package/ui/Chip/Chip.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ComponentPropsWithoutRef, ElementType, MouseEvent, HTMLAttributes } from 'react';
2
2
  import { ColorStatusType, ColorThemeType, ColorType, SizeType, VariantType, ShapeType } from '../../types/theme';
3
- export type ChipProps<T extends ElementType = ElementType<HTMLAttributes<HTMLSpanElement>>> = Omit<ComponentPropsWithoutRef<T>, 'color'> & {
3
+ type OwnProps<T extends ElementType = ElementType<HTMLAttributes<HTMLSpanElement>>> = Omit<ComponentPropsWithoutRef<T>, 'color'> & {
4
4
  size?: Exclude<SizeType, 'large' | 'extraLarge'>;
5
5
  color?: ColorType | ColorThemeType | ColorStatusType;
6
6
  text?: string;
@@ -10,7 +10,7 @@ export type ChipProps<T extends ElementType = ElementType<HTMLAttributes<HTMLSpa
10
10
  shape?: ShapeType;
11
11
  as?: T;
12
12
  disabled?: boolean;
13
- className?: string;
14
13
  };
14
+ export type ChipProps<T extends ElementType = 'span'> = OwnProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof OwnProps<T>>;
15
15
  declare function Chip<T extends ElementType>(props: ChipProps<T>): import("react/jsx-runtime").JSX.Element;
16
16
  export default Chip;
package/ui/Chip/Chip.js CHANGED
@@ -14,11 +14,13 @@ function Chip(props) {
14
14
  color,
15
15
  className,
16
16
  children,
17
- disabled
17
+ disabled,
18
+ ...restProps
18
19
  } = props;
19
20
  let Component = as || 'span';
20
21
  return /*#__PURE__*/_jsx(_Fragment, {
21
22
  children: /*#__PURE__*/_jsx(Component, {
23
+ ...restProps,
22
24
  className: clsx('arm-chip', className, {
23
25
  'arm-chip_disabled': !!disabled
24
26
  }, ['arm-chip_' + size], ['arm-chip_' + variant], ['arm-chip_' + color], ['arm-chip_' + shape]),
@@ -10,6 +10,7 @@ export declare const Password: import("react").ForwardRefExoticComponent<{
10
10
  focused?: boolean | undefined;
11
11
  editable?: boolean | undefined;
12
12
  classes?: Partial<{
13
+ input: string;
13
14
  root: string;
14
15
  wrapper: string;
15
16
  }> | undefined;
@@ -35,8 +35,8 @@ type SelectOptionsType<T extends boolean> = {
35
35
  multiple?: T;
36
36
  onClick: (e: MouseEvent, option: OptionType) => void;
37
37
  listStyle?: 'checkbox' | 'default';
38
- onSelectAll?: () => void;
39
- onClearAll?: () => void;
38
+ onSelectAll?: (e: MouseEvent) => void;
39
+ onClearAll?: (e: MouseEvent) => void;
40
40
  onSubmit?: () => void;
41
41
  disabled?: boolean;
42
42
  };
@@ -8,7 +8,7 @@ import useClickOutside from "../../../lib/hooks/useClickOutside";
8
8
  import ButtonIcon from "../../ButtonIcon";
9
9
  import Adornment from "../../Adornment";
10
10
  import { SelectSummary, SelectSummaryChips } from "./SelectSummary";
11
- import Popover from "../../Popover";
11
+ import Popover from "../../Popover/Popover";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { Fragment as _Fragment } from "react/jsx-runtime";
14
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -52,8 +52,10 @@ function Select(props) {
52
52
  }
53
53
  };
54
54
  const handleSelect = (e, option) => {
55
+ if (option.disabled || props.disabled) return;
55
56
  let v = getOptionValue(option);
56
- let mSelected = Array.isArray(selected) ? selected : [selected];
57
+ const realSelected = value !== undefined ? value : selected;
58
+ let mSelected = Array.isArray(realSelected) ? realSelected : [realSelected];
57
59
  let newValueS = v;
58
60
  let newValueM = mSelected.includes(v) ? mSelected.filter(item => item !== v) : mSelected.concat(v);
59
61
  setSelected(multiple ? newValueM : newValueS);
@@ -94,14 +96,34 @@ function Select(props) {
94
96
  })
95
97
  })]
96
98
  });
97
- const handleSelectAll = () => {
98
- let value = options.map(item => getOptionValue(item));
99
+ const handleSelectAll = e => {
100
+ if (props.disabled) return;
101
+ let value = options.filter(item => !item.disabled).map(item => getOptionValue(item));
99
102
  setSelected(value);
100
- if (onChange) onChange(value);
103
+ if (onChange) {
104
+ Object.defineProperty(e, 'target', {
105
+ writable: false,
106
+ value: {
107
+ name: props.name,
108
+ value
109
+ }
110
+ });
111
+ onChange(e);
112
+ }
101
113
  };
102
- const handleResetAll = () => {
114
+ const handleResetAll = e => {
115
+ if (props.disabled) return;
103
116
  setSelected([]);
104
- if (onChange) onChange([]);
117
+ if (onChange) {
118
+ Object.defineProperty(e, 'target', {
119
+ writable: false,
120
+ value: {
121
+ name: props.name,
122
+ value: []
123
+ }
124
+ });
125
+ onChange(e);
126
+ }
105
127
  };
106
128
  const handleSubmit = () => {
107
129
  if (open === undefined) setActive(false);else if (onSubmit) {
@@ -206,7 +228,7 @@ const SelectOptions = /*#__PURE__*/forwardRef((props, ref) => {
206
228
  let active = multiple === true && value ? value.includes(optValue) : optValue === value;
207
229
  let checked = listStyle === 'checkbox' && !!multiple ? active : undefined;
208
230
  return /*#__PURE__*/_jsx(ListItem, {
209
- disabled: disabled,
231
+ disabled: disabled || !!item.disabled,
210
232
  checked: checked,
211
233
  active: active,
212
234
  onClick: e => onClick(e, item),
@@ -5,9 +5,9 @@ export type SelectSummaryProps = {
5
5
  label_uncheck_all?: string;
6
6
  label_submit?: string;
7
7
  onClose: (e: MouseEvent, option: OptionType) => void;
8
- onSelectAll?: () => void;
9
- onClearAll?: () => void;
10
- onSubmit?: () => void;
8
+ onSelectAll?: (e: MouseEvent) => void;
9
+ onClearAll?: (e: MouseEvent) => void;
10
+ onSubmit?: (e: MouseEvent) => void;
11
11
  options: OptionType[];
12
12
  value: string[];
13
13
  disabled?: boolean;
@@ -32,7 +32,8 @@ const TextArea = props => {
32
32
  onChange: handleChange,
33
33
  multiline: true,
34
34
  classes: {
35
- root: 'arm-textarea__root'
35
+ root: 'arm-textarea__root',
36
+ ...restProps.classes
36
37
  },
37
38
  style: {
38
39
  height: textHeight + 'px'
@@ -1,6 +1,6 @@
1
1
  import { ElementType, HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
2
2
  import { SizeType, VariantType } from '../../../types/theme';
3
- type Classes = Record<'root' | 'wrapper', string>;
3
+ type Classes = Record<'root' | 'wrapper' | 'input', string>;
4
4
  export type TextFieldProps = {
5
5
  label?: string;
6
6
  size?: Exclude<SizeType, 'extraLarge' | 'medium'>;
@@ -76,6 +76,7 @@ export const TextField = /*#__PURE__*/forwardRef((props, ref) => {
76
76
  className: classes == null ? void 0 : classes.root,
77
77
  children: [/*#__PURE__*/_jsx(TextFieldInput, {
78
78
  wrapperClass: classes == null ? void 0 : classes.wrapper,
79
+ className: classes == null ? void 0 : classes.input,
79
80
  Component: Component,
80
81
  ref: inputRef,
81
82
  size: size,
@@ -1,4 +1,4 @@
1
- import { PopperBaseProps } from '../../ui/Popper';
1
+ import { PopperBaseProps } from '../Popper/PopperBase';
2
2
  type ClassesType = {
3
3
  paper: string;
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import BackDrop from "../BackDrop";
2
- import { PopperBase } from "../Popper";
2
+ import { PopperBase } from "../Popper/PopperBase";
3
3
  import Paper from "../Paper";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -9,19 +9,19 @@ export const Popover = props => {
9
9
  matchWidth = false,
10
10
  children,
11
11
  classes,
12
- ...poperProps
12
+ ...popperProps
13
13
  } = props;
14
- if (!props.open || !poperProps.anchorEl) return null;
14
+ if (!props.open || !popperProps.anchorEl) return null;
15
15
  return /*#__PURE__*/_jsx(_Fragment, {
16
16
  children: /*#__PURE__*/_jsx(BackDrop, {
17
17
  onClick: onClose,
18
18
  children: /*#__PURE__*/_jsx(PopperBase, {
19
- ...poperProps,
20
- anchorEl: poperProps.anchorEl,
19
+ ...popperProps,
20
+ anchorEl: popperProps.anchorEl,
21
21
  children: /*#__PURE__*/_jsx(Paper, {
22
22
  className: classes == null ? void 0 : classes.paper,
23
23
  style: matchWidth ? {
24
- width: poperProps.anchorEl.clientWidth
24
+ width: popperProps.anchorEl.clientWidth
25
25
  } : undefined,
26
26
  children: children
27
27
  })
@@ -11,3 +11,4 @@ export type PopperBaseProps = {
11
11
  placement?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
12
12
  };
13
13
  export declare const PopperBase: (props: PopperBaseProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default PopperBase;
@@ -50,4 +50,5 @@ export const PopperBase = props => {
50
50
  children: children
51
51
  })
52
52
  });
53
- };
53
+ };
54
+ export default PopperBase;