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.
- package/carousel/styles/_index.scss +53 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +24 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +67 -4
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +10 -23
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +16 -1
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +18 -4
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +7 -3
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +27 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +568 -7
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +8 -4
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +8 -4
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +8 -4
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +8 -4
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +8 -4
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +8 -4
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +8 -4
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +8 -4
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +8 -4
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +8 -4
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +8 -4
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +8 -4
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +8 -4
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +8 -4
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +8 -4
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +8 -4
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +8 -4
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +8 -4
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +8 -4
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +8 -4
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +8 -4
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +8 -4
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +2 -2
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +1 -0
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +1 -0
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +100 -3
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +2 -2
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +71 -3
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +171 -11
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tour-testing.mjs +13 -1
- package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +13 -9
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +12 -1
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +64 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/graph/styles/_index.scss +87 -0
- package/i18n/ar.json +8 -4
- package/i18n/cs.json +8 -4
- package/i18n/de.json +8 -4
- package/i18n/en.json +8 -4
- package/i18n/es.json +8 -4
- package/i18n/fr.json +8 -4
- package/i18n/he.json +8 -4
- package/i18n/hi.json +8 -4
- package/i18n/id.json +8 -4
- package/i18n/it.json +8 -4
- package/i18n/ja.json +8 -4
- package/i18n/ko.json +8 -4
- package/i18n/nl.json +8 -4
- package/i18n/pl.json +8 -4
- package/i18n/pt.json +8 -4
- package/i18n/ru.json +8 -4
- package/i18n/sv.json +8 -4
- package/i18n/tr.json +8 -4
- package/i18n/uk.json +8 -4
- package/i18n/vi.json +8 -4
- package/i18n/zh-TW.json +8 -4
- package/i18n/zh.json +8 -4
- package/llms-full.txt +4 -4
- package/llms.txt +57 -24
- package/package.json +1 -1
- package/schematics/collection.json +5 -0
- package/schematics/eject/index.js +158 -0
- package/schematics/eject/schema.js +8 -0
- package/schematics/eject/schema.json +24 -0
- package/schematics/eject/source.js +295 -0
- package/schematics/use/symbol-map.json +1 -0
- package/select/styles/_index.scss +13 -0
- package/skills/ngwr/SKILL.md +30 -3
- package/skills/ngwr/references/catalog.md +1 -1
- package/table/styles/_index.scss +24 -0
- package/theme/styles/_focus.scss +11 -1
- package/types/ngwr-carousel-testing.d.ts +27 -6
- package/types/ngwr-carousel.d.ts +42 -6
- package/types/ngwr-cascader.d.ts +3 -5
- package/types/ngwr-context-menu.d.ts +2 -0
- package/types/ngwr-dropdown.d.ts +2 -0
- package/types/ngwr-file-upload.d.ts +8 -2
- package/types/ngwr-graph-testing.d.ts +28 -0
- package/types/ngwr-graph.d.ts +247 -91
- package/types/ngwr-select.d.ts +37 -0
- package/types/ngwr-table-testing.d.ts +52 -1
- package/types/ngwr-table.d.ts +101 -9
- package/types/ngwr-tour-testing.d.ts +10 -0
- package/types/ngwr-tour.d.ts +11 -2
- package/types/ngwr-tree.d.ts +2 -0
- package/types/ngwr-utils.d.ts +79 -1
- package/types/ngwr-version.d.ts +1 -1
package/fesm2022/ngwr-utils.mjs
CHANGED
|
@@ -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
|