@vkontakte/vkui 6.7.0 → 6.7.1

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.
Files changed (99) hide show
  1. package/dist/cjs/components/BaseGallery/CarouselBase/CarouselBase.d.ts.map +1 -1
  2. package/dist/cjs/components/BaseGallery/CarouselBase/CarouselBase.js +9 -0
  3. package/dist/cjs/components/BaseGallery/CarouselBase/CarouselBase.js.map +1 -1
  4. package/dist/cjs/components/CustomSelect/CustomSelect.d.ts +12 -2
  5. package/dist/cjs/components/CustomSelect/CustomSelect.d.ts.map +1 -1
  6. package/dist/cjs/components/CustomSelect/CustomSelect.js +72 -52
  7. package/dist/cjs/components/CustomSelect/CustomSelect.js.map +1 -1
  8. package/dist/cjs/components/CustomSelect/CustomSelectInput.d.ts +1 -3
  9. package/dist/cjs/components/CustomSelect/CustomSelectInput.d.ts.map +1 -1
  10. package/dist/cjs/components/CustomSelect/CustomSelectInput.js +24 -19
  11. package/dist/cjs/components/CustomSelect/CustomSelectInput.js.map +1 -1
  12. package/dist/cjs/components/Select/Select.js +2 -1
  13. package/dist/cjs/components/Select/Select.js.map +1 -1
  14. package/dist/cjs/components/Spacing/Spacing.js +1 -1
  15. package/dist/cjs/components/Spacing/Spacing.js.map +1 -1
  16. package/dist/cjs/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.d.ts.map +1 -1
  17. package/dist/cjs/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js +3 -0
  18. package/dist/cjs/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js.map +1 -1
  19. package/dist/components/BaseGallery/CarouselBase/CarouselBase.d.ts.map +1 -1
  20. package/dist/components/BaseGallery/CarouselBase/CarouselBase.js +10 -1
  21. package/dist/components/BaseGallery/CarouselBase/CarouselBase.js.map +1 -1
  22. package/dist/components/CustomSelect/CustomSelect.d.ts +12 -2
  23. package/dist/components/CustomSelect/CustomSelect.d.ts.map +1 -1
  24. package/dist/components/CustomSelect/CustomSelect.js +64 -44
  25. package/dist/components/CustomSelect/CustomSelect.js.map +1 -1
  26. package/dist/components/CustomSelect/CustomSelectInput.d.ts +1 -3
  27. package/dist/components/CustomSelect/CustomSelectInput.d.ts.map +1 -1
  28. package/dist/components/CustomSelect/CustomSelectInput.js +24 -19
  29. package/dist/components/CustomSelect/CustomSelectInput.js.map +1 -1
  30. package/dist/components/Select/Select.js +2 -1
  31. package/dist/components/Select/Select.js.map +1 -1
  32. package/dist/components/Spacing/Spacing.js +1 -1
  33. package/dist/components/Spacing/Spacing.js.map +1 -1
  34. package/dist/components.css +3 -3
  35. package/dist/components.css.map +1 -1
  36. package/dist/components.js.tmp +117 -159
  37. package/dist/cssm/components/BaseGallery/CarouselBase/CarouselBase.d.ts.map +1 -1
  38. package/dist/cssm/components/BaseGallery/CarouselBase/CarouselBase.js +10 -1
  39. package/dist/cssm/components/BaseGallery/CarouselBase/CarouselBase.js.map +1 -1
  40. package/dist/cssm/components/CustomSelect/CustomSelect.d.ts +12 -2
  41. package/dist/cssm/components/CustomSelect/CustomSelect.d.ts.map +1 -1
  42. package/dist/cssm/components/CustomSelect/CustomSelect.js +60 -41
  43. package/dist/cssm/components/CustomSelect/CustomSelect.js.map +1 -1
  44. package/dist/cssm/components/CustomSelect/CustomSelectInput.d.ts +1 -3
  45. package/dist/cssm/components/CustomSelect/CustomSelectInput.d.ts.map +1 -1
  46. package/dist/cssm/components/CustomSelect/CustomSelectInput.js +21 -16
  47. package/dist/cssm/components/CustomSelect/CustomSelectInput.js.map +1 -1
  48. package/dist/cssm/components/CustomSelect/CustomSelectInput.module.css +40 -74
  49. package/dist/cssm/components/Select/Select.js +2 -1
  50. package/dist/cssm/components/Select/Select.js.map +1 -1
  51. package/dist/cssm/components/Spacing/Spacing.js +1 -1
  52. package/dist/cssm/components/Spacing/Spacing.js.map +1 -1
  53. package/dist/cssm/components/Spacing/Spacing.module.css +1 -2
  54. package/dist/cssm/components/TabsItem/TabsItem.module.css +1 -1
  55. package/dist/cssm/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.d.ts.map +1 -1
  56. package/dist/cssm/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js +3 -0
  57. package/dist/cssm/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js.map +1 -1
  58. package/dist/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.d.ts.map +1 -1
  59. package/dist/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js +3 -0
  60. package/dist/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js.map +1 -1
  61. package/dist/vkui.css +3 -3
  62. package/dist/vkui.css.map +1 -1
  63. package/dist/vkui.js.tmp +117 -159
  64. package/package.json +1 -1
  65. package/src/components/BaseGallery/CarouselBase/CarouselBase.tsx +16 -1
  66. package/src/components/CustomSelect/CustomSelect.tsx +101 -53
  67. package/src/components/CustomSelect/CustomSelectInput.module.css +35 -55
  68. package/src/components/CustomSelect/CustomSelectInput.tsx +35 -24
  69. package/src/components/Select/Select.tsx +2 -2
  70. package/src/components/Spacing/Spacing.module.css +1 -2
  71. package/src/components/Spacing/Spacing.tsx +1 -1
  72. package/src/components/TabsItem/TabsItem.module.css +1 -1
  73. package/src/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.ts +3 -0
  74. package/dist/cjs/components/CustomSelect/helpers.d.ts +0 -8
  75. package/dist/cjs/components/CustomSelect/helpers.d.ts.map +0 -1
  76. package/dist/cjs/components/CustomSelect/helpers.js +0 -76
  77. package/dist/cjs/components/CustomSelect/helpers.js.map +0 -1
  78. package/dist/cjs/components/CustomSelect/types.d.ts +0 -12
  79. package/dist/cjs/components/CustomSelect/types.d.ts.map +0 -1
  80. package/dist/cjs/components/CustomSelect/types.js +0 -6
  81. package/dist/cjs/components/CustomSelect/types.js.map +0 -1
  82. package/dist/components/CustomSelect/helpers.d.ts +0 -8
  83. package/dist/components/CustomSelect/helpers.d.ts.map +0 -1
  84. package/dist/components/CustomSelect/helpers.js +0 -48
  85. package/dist/components/CustomSelect/helpers.js.map +0 -1
  86. package/dist/components/CustomSelect/types.d.ts +0 -12
  87. package/dist/components/CustomSelect/types.d.ts.map +0 -1
  88. package/dist/components/CustomSelect/types.js +0 -3
  89. package/dist/components/CustomSelect/types.js.map +0 -1
  90. package/dist/cssm/components/CustomSelect/helpers.d.ts +0 -8
  91. package/dist/cssm/components/CustomSelect/helpers.d.ts.map +0 -1
  92. package/dist/cssm/components/CustomSelect/helpers.js +0 -44
  93. package/dist/cssm/components/CustomSelect/helpers.js.map +0 -1
  94. package/dist/cssm/components/CustomSelect/types.d.ts +0 -12
  95. package/dist/cssm/components/CustomSelect/types.d.ts.map +0 -1
  96. package/dist/cssm/components/CustomSelect/types.js +0 -3
  97. package/dist/cssm/components/CustomSelect/types.js.map +0 -1
  98. package/src/components/CustomSelect/helpers.tsx +0 -61
  99. package/src/components/CustomSelect/types.ts +0 -15
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- calculateInputValueFromOptions: function() {
13
- return calculateInputValueFromOptions;
14
- },
15
- defaultRenderOptionFn: function() {
16
- return defaultRenderOptionFn;
17
- },
18
- findIndexAfter: function() {
19
- return findIndexAfter;
20
- },
21
- findIndexBefore: function() {
22
- return findIndexBefore;
23
- },
24
- findSelectedIndex: function() {
25
- return findSelectedIndex;
26
- }
27
- });
28
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
29
- const _object_spread = require("@swc/helpers/_/_object_spread");
30
- const _object_without_properties = require("@swc/helpers/_/_object_without_properties");
31
- const _jsxruntime = require("react/jsx-runtime");
32
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
33
- const _children = require("../../lib/children");
34
- const _CustomSelectOption = require("../CustomSelectOption/CustomSelectOption");
35
- const findIndexAfter = (options = [], startIndex = -1)=>{
36
- if (startIndex >= options.length - 1) {
37
- return -1;
38
- }
39
- return options.findIndex((option, i)=>i > startIndex && !option.disabled);
40
- };
41
- const findIndexBefore = (options = [], endIndex = options.length)=>{
42
- let result = -1;
43
- if (endIndex <= 0) {
44
- return result;
45
- }
46
- for(let i = endIndex - 1; i >= 0; i--){
47
- let option = options[i];
48
- if (!option.disabled) {
49
- result = i;
50
- break;
51
- }
52
- }
53
- return result;
54
- };
55
- function findSelectedIndex(options = [], value, withClear) {
56
- if (withClear && value === '') {
57
- return -1;
58
- }
59
- var _options_findIndex;
60
- return (_options_findIndex = options.findIndex((item)=>{
61
- value = typeof item.value === 'number' ? Number(value) : value;
62
- return item.value === value;
63
- })) !== null && _options_findIndex !== void 0 ? _options_findIndex : -1;
64
- }
65
- function calculateInputValueFromOptions(options = [], selectValue) {
66
- const selectedOption = options.find((option)=>option.value === selectValue);
67
- return selectedOption ? (0, _children.getTextFromChildren)(selectedOption.label) : '';
68
- }
69
- function defaultRenderOptionFn(_param) {
70
- var { option } = _param, props = _object_without_properties._(_param, [
71
- "option"
72
- ]);
73
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_CustomSelectOption.CustomSelectOption, _object_spread._({}, props));
74
- }
75
-
76
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/CustomSelect/helpers.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getTextFromChildren } from '../../lib/children';\nimport { CustomSelectOption } from '../CustomSelectOption/CustomSelectOption';\nimport type { CustomSelectOptionInterface, CustomSelectRenderOption, SelectValue } from './types';\n\nexport const findIndexAfter = (options: CustomSelectOptionInterface[] = [], startIndex = -1) => {\n if (startIndex >= options.length - 1) {\n return -1;\n }\n return options.findIndex((option, i) => i > startIndex && !option.disabled);\n};\n\nexport const findIndexBefore = (\n options: CustomSelectOptionInterface[] = [],\n endIndex: number = options.length,\n) => {\n let result = -1;\n if (endIndex <= 0) {\n return result;\n }\n for (let i = endIndex - 1; i >= 0; i--) {\n let option = options[i];\n\n if (!option.disabled) {\n result = i;\n break;\n }\n }\n return result;\n};\n\nexport function findSelectedIndex<T extends CustomSelectOptionInterface>(\n options: T[] = [],\n value: SelectValue,\n withClear: boolean,\n) {\n if (withClear && value === '') {\n return -1;\n }\n return (\n options.findIndex((item) => {\n value = typeof item.value === 'number' ? Number(value) : value;\n return item.value === value;\n }) ?? -1\n );\n}\n\nexport function calculateInputValueFromOptions<T extends CustomSelectOptionInterface>(\n options: T[] = [],\n selectValue: SelectValue,\n) {\n const selectedOption = options.find((option) => option.value === selectValue);\n return selectedOption ? getTextFromChildren(selectedOption.label) : '';\n}\n\nexport function defaultRenderOptionFn<T extends CustomSelectOptionInterface>({\n option,\n ...props\n}: CustomSelectRenderOption<T>): React.ReactNode {\n return <CustomSelectOption {...props} />;\n}\n"],"names":["calculateInputValueFromOptions","defaultRenderOptionFn","findIndexAfter","findIndexBefore","findSelectedIndex","options","startIndex","length","findIndex","option","i","disabled","endIndex","result","value","withClear","item","Number","selectValue","selectedOption","find","getTextFromChildren","label","props","CustomSelectOption"],"mappings":";;;;;;;;;;;IA+CgBA,8BAA8B;eAA9BA;;IAQAC,qBAAqB;eAArBA;;IAlDHC,cAAc;eAAdA;;IAOAC,eAAe;eAAfA;;IAmBGC,iBAAiB;eAAjBA;;;;;;;iEA/BO;0BACa;oCACD;AAG5B,MAAMF,iBAAiB,CAACG,UAAyC,EAAE,EAAEC,aAAa,CAAC,CAAC;IACzF,IAAIA,cAAcD,QAAQE,MAAM,GAAG,GAAG;QACpC,OAAO,CAAC;IACV;IACA,OAAOF,QAAQG,SAAS,CAAC,CAACC,QAAQC,IAAMA,IAAIJ,cAAc,CAACG,OAAOE,QAAQ;AAC5E;AAEO,MAAMR,kBAAkB,CAC7BE,UAAyC,EAAE,EAC3CO,WAAmBP,QAAQE,MAAM;IAEjC,IAAIM,SAAS,CAAC;IACd,IAAID,YAAY,GAAG;QACjB,OAAOC;IACT;IACA,IAAK,IAAIH,IAAIE,WAAW,GAAGF,KAAK,GAAGA,IAAK;QACtC,IAAID,SAASJ,OAAO,CAACK,EAAE;QAEvB,IAAI,CAACD,OAAOE,QAAQ,EAAE;YACpBE,SAASH;YACT;QACF;IACF;IACA,OAAOG;AACT;AAEO,SAAST,kBACdC,UAAe,EAAE,EACjBS,KAAkB,EAClBC,SAAkB;IAElB,IAAIA,aAAaD,UAAU,IAAI;QAC7B,OAAO,CAAC;IACV;QAEET;IADF,OACEA,CAAAA,qBAAAA,QAAQG,SAAS,CAAC,CAACQ;QACjBF,QAAQ,OAAOE,KAAKF,KAAK,KAAK,WAAWG,OAAOH,SAASA;QACzD,OAAOE,KAAKF,KAAK,KAAKA;IACxB,gBAHAT,gCAAAA,qBAGM,CAAC;AAEX;AAEO,SAASL,+BACdK,UAAe,EAAE,EACjBa,WAAwB;IAExB,MAAMC,iBAAiBd,QAAQe,IAAI,CAAC,CAACX,SAAWA,OAAOK,KAAK,KAAKI;IACjE,OAAOC,iBAAiBE,IAAAA,6BAAmB,EAACF,eAAeG,KAAK,IAAI;AACtE;AAEO,SAASrB,sBAA6D;QAAA,EAC3EQ,MAAM,EAEsB,GAH+C,QAExEc,qCAFwE;QAC3Ed;;IAGA,qBAAO,qBAACe,sCAAkB,uBAAKD;AACjC"}
@@ -1,12 +0,0 @@
1
- import { type CustomSelectOptionProps } from '../CustomSelectOption/CustomSelectOption';
2
- export type SelectValue = React.SelectHTMLAttributes<HTMLSelectElement>['value'];
3
- export interface CustomSelectOptionInterface {
4
- value: SelectValue;
5
- label: React.ReactElement | string;
6
- disabled?: boolean;
7
- [index: string]: any;
8
- }
9
- export interface CustomSelectRenderOption<T extends CustomSelectOptionInterface> extends CustomSelectOptionProps {
10
- option: T;
11
- }
12
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/CustomSelect/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAExF,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC;AAEjF,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,2BAA2B,CAC7E,SAAQ,uBAAuB;IAC/B,MAAM,EAAE,CAAC,CAAC;CACX"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/CustomSelect/types.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import type { CustomSelectOptionInterface, CustomSelectRenderOption, SelectValue } from './types';
3
- export declare const findIndexAfter: (options?: CustomSelectOptionInterface[], startIndex?: number) => number;
4
- export declare const findIndexBefore: (options?: CustomSelectOptionInterface[], endIndex?: number) => number;
5
- export declare function findSelectedIndex<T extends CustomSelectOptionInterface>(options: T[] | undefined, value: SelectValue, withClear: boolean): number;
6
- export declare function calculateInputValueFromOptions<T extends CustomSelectOptionInterface>(options: T[] | undefined, selectValue: SelectValue): string;
7
- export declare function defaultRenderOptionFn<T extends CustomSelectOptionInterface>({ option, ...props }: CustomSelectRenderOption<T>): React.ReactNode;
8
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/CustomSelect/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElG,eAAO,MAAM,cAAc,aAAa,2BAA2B,EAAE,gCAKpE,CAAC;AAEF,eAAO,MAAM,eAAe,aACjB,2BAA2B,EAAE,aAC5B,MAAM,WAejB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,2BAA2B,EACrE,OAAO,EAAE,CAAC,EAAE,YAAK,EACjB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,OAAO,UAWnB;AAED,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,2BAA2B,EAClF,OAAO,EAAE,CAAC,EAAE,YAAK,EACjB,WAAW,EAAE,WAAW,UAIzB;AAED,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,2BAA2B,EAAE,EAC3E,MAAM,EACN,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,CAE/C"}
@@ -1,48 +0,0 @@
1
- import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
- import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- import * as React from 'react';
5
- import { getTextFromChildren } from '../../lib/children';
6
- import { CustomSelectOption } from '../CustomSelectOption/CustomSelectOption';
7
- export const findIndexAfter = (options = [], startIndex = -1)=>{
8
- if (startIndex >= options.length - 1) {
9
- return -1;
10
- }
11
- return options.findIndex((option, i)=>i > startIndex && !option.disabled);
12
- };
13
- export const findIndexBefore = (options = [], endIndex = options.length)=>{
14
- let result = -1;
15
- if (endIndex <= 0) {
16
- return result;
17
- }
18
- for(let i = endIndex - 1; i >= 0; i--){
19
- let option = options[i];
20
- if (!option.disabled) {
21
- result = i;
22
- break;
23
- }
24
- }
25
- return result;
26
- };
27
- export function findSelectedIndex(options = [], value, withClear) {
28
- if (withClear && value === '') {
29
- return -1;
30
- }
31
- var _options_findIndex;
32
- return (_options_findIndex = options.findIndex((item)=>{
33
- value = typeof item.value === 'number' ? Number(value) : value;
34
- return item.value === value;
35
- })) !== null && _options_findIndex !== void 0 ? _options_findIndex : -1;
36
- }
37
- export function calculateInputValueFromOptions(options = [], selectValue) {
38
- const selectedOption = options.find((option)=>option.value === selectValue);
39
- return selectedOption ? getTextFromChildren(selectedOption.label) : '';
40
- }
41
- export function defaultRenderOptionFn(_param) {
42
- var { option } = _param, props = _object_without_properties(_param, [
43
- "option"
44
- ]);
45
- return /*#__PURE__*/ _jsx(CustomSelectOption, _object_spread({}, props));
46
- }
47
-
48
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/CustomSelect/helpers.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getTextFromChildren } from '../../lib/children';\nimport { CustomSelectOption } from '../CustomSelectOption/CustomSelectOption';\nimport type { CustomSelectOptionInterface, CustomSelectRenderOption, SelectValue } from './types';\n\nexport const findIndexAfter = (options: CustomSelectOptionInterface[] = [], startIndex = -1) => {\n if (startIndex >= options.length - 1) {\n return -1;\n }\n return options.findIndex((option, i) => i > startIndex && !option.disabled);\n};\n\nexport const findIndexBefore = (\n options: CustomSelectOptionInterface[] = [],\n endIndex: number = options.length,\n) => {\n let result = -1;\n if (endIndex <= 0) {\n return result;\n }\n for (let i = endIndex - 1; i >= 0; i--) {\n let option = options[i];\n\n if (!option.disabled) {\n result = i;\n break;\n }\n }\n return result;\n};\n\nexport function findSelectedIndex<T extends CustomSelectOptionInterface>(\n options: T[] = [],\n value: SelectValue,\n withClear: boolean,\n) {\n if (withClear && value === '') {\n return -1;\n }\n return (\n options.findIndex((item) => {\n value = typeof item.value === 'number' ? Number(value) : value;\n return item.value === value;\n }) ?? -1\n );\n}\n\nexport function calculateInputValueFromOptions<T extends CustomSelectOptionInterface>(\n options: T[] = [],\n selectValue: SelectValue,\n) {\n const selectedOption = options.find((option) => option.value === selectValue);\n return selectedOption ? getTextFromChildren(selectedOption.label) : '';\n}\n\nexport function defaultRenderOptionFn<T extends CustomSelectOptionInterface>({\n option,\n ...props\n}: CustomSelectRenderOption<T>): React.ReactNode {\n return <CustomSelectOption {...props} />;\n}\n"],"names":["React","getTextFromChildren","CustomSelectOption","findIndexAfter","options","startIndex","length","findIndex","option","i","disabled","findIndexBefore","endIndex","result","findSelectedIndex","value","withClear","item","Number","calculateInputValueFromOptions","selectValue","selectedOption","find","label","defaultRenderOptionFn","props"],"mappings":";;;AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,qBAAqB;AACzD,SAASC,kBAAkB,QAAQ,2CAA2C;AAG9E,OAAO,MAAMC,iBAAiB,CAACC,UAAyC,EAAE,EAAEC,aAAa,CAAC,CAAC;IACzF,IAAIA,cAAcD,QAAQE,MAAM,GAAG,GAAG;QACpC,OAAO,CAAC;IACV;IACA,OAAOF,QAAQG,SAAS,CAAC,CAACC,QAAQC,IAAMA,IAAIJ,cAAc,CAACG,OAAOE,QAAQ;AAC5E,EAAE;AAEF,OAAO,MAAMC,kBAAkB,CAC7BP,UAAyC,EAAE,EAC3CQ,WAAmBR,QAAQE,MAAM;IAEjC,IAAIO,SAAS,CAAC;IACd,IAAID,YAAY,GAAG;QACjB,OAAOC;IACT;IACA,IAAK,IAAIJ,IAAIG,WAAW,GAAGH,KAAK,GAAGA,IAAK;QACtC,IAAID,SAASJ,OAAO,CAACK,EAAE;QAEvB,IAAI,CAACD,OAAOE,QAAQ,EAAE;YACpBG,SAASJ;YACT;QACF;IACF;IACA,OAAOI;AACT,EAAE;AAEF,OAAO,SAASC,kBACdV,UAAe,EAAE,EACjBW,KAAkB,EAClBC,SAAkB;IAElB,IAAIA,aAAaD,UAAU,IAAI;QAC7B,OAAO,CAAC;IACV;QAEEX;IADF,OACEA,CAAAA,qBAAAA,QAAQG,SAAS,CAAC,CAACU;QACjBF,QAAQ,OAAOE,KAAKF,KAAK,KAAK,WAAWG,OAAOH,SAASA;QACzD,OAAOE,KAAKF,KAAK,KAAKA;IACxB,gBAHAX,gCAAAA,qBAGM,CAAC;AAEX;AAEA,OAAO,SAASe,+BACdf,UAAe,EAAE,EACjBgB,WAAwB;IAExB,MAAMC,iBAAiBjB,QAAQkB,IAAI,CAAC,CAACd,SAAWA,OAAOO,KAAK,KAAKK;IACjE,OAAOC,iBAAiBpB,oBAAoBoB,eAAeE,KAAK,IAAI;AACtE;AAEA,OAAO,SAASC,sBAA6D;QAAA,EAC3EhB,MAAM,EAEsB,GAH+C,QAExEiB,mCAFwE;QAC3EjB;;IAGA,qBAAO,KAACN,uCAAuBuB;AACjC"}
@@ -1,12 +0,0 @@
1
- import { type CustomSelectOptionProps } from '../CustomSelectOption/CustomSelectOption';
2
- export type SelectValue = React.SelectHTMLAttributes<HTMLSelectElement>['value'];
3
- export interface CustomSelectOptionInterface {
4
- value: SelectValue;
5
- label: React.ReactElement | string;
6
- disabled?: boolean;
7
- [index: string]: any;
8
- }
9
- export interface CustomSelectRenderOption<T extends CustomSelectOptionInterface> extends CustomSelectOptionProps {
10
- option: T;
11
- }
12
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/CustomSelect/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAExF,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC;AAEjF,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,2BAA2B,CAC7E,SAAQ,uBAAuB;IAC/B,MAAM,EAAE,CAAC,CAAC;CACX"}
@@ -1,3 +0,0 @@
1
- export { };
2
-
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/CustomSelect/types.ts"],"sourcesContent":["import { type CustomSelectOptionProps } from '../CustomSelectOption/CustomSelectOption';\n\nexport type SelectValue = React.SelectHTMLAttributes<HTMLSelectElement>['value'];\n\nexport interface CustomSelectOptionInterface {\n value: SelectValue;\n label: React.ReactElement | string;\n disabled?: boolean;\n [index: string]: any;\n}\n\nexport interface CustomSelectRenderOption<T extends CustomSelectOptionInterface>\n extends CustomSelectOptionProps {\n option: T;\n}\n"],"names":[],"mappings":"AAWA,WAGC"}
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import type { CustomSelectOptionInterface, CustomSelectRenderOption, SelectValue } from './types';
3
- export declare const findIndexAfter: (options?: CustomSelectOptionInterface[], startIndex?: number) => number;
4
- export declare const findIndexBefore: (options?: CustomSelectOptionInterface[], endIndex?: number) => number;
5
- export declare function findSelectedIndex<T extends CustomSelectOptionInterface>(options: T[] | undefined, value: SelectValue, withClear: boolean): number;
6
- export declare function calculateInputValueFromOptions<T extends CustomSelectOptionInterface>(options: T[] | undefined, selectValue: SelectValue): string;
7
- export declare function defaultRenderOptionFn<T extends CustomSelectOptionInterface>({ option, ...props }: CustomSelectRenderOption<T>): React.ReactNode;
8
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/components/CustomSelect/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElG,eAAO,MAAM,cAAc,aAAa,2BAA2B,EAAE,gCAKpE,CAAC;AAEF,eAAO,MAAM,eAAe,aACjB,2BAA2B,EAAE,aAC5B,MAAM,WAejB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,2BAA2B,EACrE,OAAO,EAAE,CAAC,EAAE,YAAK,EACjB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,OAAO,UAWnB;AAED,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,2BAA2B,EAClF,OAAO,EAAE,CAAC,EAAE,YAAK,EACjB,WAAW,EAAE,WAAW,UAIzB;AAED,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,2BAA2B,EAAE,EAC3E,MAAM,EACN,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,CAE/C"}
@@ -1,44 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import { getTextFromChildren } from '../../lib/children';
4
- import { CustomSelectOption } from '../CustomSelectOption/CustomSelectOption';
5
- export const findIndexAfter = (options = [], startIndex = -1)=>{
6
- if (startIndex >= options.length - 1) {
7
- return -1;
8
- }
9
- return options.findIndex((option, i)=>i > startIndex && !option.disabled);
10
- };
11
- export const findIndexBefore = (options = [], endIndex = options.length)=>{
12
- let result = -1;
13
- if (endIndex <= 0) {
14
- return result;
15
- }
16
- for(let i = endIndex - 1; i >= 0; i--){
17
- let option = options[i];
18
- if (!option.disabled) {
19
- result = i;
20
- break;
21
- }
22
- }
23
- return result;
24
- };
25
- export function findSelectedIndex(options = [], value, withClear) {
26
- if (withClear && value === '') {
27
- return -1;
28
- }
29
- return options.findIndex((item)=>{
30
- value = typeof item.value === 'number' ? Number(value) : value;
31
- return item.value === value;
32
- }) ?? -1;
33
- }
34
- export function calculateInputValueFromOptions(options = [], selectValue) {
35
- const selectedOption = options.find((option)=>option.value === selectValue);
36
- return selectedOption ? getTextFromChildren(selectedOption.label) : '';
37
- }
38
- export function defaultRenderOptionFn({ option, ...props }) {
39
- return /*#__PURE__*/ _jsx(CustomSelectOption, {
40
- ...props
41
- });
42
- }
43
-
44
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/CustomSelect/helpers.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getTextFromChildren } from '../../lib/children';\nimport { CustomSelectOption } from '../CustomSelectOption/CustomSelectOption';\nimport type { CustomSelectOptionInterface, CustomSelectRenderOption, SelectValue } from './types';\n\nexport const findIndexAfter = (options: CustomSelectOptionInterface[] = [], startIndex = -1) => {\n if (startIndex >= options.length - 1) {\n return -1;\n }\n return options.findIndex((option, i) => i > startIndex && !option.disabled);\n};\n\nexport const findIndexBefore = (\n options: CustomSelectOptionInterface[] = [],\n endIndex: number = options.length,\n) => {\n let result = -1;\n if (endIndex <= 0) {\n return result;\n }\n for (let i = endIndex - 1; i >= 0; i--) {\n let option = options[i];\n\n if (!option.disabled) {\n result = i;\n break;\n }\n }\n return result;\n};\n\nexport function findSelectedIndex<T extends CustomSelectOptionInterface>(\n options: T[] = [],\n value: SelectValue,\n withClear: boolean,\n) {\n if (withClear && value === '') {\n return -1;\n }\n return (\n options.findIndex((item) => {\n value = typeof item.value === 'number' ? Number(value) : value;\n return item.value === value;\n }) ?? -1\n );\n}\n\nexport function calculateInputValueFromOptions<T extends CustomSelectOptionInterface>(\n options: T[] = [],\n selectValue: SelectValue,\n) {\n const selectedOption = options.find((option) => option.value === selectValue);\n return selectedOption ? getTextFromChildren(selectedOption.label) : '';\n}\n\nexport function defaultRenderOptionFn<T extends CustomSelectOptionInterface>({\n option,\n ...props\n}: CustomSelectRenderOption<T>): React.ReactNode {\n return <CustomSelectOption {...props} />;\n}\n"],"names":["React","getTextFromChildren","CustomSelectOption","findIndexAfter","options","startIndex","length","findIndex","option","i","disabled","findIndexBefore","endIndex","result","findSelectedIndex","value","withClear","item","Number","calculateInputValueFromOptions","selectValue","selectedOption","find","label","defaultRenderOptionFn","props"],"mappings":";AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,qBAAqB;AACzD,SAASC,kBAAkB,QAAQ,2CAA2C;AAG9E,OAAO,MAAMC,iBAAiB,CAACC,UAAyC,EAAE,EAAEC,aAAa,CAAC,CAAC;IACzF,IAAIA,cAAcD,QAAQE,MAAM,GAAG,GAAG;QACpC,OAAO,CAAC;IACV;IACA,OAAOF,QAAQG,SAAS,CAAC,CAACC,QAAQC,IAAMA,IAAIJ,cAAc,CAACG,OAAOE,QAAQ;AAC5E,EAAE;AAEF,OAAO,MAAMC,kBAAkB,CAC7BP,UAAyC,EAAE,EAC3CQ,WAAmBR,QAAQE,MAAM;IAEjC,IAAIO,SAAS,CAAC;IACd,IAAID,YAAY,GAAG;QACjB,OAAOC;IACT;IACA,IAAK,IAAIJ,IAAIG,WAAW,GAAGH,KAAK,GAAGA,IAAK;QACtC,IAAID,SAASJ,OAAO,CAACK,EAAE;QAEvB,IAAI,CAACD,OAAOE,QAAQ,EAAE;YACpBG,SAASJ;YACT;QACF;IACF;IACA,OAAOI;AACT,EAAE;AAEF,OAAO,SAASC,kBACdV,UAAe,EAAE,EACjBW,KAAkB,EAClBC,SAAkB;IAElB,IAAIA,aAAaD,UAAU,IAAI;QAC7B,OAAO,CAAC;IACV;IACA,OACEX,QAAQG,SAAS,CAAC,CAACU;QACjBF,QAAQ,OAAOE,KAAKF,KAAK,KAAK,WAAWG,OAAOH,SAASA;QACzD,OAAOE,KAAKF,KAAK,KAAKA;IACxB,MAAM,CAAC;AAEX;AAEA,OAAO,SAASI,+BACdf,UAAe,EAAE,EACjBgB,WAAwB;IAExB,MAAMC,iBAAiBjB,QAAQkB,IAAI,CAAC,CAACd,SAAWA,OAAOO,KAAK,KAAKK;IACjE,OAAOC,iBAAiBpB,oBAAoBoB,eAAeE,KAAK,IAAI;AACtE;AAEA,OAAO,SAASC,sBAA6D,EAC3EhB,MAAM,EACN,GAAGiB,OACyB;IAC5B,qBAAO,KAACvB;QAAoB,GAAGuB,KAAK;;AACtC"}
@@ -1,12 +0,0 @@
1
- import { type CustomSelectOptionProps } from '../CustomSelectOption/CustomSelectOption';
2
- export type SelectValue = React.SelectHTMLAttributes<HTMLSelectElement>['value'];
3
- export interface CustomSelectOptionInterface {
4
- value: SelectValue;
5
- label: React.ReactElement | string;
6
- disabled?: boolean;
7
- [index: string]: any;
8
- }
9
- export interface CustomSelectRenderOption<T extends CustomSelectOptionInterface> extends CustomSelectOptionProps {
10
- option: T;
11
- }
12
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/CustomSelect/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAExF,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC;AAEjF,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,2BAA2B,CAC7E,SAAQ,uBAAuB;IAC/B,MAAM,EAAE,CAAC,CAAC;CACX"}
@@ -1,3 +0,0 @@
1
- export { };
2
-
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/CustomSelect/types.ts"],"sourcesContent":["import { type CustomSelectOptionProps } from '../CustomSelectOption/CustomSelectOption';\n\nexport type SelectValue = React.SelectHTMLAttributes<HTMLSelectElement>['value'];\n\nexport interface CustomSelectOptionInterface {\n value: SelectValue;\n label: React.ReactElement | string;\n disabled?: boolean;\n [index: string]: any;\n}\n\nexport interface CustomSelectRenderOption<T extends CustomSelectOptionInterface>\n extends CustomSelectOptionProps {\n option: T;\n}\n"],"names":[],"mappings":"AAWA,WAGC"}
@@ -1,61 +0,0 @@
1
- import * as React from 'react';
2
- import { getTextFromChildren } from '../../lib/children';
3
- import { CustomSelectOption } from '../CustomSelectOption/CustomSelectOption';
4
- import type { CustomSelectOptionInterface, CustomSelectRenderOption, SelectValue } from './types';
5
-
6
- export const findIndexAfter = (options: CustomSelectOptionInterface[] = [], startIndex = -1) => {
7
- if (startIndex >= options.length - 1) {
8
- return -1;
9
- }
10
- return options.findIndex((option, i) => i > startIndex && !option.disabled);
11
- };
12
-
13
- export const findIndexBefore = (
14
- options: CustomSelectOptionInterface[] = [],
15
- endIndex: number = options.length,
16
- ) => {
17
- let result = -1;
18
- if (endIndex <= 0) {
19
- return result;
20
- }
21
- for (let i = endIndex - 1; i >= 0; i--) {
22
- let option = options[i];
23
-
24
- if (!option.disabled) {
25
- result = i;
26
- break;
27
- }
28
- }
29
- return result;
30
- };
31
-
32
- export function findSelectedIndex<T extends CustomSelectOptionInterface>(
33
- options: T[] = [],
34
- value: SelectValue,
35
- withClear: boolean,
36
- ) {
37
- if (withClear && value === '') {
38
- return -1;
39
- }
40
- return (
41
- options.findIndex((item) => {
42
- value = typeof item.value === 'number' ? Number(value) : value;
43
- return item.value === value;
44
- }) ?? -1
45
- );
46
- }
47
-
48
- export function calculateInputValueFromOptions<T extends CustomSelectOptionInterface>(
49
- options: T[] = [],
50
- selectValue: SelectValue,
51
- ) {
52
- const selectedOption = options.find((option) => option.value === selectValue);
53
- return selectedOption ? getTextFromChildren(selectedOption.label) : '';
54
- }
55
-
56
- export function defaultRenderOptionFn<T extends CustomSelectOptionInterface>({
57
- option,
58
- ...props
59
- }: CustomSelectRenderOption<T>): React.ReactNode {
60
- return <CustomSelectOption {...props} />;
61
- }
@@ -1,15 +0,0 @@
1
- import { type CustomSelectOptionProps } from '../CustomSelectOption/CustomSelectOption';
2
-
3
- export type SelectValue = React.SelectHTMLAttributes<HTMLSelectElement>['value'];
4
-
5
- export interface CustomSelectOptionInterface {
6
- value: SelectValue;
7
- label: React.ReactElement | string;
8
- disabled?: boolean;
9
- [index: string]: any;
10
- }
11
-
12
- export interface CustomSelectRenderOption<T extends CustomSelectOptionInterface>
13
- extends CustomSelectOptionProps {
14
- option: T;
15
- }