@mk-kit/ui 0.43.0 → 0.45.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/README.md +11 -0
- package/fesm2022/mk-kit-ui-core.mjs +30 -13
- package/fesm2022/mk-kit-ui-core.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-data.mjs +1 -1
- package/fesm2022/mk-kit-ui-data.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-directives.mjs +27 -8
- package/fesm2022/mk-kit-ui-directives.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-dnd.mjs +43 -8
- package/fesm2022/mk-kit-ui-dnd.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-forms.mjs +1 -1
- package/fesm2022/mk-kit-ui-forms.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-locales-pl.mjs +503 -0
- package/fesm2022/mk-kit-ui-locales-pl.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-media.mjs +1 -1
- package/fesm2022/mk-kit-ui-media.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-table.mjs +658 -22
- package/fesm2022/mk-kit-ui-table.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-testing.mjs +54 -0
- package/fesm2022/mk-kit-ui-testing.mjs.map +1 -1
- package/package.json +5 -1
- package/types/mk-kit-ui-core.d.ts +36 -10
- package/types/mk-kit-ui-directives.d.ts +12 -6
- package/types/mk-kit-ui-dnd.d.ts +32 -4
- package/types/mk-kit-ui-locales-pl.d.ts +42 -0
- package/types/mk-kit-ui-table.d.ts +234 -8
- package/types/mk-kit-ui-testing.d.ts +16 -0
package/README.md
CHANGED
|
@@ -165,6 +165,15 @@ bootstrapApplication(AppRoot, {
|
|
|
165
165
|
});
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
+
Complete translations are their own entry points, so an app carries only the
|
|
169
|
+
locales it provides — today Polish:
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
import { provideMkI18nPl } from '@mk-kit/ui/locales/pl';
|
|
173
|
+
|
|
174
|
+
providers: [provideMkI18nPl({ noData: 'Nic tu nie ma' })]; // overrides merge over the pack
|
|
175
|
+
```
|
|
176
|
+
|
|
168
177
|
Overrides can be scoped to a component subtree for mixed-locale screens.
|
|
169
178
|
Layout and arrow keys flip under `dir="rtl"`.
|
|
170
179
|
|
|
@@ -176,6 +185,8 @@ modals, an Escape that closes only the topmost overlay, live-region
|
|
|
176
185
|
announcements for async state, contrast-checked tokens in both themes,
|
|
177
186
|
`prefers-reduced-motion` and `forced-colors` support. Axe runs over rendered
|
|
178
187
|
fixtures in the test suite; information is never conveyed by colour alone.
|
|
188
|
+
The [accessibility statement](https://mk-kit.dev/accessibility) lists what is
|
|
189
|
+
verified automatically and the known gaps.
|
|
179
190
|
|
|
180
191
|
## SSR & zoneless
|
|
181
192
|
|
|
@@ -1585,6 +1585,11 @@ const MK_DEFAULT_I18N = {
|
|
|
1585
1585
|
chartShare: 'Share',
|
|
1586
1586
|
chartLabel: 'Label',
|
|
1587
1587
|
qrCodeLabel: (text) => `QR code: ${text}`,
|
|
1588
|
+
sortableListLabel: 'Sortable list',
|
|
1589
|
+
filterColumn: (column) => `Filter ${column}`,
|
|
1590
|
+
clearFilter: (column) => `Clear filter for ${column}`,
|
|
1591
|
+
filterAny: 'All',
|
|
1592
|
+
filterMin: 'Min',
|
|
1588
1593
|
blockEditor: {
|
|
1589
1594
|
addBlock: 'Add block',
|
|
1590
1595
|
addFirstBlock: 'Add your first block',
|
|
@@ -1719,25 +1724,37 @@ const MK_I18N = new InjectionToken('MK_I18N', {
|
|
|
1719
1724
|
factory: () => MK_DEFAULT_I18N,
|
|
1720
1725
|
});
|
|
1721
1726
|
/**
|
|
1722
|
-
*
|
|
1723
|
-
*
|
|
1724
|
-
*
|
|
1727
|
+
* Merges `overrides` over a complete string map — shallow for the top level,
|
|
1728
|
+
* deep for the `dateNames`, `blockEditor` and `validation` groups. Exported
|
|
1729
|
+
* so locale packs and tests can build a map without providing it.
|
|
1730
|
+
*/
|
|
1731
|
+
function mkMergeI18n(base, overrides) {
|
|
1732
|
+
return {
|
|
1733
|
+
...base,
|
|
1734
|
+
...overrides,
|
|
1735
|
+
dateNames: { ...base.dateNames, ...overrides.dateNames },
|
|
1736
|
+
blockEditor: { ...base.blockEditor, ...overrides.blockEditor },
|
|
1737
|
+
validation: { ...base.validation, ...overrides.validation },
|
|
1738
|
+
};
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* Provide localised strings — pass any subset, merged over `base` (the
|
|
1742
|
+
* English defaults unless given). The nested `dateNames`, `blockEditor` and
|
|
1743
|
+
* `validation` groups are merged deeply, so partial overrides of those work
|
|
1744
|
+
* too.
|
|
1725
1745
|
*
|
|
1726
1746
|
* ```ts
|
|
1727
1747
|
* bootstrapApplication(App, {
|
|
1728
1748
|
* providers: [provideMkI18n({ noResults: 'Brak wyników', close: 'Zamknij' })],
|
|
1729
1749
|
* });
|
|
1730
1750
|
* ```
|
|
1751
|
+
*
|
|
1752
|
+
* A locale pack is a complete map that serves as the base — either through
|
|
1753
|
+
* its own helper (`provideMkI18nPl(overrides)` from `@mk-kit/ui/locales/pl`)
|
|
1754
|
+
* or explicitly: `provideMkI18n(overrides, MK_PL_I18N)`.
|
|
1731
1755
|
*/
|
|
1732
|
-
function provideMkI18n(overrides) {
|
|
1733
|
-
|
|
1734
|
-
...MK_DEFAULT_I18N,
|
|
1735
|
-
...overrides,
|
|
1736
|
-
dateNames: { ...MK_DEFAULT_DATE_NAMES, ...overrides.dateNames },
|
|
1737
|
-
blockEditor: { ...MK_DEFAULT_I18N.blockEditor, ...overrides.blockEditor },
|
|
1738
|
-
validation: { ...MK_DEFAULT_VALIDATION, ...overrides.validation },
|
|
1739
|
-
};
|
|
1740
|
-
return { provide: MK_I18N, useValue: value };
|
|
1756
|
+
function provideMkI18n(overrides, base = MK_DEFAULT_I18N) {
|
|
1757
|
+
return { provide: MK_I18N, useValue: mkMergeI18n(base, overrides) };
|
|
1741
1758
|
}
|
|
1742
1759
|
|
|
1743
1760
|
/**
|
|
@@ -2256,5 +2273,5 @@ function mkQueryToText(group, fields = [], i18n = MK_DEFAULT_I18N) {
|
|
|
2256
2273
|
* Generated bundle index. Do not edit.
|
|
2257
2274
|
*/
|
|
2258
2275
|
|
|
2259
|
-
export { MK_BREAKPOINTS, MK_DEFAULT_BREAKPOINTS, MK_DEFAULT_DATE_NAMES, MK_DEFAULT_I18N, MK_DEFAULT_VALIDATION, MK_I18N, MK_OVERLAY_DATA, MK_QUERY_OPERATORS, MK_QUERY_UNARY, MkAnchoredPanel, MkBreakpointService, MkFieldContext, MkFocusTrap, MkLiveAnnouncer, MkOverlayRef, MkOverlayService, MkThemeService, mkComputeAnchoredPosition, mkCreateQueryGroup, mkCreateQueryRule, mkFirstErrorMessage, mkGetFocusable, mkHighlight, mkHighlightJson, mkInjectFieldTouched, mkIsQueryGroup, mkIsResponsive, mkQueryCompact, mkQueryIsEmpty, mkQueryOperatorLabel, mkQueryOperatorsFor, mkQueryRuleCount, mkQueryRuleIsComplete, mkQueryRuleMatches, mkQueryToPredicate, mkQueryToText, mkSignalErrorMessage, mkSignalErrorsToValidationErrors, mkUniqueId, mkValidatorChange, provideMkI18n };
|
|
2276
|
+
export { MK_BREAKPOINTS, MK_DEFAULT_BREAKPOINTS, MK_DEFAULT_DATE_NAMES, MK_DEFAULT_I18N, MK_DEFAULT_VALIDATION, MK_I18N, MK_OVERLAY_DATA, MK_QUERY_OPERATORS, MK_QUERY_UNARY, MkAnchoredPanel, MkBreakpointService, MkFieldContext, MkFocusTrap, MkLiveAnnouncer, MkOverlayRef, MkOverlayService, MkThemeService, mkComputeAnchoredPosition, mkCreateQueryGroup, mkCreateQueryRule, mkFirstErrorMessage, mkGetFocusable, mkHighlight, mkHighlightJson, mkInjectFieldTouched, mkIsQueryGroup, mkIsResponsive, mkMergeI18n, mkQueryCompact, mkQueryIsEmpty, mkQueryOperatorLabel, mkQueryOperatorsFor, mkQueryRuleCount, mkQueryRuleIsComplete, mkQueryRuleMatches, mkQueryToPredicate, mkQueryToText, mkSignalErrorMessage, mkSignalErrorsToValidationErrors, mkUniqueId, mkValidatorChange, provideMkI18n };
|
|
2260
2277
|
//# sourceMappingURL=mk-kit-ui-core.mjs.map
|