funda-ui 4.7.335 → 4.7.345

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 (35) hide show
  1. package/CascadingSelect/index.css +86 -86
  2. package/CascadingSelect/index.d.ts +21 -4
  3. package/CascadingSelect/index.js +209 -53
  4. package/CascadingSelectE2E/index.css +86 -86
  5. package/CascadingSelectE2E/index.d.ts +22 -5
  6. package/CascadingSelectE2E/index.js +233 -69
  7. package/MultipleCheckboxes/index.js +71 -0
  8. package/MultipleSelect/index.js +71 -0
  9. package/TagInput/index.js +71 -0
  10. package/Utils/extract.d.ts +39 -1
  11. package/Utils/extract.js +65 -0
  12. package/Utils/useDragDropPosition.d.ts +0 -3
  13. package/Utils/useDragDropPosition.js +0 -3
  14. package/lib/cjs/CascadingSelect/index.d.ts +21 -4
  15. package/lib/cjs/CascadingSelect/index.js +209 -53
  16. package/lib/cjs/CascadingSelectE2E/index.d.ts +22 -5
  17. package/lib/cjs/CascadingSelectE2E/index.js +233 -69
  18. package/lib/cjs/MultipleCheckboxes/index.js +71 -0
  19. package/lib/cjs/MultipleSelect/index.js +71 -0
  20. package/lib/cjs/TagInput/index.js +71 -0
  21. package/lib/cjs/Utils/extract.d.ts +39 -1
  22. package/lib/cjs/Utils/extract.js +65 -0
  23. package/lib/cjs/Utils/useDragDropPosition.d.ts +0 -3
  24. package/lib/cjs/Utils/useDragDropPosition.js +0 -3
  25. package/lib/css/CascadingSelect/index.css +86 -86
  26. package/lib/css/CascadingSelectE2E/index.css +86 -86
  27. package/lib/esm/CascadingSelect/Group.tsx +4 -3
  28. package/lib/esm/CascadingSelect/index.scss +67 -65
  29. package/lib/esm/CascadingSelect/index.tsx +201 -60
  30. package/lib/esm/CascadingSelectE2E/Group.tsx +3 -3
  31. package/lib/esm/CascadingSelectE2E/index.scss +67 -65
  32. package/lib/esm/CascadingSelectE2E/index.tsx +235 -79
  33. package/lib/esm/Utils/hooks/useDragDropPosition.tsx +0 -3
  34. package/lib/esm/Utils/libs/extract.ts +77 -3
  35. package/package.json +1 -1
@@ -462,6 +462,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
462
462
  return (/* binding */_extractContentsOfBrackets
463
463
  );
464
464
  },
465
+ /* harmony export */"extractContentsOfMixedCharactersWithBraces": function extractContentsOfMixedCharactersWithBraces() {
466
+ return (/* binding */_extractContentsOfMixedCharactersWithBraces
467
+ );
468
+ },
469
+ /* harmony export */"extractContentsOfMixedCharactersWithComma": function extractContentsOfMixedCharactersWithComma() {
470
+ return (/* binding */_extractContentsOfMixedCharactersWithComma
471
+ );
472
+ },
465
473
  /* harmony export */"extractContentsOfParentheses": function extractContentsOfParentheses() {
466
474
  return (/* binding */_extractContentsOfParentheses
467
475
  );
@@ -545,6 +553,69 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
545
553
  }
546
554
  }
547
555
 
