awing-library 2.1.2-dev.528 → 2.1.2-dev.529

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.
@@ -9,7 +9,7 @@ var __webpack_modules__ = {
9
9
  "AWING/DataInput": function(module) {
10
10
  module.exports = __WEBPACK_EXTERNAL_MODULE__DataInput_index_js_c7933a4f__;
11
11
  },
12
- "../helper": function(module) {
12
+ "AWING/helper": function(module) {
13
13
  module.exports = __WEBPACK_EXTERNAL_MODULE__helper_js_663c9e82__;
14
14
  }
15
15
  };
@@ -92,9 +92,9 @@ jest.mock('@mui/material', ()=>({
92
92
  })
93
93
  }));
94
94
  const mockInputFactory = __webpack_require__("AWING/DataInput")["default"];
95
- const mockCalculateValue = __webpack_require__("../helper").calculateValue;
96
- const mockConvertFormulaToBinaryTree = __webpack_require__("../helper").convertFormulaToBinaryTree;
97
- const mockReplaceFieldsValue = __webpack_require__("../helper").replaceFieldsValue;
95
+ const mockCalculateValue = __webpack_require__("AWING/helper").calculateValue;
96
+ const mockConvertFormulaToBinaryTree = __webpack_require__("AWING/helper").convertFormulaToBinaryTree;
97
+ const mockReplaceFieldsValue = __webpack_require__("AWING/helper").replaceFieldsValue;
98
98
  describe('DataForm Component', ()=>{
99
99
  const mockFields = [
100
100
  {
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/AWING/MultipleChoice/component.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,6BAA6B,EAAW,MAAM,aAAa,CAAC;AAarE,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,KAAK,EAAE,6BAA6B,2CAkHnF"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/AWING/MultipleChoice/component.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,6BAA6B,EAAW,MAAM,aAAa,CAAC;AAarE,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,KAAK,EAAE,6BAA6B,2CAwHnF"}
@@ -15,14 +15,17 @@ const useStyles = makeStyles({
15
15
  function MultipleChoiceComponent(props) {
16
16
  const classes = useStyles();
17
17
  const { label, selected, options, onChange, popupOpen = true, onOpen, onClose, variant, placeholder, error, helperText, operators, operator, onOperatorChange } = props;
18
- const renderTags = (options, getTagProps)=>options.map((option, i)=>/*#__PURE__*/ jsx(Chip, {
18
+ const renderTags = (options, getTagProps)=>options.map((option, i)=>{
19
+ const { key, ...tagProps } = getTagProps({
20
+ index: i
21
+ });
22
+ return /*#__PURE__*/ jsx(Chip, {
19
23
  label: option.name,
20
24
  title: option.name,
21
25
  size: "small",
22
- ...getTagProps({
23
- index: i
24
- })
25
- }));
26
+ ...tagProps
27
+ }, key);
28
+ });
26
29
  const renderInput = (params)=>/*#__PURE__*/ jsxs(Box, {
27
30
  style: {
28
31
  position: 'relative'
@@ -71,8 +74,10 @@ function MultipleChoiceComponent(props) {
71
74
  })
72
75
  ]
73
76
  });
74
- const renderOption = (props, option, { selected })=>/*#__PURE__*/ createElement(Box, {
75
- ...props,
77
+ const renderOption = (props, option, { selected })=>{
78
+ const { key: _key, ...optionProps } = props;
79
+ return /*#__PURE__*/ createElement(Box, {
80
+ ...optionProps,
76
81
  component: "li",
77
82
  key: option.id,
78
83
  style: {
@@ -90,6 +95,7 @@ function MultipleChoiceComponent(props) {
90
95
  })
91
96
  ]
92
97
  });
98
+ };
93
99
  return /*#__PURE__*/ jsx(Autocomplete, {
94
100
  className: operator ? classes.hideIndicator : '',
95
101
  size: "small",
@@ -100,6 +106,7 @@ function MultipleChoiceComponent(props) {
100
106
  onChange: onChange,
101
107
  value: selected,
102
108
  getOptionLabel: (option)=>option.name,
109
+ getOptionKey: (option)=>option.id,
103
110
  isOptionEqualToValue: (option, value)=>option?.id === value?.id,
104
111
  renderTags: renderTags,
105
112
  renderInput: renderInput,
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/AWING/MultipleHierarchicalChoice/component.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAoC,wCAAwC,EAAE,MAAM,aAAa,CAAC;AAazG,iBAAS,mCAAmC,CAAC,KAAK,EAAE,wCAAwC,2CA6H3F;AAED,eAAe,mCAAmC,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/AWING/MultipleHierarchicalChoice/component.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAoC,wCAAwC,EAAE,MAAM,aAAa,CAAC;AAazG,iBAAS,mCAAmC,CAAC,KAAK,EAAE,wCAAwC,2CAiI3F;AAED,eAAe,mCAAmC,CAAC"}
@@ -23,14 +23,17 @@ function MultipleHierarchicalChoiceComponent(props) {
23
23
  });
24
24
  return result;
25
25
  };
26
- const renderTags = (options, getTagProps)=>options.map((option, i)=>/*#__PURE__*/ jsx(Chip, {
26
+ const renderTags = (options, getTagProps)=>options.map((option, i)=>{
27
+ const { key, ...tagProps } = getTagProps({
28
+ index: i
29
+ });
30
+ return /*#__PURE__*/ jsx(Chip, {
27
31
  label: getTagName(option),
28
32
  title: getTagName(option),
29
33
  size: "small",
30
- ...getTagProps({
31
- index: i
32
- })
33
- }));
34
+ ...tagProps
35
+ }, key);
36
+ });
34
37
  const renderInput = (params)=>/*#__PURE__*/ jsxs(Box, {
35
38
  style: {
36
39
  position: 'relative'
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../../src/AWING/PlaceFilter/Input/AreaSelectField/component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,iBAAiB,EAOpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,iBAAiB,CAAC,gCAAgC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AACpI,UAAU,6BAA6B;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,gCAAgC,EAAE,CAAC;IAC5C,YAAY,EAAE,gCAAgC,EAAE,CAAC;IACjD,QAAQ,EAAE,oBAAoB,CAAC;CAClC;AAOD,QAAA,MAAM,wBAAwB,EAAE,EAAE,CAAC,6BAA6B,CA8C/D,CAAC;AACF,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../../src/AWING/PlaceFilter/Input/AreaSelectField/component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,iBAAiB,EAOpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAC1C,iBAAiB,CAAC,gCAAgC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,UAAU,CAAC,CACtF,CAAC;AACF,UAAU,6BAA6B;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,gCAAgC,EAAE,CAAC;IAC5C,YAAY,EAAE,gCAAgC,EAAE,CAAC;IACjD,QAAQ,EAAE,oBAAoB,CAAC;CAClC;AAMD,QAAA,MAAM,wBAAwB,EAAE,EAAE,CAAC,6BAA6B,CA8C/D,CAAC;AACF,eAAe,wBAAwB,CAAC"}
@@ -1,17 +1,16 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { Fragment, createElement } from "react";
3
2
  import { Autocomplete, Chip, ListSubheader, TextField } from "@mui/material";
4
- const renderTags = (options, getTagProps)=>options.map((option, i)=>/*#__PURE__*/ jsx(Fragment, {
5
- children: /*#__PURE__*/ createElement(Chip, {
6
- label: option.name,
7
- title: option.name,
8
- size: "small",
9
- ...getTagProps({
10
- index: i
11
- }),
12
- key: i
13
- })
14
- }, i));
3
+ const renderTags = (options, getTagProps)=>options.map((option, i)=>{
4
+ const { key, ...tagProps } = getTagProps({
5
+ index: i
6
+ });
7
+ return /*#__PURE__*/ jsx(Chip, {
8
+ label: option.name,
9
+ title: option.name,
10
+ size: "small",
11
+ ...tagProps
12
+ }, key);
13
+ });
15
14
  const AreaSelectFieldComponent = (props)=>{
16
15
  const { label, placeholder, options, areaSelected, onChange } = props;
17
16
  const renderInput = (params)=>/*#__PURE__*/ jsx(TextField, {
@@ -4,10 +4,5 @@ export declare const CustomSpan: import("@emotion/styled").StyledComponent<{
4
4
  as?: React.ElementType;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
6
6
  export declare const getTagInputDetail: ((tag: ITag) => import("react").FunctionComponentElement<import("@mui/material/OverridableComponent").DefaultComponentProps<import("@mui/material").TypographyTypeMap<{}, "span">>>[]) & import("lodash").MemoizedFunction;
7
- export declare const getTagTitle: (tag: ITag, numOfPreviousPlaces: number) => import("react").DetailedReactHTMLElement<{
8
- children: (string | import("react").FunctionComponentElement<{
9
- theme?: import("@emotion/react").Theme;
10
- as?: React.ElementType;
11
- } & import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement>>)[];
12
- }, HTMLElement>;
7
+ export declare const getTagTitle: (tag: ITag, numOfPreviousPlaces: number) => import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<HTMLElement>, HTMLElement>;
13
8
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/AWING/PlaceFilter/Tag/component/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,IAAI,EAAE,MAAM,6BAA6B,CAAC;AASjE,eAAO,MAAM,UAAU;;SAEL,MAElB,WAAW;2GADV,CAAC;AAsDF,eAAO,MAAM,iBAAiB,SAAiB,IAAI,+MAmBjD,CAAC;AACH,eAAO,MAAM,WAAW,QAAS,IAAI,uBAAuB,MAAM;;;aA3EhD,MAElB,WAAW;;eAqJV,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/AWING/PlaceFilter/Tag/component/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,IAAI,EAAE,MAAM,6BAA6B,CAAC;AASjE,eAAO,MAAM,UAAU;;SAEL,MAElB,WAAW;2GADV,CAAC;AAsDF,eAAO,MAAM,iBAAiB,SAAiB,IAAI,+MAmBjD,CAAC;AACH,eAAO,MAAM,WAAW,QAAS,IAAI,uBAAuB,MAAM,uGA4EjE,CAAC"}
@@ -128,20 +128,17 @@ const getTagTitle = (tag, numOfPreviousPlaces)=>{
128
128
  }
129
129
  });
130
130
  title = (title.length >= MAX_TAG_TITLE_LENGTH ? `${title.slice(0, MAX_TAG_TITLE_LENGTH - 1)}...` : title) || 'ALL';
131
- return createElement('span', {
132
- children: [
133
- `${title}: `,
134
- numOfPreviousPlaces === numOfPlaces ? createElement(CustomSpan, {
135
- color: NORMAL_COLOR,
136
- children: numOfPlaces
137
- }) : numOfPreviousPlaces < numOfPlaces ? createElement(CustomSpan, {
138
- color: POSITIVE_COLOR,
139
- children: `${numOfPlaces} (+${numOfPlaces - numOfPreviousPlaces})`
140
- }) : createElement(CustomSpan, {
141
- color: NEGATIVE_COLOR,
142
- children: `${numOfPlaces} (-${numOfPreviousPlaces - numOfPlaces})`
143
- })
144
- ]
131
+ let placeCountNode;
132
+ placeCountNode = numOfPreviousPlaces === numOfPlaces ? createElement(CustomSpan, {
133
+ color: NORMAL_COLOR,
134
+ children: numOfPlaces
135
+ }) : numOfPreviousPlaces < numOfPlaces ? createElement(CustomSpan, {
136
+ color: POSITIVE_COLOR,
137
+ children: `${numOfPlaces} (+${numOfPlaces - numOfPreviousPlaces})`
138
+ }) : createElement(CustomSpan, {
139
+ color: NEGATIVE_COLOR,
140
+ children: `${numOfPlaces} (-${numOfPreviousPlaces - numOfPlaces})`
145
141
  });
142
+ return createElement('span', null, `${title}: `, placeCountNode);
146
143
  };
147
144
  export { CustomSpan, getTagInputDetail, getTagTitle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.2-dev.528",
3
+ "version": "2.1.2-dev.529",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {