oolib 2.82.2 → 2.82.3

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.
@@ -66,7 +66,7 @@ function DropdownMulti(_a) {
66
66
  S = _a.S, disabled = _a.disabled, broadcastShowOptions = _a.broadcastShowOptions;
67
67
  var theme = (0, styled_components_1.useTheme)();
68
68
  var props = arguments[0];
69
- var value = (0, getValue_1.getValue_MULTI)({ valueProp: valueProp, optionsFn: optionsFn, options: optionsProp, theme: theme });
69
+ var value = (0, getValue_1.getValue_MULTI)({ valueProp: valueProp, optionsFn: optionsFn, options: optionsProp, theme: theme, saveValueAsString: saveValueAsString });
70
70
  //1 INIT REFS
71
71
  var _b = (0, useCreateDropdownRefs_1.useCreateDropdownRefs)(), selectRef = _b.selectRef, dropdownRef = _b.dropdownRef;
72
72
  //2 INIT SHOW OPTIONS STATE
@@ -75,7 +75,7 @@ function DropdownSingle(_a) {
75
75
  ;
76
76
  var theme = (0, styled_components_1.useTheme)();
77
77
  var props = arguments[0];
78
- var value = (0, getValue_1.getValue_SINGLE)({ valueProp: valueProp, optionsFn: optionsFn, options: optionsProp, theme: theme });
78
+ var value = (0, getValue_1.getValue_SINGLE)({ valueProp: valueProp, optionsFn: optionsFn, options: optionsProp, theme: theme, saveValueAsString: saveValueAsString });
79
79
  //1 INIT REFS
80
80
  var _b = (0, useCreateDropdownRefs_1.useCreateDropdownRefs)(), selectRef = _b.selectRef, dropdownRef = _b.dropdownRef;
81
81
  //2 INIT SHOW OPTIONS STATE
@@ -1,12 +1,14 @@
1
- export function getValue_SINGLE({ valueProp, optionsFn, options, theme }: {
1
+ export function getValue_SINGLE({ valueProp, optionsFn, options, theme, saveValueAsString }: {
2
2
  valueProp: any;
3
3
  optionsFn: any;
4
4
  options: any;
5
5
  theme: any;
6
+ saveValueAsString: any;
6
7
  }): any;
7
- export function getValue_MULTI({ valueProp, optionsFn, options, theme }: {
8
+ export function getValue_MULTI({ valueProp, optionsFn, options, theme, saveValueAsString }: {
8
9
  valueProp: any;
9
10
  optionsFn: any;
10
11
  options: any;
11
12
  theme: any;
13
+ saveValueAsString: any;
12
14
  }): any;
@@ -9,18 +9,20 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.getValue_MULTI = exports.getValue_SINGLE = void 0;
11
11
  var getAllOptionsFns_1 = require("./getAllOptionsFns");
12
+ // Note: - saveValueAsString can be misleading here, because the value could be a string, integer, boolean values
13
+ // maybe we can rename to saveValueOnly, or some better name
12
14
  var getValue_SINGLE = function (_a) {
13
15
  var _b;
14
- var valueProp = _a.valueProp, optionsFn = _a.optionsFn, options = _a.options, theme = _a.theme;
15
- return !!valueProp === true && typeof valueProp === 'string'
16
+ var valueProp = _a.valueProp, optionsFn = _a.optionsFn, options = _a.options, theme = _a.theme, saveValueAsString = _a.saveValueAsString;
17
+ return saveValueAsString
16
18
  ? (optionsFn ? (_b = (0, getAllOptionsFns_1.getAllOptionsFns)(theme))[optionsFn.fn].apply(_b, (optionsFn.args || [])) : options).find(function (d) { return d.value === valueProp; })
17
19
  : valueProp;
18
20
  };
19
21
  exports.getValue_SINGLE = getValue_SINGLE;
20
22
  var getValue_MULTI = function (_a) {
21
- var valueProp = _a.valueProp, optionsFn = _a.optionsFn, options = _a.options, theme = _a.theme;
22
- return !!valueProp === true && valueProp.every(function (v) { return typeof v === 'string'; })
23
- ? valueProp.map(function (vProp) {
23
+ var valueProp = _a.valueProp, optionsFn = _a.optionsFn, options = _a.options, theme = _a.theme, saveValueAsString = _a.saveValueAsString;
24
+ return saveValueAsString
25
+ ? valueProp === null || valueProp === void 0 ? void 0 : valueProp.map(function (vProp) {
24
26
  var _a;
25
27
  return (optionsFn ? (_a = (0, getAllOptionsFns_1.getAllOptionsFns)(theme))[optionsFn.fn].apply(_a, (optionsFn.args || [])) : options).find(function (d) { return d.value === vProp; });
26
28
  })
@@ -3,6 +3,7 @@ export namespace icons {
3
3
  export { PencilLine };
4
4
  export { Plus };
5
5
  export { Lightbulb };
6
+ export { Tag };
6
7
  export { UploadSimple };
7
8
  export { CaretLeft };
8
9
  export { CaretRight };
@@ -161,6 +162,7 @@ import { PencilSimple } from "phosphor-react";
161
162
  import { PencilLine } from "phosphor-react";
162
163
  import { Plus } from "phosphor-react";
163
164
  import { Lightbulb } from "phosphor-react";
165
+ import { Tag } from "phosphor-react";
164
166
  import { UploadSimple } from "phosphor-react";
165
167
  import { CaretLeft } from "phosphor-react";
166
168
  import { CaretRight } from "phosphor-react";
@@ -8,6 +8,7 @@ exports.icons = {
8
8
  PencilLine: phosphor_react_1.PencilLine,
9
9
  Plus: phosphor_react_1.Plus,
10
10
  Lightbulb: phosphor_react_1.Lightbulb,
11
+ Tag: phosphor_react_1.Tag,
11
12
  UploadSimple: phosphor_react_1.UploadSimple,
12
13
  CaretLeft: phosphor_react_1.CaretLeft,
13
14
  CaretRight: phosphor_react_1.CaretRight,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.82.2",
3
+ "version": "2.82.3",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",