556
+ /**
557
+ * Parses a braces-separated string of `{label[value]}` pairs into an array of objects.
558
+ *
559
+ * Example:
560
+ * Input: "{Poor[c]}{Sub-option 4[c-2]}{Empty[]}"
561
+ * Input: "{{Poor[c]}{Sub-option 4[c-2]}{Empty[]}[]}"
562
+ *
563
+ * Output: [
564
+ * { label: "Poor", value: "c" },
565
+ * { label: "Sub-option 4", value: "c-2" },
566
+ * { label: "Empty", value: "" }
567
+ * ]
568
+ *
569
+ * @param {string} str - The input string containing one or more `{label[value]}` segments.
570
+ * @returns {Array<{label: string, value: string}>} - An array of extracted label-value objects.
571
+ */
572
+ function _extractContentsOfMixedCharactersWithBraces(str) {
573
+ // Fix the extra '{' at the beginning
574
+ var cleaned = str.replace(/^{{/, '{');
575
+
576
+ // Remove empty {} or {[]} tail
577
+ var trimmed = cleaned.replace(/\{\[\]\}$/, '');
578
+
579
+ // The match is like {label[value]}
580
+ var pattern = /\{(.*?)\[(.*?)\]\}/g;
581
+ var matches = Array.from(trimmed.matchAll(pattern));
582
+ return matches.map(function (match) {
583
+ return {
584
+ label: match[1],
585
+ value: match[2]
586
+ };
587
+ });
588
+ }
589
+
590
+ /**
591
+ * Parses a comma-separated string of `label[value]` pairs into an array of objects.
592
+ *
593
+ * Example:
594
+ * Input: "Poor[c],Sub-option 4[c-2],Empty[]"
595
+ * Output: [
596
+ * { label: "Poor", value: "c" },
597
+ * { label: "Sub-option 4", value: "c-2" },
598
+ * { label: "Empty", value: "" }
599
+ * ]
600
+ *
601
+ * @param {string} str - A string containing label-value pairs in the format `label[value]`, separated by commas.
602
+ * @returns {Array<{ label: string, value: string }>} - An array of parsed objects.
603
+ */
604
+ function _extractContentsOfMixedCharactersWithComma(str) {
605
+ return str.split(",").map(function (item) {
606
+ return item.trim();
607
+ }).map(function (item) {
608
+ var match = item.match(/^(.*?)\[(.*?)\]$/);
609
+ if (match) {
610
+ return {
611
+ label: match[1],
612
+ value: match[2]
613
+ };
614
+ }
615
+ return null;
616
+ }).filter(Boolean);
617
+ }
618
+
548
619
  /******/
549
620
  return __webpack_exports__;
550
621
  /******/
@@ -2269,6 +2269,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2269
2269
  return (/* binding */_extractContentsOfBrackets
2270
2270
  );
2271
2271
  },
2272
+ /* harmony export */"extractContentsOfMixedCharactersWithBraces": function extractContentsOfMixedCharactersWithBraces() {
2273
+ return (/* binding */_extractContentsOfMixedCharactersWithBraces
2274
+ );
2275
+ },
2276
+ /* harmony export */"extractContentsOfMixedCharactersWithComma": function extractContentsOfMixedCharactersWithComma() {
2277
+ return (/* binding */_extractContentsOfMixedCharactersWithComma
2278
+ );
2279
+ },
2272
2280
  /* harmony export */"extractContentsOfParentheses": function extractContentsOfParentheses() {
2273
2281
  return (/* binding */_extractContentsOfParentheses
2274
2282
  );
@@ -2352,6 +2360,69 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
2352
2360
  }
2353
2361
  }
2354
2362
 
