ngwr 16.3.0 → 16.4.0

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 (142) hide show
  1. package/carousel/styles/_index.scss +53 -1
  2. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  3. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  4. package/fesm2022/ngwr-carousel-testing.mjs +24 -1
  5. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  6. package/fesm2022/ngwr-carousel.mjs +67 -4
  7. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  8. package/fesm2022/ngwr-cascader.mjs +10 -23
  9. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  10. package/fesm2022/ngwr-context-menu.mjs +16 -1
  11. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  12. package/fesm2022/ngwr-dropdown.mjs +18 -4
  13. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  14. package/fesm2022/ngwr-file-upload.mjs +7 -3
  15. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  16. package/fesm2022/ngwr-graph-testing.mjs +27 -0
  17. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  18. package/fesm2022/ngwr-graph.mjs +568 -7
  19. package/fesm2022/ngwr-graph.mjs.map +1 -1
  20. package/fesm2022/ngwr-i18n-ar.mjs +8 -4
  21. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  22. package/fesm2022/ngwr-i18n-cs.mjs +8 -4
  23. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  24. package/fesm2022/ngwr-i18n-de.mjs +8 -4
  25. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  26. package/fesm2022/ngwr-i18n-en.mjs +8 -4
  27. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  28. package/fesm2022/ngwr-i18n-es.mjs +8 -4
  29. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  30. package/fesm2022/ngwr-i18n-fr.mjs +8 -4
  31. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  32. package/fesm2022/ngwr-i18n-he.mjs +8 -4
  33. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  34. package/fesm2022/ngwr-i18n-hi.mjs +8 -4
  35. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  36. package/fesm2022/ngwr-i18n-id.mjs +8 -4
  37. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  38. package/fesm2022/ngwr-i18n-it.mjs +8 -4
  39. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  40. package/fesm2022/ngwr-i18n-ja.mjs +8 -4
  41. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  42. package/fesm2022/ngwr-i18n-ko.mjs +8 -4
  43. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  44. package/fesm2022/ngwr-i18n-nl.mjs +8 -4
  45. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  46. package/fesm2022/ngwr-i18n-pl.mjs +8 -4
  47. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  48. package/fesm2022/ngwr-i18n-pt.mjs +8 -4
  49. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  50. package/fesm2022/ngwr-i18n-ru.mjs +8 -4
  51. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  52. package/fesm2022/ngwr-i18n-sv.mjs +8 -4
  53. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  54. package/fesm2022/ngwr-i18n-tr.mjs +8 -4
  55. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  56. package/fesm2022/ngwr-i18n-uk.mjs +8 -4
  57. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  58. package/fesm2022/ngwr-i18n-vi.mjs +8 -4
  59. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  60. package/fesm2022/ngwr-i18n-zh-tw.mjs +8 -4
  61. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  62. package/fesm2022/ngwr-i18n-zh.mjs +8 -4
  63. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  64. package/fesm2022/ngwr-lightbox.mjs +2 -2
  65. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  66. package/fesm2022/ngwr-list.mjs +2 -2
  67. package/fesm2022/ngwr-list.mjs.map +1 -1
  68. package/fesm2022/ngwr-pagination.mjs +1 -0
  69. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  70. package/fesm2022/ngwr-schema-form.mjs +1 -0
  71. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  72. package/fesm2022/ngwr-select.mjs +100 -3
  73. package/fesm2022/ngwr-select.mjs.map +1 -1
  74. package/fesm2022/ngwr-sortable-list.mjs +2 -2
  75. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  76. package/fesm2022/ngwr-table-testing.mjs +71 -3
  77. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  78. package/fesm2022/ngwr-table.mjs +171 -11
  79. package/fesm2022/ngwr-table.mjs.map +1 -1
  80. package/fesm2022/ngwr-tour-testing.mjs +13 -1
  81. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  82. package/fesm2022/ngwr-tour.mjs +13 -9
  83. package/fesm2022/ngwr-tour.mjs.map +1 -1
  84. package/fesm2022/ngwr-tree.mjs +12 -1
  85. package/fesm2022/ngwr-tree.mjs.map +1 -1
  86. package/fesm2022/ngwr-utils.mjs +64 -1
  87. package/fesm2022/ngwr-utils.mjs.map +1 -1
  88. package/fesm2022/ngwr-version.mjs +1 -1
  89. package/fesm2022/ngwr-version.mjs.map +1 -1
  90. package/graph/styles/_index.scss +87 -0
  91. package/i18n/ar.json +8 -4
  92. package/i18n/cs.json +8 -4
  93. package/i18n/de.json +8 -4
  94. package/i18n/en.json +8 -4
  95. package/i18n/es.json +8 -4
  96. package/i18n/fr.json +8 -4
  97. package/i18n/he.json +8 -4
  98. package/i18n/hi.json +8 -4
  99. package/i18n/id.json +8 -4
  100. package/i18n/it.json +8 -4
  101. package/i18n/ja.json +8 -4
  102. package/i18n/ko.json +8 -4
  103. package/i18n/nl.json +8 -4
  104. package/i18n/pl.json +8 -4
  105. package/i18n/pt.json +8 -4
  106. package/i18n/ru.json +8 -4
  107. package/i18n/sv.json +8 -4
  108. package/i18n/tr.json +8 -4
  109. package/i18n/uk.json +8 -4
  110. package/i18n/vi.json +8 -4
  111. package/i18n/zh-TW.json +8 -4
  112. package/i18n/zh.json +8 -4
  113. package/llms-full.txt +4 -4
  114. package/llms.txt +57 -24
  115. package/package.json +1 -1
  116. package/schematics/collection.json +5 -0
  117. package/schematics/eject/index.js +158 -0
  118. package/schematics/eject/schema.js +8 -0
  119. package/schematics/eject/schema.json +24 -0
  120. package/schematics/eject/source.js +295 -0
  121. package/schematics/use/symbol-map.json +1 -0
  122. package/select/styles/_index.scss +13 -0
  123. package/skills/ngwr/SKILL.md +30 -3
  124. package/skills/ngwr/references/catalog.md +1 -1
  125. package/table/styles/_index.scss +24 -0
  126. package/theme/styles/_focus.scss +11 -1
  127. package/types/ngwr-carousel-testing.d.ts +27 -6
  128. package/types/ngwr-carousel.d.ts +42 -6
  129. package/types/ngwr-cascader.d.ts +3 -5
  130. package/types/ngwr-context-menu.d.ts +2 -0
  131. package/types/ngwr-dropdown.d.ts +2 -0
  132. package/types/ngwr-file-upload.d.ts +8 -2
  133. package/types/ngwr-graph-testing.d.ts +28 -0
  134. package/types/ngwr-graph.d.ts +247 -91
  135. package/types/ngwr-select.d.ts +37 -0
  136. package/types/ngwr-table-testing.d.ts +52 -1
  137. package/types/ngwr-table.d.ts +101 -9
  138. package/types/ngwr-tour-testing.d.ts +10 -0
  139. package/types/ngwr-tour.d.ts +11 -2
  140. package/types/ngwr-tree.d.ts +2 -0
  141. package/types/ngwr-utils.d.ts +79 -1
  142. package/types/ngwr-version.d.ts +1 -1
