@agridea/suibi-module 0.1.0-preview.8

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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +120 -0
  3. package/dist/elements/browser/main.js +67 -0
  4. package/dist/elements/browser/polyfills.js +1 -0
  5. package/dist/elements/browser/styles.css +1 -0
  6. package/dist/elements/browser/suibi-module-latest.css +1 -0
  7. package/dist/elements/browser/suibi-module-latest.js +67 -0
  8. package/dist/elements/browser/suibi-module.v0.1.0-preview.8.css +1 -0
  9. package/dist/elements/browser/suibi-module.v0.1.0-preview.8.js +67 -0
  10. package/dist/elements/browser/suibi-theme-dark.css +1 -0
  11. package/dist/elements/browser/version.txt +1 -0
  12. package/dist/types/app/animal-stock/animal-stock-detail.component.d.ts +22 -0
  13. package/dist/types/app/animal-stock/animal-stock-list.component.d.ts +21 -0
  14. package/dist/types/app/animal-stock/animal-stock-master-detail.component.d.ts +21 -0
  15. package/dist/types/app/animal-stock/animal-stock.types.d.ts +69 -0
  16. package/dist/types/app/app.config.d.ts +2 -0
  17. package/dist/types/app/app.d.ts +26 -0
  18. package/dist/types/app/core/data/naebi-data.service.d.ts +232 -0
  19. package/dist/types/app/core/i18n/i18n.service.d.ts +20 -0
  20. package/dist/types/app/core/i18n/locales/de.d.ts +2 -0
  21. package/dist/types/app/core/i18n/locales/en.d.ts +2 -0
  22. package/dist/types/app/core/master-data/master-data.service.d.ts +18 -0
  23. package/dist/types/app/core/navigation/navigation.service.d.ts +53 -0
  24. package/dist/types/app/core/schemas/index.d.ts +18 -0
  25. package/dist/types/app/core/schemas/schema-merge.util.d.ts +26 -0
  26. package/dist/types/app/core/schemas/ui-helper-registry.d.ts +16 -0
  27. package/dist/types/app/core/validation/ajv-custom.d.ts +15 -0
  28. package/dist/types/app/core/validation/capabilities.d.ts +18 -0
  29. package/dist/types/app/core/validation/error-formatter.d.ts +19 -0
  30. package/dist/types/app/core/validation/global-validation.service.d.ts +32 -0
  31. package/dist/types/app/core/validation/validation-errors-panel.d.ts +36 -0
  32. package/dist/types/app/data-preview.d.ts +7 -0
  33. package/dist/types/app/header-bar.d.ts +19 -0
  34. package/dist/types/app/jsonforms/constraints/constraint-resolvers.d.ts +50 -0
  35. package/dist/types/app/jsonforms/filters/code-list-filter-resolvers.d.ts +60 -0
  36. package/dist/types/app/jsonforms/registry/renderers.registry.d.ts +26 -0
  37. package/dist/types/app/jsonforms/renderers/controls/selects/animal-category/animal-category-select.renderer.d.ts +21 -0
  38. package/dist/types/app/jsonforms/renderers/controls/selects/code-list/code-list-select.renderer.d.ts +20 -0
  39. package/dist/types/app/jsonforms/renderers/layout/constraint/constraint-layout.renderer.d.ts +30 -0
  40. package/dist/types/app/jsonforms/renderers/layout/group/base-group.renderer.d.ts +29 -0
  41. package/dist/types/app/jsonforms/renderers/layout/group/card-group.renderer.d.ts +6 -0
  42. package/dist/types/app/jsonforms/renderers/layout/group/group-testers.d.ts +4 -0
  43. package/dist/types/app/jsonforms/renderers/layout/group/logical-group.renderer.d.ts +6 -0
  44. package/dist/types/app/jsonforms/renderers/layout/group/plain-group.renderer.d.ts +6 -0
  45. package/dist/types/app/jsonforms/shared/base-control/base-select-control.d.ts +16 -0
  46. package/dist/types/app/jsonforms/shared/option-sources/code-lists.d.ts +11 -0
  47. package/dist/types/app/jsonforms/shared/validation/field-error.service.d.ts +18 -0
  48. package/dist/types/app/welcome-page.d.ts +4 -0
  49. package/dist/types/public-api.d.ts +4 -0
  50. package/dist/types/shared/material-icons.d.ts +16 -0
  51. package/package.json +90 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Agridea
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # Agridea SuisseBilanz Module
2
+
3
+ This is the Agridea SuisseBilanz Module, and its aim is to be a compliance module that can easily be integrated in other applications.
4
+
5
+ **Current status:** Proof of concept, where the overall architecture gets clarified and tested. (we will update this along the way)
6
+
7
+ Built as an Angular standalone app that ships as a Web Component (`<suibi-module>`).
8
+
9
+ **Quick start (stable latest via unpkg):**
10
+ ```html
11
+ <script type="module" src="https://unpkg.com/@agridea/suibi-module@latest/dist/elements/browser/main.js"></script>
12
+ <suibi-module locale="en"></suibi-module>
13
+ ```
14
+
15
+ **Preview (latest pre-release via unpkg):**
16
+ ```html
17
+ <script type="module" src="https://unpkg.com/@agridea/suibi-module@preview/dist/elements/browser/main.js"></script>
18
+ <suibi-module locale="en"></suibi-module>
19
+ ```
20
+
21
+ **Pinned to a specific version (via unpkg, recommended for production):**
22
+ ```html
23
+ <script type="module" src="https://unpkg.com/@agridea/suibi-module@0.1.0/dist/elements/browser/main.js"></script>
24
+ <suibi-module locale="en"></suibi-module>
25
+ ```
26
+
27
+ ## Documentation
28
+ - [Architecture](./doc/architecture.md) - Technical decisions, signals, Shadow DOM, i18n
29
+ - [Web Component API](./doc/web-component-api.md) - Public attributes, properties, and emitted events
30
+ - Includes semantic versioning & distribution channel details (stable / preview)
31
+ - [Theming](./doc/theming.md) - Theme bundle selection via `theme-src`
32
+ - [Development Environment](./doc/development-environment.md) - Setup, build scripts, testing
33
+ - [CI/CD](./doc/cicd.md) - GitHub Actions → Azure Static Web Apps (prod: `main`, staging: `develop`, PR previews)
34
+ - [AI Tooling & MCP](./doc/ai-tooling.md)
35
+ - [Master Data Automation](./doc/master-data.md) - NMD Arrays
36
+ - [JSONForms Customizations](./doc/jsonforms-customizations.md) - Custom renderers & layout variants (card/plain/logical)
37
+ - [Schema & UI Helper Architecture](./doc/ui-schema-extensions.md) - Separation of domain schema, UI helpers, custom code lists
38
+
39
+ ## Quick Start
40
+
41
+ ### Prerequisites
42
+ - Node.js 20+
43
+ - npm 10+
44
+
45
+ ### Installation
46
+ ```bash
47
+ npm ci
48
+ ```
49
+
50
+ ### Development (Angular SPA)
51
+ ```bash
52
+ npm start
53
+ ```
54
+ Open http://localhost:4200/
55
+
56
+ ### Build Web Component
57
+
58
+ ```bash
59
+ npm run build:wc
60
+ ```
61
+
62
+ Outputs (in `dist/elements/browser/`):
63
+ - `main.js` (raw build)
64
+ - `suibi-module-latest.js` / `.css` (synced to latest stable release)
65
+ - `suibi-module-preview.js` / `.css` (synced to latest preview)
66
+ - `suibi-module.vX.Y.Z.js` / `.css` (semantic versioned immutable artifact)
67
+ - `version.txt` containing `<version> <git-sha>`
68
+
69
+ For production, use a pinned version URL; stable/preview aliases are convenient for rapid development but may update unexpectedly.
70
+
71
+ ### NPM Package Consumption (Types & Bundled WC)
72
+
73
+ The component is published to npm.org as `@agridea/suibi-module` with semantic versions.
74
+
75
+ 1. Install:
76
+ ```bash
77
+ npm install @agridea/suibi-module@latest # or @preview for pre-release
78
+ ```
79
+ 2. Import types (optional):
80
+ ```ts
81
+ import type { NaebiData, PageId, Locale, EnrichedValidationError } from '@agridea/suibi-module';
82
+ ```
83
+
84
+ For script-tag usage, prefer unpkg CDN (zero setup, no auth required). The npm install path is primarily for host apps needing TypeScript types or bundler-based integration.### Versioning & Release Channels
85
+
86
+ | Channel | Trigger | CDN URL Pattern | Version pattern | npm dist-tag |
87
+ |----------|------------------------------|---------------------------|----------------------------|--------------|
88
+ | Stable | Git tag `vX.Y.Z` on `main` | unpkg `@latest` | `X.Y.Z` | `latest` |
89
+ | Preview | Push to `develop` | unpkg `@preview` | `X.Y.Z-preview.<n>` | `preview` |
90
+
91
+ **CDN usage (via unpkg):**
92
+ - Stable latest: `https://unpkg.com/@agridea/suibi-module@latest/dist/elements/browser/main.js`
93
+ - Preview latest: `https://unpkg.com/@agridea/suibi-module@preview/dist/elements/browser/main.js`
94
+ - Pinned version: `https://unpkg.com/@agridea/suibi-module@X.Y.Z/dist/elements/browser/main.js`
95
+
96
+ Rules / notes:
97
+ - Semantic Versioning (MAJOR.MINOR.PATCH) for stable tags.
98
+ - Preview builds increment `<n>` monotonically per base version (CI run counter) and are ephemeral (replaced on next develop push).
99
+ - **For production:** pin to a versioned tag (`@X.Y.Z`) for immutability and cache stability.
100
+ - **For development:** use `@latest` (stable) or `@preview` for convenience; expect updates.
101
+ - All releases include `version.txt` (in GitHub Releases) with semver + git SHA for audit trails.
102
+
103
+ ### Fonts & Styles
104
+
105
+ The bundle injects Roboto + Material Icons via Google Fonts for convenience. Production hosts with stricter CSP / offline needs can:
106
+ 1. Self-host fonts (place CSS before the script tag so the runtime detects them and skips injection), or
107
+ 2. Override via a custom theme stylesheet referenced with the `theme-src` attribute (fetched once at element connect).
108
+
109
+ `styles.css` (and its versioned/alias variants) MUST be served adjacent to the JS bundle for automatic discovery. If you relocate files, ensure the relative path logic in `element.ts` still resolves (or adapt it locally).
110
+
111
+ ### Testing
112
+ ```bash
113
+ npm test # headed
114
+ npm run test:headless
115
+ ```
116
+
117
+ The test scripts auto-detect Chrome/Chromium binaries across different environments (devcontainer, CI, local setups). Override with `CHROME_BIN=/path/to/chrome npm test` if needed.
118
+
119
+ For detailed development instructions, build options, and testing setup, see the [Development Environment](./doc/development-environment.md) guide.
120
+