2363
+ /**
2364
+ * Parses a braces-separated string of `{label[value]}` pairs into an array of objects.
2365
+ *
2366
+ * Example:
2367
+ * Input: "{Poor[c]}{Sub-option 4[c-2]}{Empty[]}"
2368
+ * Input: "{{Poor[c]}{Sub-option 4[c-2]}{Empty[]}[]}"
2369
+ *
2370
+ * Output: [
2371
+ * { label: "Poor", value: "c" },
2372
+ * { label: "Sub-option 4", value: "c-2" },
2373
+ * { label: "Empty", value: "" }
2374
+ * ]
2375
+ *
2376
+ * @param {string} str - The input string containing one or more `{label[value]}` segments.
2377
+ * @returns {Array<{label: string, value: string}>} - An array of extracted label-value objects.
2378
+ */
2379
+ function _extractContentsOfMixedCharactersWithBraces(str) {
2380
+ // Fix the extra '{' at the beginning
2381
+ var cleaned = str.replace(/^{{/, '{');
2382
+
2383
+ // Remove empty {} or {[]} tail
2384
+ var trimmed = cleaned.replace(/\{\[\]\}$/, '');
2385
+
2386
+ // The match is like {label[value]}
2387
+ var pattern = /\{(.*?)\[(.*?)\]\}/g;
2388
+ var matches = Array.from(trimmed.matchAll(pattern));
2389
+ return matches.map(function (match) {
2390
+ return {
2391
+ label: match[1],
2392
+ value: match[2]
2393
+ };
2394
+ });
2395
+ }
2396
+
2397
+ /**
2398
+ * Parses a comma-separated string of `label[value]` pairs into an array of objects.
2399
+ *
2400
+ * Example:
2401
+ * Input: "Poor[c],Sub-option 4[c-2],Empty[]"
2402
+ * Output: [
2403
+ * { label: "Poor", value: "c" },
2404
+ * { label: "Sub-option 4", value: "c-2" },
2405
+ * { label: "Empty", value: "" }
2406
+ * ]
2407
+ *
2408
+ * @param {string} str - A string containing label-value pairs in the format `label[value]`, separated by commas.
2409
+ * @returns {Array<{ label: string, value: string }>} - An array of parsed objects.
2410
+ */
2411
+ function _extractContentsOfMixedCharactersWithComma(str) {
2412
+ return str.split(",").map(function (item) {
2413
+ return item.trim();
2414
+ }).map(function (item) {
2415
+ var match = item.match(/^(.*?)\[(.*?)\]$/);
2416
+ if (match) {
2417
+ return {
2418
+ label: match[1],
2419
+ value: match[2]
2420
+ };
2421
+ }
2422
+ return null;
2423
+ }).filter(Boolean);
2424
+ }
2425
+
2355
2426
  /******/
2356
2427
  return __webpack_exports__;
2357
2428
  /******/
@@ -462,6 +462,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
462
462
  return (/* binding */_extractContentsOfBrackets
463
463
  );
464
464
  },
465
+ /* harmony export */"extractContentsOfMixedCharactersWithBraces": function extractContentsOfMixedCharactersWithBraces() {
466
+ return (/* binding */_extractContentsOfMixedCharactersWithBraces
467
+ );
468
+ },
469
+ /* harmony export */"extractContentsOfMixedCharactersWithComma": function extractContentsOfMixedCharactersWithComma() {
470
+ return (/* binding */_extractContentsOfMixedCharactersWithComma
471
+ );
472
+ },
465
473
  /* harmony export */"extractContentsOfParentheses": function extractContentsOfParentheses() {
466
474
  return (/* binding */_extractContentsOfParentheses
467
475
  );
@@ -545,6 +553,69 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
545
553
  }
546
554
  }
547
555
 