@@ -763,6 +763,69 @@ function wrIsComposing(event) {
763
763
  * Use of this source code is governed by an MIT-style license that can be
764
764
  * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
765
765
  */
766
+ function isTextField(target) {
767
+ const el = target;
768
+ if (!el?.tagName) return false;
769
+ return el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT" || el.isContentEditable === true;
770
+ }
771
+ function wrTypeahead(options = {}) {
772
+ const resetMs = options.resetMs ?? 500;
773
+ let typed = "";
774
+ let typedAt = 0;
775
+ const locale = () => typeof options.locale === "function" ? options.locale() : options.locale;
776
+ const fold = (text, tag) => {
777
+ try {
778
+ return text.toLocaleLowerCase(tag);
779
+ } catch {
780
+ return text.toLocaleLowerCase();
781
+ }
782
+ };
783
+ const isActive = () => typed !== "" && Date.now() - typedAt <= resetMs;
784
+ const type = (event) => {
785
+ if (!wrIsPrintableKey(event) || wrIsComposing(event) || isTextField(event.target)) return false;
786
+ const active = isActive();
787
+ if (event.key === " " && !active) return false;
788
+ typed = active ? typed + event.key : event.key;
789
+ typedAt = Date.now();
790
+ return true;
791
+ };
792
+ const find = (items, current) => {
793
+ if (typed === "" || items.length === 0) return -1;
794
+ const tag = locale();
795
+ const run = fold(typed, tag);
796
+ const chars = [...run];
797
+ const repeated = chars.every((ch) => ch === chars[0]);
798
+ const search = repeated ? chars[0] : run;
799
+ const from = current >= 0 && current < items.length ? current : -1;
800
+ const start = repeated ? from + 1 : Math.max(from, 0);
801
+ for (let step = 0; step < items.length; step++) {
802
+ const index = (start + step) % items.length;
803
+ const item = items[index];
804
+ if (typeof item !== "string" && item.disabled) continue;
805
+ const label = typeof item === "string" ? item : item.label;
806
+ if (fold(label.trim(), tag).startsWith(search)) return index;
807
+ }
808
+ return -1;
809
+ };
810
+ return {
811
+ handleKey: (event, items, current) => type(event) ? find(items, current) : null,
812
+ type,
813
+ find,
814
+ get active() {
815
+ return isActive();
816
+ },
817
+ reset: () => {
818
+ typed = "";
819
+ typedAt = 0;
820
+ }
821
+ };
822
+ }
823
+ /**
824
+ * @license
825
+ *
826
+ * Use of this source code is governed by an MIT-style license that can be
827
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
828
+ */
766
829
  const badgeStyle = (color) => `
767
830
  display: inline-block;
768
831
  border: 1px solid ${color};
@@ -975,6 +1038,6 @@ function wrResourceValue(resource, fallback) {
975
1038
  effect(() => value());
976
1039
  return value.asReadonly();
977
1040
  }
978
- export { WR_KEYS, WR_KEY_LABELS, WR_LIVE_LOCALE, wrAction, wrBadgeError, wrBadgeLog, wrBadgeWarn, wrCheckStyles, wrClamp, wrContentDispositionFileName, wrDebounce, wrDecimal, wrDecimalAdd, wrDecimalCompare, wrDecimalDivide, wrDecimalMultiply, wrDecimalRound, wrDecimalSubtract, wrDownloadBlob, wrFeature, wrGetFocusableElements, wrGetRootFontSize, wrHasModifier, wrInitials, wrIsComposing, wrIsDefined, wrIsNonEmptyArray, wrIsObservable, wrIsPrintableKey, wrIsSafeCssValue, wrKeyedAction, wrNoop, wrNumAttr, wrRandomId, wrResolveCssColor, wrResolveCssColorChannels, wrResolveCssSize, wrResourceValue, wrRestoreFocus, wrRound, wrThrottle, wrToClassList, wrTrapFocus, wrWatchColorScheme, wrWatchDragCancel };
1041
+ export { WR_KEYS, WR_KEY_LABELS, WR_LIVE_LOCALE, wrAction, wrBadgeError, wrBadgeLog, wrBadgeWarn, wrCheckStyles, wrClamp, wrContentDispositionFileName, wrDebounce, wrDecimal, wrDecimalAdd, wrDecimalCompare, wrDecimalDivide, wrDecimalMultiply, wrDecimalRound, wrDecimalSubtract, wrDownloadBlob, wrFeature, wrGetFocusableElements, wrGetRootFontSize, wrHasModifier, wrInitials, wrIsComposing, wrIsDefined, wrIsNonEmptyArray, wrIsObservable, wrIsPrintableKey, wrIsSafeCssValue, wrKeyedAction, wrNoop, wrNumAttr, wrRandomId, wrResolveCssColor, wrResolveCssColorChannels, wrResolveCssSize, wrResourceValue, wrRestoreFocus, wrRound, wrThrottle, wrToClassList, wrTrapFocus, wrTypeahead, wrWatchColorScheme, wrWatchDragCancel };
979
1042
 
980
1043
  //# sourceMappingURL=ngwr-utils.mjs.map