556
+ /**
557
+ * Parses a braces-separated string of `{label[value]}` pairs into an array of objects.
558
+ *
559
+ * Example:
560
+ * Input: "{Poor[c]}{Sub-option 4[c-2]}{Empty[]}"
561
+ * Input: "{{Poor[c]}{Sub-option 4[c-2]}{Empty[]}[]}"
562
+ *
563
+ * Output: [
564
+ * { label: "Poor", value: "c" },
565
+ * { label: "Sub-option 4", value: "c-2" },
566
+ * { label: "Empty", value: "" }
567
+ * ]
568
+ *
569
+ * @param {string} str - The input string containing one or more `{label[value]}` segments.
570
+ * @returns {Array<{label: string, value: string}>} - An array of extracted label-value objects.
571
+ */
572
+ function _extractContentsOfMixedCharactersWithBraces(str) {
573
+ // Fix the extra '{' at the beginning
574
+ var cleaned = str.replace(/^{{/, '{');
575
+
576
+ // Remove empty {} or {[]} tail
577
+ var trimmed = cleaned.replace(/\{\[\]\}$/, '');
578
+
579
+ // The match is like {label[value]}
580
+ var pattern = /\{(.*?)\[(.*?)\]\}/g;
581
+ var matches = Array.from(trimmed.matchAll(pattern));
582
+ return matches.map(function (match) {
583
+ return {
584
+ label: match[1],
585
+ value: match[2]
586
+ };
587
+ });
588
+ }
589
+
590
+ /**
591
+ * Parses a comma-separated string of `label[value]` pairs into an array of objects.
592
+ *
593
+ * Example:
594
+ * Input: "Poor[c],Sub-option 4[c-2],Empty[]"
595
+ * Output: [
596
+ * { label: "Poor", value: "c" },
597
+ * { label: "Sub-option 4", value: "c-2" },
598
+ * { label: "Empty", value: "" }
599
+ * ]
600
+ *
601
+ * @param {string} str - A string containing label-value pairs in the format `label[value]`, separated by commas.
602
+ * @returns {Array<{ label: string, value: string }>} - An array of parsed objects.
603
+ */
604
+ function _extractContentsOfMixedCharactersWithComma(str) {
605
+ return str.split(",").map(function (item) {
606
+ return item.trim();
607
+ }).map(function (item) {
608
+ var match = item.match(/^(.*?)\[(.*?)\]$/);
609
+ if (match) {
610
+ return {
611
+ label: match[1],
612
+ value: match[2]
613
+ };
614
+ }
615
+ return null;
616
+ }).filter(Boolean);
617
+ }
618
+
548
619
  /******/
549
620
  return __webpack_exports__;
550
621
  /******/
@@ -25,4 +25,42 @@ declare function extractContentsOfBraces(str: string, commaSeparated?: boolean):
25
25
  * @returns {Array<string>|string} such as: ['1,2','f','c']
26
26
  */
27
27
  declare function extractContentsOfParentheses(str: string, commaSeparated?: boolean): Array<string> | string;
28
- export { extractorExist, extractContentsOfBrackets, extractContentsOfBraces, extractContentsOfParentheses };
28
+ /**
29
+ * Parses a braces-separated string of `{label[value]}` pairs into an array of objects.
30
+ *
31
+ * Example:
32
+ * Input: "{Poor[c]}{Sub-option 4[c-2]}{Empty[]}"
33
+ * Input: "{{Poor[c]}{Sub-option 4[c-2]}{Empty[]}[]}"
34
+ *
35
+ * Output: [
36
+ * { label: "Poor", value: "c" },
37
+ * { label: "Sub-option 4", value: "c-2" },
38
+ * { label: "Empty", value: "" }
39
+ * ]
40
+ *
41
+ * @param {string} str - The input string containing one or more `{label[value]}` segments.
42
+ * @returns {Array<{label: string, value: string}>} - An array of extracted label-value objects.
43
+ */
44
+ declare function extractContentsOfMixedCharactersWithBraces(str: string): {
45
+ label: string;
46
+ value: string | number;
47
+ }[];
48
+ /**
49
+ * Parses a comma-separated string of `label[value]` pairs into an array of objects.
50
+ *
51
+ * Example:
52
+ * Input: "Poor[c],Sub-option 4[c-2],Empty[]"
53
+ * Output: [
54
+ * { label: "Poor", value: "c" },
55
+ * { label: "Sub-option 4", value: "c-2" },
56
+ * { label: "Empty", value: "" }
57
+ * ]
58
+ *
59
+ * @param {string} str - A string containing label-value pairs in the format `label[value]`, separated by commas.
60
+ * @returns {Array<{ label: string, value: string }>} - An array of parsed objects.
61
+ */
62
+ declare function extractContentsOfMixedCharactersWithComma(str: string): {
63
+ label: string;
64
+ value: string | number;
65
+ }[];
66
+ export { extractorExist, extractContentsOfBrackets, extractContentsOfBraces, extractContentsOfParentheses, extractContentsOfMixedCharactersWithBraces, extractContentsOfMixedCharactersWithComma };
@@ -48,6 +48,8 @@ __webpack_require__.r(__webpack_exports__);
48
48
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
49
49
  /* harmony export */ "extractContentsOfBraces": () => (/* binding */ extractContentsOfBraces),
50
50
  /* harmony export */ "extractContentsOfBrackets": () => (/* binding */ extractContentsOfBrackets),
51
+ /* harmony export */ "extractContentsOfMixedCharactersWithBraces": () => (/* binding */ extractContentsOfMixedCharactersWithBraces),
52
+ /* harmony export */ "extractContentsOfMixedCharactersWithComma": () => (/* binding */ extractContentsOfMixedCharactersWithComma),
51
53
  /* harmony export */ "extractContentsOfParentheses": () => (/* binding */ extractContentsOfParentheses),
52
54
  /* harmony export */ "extractorExist": () => (/* binding */ extractorExist)
53
55
  /* harmony export */ });
@@ -124,6 +126,69 @@ function extractContentsOfParentheses(str) {
124
126
  }
125
127
  }
126
128
 
129
+ /**
130
+ * Parses a braces-separated string of `{label[value]}` pairs into an array of objects.
131
+ *
132
+ * Example:
133
+ * Input: "{Poor[c]}{Sub-option 4[c-2]}{Empty[]}"
134
+ * Input: "{{Poor[c]}{Sub-option 4[c-2]}{Empty[]}[]}"
135
+ *
136
+ * Output: [
137
+ * { label: "Poor", value: "c" },
138
+ * { label: "Sub-option 4", value: "c-2" },
139
+ * { label: "Empty", value: "" }
140
+ * ]
141
+ *
142
+ * @param {string} str - The input string containing one or more `{label[value]}` segments.
143
+ * @returns {Array<{label: string, value: string}>} - An array of extracted label-value objects.
144
+ */
145
+ function extractContentsOfMixedCharactersWithBraces(str) {
146
+ // Fix the extra '{' at the beginning
147
+ var cleaned = str.replace(/^{{/, '{');
148
+
149
+ // Remove empty {} or {[]} tail
150
+ var trimmed = cleaned.replace(/\{\[\]\}$/, '');
151
+
152
+ // The match is like {label[value]}
153
+ var pattern = /\{(.*?)\[(.*?)\]\}/g;
154
+ var matches = Array.from(trimmed.matchAll(pattern));
155
+ return matches.map(function (match) {
156
+ return {
157
+ label: match[1],
158
+ value: match[2]
159
+ };
160
+ });
161
+ }
162
+
163
+ /**
164
+ * Parses a comma-separated string of `label[value]` pairs into an array of objects.
165
+ *
166
+ * Example:
167
+ * Input: "Poor[c],Sub-option 4[c-2],Empty[]"
168
+ * Output: [
169
+ * { label: "Poor", value: "c" },
170
+ * { label: "Sub-option 4", value: "c-2" },
171
+ * { label: "Empty", value: "" }
172
+ * ]
173
+ *
174
+ * @param {string} str - A string containing label-value pairs in the format `label[value]`, separated by commas.
175
+ * @returns {Array<{ label: string, value: string }>} - An array of parsed objects.
176
+ */
177
+ function extractContentsOfMixedCharactersWithComma(str) {
178
+ return str.split(",").map(function (item) {
179
+ return item.trim();
180
+ }).map(function (item) {
181
+ var match = item.match(/^(.*?)\[(.*?)\]$/);
182
+ if (match) {
183
+ return {
184
+ label: match[1],
185
+ value: match[2]
186
+ };
187
+ }
188
+ return null;
189
+ }).filter(Boolean);
190
+ }
191
+
127
192
  /******/ return __webpack_exports__;
128
193
  /******/ })()
129
194
  ;
@@ -3,9 +3,6 @@
3
3
  *
4
4
  * @usage:
5
5
 
6
- import { useState, useCallback } from 'react';
7
- import { useDragDropPosition } from '@/utils/hooks/useDragDropPosition';
8
-
9
6
  const App = () => {
10
7
 
11
8
  const [show, setShow] = useState<boolean>(false);
@@ -101,9 +101,6 @@ __webpack_require__.r(__webpack_exports__);
101
101
  *
102
102
  * @usage:
103
103
 
104
- import { useState, useCallback } from 'react';
105
- import { useDragDropPosition } from '@/utils/hooks/useDragDropPosition';
106
-
107
104
  const App = () => {
108
105
 
109
106
  const [show, setShow] = useState<boolean>(false);